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