Parse a
(lex-transition abnf::input) → (mv abnf::tree abnf::rest-input)
Function:
(defun lex-transition (abnf::input) (declare (xargs :guard (nat-listp abnf::input))) (let ((__function__ 'lex-transition)) (declare (ignorable __function__)) (b* (((mv abnf::treess abnf::input) (b* (((mv abnf::treess1 abnf::input1) (b* (((mv abnf::tree abnf::input) (lex-cws abnf::input)) ((when (reserrp abnf::tree)) (mv (reserrf-push abnf::tree) abnf::input)) (abnf::trees1 (list abnf::tree)) ((mv abnf::tree abnf::input) (abnf::parse-schars "transition" abnf::input)) ((when (reserrp abnf::tree)) (mv (reserrf-push abnf::tree) abnf::input)) (abnf::trees2 (list abnf::tree)) ((mv abnf::tree abnf::input) (lex-ws abnf::input)) ((when (reserrp abnf::tree)) (mv (reserrf-push abnf::tree) abnf::input)) (abnf::trees3 (list abnf::tree)) ((mv abnf::tree abnf::input) (lex-identifier 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) (abnf::parse-ichars ":" abnf::input)) ((when (reserrp abnf::tree)) (mv (reserrf-push abnf::tree) abnf::input)) (abnf::trees6 (list abnf::tree)) ((mv abnf::trees7 abnf::input) (lex-repetition-*-transition-input abnf::input)) ((when (reserrp abnf::trees7)) (mv (reserrf-push abnf::trees7) abnf::input)) ((mv abnf::trees8 abnf::input) (lex-repetition-*-instruction abnf::input)) ((when (reserrp abnf::trees8)) (mv (reserrf-push abnf::trees8) abnf::input)) ((mv abnf::trees9 abnf::input) (lex-repetition-*-transition-output abnf::input)) ((when (reserrp abnf::trees9)) (mv (reserrf-push abnf::trees9) abnf::input)) ((mv abnf::tree abnf::input) (lex-optional-transition-finalize abnf::input)) ((when (reserrp abnf::tree)) (mv (reserrf-push abnf::tree) abnf::input)) (abnf::trees10 (list abnf::tree)) (abnf::treess (list abnf::trees1 abnf::trees2 abnf::trees3 abnf::trees4 abnf::trees5 abnf::trees6 abnf::trees7 abnf::trees8 abnf::trees9 abnf::trees10))) (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 "cws"))) (:repetition (:repeat 1 (:finite 1)) (:char-val (:sensitive "transition"))) (:repetition (:repeat 1 (:finite 1)) (:rulename (:rulename "ws"))) (:repetition (:repeat 1 (:finite 1)) (:rulename (:rulename "identifier"))) (:repetition (:repeat 1 (:finite 1)) (:rulename (:rulename "ws"))) (:repetition (:repeat 1 (:finite 1)) (:char-val (:insensitive nil ":"))) (:repetition (:repeat 0 (:infinity)) (:rulename (:rulename "transition-input"))) (:repetition (:repeat 0 (:infinity)) (:rulename (:rulename "instruction"))) (:repetition (:repeat 0 (:infinity)) (:rulename (:rulename "transition-output"))) (:repetition (:repeat 1 (:finite 1)) (:option (((:repetition (:repeat 1 (:finite 1)) (:rulename (:rulename "finalize-command"))) (:repetition (:repeat 1 (:finite 1)) (:rulename (:rulename "finalize"))))))))))) abnf::input))) ((when (reserrp abnf::treess)) (mv (reserrf-push abnf::treess) (nat-list-fix abnf::input)))) (mv (abnf::make-tree-nonleaf :rulename? (abnf::rulename "transition") :branches abnf::treess) abnf::input))))
Theorem:
(defthm tree-resultp-of-lex-transition.tree (b* (((mv abnf::?tree abnf::?rest-input) (lex-transition abnf::input))) (abnf::tree-resultp abnf::tree)) :rule-classes :rewrite)
Theorem:
(defthm nat-listp-of-lex-transition.rest-input (b* (((mv abnf::?tree abnf::?rest-input) (lex-transition abnf::input))) (nat-listp abnf::rest-input)) :rule-classes :rewrite)
Theorem:
(defthm len-of-lex-transition-<= (b* (((mv abnf::?tree abnf::?rest-input) (lex-transition abnf::input))) (<= (len abnf::rest-input) (len abnf::input))) :rule-classes :linear)
Theorem:
(defthm len-of-lex-transition-< (b* (((mv abnf::?tree abnf::?rest-input) (lex-transition abnf::input))) (implies (not (reserrp abnf::tree)) (< (len abnf::rest-input) (len abnf::input)))) :rule-classes :linear)
Theorem:
(defthm lex-transition-of-nat-list-fix-input (equal (lex-transition (nat-list-fix abnf::input)) (lex-transition abnf::input)))
Theorem:
(defthm lex-transition-nat-list-equiv-congruence-on-input (implies (acl2::nat-list-equiv abnf::input input-equiv) (equal (lex-transition abnf::input) (lex-transition input-equiv))) :rule-classes :congruence)