Semantics of characters in case-sensitive character value notations.
(nat-match-sensitive-char-p nat char) → yes/no
A natural number matches a character in a case-sensitive character value notation iff the natural number is the character's code.
Function:
(defun nat-match-sensitive-char-p (nat char) (declare (xargs :guard (and (natp nat) (characterp char)))) (b* ((nat (mbe :logic (nfix nat) :exec nat))) (equal nat (char-code char))))
Theorem:
(defthm booleanp-of-nat-match-sensitive-char-p (b* ((yes/no (nat-match-sensitive-char-p nat char))) (booleanp yes/no)) :rule-classes :rewrite)
Theorem:
(defthm nat-match-sensitive-char-p-of-char-fix (equal (nat-match-sensitive-char-p nat (char-fix char)) (nat-match-sensitive-char-p nat char)))
Theorem:
(defthm nat-match-sensitive-char-p-of-nfix-nat (equal (nat-match-sensitive-char-p (nfix nat) char) (nat-match-sensitive-char-p nat char)))
Theorem:
(defthm nat-match-sensitive-char-p-nat-equiv-congruence-on-nat (implies (acl2::nat-equiv nat nat-equiv) (equal (nat-match-sensitive-char-p nat char) (nat-match-sensitive-char-p nat-equiv char))) :rule-classes :congruence)
Theorem:
(defthm nat-match-sensitive-char-p-of-char-fix-char (equal (nat-match-sensitive-char-p nat (char-fix char)) (nat-match-sensitive-char-p nat char)))
Theorem:
(defthm nat-match-sensitive-char-p-chareqv-congruence-on-char (implies (acl2::chareqv char char-equiv) (equal (nat-match-sensitive-char-p nat char) (nat-match-sensitive-char-p nat char-equiv))) :rule-classes :congruence)