Parse a
(parse-*-comma-identifier token input) → (mv trees next-token rest-input)
Function:
(defun parse-*-comma-identifier (token input) (declare (xargs :guard (and (abnf::tree-optionp token) (abnf::tree-listp input)))) (let ((__function__ 'parse-*-comma-identifier)) (declare (ignorable __function__)) (b* (((unless (token-stringp "," token)) (mv nil (abnf::tree-option-fix token) (abnf::tree-list-fix input))) (start-token token) (start-input input) ((pok< tree1) (parse-separator "," token input)) (token1 token) (input1 input) ((mv tree2 token input) (parse-identifier token input))) (if (reserrp tree2) (mv nil (abnf::tree-option-fix start-token) (abnf::tree-list-fix start-input)) (b* ((tree (abnf::make-tree-nonleaf :rulename? nil :branches (list (list tree1) (list tree2)))) ((unless (mbt (< (parsize token input) (parsize token1 input1)))) (mv (reserrf :impossible) token1 input1)) ((pok trees) (parse-*-comma-identifier token input))) (mv (cons tree trees) token input))))))
Theorem:
(defthm tree-list-resultp-of-parse-*-comma-identifier.trees (b* (((mv ?trees ?next-token ?rest-input) (parse-*-comma-identifier token input))) (abnf::tree-list-resultp trees)) :rule-classes :rewrite)
Theorem:
(defthm tree-optionp-of-parse-*-comma-identifier.next-token (b* (((mv ?trees ?next-token ?rest-input) (parse-*-comma-identifier token input))) (abnf::tree-optionp next-token)) :rule-classes :rewrite)
Theorem:
(defthm tree-listp-of-parse-*-comma-identifier.rest-input (b* (((mv ?trees ?next-token ?rest-input) (parse-*-comma-identifier token input))) (abnf::tree-listp rest-input)) :rule-classes :rewrite)
Theorem:
(defthm parsize-of-parse-*-comma-identifier-<= (b* (((mv ?trees ?next-token ?rest-input) (parse-*-comma-identifier token input))) (<= (parsize next-token rest-input) (parsize token input))) :rule-classes :linear)
Theorem:
(defthm parse-*-comma-identifier-of-tree-option-fix-token (equal (parse-*-comma-identifier (abnf::tree-option-fix token) input) (parse-*-comma-identifier token input)))
Theorem:
(defthm parse-*-comma-identifier-tree-option-equiv-congruence-on-token (implies (abnf::tree-option-equiv token token-equiv) (equal (parse-*-comma-identifier token input) (parse-*-comma-identifier token-equiv input))) :rule-classes :congruence)
Theorem:
(defthm parse-*-comma-identifier-of-tree-list-fix-input (equal (parse-*-comma-identifier token (abnf::tree-list-fix input)) (parse-*-comma-identifier token input)))
Theorem:
(defthm parse-*-comma-identifier-tree-list-equiv-congruence-on-input (implies (abnf::tree-list-equiv input input-equiv) (equal (parse-*-comma-identifier token input) (parse-*-comma-identifier token input-equiv))) :rule-classes :congruence)