(parse-regex x) → (mv err pat)
Function:
(defun parse-regex (x) (declare (xargs :guard (stringp x))) (let ((__function__ 'parse-regex)) (declare (ignorable __function__)) (b* (((mv err regex index ?br-index) (parse-regex-rec x 0 1)) ((when err) (mv err nil)) ((when (< index (strlen x))) (mv (str::cat "Regex parsing didn't consume the whole string: Remaining: " (subseq x index nil)) nil))) (mv nil regex))))
Theorem:
(defthm maybe-stringp-of-parse-regex.err (b* (((mv ?err ?pat) (parse-regex x))) (acl2::maybe-stringp err)) :rule-classes :rewrite)
Theorem:
(defthm return-type-of-parse-regex.pat (b* (((mv ?err ?pat) (parse-regex x))) (implies (not err) (regex-p pat))) :rule-classes :rewrite)
Theorem:
(defthm parse-regex-of-str-fix-x (equal (parse-regex (acl2::str-fix x)) (parse-regex x)))
Theorem:
(defthm parse-regex-streqv-congruence-on-x (implies (acl2::streqv x x-equiv) (equal (parse-regex x) (parse-regex x-equiv))) :rule-classes :congruence)