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