Fixing function for char-literal structures.
(char-literal-fix x) → new-x
Function:
(defun char-literal-fix$inline (x) (declare (xargs :guard (char-literalp x))) (let ((__function__ 'char-literal-fix)) (declare (ignorable __function__)) (mbe :logic (case (char-literal-kind x) (:char (b* ((get (unicode-charlit-char-fix (std::da-nth 0 (cdr x))))) (cons :char (list get)))) (:escape (b* ((get (escape-sequence-fix (std::da-nth 0 (cdr x))))) (cons :escape (list get))))) :exec x)))
Theorem:
(defthm char-literalp-of-char-literal-fix (b* ((new-x (char-literal-fix$inline x))) (char-literalp new-x)) :rule-classes :rewrite)
Theorem:
(defthm char-literal-fix-when-char-literalp (implies (char-literalp x) (equal (char-literal-fix x) x)))
Function:
(defun char-literal-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (char-literalp acl2::x) (char-literalp acl2::y)))) (equal (char-literal-fix acl2::x) (char-literal-fix acl2::y)))
Theorem:
(defthm char-literal-equiv-is-an-equivalence (and (booleanp (char-literal-equiv x y)) (char-literal-equiv x x) (implies (char-literal-equiv x y) (char-literal-equiv y x)) (implies (and (char-literal-equiv x y) (char-literal-equiv y z)) (char-literal-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm char-literal-equiv-implies-equal-char-literal-fix-1 (implies (char-literal-equiv acl2::x x-equiv) (equal (char-literal-fix acl2::x) (char-literal-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm char-literal-fix-under-char-literal-equiv (char-literal-equiv (char-literal-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-char-literal-fix-1-forward-to-char-literal-equiv (implies (equal (char-literal-fix acl2::x) acl2::y) (char-literal-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-char-literal-fix-2-forward-to-char-literal-equiv (implies (equal acl2::x (char-literal-fix acl2::y)) (char-literal-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm char-literal-equiv-of-char-literal-fix-1-forward (implies (char-literal-equiv (char-literal-fix acl2::x) acl2::y) (char-literal-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm char-literal-equiv-of-char-literal-fix-2-forward (implies (char-literal-equiv acl2::x (char-literal-fix acl2::y)) (char-literal-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm char-literal-kind$inline-of-char-literal-fix-x (equal (char-literal-kind$inline (char-literal-fix x)) (char-literal-kind$inline x)))
Theorem:
(defthm char-literal-kind$inline-char-literal-equiv-congruence-on-x (implies (char-literal-equiv x x-equiv) (equal (char-literal-kind$inline x) (char-literal-kind$inline x-equiv))) :rule-classes :congruence)
Theorem:
(defthm consp-of-char-literal-fix (consp (char-literal-fix x)) :rule-classes :type-prescription)