(find-substr target x index) → pos
Function:
(defun find-substr (target x index) (declare (xargs :guard (and (stringp target) (stringp x) (natp index)))) (declare (xargs :guard (<= index (strlen x)))) (let ((__function__ 'find-substr)) (declare (ignorable __function__)) (str::strpos-fast (lstrfix target) (lstrfix x) (lnfix index) (strlen target) (strlen x))))
Theorem:
(defthm maybe-natp-of-find-substr (b* ((pos (find-substr target x index))) (maybe-natp pos)) :rule-classes :type-prescription)
Theorem:
(defthm new-index-of-find-substr (b* ((?pos (find-substr target x index))) (implies pos (<= (nfix index) pos))) :rule-classes :linear)
Theorem:
(defthm new-index-of-find-substr-less-than-length (b* ((?pos (find-substr target x index))) (implies (and pos (<= (nfix index) (len (acl2::explode x)))) (<= pos (- (len (acl2::explode x)) (len (acl2::explode target)))))) :rule-classes :linear)
Theorem:
(defthm find-substr-of-str-fix-target (equal (find-substr (acl2::str-fix target) x index) (find-substr target x index)))
Theorem:
(defthm find-substr-streqv-congruence-on-target (implies (acl2::streqv target target-equiv) (equal (find-substr target x index) (find-substr target-equiv x index))) :rule-classes :congruence)
Theorem:
(defthm find-substr-of-str-fix-x (equal (find-substr target (acl2::str-fix x) index) (find-substr target x index)))
Theorem:
(defthm find-substr-streqv-congruence-on-x (implies (acl2::streqv x x-equiv) (equal (find-substr target x index) (find-substr target x-equiv index))) :rule-classes :congruence)
Theorem:
(defthm find-substr-of-nfix-index (equal (find-substr target x (nfix index)) (find-substr target x index)))
Theorem:
(defthm find-substr-nat-equiv-congruence-on-index (implies (acl2::nat-equiv index index-equiv) (equal (find-substr target x index) (find-substr target x index-equiv))) :rule-classes :congruence)