Fixing function for inst structures.
Function:
(defun inst-fix$inline (x) (declare (xargs :guard (inst-p x))) (let ((__function__ 'inst-fix)) (declare (ignorable __function__)) (mbe :logic (b* ((mnemonic (mnemonic-fix (std::prod-car (std::prod-car x)))) (opcode (strict-opcode-fix (std::prod-cdr (std::prod-car x)))) (operands (maybe-operands-fix (std::prod-car (std::prod-cdr x)))) (fn (fn-desc-fix (std::prod-car (std::prod-cdr (std::prod-cdr x))))) (excep (exception-desc-fix (std::prod-cdr (std::prod-cdr (std::prod-cdr x)))))) (std::prod-cons (std::prod-cons mnemonic opcode) (std::prod-cons operands (std::prod-cons fn excep)))) :exec x)))
Theorem:
(defthm inst-p-of-inst-fix (b* ((new-x (inst-fix$inline x))) (inst-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm inst-fix-when-inst-p (implies (inst-p x) (equal (inst-fix x) x)))
Function:
(defun inst-equiv$inline (x y) (declare (xargs :guard (and (inst-p x) (inst-p y)))) (equal (inst-fix x) (inst-fix y)))
Theorem:
(defthm inst-equiv-is-an-equivalence (and (booleanp (inst-equiv x y)) (inst-equiv x x) (implies (inst-equiv x y) (inst-equiv y x)) (implies (and (inst-equiv x y) (inst-equiv y z)) (inst-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm inst-equiv-implies-equal-inst-fix-1 (implies (inst-equiv x x-equiv) (equal (inst-fix x) (inst-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm inst-fix-under-inst-equiv (inst-equiv (inst-fix x) x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-inst-fix-1-forward-to-inst-equiv (implies (equal (inst-fix x) y) (inst-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-inst-fix-2-forward-to-inst-equiv (implies (equal x (inst-fix y)) (inst-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm inst-equiv-of-inst-fix-1-forward (implies (inst-equiv (inst-fix x) y) (inst-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm inst-equiv-of-inst-fix-2-forward (implies (inst-equiv x (inst-fix y)) (inst-equiv x y)) :rule-classes :forward-chaining)