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