Parse a quoted string.
(parse-quoted-string input) → (mv error? tree? rest-input)
Function:
(defun parse-quoted-string (input) (declare (xargs :guard (nat-listp input))) (seq input (tree-open-quote := (parse-dquote input)) (trees := (parse-*-in-either-range 32 33 35 126 input)) (tree-close-quote := (parse-dquote input)) (return (make-tree-nonleaf :rulename? *quoted-string* :branches (list (list tree-open-quote) trees (list tree-close-quote))))))
Theorem:
(defthm maybe-msgp-of-parse-quoted-string.error? (b* (((mv ?error? ?tree? ?rest-input) (parse-quoted-string input))) (maybe-msgp error?)) :rule-classes :rewrite)
Theorem:
(defthm return-type-of-parse-quoted-string.tree? (b* (((mv ?error? ?tree? ?rest-input) (parse-quoted-string input))) (and (tree-optionp tree?) (implies (not error?) (treep tree?)) (implies error? (not tree?)))) :rule-classes :rewrite)
Theorem:
(defthm nat-listp-of-parse-quoted-string.rest-input (b* (((mv ?error? ?tree? ?rest-input) (parse-quoted-string input))) (nat-listp rest-input)) :rule-classes :rewrite)
Theorem:
(defthm len-of-parse-quoted-string-linear (b* (((mv ?error? ?tree? ?rest-input) (parse-quoted-string input))) (and (<= (len rest-input) (len input)) (implies (not error?) (< (len rest-input) (len input))))) :rule-classes :linear)
Theorem:
(defthm parse-quoted-string-of-nat-list-fix-input (equal (parse-quoted-string (nat-list-fix input)) (parse-quoted-string input)))
Theorem:
(defthm parse-quoted-string-nat-list-equiv-congruence-on-input (implies (acl2::nat-list-equiv input input-equiv) (equal (parse-quoted-string input) (parse-quoted-string input-equiv))) :rule-classes :congruence)