Parse a pattern string into a regular expression object.
(parse pat &key (legible 't)) → (mv err regex)
Function:
(defun parse-fn (pat legible) (declare (xargs :guard (and (stringp pat) (booleanp legible)))) (let ((__function__ 'parse)) (declare (ignorable __function__)) (b* ((preproc-pat (if legible (preproc-legible pat) (lstrfix pat)))) (parse-regex preproc-pat))))
Theorem:
(defthm maybe-stringp-of-parse.err (b* (((mv ?err ?regex) (parse-fn pat legible))) (acl2::maybe-stringp err)) :rule-classes :type-prescription)
Theorem:
(defthm return-type-of-parse.regex (b* (((mv ?err ?regex) (parse-fn pat legible))) (implies (not err) (regex-p regex))) :rule-classes :rewrite)
Theorem:
(defthm parse-fn-of-str-fix-pat (equal (parse-fn (acl2::str-fix pat) legible) (parse-fn pat legible)))
Theorem:
(defthm parse-fn-streqv-congruence-on-pat (implies (acl2::streqv pat pat-equiv) (equal (parse-fn pat legible) (parse-fn pat-equiv legible))) :rule-classes :congruence)
Theorem:
(defthm parse-fn-of-bool-fix-legible (equal (parse-fn pat (acl2::bool-fix legible)) (parse-fn pat legible)))
Theorem:
(defthm parse-fn-iff-congruence-on-legible (implies (iff legible legible-equiv) (equal (parse-fn pat legible) (parse-fn pat legible-equiv))) :rule-classes :congruence)