Fixing function for truth3 bit structures.
Function:
(defun truth3-fix (x) (declare (xargs :guard (truth3-p x))) (let ((__function__ 'truth3-fix)) (declare (ignorable __function__)) (mbe :logic (loghead 8 x) :exec x)))
Theorem:
(defthm truth3-p-of-truth3-fix (b* ((fty::fixed (truth3-fix x))) (truth3-p fty::fixed)) :rule-classes :rewrite)
Theorem:
(defthm truth3-fix-when-truth3-p (implies (truth3-p x) (equal (truth3-fix x) x)))
Function:
(defun truth3-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (truth3-p acl2::x) (truth3-p acl2::y)))) (equal (truth3-fix acl2::x) (truth3-fix acl2::y)))
Theorem:
(defthm truth3-equiv-is-an-equivalence (and (booleanp (truth3-equiv x y)) (truth3-equiv x x) (implies (truth3-equiv x y) (truth3-equiv y x)) (implies (and (truth3-equiv x y) (truth3-equiv y z)) (truth3-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm truth3-equiv-implies-equal-truth3-fix-1 (implies (truth3-equiv acl2::x x-equiv) (equal (truth3-fix acl2::x) (truth3-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm truth3-fix-under-truth3-equiv (truth3-equiv (truth3-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm truth3-fix-of-truth3-fix-x (equal (truth3-fix (truth3-fix x)) (truth3-fix x)))
Theorem:
(defthm truth3-fix-truth3-equiv-congruence-on-x (implies (truth3-equiv x x-equiv) (equal (truth3-fix x) (truth3-fix x-equiv))) :rule-classes :congruence)