Parse a
(parse-*-definition token input) → (mv trees next-token rest-input)
Function:
(defun parse-*-definition (token input) (declare (xargs :guard (and (abnf::tree-optionp token) (abnf::tree-listp input)))) (let ((__function__ 'parse-*-definition)) (declare (ignorable __function__)) (b* (((mv tree token-after-definition input-after-definition) (parse-definition token input)) ((when (reserrp tree)) (mv nil (abnf::tree-option-fix token) (abnf::tree-list-fix input))) ((pok trees) (parse-*-definition token-after-definition input-after-definition))) (mv (cons tree trees) token input))))
Theorem:
(defthm tree-list-resultp-of-parse-*-definition.trees (b* (((mv ?trees ?next-token ?rest-input) (parse-*-definition token input))) (abnf::tree-list-resultp trees)) :rule-classes :rewrite)
Theorem:
(defthm tree-optionp-of-parse-*-definition.next-token (b* (((mv ?trees ?next-token ?rest-input) (parse-*-definition token input))) (abnf::tree-optionp next-token)) :rule-classes :rewrite)
Theorem:
(defthm tree-listp-of-parse-*-definition.rest-input (b* (((mv ?trees ?next-token ?rest-input) (parse-*-definition token input))) (abnf::tree-listp rest-input)) :rule-classes :rewrite)
Theorem:
(defthm parsize-of-parse-*-definition-<= (b* (((mv ?trees ?next-token ?rest-input) (parse-*-definition token input))) (<= (parsize next-token rest-input) (parsize token input))) :rule-classes :linear)
Theorem:
(defthm parse-*-definition-of-tree-option-fix-token (equal (parse-*-definition (abnf::tree-option-fix token) input) (parse-*-definition token input)))
Theorem:
(defthm parse-*-definition-tree-option-equiv-congruence-on-token (implies (abnf::tree-option-equiv token token-equiv) (equal (parse-*-definition token input) (parse-*-definition token-equiv input))) :rule-classes :congruence)
Theorem:
(defthm parse-*-definition-of-tree-list-fix-input (equal (parse-*-definition token (abnf::tree-list-fix input)) (parse-*-definition token input)))
Theorem:
(defthm parse-*-definition-tree-list-equiv-congruence-on-input (implies (abnf::tree-list-equiv input input-equiv) (equal (parse-*-definition token input) (parse-*-definition token input-equiv))) :rule-classes :congruence)