Fixing function for operands structures.
(operands-fix x) → new-x
Function:
(defun operands-fix$inline (x) (declare (xargs :guard (operands-p x))) (let ((__function__ 'operands-fix)) (declare (ignorable __function__)) (mbe :logic (b* ((op1 (operand-type-fix (std::prod-car (std::prod-car x)))) (op2 (operand-type-fix (std::prod-cdr (std::prod-car x)))) (op3 (operand-type-fix (std::prod-car (std::prod-cdr x)))) (op4 (operand-type-fix (std::prod-cdr (std::prod-cdr x))))) (std::prod-cons (std::prod-cons op1 op2) (std::prod-cons op3 op4))) :exec x)))
Theorem:
(defthm operands-p-of-operands-fix (b* ((new-x (operands-fix$inline x))) (operands-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm operands-fix-when-operands-p (implies (operands-p x) (equal (operands-fix x) x)))
Function:
(defun operands-equiv$inline (x y) (declare (xargs :guard (and (operands-p x) (operands-p y)))) (equal (operands-fix x) (operands-fix y)))
Theorem:
(defthm operands-equiv-is-an-equivalence (and (booleanp (operands-equiv x y)) (operands-equiv x x) (implies (operands-equiv x y) (operands-equiv y x)) (implies (and (operands-equiv x y) (operands-equiv y z)) (operands-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm operands-equiv-implies-equal-operands-fix-1 (implies (operands-equiv x x-equiv) (equal (operands-fix x) (operands-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm operands-fix-under-operands-equiv (operands-equiv (operands-fix x) x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-operands-fix-1-forward-to-operands-equiv (implies (equal (operands-fix x) y) (operands-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-operands-fix-2-forward-to-operands-equiv (implies (equal x (operands-fix y)) (operands-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm operands-equiv-of-operands-fix-1-forward (implies (operands-equiv (operands-fix x) y) (operands-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm operands-equiv-of-operands-fix-2-forward (implies (operands-equiv x (operands-fix y)) (operands-equiv x y)) :rule-classes :forward-chaining)