Parse a
(lex-optional-underbar abnf::input) → (mv abnf::tree abnf::rest-input)
Function:
(defun lex-optional-underbar (abnf::input) (declare (xargs :guard (nat-listp abnf::input))) (let ((__function__ 'lex-optional-underbar)) (declare (ignorable __function__)) (b* (((mv abnf::treess abnf::input) (b* (((mv abnf::treess1 abnf::input1) (b* (((mv abnf::tree abnf::input) (abnf::parse-ichars "_" abnf::input)) ((when (reserrp abnf::tree)) (mv (fty::reserrf-push abnf::tree) abnf::input)) (abnf::trees1 (list abnf::tree)) (abnf::treess (list abnf::trees1))) (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)) (:char-val (:insensitive nil "_"))))))) abnf::input))) ((when (reserrp abnf::treess)) (mv (abnf::make-tree-nonleaf :rulename? nil :branches nil) (acl2::nat-list-fix abnf::input)))) (mv (abnf::make-tree-nonleaf :rulename? nil :branches abnf::treess) abnf::input))))
Theorem:
(defthm tree-resultp-of-lex-optional-underbar.tree (b* (((mv abnf::?tree abnf::?rest-input) (lex-optional-underbar abnf::input))) (abnf::tree-resultp abnf::tree)) :rule-classes :rewrite)
Theorem:
(defthm nat-listp-of-lex-optional-underbar.rest-input (b* (((mv abnf::?tree abnf::?rest-input) (lex-optional-underbar abnf::input))) (nat-listp abnf::rest-input)) :rule-classes :rewrite)
Theorem:
(defthm len-of-lex-optional-underbar-<= (b* (((mv abnf::?tree abnf::?rest-input) (lex-optional-underbar abnf::input))) (<= (len abnf::rest-input) (len abnf::input))) :rule-classes :linear)
Theorem:
(defthm lex-optional-underbar-of-nat-list-fix-input (equal (lex-optional-underbar (acl2::nat-list-fix abnf::input)) (lex-optional-underbar abnf::input)))
Theorem:
(defthm lex-optional-underbar-nat-list-equiv-congruence-on-input (implies (acl2::nat-list-equiv abnf::input input-equiv) (equal (lex-optional-underbar abnf::input) (lex-optional-underbar input-equiv))) :rule-classes :congruence)