Parse a
(lex-binary abnf::input) → (mv abnf::tree abnf::rest-input)
Function:
(defun lex-binary (abnf::input) (declare (xargs :guard (nat-listp abnf::input))) (let ((__function__ 'lex-binary)) (declare (ignorable __function__)) (b* (((mv abnf::treess abnf::input) (b* (((mv abnf::treess1 abnf::input1) (b* (((mv abnf::tree abnf::input) (lex-binary-op abnf::input)) ((when (reserrp abnf::tree)) (mv (reserrf-push abnf::tree) abnf::input)) (abnf::trees1 (list abnf::tree)) ((mv abnf::tree abnf::input) (lex-ws abnf::input)) ((when (reserrp abnf::tree)) (mv (reserrf-push abnf::tree) abnf::input)) (abnf::trees2 (list abnf::tree)) ((mv abnf::trees3 abnf::input) (lex-repetition-2-operands abnf::input)) ((when (reserrp abnf::trees3)) (mv (reserrf-push abnf::trees3) abnf::input)) ((mv abnf::tree abnf::input) (abnf::parse-schars "into" abnf::input)) ((when (reserrp abnf::tree)) (mv (reserrf-push abnf::tree) abnf::input)) (abnf::trees4 (list abnf::tree)) ((mv abnf::tree abnf::input) (lex-ws abnf::input)) ((when (reserrp abnf::tree)) (mv (reserrf-push abnf::tree) abnf::input)) (abnf::trees5 (list abnf::tree)) ((mv abnf::tree abnf::input) (lex-register abnf::input)) ((when (reserrp abnf::tree)) (mv (reserrf-push abnf::tree) abnf::input)) (abnf::trees6 (list abnf::tree)) (abnf::treess (list abnf::trees1 abnf::trees2 abnf::trees3 abnf::trees4 abnf::trees5 abnf::trees6))) (mv abnf::treess abnf::input))) ((when (not (reserrp abnf::treess1))) (mv abnf::treess1 abnf::input1))) (mv (reserrf (list :found (list abnf::treess1) :required '(((:repetition (:repeat 1 (:finite 1)) (:rulename (:rulename "binary-op"))) (:repetition (:repeat 1 (:finite 1)) (:rulename (:rulename "ws"))) (:repetition (:repeat 2 (:finite 2)) (:group (((:repetition (:repeat 1 (:finite 1)) (:rulename (:rulename "operand"))) (:repetition (:repeat 1 (:finite 1)) (:rulename (:rulename "ws"))))))) (:repetition (:repeat 1 (:finite 1)) (:char-val (:sensitive "into"))) (:repetition (:repeat 1 (:finite 1)) (:rulename (:rulename "ws"))) (:repetition (:repeat 1 (:finite 1)) (:rulename (:rulename "register"))))))) abnf::input))) ((when (reserrp abnf::treess)) (mv (reserrf-push abnf::treess) (nat-list-fix abnf::input)))) (mv (abnf::make-tree-nonleaf :rulename? (abnf::rulename "binary") :branches abnf::treess) abnf::input))))
Theorem:
(defthm tree-resultp-of-lex-binary.tree (b* (((mv abnf::?tree abnf::?rest-input) (lex-binary abnf::input))) (abnf::tree-resultp abnf::tree)) :rule-classes :rewrite)
Theorem:
(defthm nat-listp-of-lex-binary.rest-input (b* (((mv abnf::?tree abnf::?rest-input) (lex-binary abnf::input))) (nat-listp abnf::rest-input)) :rule-classes :rewrite)
Theorem:
(defthm len-of-lex-binary-<= (b* (((mv abnf::?tree abnf::?rest-input) (lex-binary abnf::input))) (<= (len abnf::rest-input) (len abnf::input))) :rule-classes :linear)
Theorem:
(defthm len-of-lex-binary-< (b* (((mv abnf::?tree abnf::?rest-input) (lex-binary abnf::input))) (implies (not (reserrp abnf::tree)) (< (len abnf::rest-input) (len abnf::input)))) :rule-classes :linear)
Theorem:
(defthm lex-binary-of-nat-list-fix-input (equal (lex-binary (nat-list-fix abnf::input)) (lex-binary abnf::input)))
Theorem:
(defthm lex-binary-nat-list-equiv-congruence-on-input (implies (acl2::nat-list-equiv abnf::input input-equiv) (equal (lex-binary abnf::input) (lex-binary input-equiv))) :rule-classes :congruence)