A fixtype of (unsigned 8-bit) bytes.
We use fty::defbyte to generate this fixtype, along with the recognizer, fixer, and equivalence. The recognizer is identical to bytep.
Function:
(defun byte-equiv$inline (x y) (declare (xargs :guard (and (bytep x) (bytep y)))) (equal (byte-fix x) (byte-fix y)))
Theorem:
(defthm byte-equiv-is-an-equivalence (and (booleanp (byte-equiv x y)) (byte-equiv x x) (implies (byte-equiv x y) (byte-equiv y x)) (implies (and (byte-equiv x y) (byte-equiv y z)) (byte-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm byte-equiv-implies-equal-byte-fix-1 (implies (byte-equiv x x-equiv) (equal (byte-fix x) (byte-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm byte-fix-under-byte-equiv (byte-equiv (byte-fix x) x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-byte-fix-1-forward-to-byte-equiv (implies (equal (byte-fix x) y) (byte-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-byte-fix-2-forward-to-byte-equiv (implies (equal x (byte-fix y)) (byte-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm byte-equiv-of-byte-fix-1-forward (implies (byte-equiv (byte-fix x) y) (byte-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm byte-equiv-of-byte-fix-2-forward (implies (byte-equiv x (byte-fix y)) (byte-equiv x y)) :rule-classes :forward-chaining)