Fixtype of Unicode input characters usable in character literals.
This corresponds to
the grammar rule for
Since
We prefer the nomenclature `Unicode character for a character literal', on which this type name is based, to the nomenclature `single character' suggested by the grammar.
Function:
(defun unicode-charlit-char-p (x) (declare (xargs :guard t)) (let ((__function__ 'unicode-charlit-char-p)) (declare (ignorable __function__)) (and (unicode-input-char-p x) (not (member (unicode-input-char->unicode x) (list (char-code #\Return) (char-code #\Newline) (char-code #\') (char-code #\\)))))))
Theorem:
(defthm booleanp-of-unicode-charlit-char-p (b* ((yes/no (unicode-charlit-char-p x))) (booleanp yes/no)) :rule-classes :rewrite)
Function:
(defun unicode-charlit-char-fix (x) (declare (xargs :guard (unicode-charlit-char-p x))) (mbe :logic (if (unicode-charlit-char-p x) x (make-unicode-input-char :unicode 0 :umarker 0)) :exec x))
Theorem:
(defthm unicode-charlit-char-p-of-unicode-charlit-char-fix (b* ((fixed-x (unicode-charlit-char-fix x))) (unicode-charlit-char-p fixed-x)) :rule-classes :rewrite)
Theorem:
(defthm unicode-charlit-char-fix-when-unicode-charlit-char-p (implies (unicode-charlit-char-p x) (equal (unicode-charlit-char-fix x) x)))
Function:
(defun unicode-charlit-char-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (unicode-charlit-char-p acl2::x) (unicode-charlit-char-p acl2::y)))) (equal (unicode-charlit-char-fix acl2::x) (unicode-charlit-char-fix acl2::y)))
Theorem:
(defthm unicode-charlit-char-equiv-is-an-equivalence (and (booleanp (unicode-charlit-char-equiv x y)) (unicode-charlit-char-equiv x x) (implies (unicode-charlit-char-equiv x y) (unicode-charlit-char-equiv y x)) (implies (and (unicode-charlit-char-equiv x y) (unicode-charlit-char-equiv y z)) (unicode-charlit-char-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm unicode-charlit-char-equiv-implies-equal-unicode-charlit-char-fix-1 (implies (unicode-charlit-char-equiv acl2::x x-equiv) (equal (unicode-charlit-char-fix acl2::x) (unicode-charlit-char-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm unicode-charlit-char-fix-under-unicode-charlit-char-equiv (unicode-charlit-char-equiv (unicode-charlit-char-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-unicode-charlit-char-fix-1-forward-to-unicode-charlit-char-equiv (implies (equal (unicode-charlit-char-fix acl2::x) acl2::y) (unicode-charlit-char-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-unicode-charlit-char-fix-2-forward-to-unicode-charlit-char-equiv (implies (equal acl2::x (unicode-charlit-char-fix acl2::y)) (unicode-charlit-char-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm unicode-charlit-char-equiv-of-unicode-charlit-char-fix-1-forward (implies (unicode-charlit-char-equiv (unicode-charlit-char-fix acl2::x) acl2::y) (unicode-charlit-char-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm unicode-charlit-char-equiv-of-unicode-charlit-char-fix-2-forward (implies (unicode-charlit-char-equiv acl2::x (unicode-charlit-char-fix acl2::y)) (unicode-charlit-char-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)