Fixing function for char-value structures.
(char-value-fix x) → new-x
Function:
(defun char-value-fix$inline (x) (declare (xargs :guard (char-valuep x))) (let ((__function__ 'char-value-fix)) (declare (ignorable __function__)) (mbe :logic (b* ((nat (acl2::ubyte16-fix (std::da-nth 0 (cdr x))))) (cons :char (list nat))) :exec x)))
Theorem:
(defthm char-valuep-of-char-value-fix (b* ((new-x (char-value-fix$inline x))) (char-valuep new-x)) :rule-classes :rewrite)
Theorem:
(defthm char-value-fix-when-char-valuep (implies (char-valuep x) (equal (char-value-fix x) x)))
Function:
(defun char-value-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (char-valuep acl2::x) (char-valuep acl2::y)))) (equal (char-value-fix acl2::x) (char-value-fix acl2::y)))
Theorem:
(defthm char-value-equiv-is-an-equivalence (and (booleanp (char-value-equiv x y)) (char-value-equiv x x) (implies (char-value-equiv x y) (char-value-equiv y x)) (implies (and (char-value-equiv x y) (char-value-equiv y z)) (char-value-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm char-value-equiv-implies-equal-char-value-fix-1 (implies (char-value-equiv acl2::x x-equiv) (equal (char-value-fix acl2::x) (char-value-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm char-value-fix-under-char-value-equiv (char-value-equiv (char-value-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-char-value-fix-1-forward-to-char-value-equiv (implies (equal (char-value-fix acl2::x) acl2::y) (char-value-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-char-value-fix-2-forward-to-char-value-equiv (implies (equal acl2::x (char-value-fix acl2::y)) (char-value-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm char-value-equiv-of-char-value-fix-1-forward (implies (char-value-equiv (char-value-fix acl2::x) acl2::y) (char-value-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm char-value-equiv-of-char-value-fix-2-forward (implies (char-value-equiv acl2::x (char-value-fix acl2::y)) (char-value-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)