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