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