(match-exact pat x index mode) → new-index
Function:
(defun match-exact (pat x index mode) (declare (xargs :guard (and (stringp pat) (stringp x) (natp index) (matchmode-p mode)))) (let ((__function__ 'match-exact)) (declare (ignorable __function__)) (b* ((index (lnfix index)) (pat (lstrfix pat)) (x (lstrfix x)) ((matchmode mode)) (patlen (strlen pat)) (new-index (+ index patlen))) (and (<= new-index (strlen x)) (if mode.case-insens (str::istreqv pat (subseq x index new-index)) (equal pat (subseq x index new-index))) new-index))))
Theorem:
(defthm maybe-natp-of-match-exact (b* ((new-index (match-exact pat x index mode))) (maybe-natp new-index)) :rule-classes :type-prescription)
Theorem:
(defthm bound-of-match-exact (b* ((?new-index (match-exact pat x index mode))) (implies new-index (<= (nfix index) new-index))) :rule-classes :linear)
Theorem:
(defthm upper-bound-of-match-exact (b* ((?new-index (match-exact pat x index mode))) (implies new-index (<= new-index (len (acl2::explode x))))) :rule-classes :linear)
Theorem:
(defthm match-exact-of-str-fix-pat (equal (match-exact (acl2::str-fix pat) x index mode) (match-exact pat x index mode)))
Theorem:
(defthm match-exact-streqv-congruence-on-pat (implies (acl2::streqv pat pat-equiv) (equal (match-exact pat x index mode) (match-exact pat-equiv x index mode))) :rule-classes :congruence)
Theorem:
(defthm match-exact-of-str-fix-x (equal (match-exact pat (acl2::str-fix x) index mode) (match-exact pat x index mode)))
Theorem:
(defthm match-exact-streqv-congruence-on-x (implies (acl2::streqv x x-equiv) (equal (match-exact pat x index mode) (match-exact pat x-equiv index mode))) :rule-classes :congruence)
Theorem:
(defthm match-exact-of-nfix-index (equal (match-exact pat x (nfix index) mode) (match-exact pat x index mode)))
Theorem:
(defthm match-exact-nat-equiv-congruence-on-index (implies (acl2::nat-equiv index index-equiv) (equal (match-exact pat x index mode) (match-exact pat x index-equiv mode))) :rule-classes :congruence)
Theorem:
(defthm match-exact-of-matchmode-fix-mode (equal (match-exact pat x index (matchmode-fix mode)) (match-exact pat x index mode)))
Theorem:
(defthm match-exact-matchmode-equiv-congruence-on-mode (implies (matchmode-equiv mode mode-equiv) (equal (match-exact pat x index mode) (match-exact pat x index mode-equiv))) :rule-classes :congruence)