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