Parse an
(parse-assignment-operator token input) → (mv tree next-token rest-input)
Function:
(defun parse-assignment-operator (token input) (declare (xargs :guard (and (abnf::tree-optionp token) (abnf::tree-listp input)))) (let ((__function__ 'parse-assignment-operator)) (declare (ignorable __function__)) (b* (((pok tree) (parse-symbol-among (list "=" "+=" "-=" "*=" "/=" "%=" "**=" "<<=" ">>=" "&=" "|=" "^=" "&&=" "||=") token input))) (mv (abnf-tree-wrap tree "assignment-operator") token input))))
Theorem:
(defthm tree-resultp-of-parse-assignment-operator.tree (b* (((mv ?tree ?next-token ?rest-input) (parse-assignment-operator token input))) (abnf::tree-resultp tree)) :rule-classes :rewrite)
Theorem:
(defthm tree-optionp-of-parse-assignment-operator.next-token (b* (((mv ?tree ?next-token ?rest-input) (parse-assignment-operator token input))) (abnf::tree-optionp next-token)) :rule-classes :rewrite)
Theorem:
(defthm tree-listp-of-parse-assignment-operator.rest-input (b* (((mv ?tree ?next-token ?rest-input) (parse-assignment-operator token input))) (abnf::tree-listp rest-input)) :rule-classes :rewrite)
Theorem:
(defthm parsize-of-parse-assignment-operator-<= (b* (((mv ?tree ?next-token ?rest-input) (parse-assignment-operator token input))) (<= (parsize next-token rest-input) (parsize token input))) :rule-classes :linear)
Theorem:
(defthm parsize-of-parse-assignment-operator-< (b* (((mv ?tree ?next-token ?rest-input) (parse-assignment-operator token input))) (implies (not (reserrp tree)) (< (parsize next-token rest-input) (parsize token input)))) :rule-classes :linear)
Theorem:
(defthm parse-assignment-operator-of-tree-option-fix-token (equal (parse-assignment-operator (abnf::tree-option-fix token) input) (parse-assignment-operator token input)))
Theorem:
(defthm parse-assignment-operator-tree-option-equiv-congruence-on-token (implies (abnf::tree-option-equiv token token-equiv) (equal (parse-assignment-operator token input) (parse-assignment-operator token-equiv input))) :rule-classes :congruence)
Theorem:
(defthm parse-assignment-operator-of-tree-list-fix-input (equal (parse-assignment-operator token (abnf::tree-list-fix input)) (parse-assignment-operator token input)))
Theorem:
(defthm parse-assignment-operator-tree-list-equiv-congruence-on-input (implies (abnf::tree-list-equiv input input-equiv) (equal (parse-assignment-operator token input) (parse-assignment-operator token input-equiv))) :rule-classes :congruence)