Mixed alphanumeric string less-than test.
(strnat< x y) → *
(strnat< x y) determines if the string
See charlistnat< for a description of this order.
We avoid coercing the strings into character lists, and this is altogether pretty fast.
Function:
(defun strnat<$inline (x y) (declare (type string x) (type string y)) (let ((acl2::__function__ 'strnat<)) (declare (ignorable acl2::__function__)) (mbe :logic (charlistnat< (explode x) (explode y)) :exec (strnat<-aux (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-strnat<-1 (implies (streqv x x-equiv) (equal (strnat< x y) (strnat< x-equiv y))) :rule-classes (:congruence))
Theorem:
(defthm streqv-implies-equal-strnat<-2 (implies (streqv y y-equiv) (equal (strnat< x y) (strnat< x y-equiv))) :rule-classes (:congruence))
Theorem:
(defthm strnat<-irreflexive (not (strnat< x x)))
Theorem:
(defthm strnat<-antisymmetric (implies (strnat< x y) (not (strnat< y x))))
Theorem:
(defthm strnat<-transitive (implies (and (strnat< x y) (strnat< y z)) (strnat< x z)))
Theorem:
(defthm strnat<-transitive-alt (implies (and (strnat< y z) (strnat< x y)) (strnat< x z)))