(parse-charset-aux x index) → (mv err chars new-index)
Function:
(defun parse-charset-aux (x index) (declare (xargs :guard (and (stringp x) (natp index)))) (declare (xargs :guard (<= index (strlen x)))) (let ((__function__ 'parse-charset-aux)) (declare (ignorable __function__)) (b* (((when (mbe :logic (zp (- (strlen x) (nfix index))) :exec (eql (strlen x) index))) (mv "String ended inside charset" nil (lnfix index))) (x (lstrfix x)) (index (lnfix index)) (char1 (char x index)) ((when (eql char1 #\])) (mv nil nil (+ 1 index))) ((mv err chars index) (parse-charset-elem x index)) ((when err) (mv err nil index)) ((mv err rest index) (parse-charset-aux x index)) ((when err) (mv err nil index))) (mv nil (append chars rest) index))))
Theorem:
(defthm maybe-stringp-of-parse-charset-aux.err (b* (((mv ?err ?chars ?new-index) (parse-charset-aux x index))) (acl2::maybe-stringp err)) :rule-classes :type-prescription)
Theorem:
(defthm character-listp-of-parse-charset-aux.chars (b* (((mv ?err ?chars ?new-index) (parse-charset-aux x index))) (character-listp chars)) :rule-classes :rewrite)
Theorem:
(defthm natp-of-parse-charset-aux.new-index (b* (((mv ?err ?chars ?new-index) (parse-charset-aux x index))) (natp new-index)) :rule-classes :type-prescription)
Theorem:
(defthm new-index-of-parse-charset-aux (b* (((mv ?err ?chars ?new-index) (parse-charset-aux x index))) (<= (nfix index) new-index)) :rule-classes :linear)
Theorem:
(defthm new-index-of-parse-charset-aux-strong (b* (((mv ?err ?chars ?new-index) (parse-charset-aux x index))) (implies (not err) (< (nfix index) new-index))) :rule-classes :linear)
Theorem:
(defthm new-index-of-parse-charset-aux-less-than-length (b* (((mv ?err ?chars ?new-index) (parse-charset-aux x index))) (implies (<= (nfix index) (len (acl2::explode x))) (<= new-index (len (acl2::explode x))))) :rule-classes :linear)
Theorem:
(defthm parse-charset-aux-of-str-fix-x (equal (parse-charset-aux (acl2::str-fix x) index) (parse-charset-aux x index)))
Theorem:
(defthm parse-charset-aux-streqv-congruence-on-x (implies (acl2::streqv x x-equiv) (equal (parse-charset-aux x index) (parse-charset-aux x-equiv index))) :rule-classes :congruence)
Theorem:
(defthm parse-charset-aux-of-nfix-index (equal (parse-charset-aux x (nfix index)) (parse-charset-aux x index)))
Theorem:
(defthm parse-charset-aux-nat-equiv-congruence-on-index (implies (acl2::nat-equiv index index-equiv) (equal (parse-charset-aux x index) (parse-charset-aux x index-equiv))) :rule-classes :congruence)