Parse a
(parse-console-call token input) → (mv tree next-token rest-input)
Function:
(defun parse-console-call (token input) (declare (xargs :guard (and (abnf::tree-optionp token) (abnf::tree-listp input)))) (let ((__function__ 'parse-console-call)) (declare (ignorable __function__)) (b* (((pok tree) (if (token-stringp "assert" token) (parse-assert-call token input) (if (token-stringp "assert_eq" token) (parse-assert-equal-call token input) (if (token-stringp "assert_neq" token) (parse-assert-not-equal-call token input) (mv (reserrf :invalid-console-call-type) (abnf::tree-option-fix token) (abnf::tree-list-fix input))))))) (mv (abnf-tree-wrap tree "console-call") token input))))
Theorem:
(defthm tree-resultp-of-parse-console-call.tree (b* (((mv ?tree ?next-token ?rest-input) (parse-console-call token input))) (abnf::tree-resultp tree)) :rule-classes :rewrite)
Theorem:
(defthm tree-optionp-of-parse-console-call.next-token (b* (((mv ?tree ?next-token ?rest-input) (parse-console-call token input))) (abnf::tree-optionp next-token)) :rule-classes :rewrite)
Theorem:
(defthm tree-listp-of-parse-console-call.rest-input (b* (((mv ?tree ?next-token ?rest-input) (parse-console-call token input))) (abnf::tree-listp rest-input)) :rule-classes :rewrite)
Theorem:
(defthm parsize-of-parse-console-call-<= (b* (((mv ?tree ?next-token ?rest-input) (parse-console-call token input))) (<= (parsize next-token rest-input) (parsize token input))) :rule-classes :linear)
Theorem:
(defthm parsize-of-parse-console-call-< (b* (((mv ?tree ?next-token ?rest-input) (parse-console-call token input))) (implies (not (reserrp tree)) (< (parsize next-token rest-input) (parsize token input)))) :rule-classes :linear)
Theorem:
(defthm parse-console-call-of-tree-option-fix-token (equal (parse-console-call (abnf::tree-option-fix token) input) (parse-console-call token input)))
Theorem:
(defthm parse-console-call-tree-option-equiv-congruence-on-token (implies (abnf::tree-option-equiv token token-equiv) (equal (parse-console-call token input) (parse-console-call token-equiv input))) :rule-classes :congruence)
Theorem:
(defthm parse-console-call-of-tree-list-fix-input (equal (parse-console-call token (abnf::tree-list-fix input)) (parse-console-call token input)))
Theorem:
(defthm parse-console-call-tree-list-equiv-congruence-on-input (implies (abnf::tree-list-equiv input input-equiv) (equal (parse-console-call token input) (parse-console-call token input-equiv))) :rule-classes :congruence)