Fixing function for unary-op structures.
Function:
(defun unary-op-fix$inline (x) (declare (xargs :guard (unary-opp x))) (let ((__function__ 'unary-op-fix)) (declare (ignorable __function__)) (mbe :logic (case (unary-op-kind x) (:not (cons :not (list))) (:minus (cons :minus (list)))) :exec x)))
Theorem:
(defthm unary-opp-of-unary-op-fix (b* ((new-x (unary-op-fix$inline x))) (unary-opp new-x)) :rule-classes :rewrite)
Theorem:
(defthm unary-op-fix-when-unary-opp (implies (unary-opp x) (equal (unary-op-fix x) x)))
Function:
(defun unary-op-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (unary-opp acl2::x) (unary-opp acl2::y)))) (equal (unary-op-fix acl2::x) (unary-op-fix acl2::y)))
Theorem:
(defthm unary-op-equiv-is-an-equivalence (and (booleanp (unary-op-equiv x y)) (unary-op-equiv x x) (implies (unary-op-equiv x y) (unary-op-equiv y x)) (implies (and (unary-op-equiv x y) (unary-op-equiv y z)) (unary-op-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm unary-op-equiv-implies-equal-unary-op-fix-1 (implies (unary-op-equiv acl2::x x-equiv) (equal (unary-op-fix acl2::x) (unary-op-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm unary-op-fix-under-unary-op-equiv (unary-op-equiv (unary-op-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-unary-op-fix-1-forward-to-unary-op-equiv (implies (equal (unary-op-fix acl2::x) acl2::y) (unary-op-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-unary-op-fix-2-forward-to-unary-op-equiv (implies (equal acl2::x (unary-op-fix acl2::y)) (unary-op-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm unary-op-equiv-of-unary-op-fix-1-forward (implies (unary-op-equiv (unary-op-fix acl2::x) acl2::y) (unary-op-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm unary-op-equiv-of-unary-op-fix-2-forward (implies (unary-op-equiv acl2::x (unary-op-fix acl2::y)) (unary-op-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm unary-op-kind$inline-of-unary-op-fix-x (equal (unary-op-kind$inline (unary-op-fix x)) (unary-op-kind$inline x)))
Theorem:
(defthm unary-op-kind$inline-unary-op-equiv-congruence-on-x (implies (unary-op-equiv x x-equiv) (equal (unary-op-kind$inline x) (unary-op-kind$inline x-equiv))) :rule-classes :congruence)
Theorem:
(defthm consp-of-unary-op-fix (consp (unary-op-fix x)) :rule-classes :type-prescription)