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