Fixing function for opcode structures.
Function:
(defun opcode-fix$inline (x) (declare (xargs :guard (opcode-p x))) (let ((__function__ 'opcode-fix)) (declare (ignorable __function__)) (mbe :logic (b* ((op (24bits-fix (std::prod-car (std::prod-car (std::prod-car x))))) (mode (op-mode-fix (std::prod-car (std::prod-cdr (std::prod-car (std::prod-car x)))))) (reg (maybe-3bits-fix (std::prod-cdr (std::prod-cdr (std::prod-car (std::prod-car x)))))) (mod (mod-fix (std::prod-car (std::prod-cdr (std::prod-car x))))) (r/m (maybe-3bits-fix (std::prod-car (std::prod-cdr (std::prod-cdr (std::prod-car x)))))) (pfx (op-pfx-fix (std::prod-cdr (std::prod-cdr (std::prod-cdr (std::prod-car x)))))) (rex (rex-fix (std::prod-car (std::prod-car (std::prod-cdr x))))) (vex (maybe-vex-fix (std::prod-car (std::prod-cdr (std::prod-car (std::prod-cdr x)))))) (evex (maybe-evex-fix (std::prod-cdr (std::prod-cdr (std::prod-car (std::prod-cdr x)))))) (feat (acl2::symbol-list-fix (std::prod-car (std::prod-cdr (std::prod-cdr x))))) (superscripts (superscripts-fix (std::prod-car (std::prod-cdr (std::prod-cdr (std::prod-cdr x)))))) (group (opcode-extension-group-fix (std::prod-cdr (std::prod-cdr (std::prod-cdr (std::prod-cdr x))))))) (std::prod-cons (std::prod-cons (std::prod-cons op (std::prod-cons mode reg)) (std::prod-cons mod (std::prod-cons r/m pfx))) (std::prod-cons (std::prod-cons rex (std::prod-cons vex evex)) (std::prod-cons feat (std::prod-cons superscripts group))))) :exec x)))
Theorem:
(defthm opcode-p-of-opcode-fix (b* ((new-x (opcode-fix$inline x))) (opcode-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm opcode-fix-when-opcode-p (implies (opcode-p x) (equal (opcode-fix x) x)))
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)