Basic equivalence relation for opcode structures.
Function:
(defun opcode-equiv$inline (x y) (declare (xargs :guard (and (opcode-p x) (opcode-p y)))) (equal (opcode-fix x) (opcode-fix y)))
Theorem:
(defthm opcode-equiv-is-an-equivalence (and (booleanp (opcode-equiv x y)) (opcode-equiv x x) (implies (opcode-equiv x y) (opcode-equiv y x)) (implies (and (opcode-equiv x y) (opcode-equiv y z)) (opcode-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm opcode-equiv-implies-equal-opcode-fix-1 (implies (opcode-equiv x x-equiv) (equal (opcode-fix x) (opcode-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm opcode-fix-under-opcode-equiv (opcode-equiv (opcode-fix x) x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-opcode-fix-1-forward-to-opcode-equiv (implies (equal (opcode-fix x) y) (opcode-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-opcode-fix-2-forward-to-opcode-equiv (implies (equal x (opcode-fix y)) (opcode-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm opcode-equiv-of-opcode-fix-1-forward (implies (opcode-equiv (opcode-fix x) y) (opcode-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm opcode-equiv-of-opcode-fix-2-forward (implies (opcode-equiv x (opcode-fix y)) (opcode-equiv x y)) :rule-classes :forward-chaining)