Case-sensitive character equivalence test.
(chareqv x y) determines if
See also str::ichareqv for a case-insensitive alternative.
Function:
(defun chareqv$inline (x y) (declare (xargs :guard t)) (eql (char-fix x) (char-fix y)))
Theorem:
(defthm chareqv-is-an-equivalence (and (booleanp (chareqv x y)) (chareqv x x) (implies (chareqv x y) (chareqv y x)) (implies (and (chareqv x y) (chareqv y z)) (chareqv x z))) :rule-classes (:equivalence))
Theorem:
(defthm chareqv-of-char-fix (chareqv (char-fix x) x))
Theorem:
(defthm chareqv-implies-equal-char-fix-1 (implies (chareqv x x-equiv) (equal (char-fix x) (char-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm chareqv-implies-equal-char-code-1 (implies (chareqv x x-equiv) (equal (char-code x) (char-code x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm chareqv-implies-equal-char<-1 (implies (chareqv x x-equiv) (equal (char< x y) (char< x-equiv y))) :rule-classes (:congruence))
Theorem:
(defthm chareqv-implies-equal-char<-2 (implies (chareqv y y-equiv) (equal (char< x y) (char< x y-equiv))) :rule-classes (:congruence))