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