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