Case-sensitive string prefix test.
(strprefixp x y) determines if the string
Logically, this is identical to
(prefixp (explode x) (explode y))
But we use a more efficient implementation which avoids coercing the strings into character lists.
Function:
(defun strprefixp$inline (x y) (declare (type string x) (type string y)) (mbe :logic (prefixp (explode x) (explode y)) :exec (strprefixp-impl (the string x) (the string y) (the integer 0) (the integer 0) (the integer (length (the string x))) (the integer (length (the string y))))))
Theorem:
(defthm streqv-implies-equal-strprefixp-1 (implies (streqv x x-equiv) (equal (strprefixp x y) (strprefixp x-equiv y))) :rule-classes (:congruence))
Theorem:
(defthm streqv-implies-equal-strprefixp-2 (implies (streqv y y-equiv) (equal (strprefixp x y) (strprefixp x y-equiv))) :rule-classes (:congruence))