(parse-repeatop x index) → (mv err min max repeatmod new-index)
Function:
(defun parse-repeatop (x index) (declare (xargs :guard (and (stringp x) (natp index)))) (declare (xargs :guard (<= index (strlen x)))) (let ((__function__ 'parse-repeatop)) (declare (ignorable __function__)) (b* (((mv err min max index) (parse-repeatbase x index)) ((when err) (mv err 0 0 nil index)) ((mv err repeatmod index) (parse-repeatmod x index)) ((when err) (mv nil min max nil index))) (mv nil min max repeatmod index))))
Theorem:
(defthm maybe-stringp-of-parse-repeatop.err (b* (((mv ?err common-lisp::?min common-lisp::?max ?repeatmod ?new-index) (parse-repeatop x index))) (acl2::maybe-stringp err)) :rule-classes :type-prescription)
Theorem:
(defthm natp-of-parse-repeatop.min (b* (((mv ?err common-lisp::?min common-lisp::?max ?repeatmod ?new-index) (parse-repeatop x index))) (natp min)) :rule-classes :type-prescription)
Theorem:
(defthm maybe-natp-of-parse-repeatop.max (b* (((mv ?err common-lisp::?min common-lisp::?max ?repeatmod ?new-index) (parse-repeatop x index))) (maybe-natp max)) :rule-classes :type-prescription)
Theorem:
(defthm repeatmod-p-of-parse-repeatop.repeatmod (b* (((mv ?err common-lisp::?min common-lisp::?max ?repeatmod ?new-index) (parse-repeatop x index))) (repeatmod-p repeatmod)) :rule-classes :rewrite)
Theorem:
(defthm natp-of-parse-repeatop.new-index (b* (((mv ?err common-lisp::?min common-lisp::?max ?repeatmod ?new-index) (parse-repeatop x index))) (natp new-index)) :rule-classes :type-prescription)
Theorem:
(defthm new-index-of-parse-repeatop (b* (((mv ?err common-lisp::?min common-lisp::?max ?repeatmod ?new-index) (parse-repeatop x index))) (<= (nfix index) new-index)) :rule-classes :linear)
Theorem:
(defthm new-index-of-parse-repeatop-strong (b* (((mv ?err common-lisp::?min common-lisp::?max ?repeatmod ?new-index) (parse-repeatop x index))) (implies (not err) (< (nfix index) new-index))) :rule-classes :linear)
Theorem:
(defthm new-index-of-parse-repeatop-less-than-length (b* (((mv ?err common-lisp::?min common-lisp::?max ?repeatmod ?new-index) (parse-repeatop x index))) (implies (<= (nfix index) (len (acl2::explode x))) (<= new-index (len (acl2::explode x))))) :rule-classes :linear)
Theorem:
(defthm no-change-of-parse-repeatop (b* (((mv ?err common-lisp::?min common-lisp::?max ?repeatmod ?new-index) (parse-repeatop x index))) (implies err (equal new-index (nfix index)))))
Theorem:
(defthm parse-repeatop-of-str-fix-x (equal (parse-repeatop (acl2::str-fix x) index) (parse-repeatop x index)))
Theorem:
(defthm parse-repeatop-streqv-congruence-on-x (implies (acl2::streqv x x-equiv) (equal (parse-repeatop x index) (parse-repeatop x-equiv index))) :rule-classes :congruence)
Theorem:
(defthm parse-repeatop-of-nfix-index (equal (parse-repeatop x (nfix index)) (parse-repeatop x index)))
Theorem:
(defthm parse-repeatop-nat-equiv-congruence-on-index (implies (acl2::nat-equiv index index-equiv) (equal (parse-repeatop x index) (parse-repeatop x index-equiv))) :rule-classes :congruence)