Fixing function for binary-op structures.
(binary-op-fix x) → new-x
Function:
(defun binary-op-fix$inline (x) (declare (xargs :guard (binary-opp x))) (let ((__function__ 'binary-op-fix)) (declare (ignorable __function__)) (mbe :logic (case (binary-op-kind x) (:eq (cons :eq (list))) (:ne (cons :ne (list))) (:gt (cons :gt (list))) (:ge (cons :ge (list))) (:lt (cons :lt (list))) (:le (cons :le (list))) (:and (cons :and (list))) (:or (cons :or (list))) (:implies (cons :implies (list))) (:implied (cons :implied (list))) (:iff (cons :iff (list))) (:add (cons :add (list))) (:sub (cons :sub (list))) (:mul (cons :mul (list))) (:div (cons :div (list))) (:rem (cons :rem (list)))) :exec x)))
Theorem:
(defthm binary-opp-of-binary-op-fix (b* ((new-x (binary-op-fix$inline x))) (binary-opp new-x)) :rule-classes :rewrite)
Theorem:
(defthm binary-op-fix-when-binary-opp (implies (binary-opp x) (equal (binary-op-fix x) x)))
Function:
(defun binary-op-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (binary-opp acl2::x) (binary-opp acl2::y)))) (equal (binary-op-fix acl2::x) (binary-op-fix acl2::y)))
Theorem:
(defthm binary-op-equiv-is-an-equivalence (and (booleanp (binary-op-equiv x y)) (binary-op-equiv x x) (implies (binary-op-equiv x y) (binary-op-equiv y x)) (implies (and (binary-op-equiv x y) (binary-op-equiv y z)) (binary-op-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm binary-op-equiv-implies-equal-binary-op-fix-1 (implies (binary-op-equiv acl2::x x-equiv) (equal (binary-op-fix acl2::x) (binary-op-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm binary-op-fix-under-binary-op-equiv (binary-op-equiv (binary-op-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-binary-op-fix-1-forward-to-binary-op-equiv (implies (equal (binary-op-fix acl2::x) acl2::y) (binary-op-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-binary-op-fix-2-forward-to-binary-op-equiv (implies (equal acl2::x (binary-op-fix acl2::y)) (binary-op-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm binary-op-equiv-of-binary-op-fix-1-forward (implies (binary-op-equiv (binary-op-fix acl2::x) acl2::y) (binary-op-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm binary-op-equiv-of-binary-op-fix-2-forward (implies (binary-op-equiv acl2::x (binary-op-fix acl2::y)) (binary-op-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm binary-op-kind$inline-of-binary-op-fix-x (equal (binary-op-kind$inline (binary-op-fix x)) (binary-op-kind$inline x)))
Theorem:
(defthm binary-op-kind$inline-binary-op-equiv-congruence-on-x (implies (binary-op-equiv x x-equiv) (equal (binary-op-kind$inline x) (binary-op-kind$inline x-equiv))) :rule-classes :congruence)
Theorem:
(defthm consp-of-binary-op-fix (consp (binary-op-fix x)) :rule-classes :type-prescription)