Case-insensitive character equivalence test.
(ichareqv x y) → bool
(ichareqv x y) determines if
ACL2 has a built-in version of this function, char-equal, but it is
irritating to use because it has standard-char-p guards. In contrast,
Function:
(defun ichareqv$inline (x y) (declare (type character x) (type character y)) (let ((acl2::__function__ 'ichareqv)) (declare (ignorable acl2::__function__)) (eql (downcase-char x) (downcase-char y))))
Theorem:
(defthm ichareqv-is-an-equivalence (and (booleanp (ichareqv x y)) (ichareqv x x) (implies (ichareqv x y) (ichareqv y x)) (implies (and (ichareqv x y) (ichareqv y z)) (ichareqv x z))) :rule-classes (:equivalence))
Theorem:
(defthm chareqv-refines-ichareqv (implies (chareqv x y) (ichareqv x y)) :rule-classes (:refinement))
Theorem:
(defthm equal-of-upcase-char-and-upcase-char (equal (equal (upcase-char x) (upcase-char y)) (ichareqv x y)))
Theorem:
(defthm ichareqv-implies-equal-downcase-char-1 (implies (ichareqv x x-equiv) (equal (downcase-char x) (downcase-char x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm ichareqv-implies-equal-upcase-char-1 (implies (ichareqv x x-equiv) (equal (upcase-char x) (upcase-char x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm ichareqv-implies-equal-upcase-char-str-1 (implies (ichareqv x x-equiv) (equal (upcase-char-str x) (upcase-char-str x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm ichareqv-implies-equal-downcase-char-str-1 (implies (ichareqv x x-equiv) (equal (downcase-char-str x) (downcase-char-str x-equiv))) :rule-classes (:congruence))