Parse a
(lex-record abnf::input) → (mv abnf::tree abnf::rest-input)
Function:
(defun lex-record (abnf::input) (declare (xargs :guard (nat-listp abnf::input))) (let ((__function__ 'lex-record)) (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 "record" 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::tree abnf::input) (lex-cws abnf::input)) ((when (reserrp abnf::tree)) (mv (reserrf-push abnf::tree) abnf::input)) (abnf::trees7 (list abnf::tree)) ((mv abnf::tree abnf::input) (abnf::parse-schars "owner" abnf::input)) ((when (reserrp abnf::tree)) (mv (reserrf-push abnf::tree) abnf::input)) (abnf::trees8 (list abnf::tree)) ((mv abnf::tree abnf::input) (lex-ws abnf::input)) ((when (reserrp abnf::tree)) (mv (reserrf-push abnf::tree) abnf::input)) (abnf::trees9 (list abnf::tree)) ((mv abnf::tree abnf::input) (abnf::parse-schars "as" abnf::input)) ((when (reserrp abnf::tree)) (mv (reserrf-push abnf::tree) abnf::input)) (abnf::trees10 (list abnf::tree)) ((mv abnf::tree abnf::input) (lex-ws abnf::input)) ((when (reserrp abnf::tree)) (mv (reserrf-push abnf::tree) abnf::input)) (abnf::trees11 (list abnf::tree)) ((mv abnf::tree abnf::input) (lex-cws abnf::input)) ((when (reserrp abnf::tree)) (mv (reserrf-push abnf::tree) abnf::input)) (abnf::trees12 (list abnf::tree)) ((mv abnf::tree abnf::input) (lex-group-address-public/private abnf::input)) ((when (reserrp abnf::tree)) (mv (reserrf-push abnf::tree) abnf::input)) (abnf::trees13 (list abnf::tree)) ((mv abnf::tree abnf::input) (lex-ws abnf::input)) ((when (reserrp abnf::tree)) (mv (reserrf-push abnf::tree) abnf::input)) (abnf::trees14 (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::trees15 (list abnf::tree)) ((mv abnf::tree abnf::input) (lex-cws abnf::input)) ((when (reserrp abnf::tree)) (mv (reserrf-push abnf::tree) abnf::input)) (abnf::trees16 (list abnf::tree)) ((mv abnf::tree abnf::input) (abnf::parse-schars "gates" abnf::input)) ((when (reserrp abnf::tree)) (mv (reserrf-push abnf::tree) abnf::input)) (abnf::trees17 (list abnf::tree)) ((mv abnf::tree abnf::input) (lex-ws abnf::input)) ((when (reserrp abnf::tree)) (mv (reserrf-push abnf::tree) abnf::input)) (abnf::trees18 (list abnf::tree)) ((mv abnf::tree abnf::input) (abnf::parse-schars "as" abnf::input)) ((when (reserrp abnf::tree)) (mv (reserrf-push abnf::tree) abnf::input)) (abnf::trees19 (list abnf::tree)) ((mv abnf::tree abnf::input) (lex-ws abnf::input)) ((when (reserrp abnf::tree)) (mv (reserrf-push abnf::tree) abnf::input)) (abnf::trees20 (list abnf::tree)) ((mv abnf::tree abnf::input) (lex-cws abnf::input)) ((when (reserrp abnf::tree)) (mv (reserrf-push abnf::tree) abnf::input)) (abnf::trees21 (list abnf::tree)) ((mv abnf::tree abnf::input) (lex-group-u64-public/private abnf::input)) ((when (reserrp abnf::tree)) (mv (reserrf-push abnf::tree) abnf::input)) (abnf::trees22 (list abnf::tree)) ((mv abnf::tree abnf::input) (lex-ws abnf::input)) ((when (reserrp abnf::tree)) (mv (reserrf-push abnf::tree) abnf::input)) (abnf::trees23 (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::trees24 (list abnf::tree)) ((mv abnf::trees25 abnf::input) (lex-repetition-*-entry abnf::input)) ((when (reserrp abnf::trees25)) (mv (reserrf-push abnf::trees25) abnf::input)) (abnf::treess (list abnf::trees1 abnf::trees2 abnf::trees3 abnf::trees4 abnf::trees5 abnf::trees6 abnf::trees7 abnf::trees8 abnf::trees9 abnf::trees10 abnf::trees11 abnf::trees12 abnf::trees13 abnf::trees14 abnf::trees15 abnf::trees16 abnf::trees17 abnf::trees18 abnf::trees19 abnf::trees20 abnf::trees21 abnf::trees22 abnf::trees23 abnf::trees24 abnf::trees25))) (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 "record"))) (: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 1 (:finite 1)) (:rulename (:rulename "cws"))) (:repetition (:repeat 1 (:finite 1)) (:char-val (:sensitive "owner"))) (:repetition (:repeat 1 (:finite 1)) (:rulename (:rulename "ws"))) (:repetition (:repeat 1 (:finite 1)) (:char-val (:sensitive "as"))) (:repetition (:repeat 1 (:finite 1)) (:rulename (:rulename "ws"))) (:repetition (:repeat 1 (:finite 1)) (:rulename (:rulename "cws"))) (:repetition (:repeat 1 (:finite 1)) (:group (((:repetition (:repeat 1 (:finite 1)) (:char-val (:sensitive "address.public")))) ((:repetition (:repeat 1 (:finite 1)) (:char-val (:sensitive "address.private"))))))) (:repetition (:repeat 1 (:finite 1)) (:rulename (:rulename "ws"))) (:repetition (:repeat 1 (:finite 1)) (:char-val (:insensitive nil ";"))) (:repetition (:repeat 1 (:finite 1)) (:rulename (:rulename "cws"))) (:repetition (:repeat 1 (:finite 1)) (:char-val (:sensitive "gates"))) (:repetition (:repeat 1 (:finite 1)) (:rulename (:rulename "ws"))) (:repetition (:repeat 1 (:finite 1)) (:char-val (:sensitive "as"))) (:repetition (:repeat 1 (:finite 1)) (:rulename (:rulename "ws"))) (:repetition (:repeat 1 (:finite 1)) (:rulename (:rulename "cws"))) (:repetition (:repeat 1 (:finite 1)) (:group (((:repetition (:repeat 1 (:finite 1)) (:char-val (:sensitive "u64.public")))) ((:repetition (:repeat 1 (:finite 1)) (:char-val (:sensitive "u64.private"))))))) (:repetition (:repeat 1 (:finite 1)) (:rulename (:rulename "ws"))) (:repetition (:repeat 1 (:finite 1)) (:char-val (:insensitive nil ";"))) (:repetition (:repeat 0 (:infinity)) (:rulename (:rulename "entry"))))))) abnf::input))) ((when (reserrp abnf::treess)) (mv (reserrf-push abnf::treess) (nat-list-fix abnf::input)))) (mv (abnf::make-tree-nonleaf :rulename? (abnf::rulename "record") :branches abnf::treess) abnf::input))))
Theorem:
(defthm tree-resultp-of-lex-record.tree (b* (((mv abnf::?tree abnf::?rest-input) (lex-record abnf::input))) (abnf::tree-resultp abnf::tree)) :rule-classes :rewrite)
Theorem:
(defthm nat-listp-of-lex-record.rest-input (b* (((mv abnf::?tree abnf::?rest-input) (lex-record abnf::input))) (nat-listp abnf::rest-input)) :rule-classes :rewrite)
Theorem:
(defthm len-of-lex-record-<= (b* (((mv abnf::?tree abnf::?rest-input) (lex-record abnf::input))) (<= (len abnf::rest-input) (len abnf::input))) :rule-classes :linear)
Theorem:
(defthm len-of-lex-record-< (b* (((mv abnf::?tree abnf::?rest-input) (lex-record abnf::input))) (implies (not (reserrp abnf::tree)) (< (len abnf::rest-input) (len abnf::input)))) :rule-classes :linear)
Theorem:
(defthm lex-record-of-nat-list-fix-input (equal (lex-record (nat-list-fix abnf::input)) (lex-record abnf::input)))
Theorem:
(defthm lex-record-nat-list-equiv-congruence-on-input (implies (acl2::nat-list-equiv abnf::input input-equiv) (equal (lex-record abnf::input) (lex-record input-equiv))) :rule-classes :congruence)