Fixing function for operand structures.
Function:
(defun operand-fix$inline (x) (declare (xargs :guard (operandp x))) (let ((__function__ 'operand-fix)) (declare (ignorable __function__)) (mbe :logic (case (operand-kind x) (:literal (b* ((get (literal-fix (std::da-nth 0 (cdr x))))) (cons :literal (list get)))) (:register (b* ((get (regaccess-fix (std::da-nth 0 (cdr x))))) (cons :register (list get)))) (:program (b* ((get (programid-fix (std::da-nth 0 (cdr x))))) (cons :program (list get)))) (:selfcaller (cons :selfcaller (list)))) :exec x)))
Theorem:
(defthm operandp-of-operand-fix (b* ((new-x (operand-fix$inline x))) (operandp new-x)) :rule-classes :rewrite)
Theorem:
(defthm operand-fix-when-operandp (implies (operandp x) (equal (operand-fix x) x)))
Function:
(defun operand-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (operandp acl2::x) (operandp acl2::y)))) (equal (operand-fix acl2::x) (operand-fix acl2::y)))
Theorem:
(defthm operand-equiv-is-an-equivalence (and (booleanp (operand-equiv x y)) (operand-equiv x x) (implies (operand-equiv x y) (operand-equiv y x)) (implies (and (operand-equiv x y) (operand-equiv y z)) (operand-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm operand-equiv-implies-equal-operand-fix-1 (implies (operand-equiv acl2::x x-equiv) (equal (operand-fix acl2::x) (operand-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm operand-fix-under-operand-equiv (operand-equiv (operand-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-operand-fix-1-forward-to-operand-equiv (implies (equal (operand-fix acl2::x) acl2::y) (operand-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-operand-fix-2-forward-to-operand-equiv (implies (equal acl2::x (operand-fix acl2::y)) (operand-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm operand-equiv-of-operand-fix-1-forward (implies (operand-equiv (operand-fix acl2::x) acl2::y) (operand-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm operand-equiv-of-operand-fix-2-forward (implies (operand-equiv acl2::x (operand-fix acl2::y)) (operand-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm operand-kind$inline-of-operand-fix-x (equal (operand-kind$inline (operand-fix x)) (operand-kind$inline x)))
Theorem:
(defthm operand-kind$inline-operand-equiv-congruence-on-x (implies (operand-equiv x x-equiv) (equal (operand-kind$inline x) (operand-kind$inline x-equiv))) :rule-classes :congruence)
Theorem:
(defthm consp-of-operand-fix (consp (operand-fix x)) :rule-classes :type-prescription)