(parse-repeatmod x index) → (mv err repeatmod new-index)
Function:
(defun parse-repeatmod (x index) (declare (xargs :guard (and (stringp x) (natp index)))) (declare (xargs :guard (<= index (strlen x)))) (let ((__function__ 'parse-repeatmod)) (declare (ignorable __function__)) (b* ((index (lnfix index)) ((when (<= (strlen x) index)) (mv "End of string when parsing repeatmod" nil index)) (char (char x index))) (case char (#\? (mv nil :? (+ 1 index))) (#\+ (mv nil :+ (+ 1 index))) (t (mv "Not a repeatmod" nil index))))))
Theorem:
(defthm maybe-stringp-of-parse-repeatmod.err (b* (((mv ?err ?repeatmod ?new-index) (parse-repeatmod x index))) (acl2::maybe-stringp err)) :rule-classes :type-prescription)
Theorem:
(defthm repeatmod-p-of-parse-repeatmod.repeatmod (b* (((mv ?err ?repeatmod ?new-index) (parse-repeatmod x index))) (repeatmod-p repeatmod)) :rule-classes :rewrite)
Theorem:
(defthm natp-of-parse-repeatmod.new-index (b* (((mv ?err ?repeatmod ?new-index) (parse-repeatmod x index))) (natp new-index)) :rule-classes :type-prescription)
Theorem:
(defthm new-index-of-parse-repeatmod (b* (((mv ?err ?repeatmod ?new-index) (parse-repeatmod x index))) (<= (nfix index) new-index)) :rule-classes :linear)
Theorem:
(defthm new-index-of-parse-repeatmod-strong (b* (((mv ?err ?repeatmod ?new-index) (parse-repeatmod x index))) (implies (not err) (< (nfix index) new-index))) :rule-classes :linear)
Theorem:
(defthm new-index-of-parse-repeatmod-less-than-length (b* (((mv ?err ?repeatmod ?new-index) (parse-repeatmod x index))) (implies (<= (nfix index) (len (acl2::explode x))) (<= new-index (len (acl2::explode x))))) :rule-classes :linear)
Theorem:
(defthm no-change-of-parse-repeatmod (b* (((mv ?err ?repeatmod ?new-index) (parse-repeatmod x index))) (implies err (equal new-index (nfix index)))))
Theorem:
(defthm parse-repeatmod-of-str-fix-x (equal (parse-repeatmod (acl2::str-fix x) index) (parse-repeatmod x index)))
Theorem:
(defthm parse-repeatmod-streqv-congruence-on-x (implies (acl2::streqv x x-equiv) (equal (parse-repeatmod x index) (parse-repeatmod x-equiv index))) :rule-classes :congruence)
Theorem:
(defthm parse-repeatmod-of-nfix-index (equal (parse-repeatmod x (nfix index)) (parse-repeatmod x index)))
Theorem:
(defthm parse-repeatmod-nat-equiv-congruence-on-index (implies (acl2::nat-equiv index index-equiv) (equal (parse-repeatmod x index) (parse-repeatmod x index-equiv))) :rule-classes :congruence)