Parse a
(parse-literal token input) → (mv tree next-token rest-input)
Function:
(defun parse-literal (token input) (declare (xargs :guard (and (abnf::tree-optionp token) (abnf::tree-listp input)))) (let ((__function__ 'parse-literal)) (declare (ignorable __function__)) (b* (((pok tree) (if (token-stringp "(" token) (parse-affine-group-literal token input) (parse-atomic-literal token input)))) (mv (abnf-tree-wrap tree "literal") token input))))
Theorem:
(defthm tree-resultp-of-parse-literal.tree (b* (((mv ?tree ?next-token ?rest-input) (parse-literal token input))) (abnf::tree-resultp tree)) :rule-classes :rewrite)
Theorem:
(defthm tree-optionp-of-parse-literal.next-token (b* (((mv ?tree ?next-token ?rest-input) (parse-literal token input))) (abnf::tree-optionp next-token)) :rule-classes :rewrite)
Theorem:
(defthm tree-listp-of-parse-literal.rest-input (b* (((mv ?tree ?next-token ?rest-input) (parse-literal token input))) (abnf::tree-listp rest-input)) :rule-classes :rewrite)
Theorem:
(defthm parsize-of-parse-literal-<= (b* (((mv ?tree ?next-token ?rest-input) (parse-literal token input))) (<= (parsize next-token rest-input) (parsize token input))) :rule-classes :linear)
Theorem:
(defthm parsize-of-parse-literal-< (b* (((mv ?tree ?next-token ?rest-input) (parse-literal token input))) (implies (not (reserrp tree)) (< (parsize next-token rest-input) (parsize token input)))) :rule-classes :linear)
Theorem:
(defthm parse-literal-of-tree-option-fix-token (equal (parse-literal (abnf::tree-option-fix token) input) (parse-literal token input)))
Theorem:
(defthm parse-literal-tree-option-equiv-congruence-on-token (implies (abnf::tree-option-equiv token token-equiv) (equal (parse-literal token input) (parse-literal token-equiv input))) :rule-classes :congruence)
Theorem:
(defthm parse-literal-of-tree-list-fix-input (equal (parse-literal token (abnf::tree-list-fix input)) (parse-literal token input)))
Theorem:
(defthm parse-literal-tree-list-equiv-congruence-on-input (implies (abnf::tree-list-equiv input input-equiv) (equal (parse-literal token input) (parse-literal token input-equiv))) :rule-classes :congruence)