Parse a
(lex-string-literal abnf::input) → (mv abnf::tree abnf::rest-input)
Function:
(defun lex-string-literal (abnf::input) (declare (xargs :guard (nat-listp abnf::input))) (let ((__function__ 'lex-string-literal)) (declare (ignorable __function__)) (b* (((mv abnf::treess abnf::input) (b* (((mv abnf::treess1 abnf::input1) (b* (((mv abnf::tree abnf::input) (lex-dquote abnf::input)) ((when (reserrp abnf::tree)) (mv (fty::reserrf-push abnf::tree) abnf::input)) (abnf::trees1 (list abnf::tree)) ((mv abnf::trees2 abnf::input) (lex-repetition-*-dquoted-or-escape abnf::input)) ((when (reserrp abnf::trees2)) (mv (fty::reserrf-push abnf::trees2) abnf::input)) ((mv abnf::tree abnf::input) (lex-dquote abnf::input)) ((when (reserrp abnf::tree)) (mv (fty::reserrf-push abnf::tree) abnf::input)) (abnf::trees3 (list abnf::tree)) (abnf::treess (list abnf::trees1 abnf::trees2 abnf::trees3))) (mv abnf::treess abnf::input))) ((when (not (reserrp abnf::treess1))) (mv abnf::treess1 abnf::input1)) ((mv abnf::treess2 abnf::input1) (b* (((mv abnf::tree abnf::input) (lex-squote abnf::input)) ((when (reserrp abnf::tree)) (mv (fty::reserrf-push abnf::tree) abnf::input)) (abnf::trees1 (list abnf::tree)) ((mv abnf::trees2 abnf::input) (lex-repetition-*-squoted-or-escape abnf::input)) ((when (reserrp abnf::trees2)) (mv (fty::reserrf-push abnf::trees2) abnf::input)) ((mv abnf::tree abnf::input) (lex-squote abnf::input)) ((when (reserrp abnf::tree)) (mv (fty::reserrf-push abnf::tree) abnf::input)) (abnf::trees3 (list abnf::tree)) (abnf::treess (list abnf::trees1 abnf::trees2 abnf::trees3))) (mv abnf::treess abnf::input))) ((when (not (reserrp abnf::treess2))) (mv abnf::treess2 abnf::input1))) (mv (reserrf (list :found (list abnf::treess1 abnf::treess2) :required '(((:repetition (:repeat 1 (:finite 1)) (:rulename (:rulename "dquote"))) (:repetition (:repeat 0 (:infinity)) (:group (((:repetition (:repeat 1 (:finite 1)) (:rulename (:rulename "double-quoted-printable")))) ((:repetition (:repeat 1 (:finite 1)) (:rulename (:rulename "escape-sequence"))))))) (:repetition (:repeat 1 (:finite 1)) (:rulename (:rulename "dquote")))) ((:repetition (:repeat 1 (:finite 1)) (:rulename (:rulename "squote"))) (:repetition (:repeat 0 (:infinity)) (:group (((:repetition (:repeat 1 (:finite 1)) (:rulename (:rulename "single-quoted-printable")))) ((:repetition (:repeat 1 (:finite 1)) (:rulename (:rulename "escape-sequence"))))))) (:repetition (:repeat 1 (:finite 1)) (:rulename (:rulename "squote"))))))) abnf::input))) ((when (reserrp abnf::treess)) (mv (fty::reserrf-push abnf::treess) (acl2::nat-list-fix abnf::input)))) (mv (abnf::make-tree-nonleaf :rulename? (abnf::rulename "string-literal") :branches abnf::treess) abnf::input))))
Theorem:
(defthm tree-resultp-of-lex-string-literal.tree (b* (((mv abnf::?tree abnf::?rest-input) (lex-string-literal abnf::input))) (abnf::tree-resultp abnf::tree)) :rule-classes :rewrite)
Theorem:
(defthm nat-listp-of-lex-string-literal.rest-input (b* (((mv abnf::?tree abnf::?rest-input) (lex-string-literal abnf::input))) (nat-listp abnf::rest-input)) :rule-classes :rewrite)
Theorem:
(defthm len-of-lex-string-literal-<= (b* (((mv abnf::?tree abnf::?rest-input) (lex-string-literal abnf::input))) (<= (len abnf::rest-input) (len abnf::input))) :rule-classes :linear)
Theorem:
(defthm len-of-lex-string-literal-< (b* (((mv abnf::?tree abnf::?rest-input) (lex-string-literal abnf::input))) (implies (not (reserrp abnf::tree)) (< (len abnf::rest-input) (len abnf::input)))) :rule-classes :linear)
Theorem:
(defthm lex-string-literal-of-nat-list-fix-input (equal (lex-string-literal (acl2::nat-list-fix abnf::input)) (lex-string-literal abnf::input)))
Theorem:
(defthm lex-string-literal-nat-list-equiv-congruence-on-input (implies (acl2::nat-list-equiv abnf::input input-equiv) (equal (lex-string-literal abnf::input) (lex-string-literal input-equiv))) :rule-classes :congruence)