Fixing function for snippet-mismatch structures.
(snippet-mismatch-fix x) → new-x
Function:
(defun snippet-mismatch-fix$inline (x) (declare (xargs :guard (snippet-mismatch-p x))) (let ((__function__ 'snippet-mismatch-fix)) (declare (ignorable __function__)) (mbe :logic (b* ((input-bytes (byte-list-fix (cdr (std::da-nth 0 x)))) (expected-bytes (byte-list-fix (cdr (std::da-nth 1 x)))) (actual-bytes (byte-list-fix (cdr (std::da-nth 2 x))))) (list (cons 'input-bytes input-bytes) (cons 'expected-bytes expected-bytes) (cons 'actual-bytes actual-bytes))) :exec x)))
Theorem:
(defthm snippet-mismatch-p-of-snippet-mismatch-fix (b* ((new-x (snippet-mismatch-fix$inline x))) (snippet-mismatch-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm snippet-mismatch-fix-when-snippet-mismatch-p (implies (snippet-mismatch-p x) (equal (snippet-mismatch-fix x) x)))
Function:
(defun snippet-mismatch-equiv$inline (x y) (declare (xargs :guard (and (snippet-mismatch-p x) (snippet-mismatch-p y)))) (equal (snippet-mismatch-fix x) (snippet-mismatch-fix y)))
Theorem:
(defthm snippet-mismatch-equiv-is-an-equivalence (and (booleanp (snippet-mismatch-equiv x y)) (snippet-mismatch-equiv x x) (implies (snippet-mismatch-equiv x y) (snippet-mismatch-equiv y x)) (implies (and (snippet-mismatch-equiv x y) (snippet-mismatch-equiv y z)) (snippet-mismatch-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm snippet-mismatch-equiv-implies-equal-snippet-mismatch-fix-1 (implies (snippet-mismatch-equiv x x-equiv) (equal (snippet-mismatch-fix x) (snippet-mismatch-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm snippet-mismatch-fix-under-snippet-mismatch-equiv (snippet-mismatch-equiv (snippet-mismatch-fix x) x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-snippet-mismatch-fix-1-forward-to-snippet-mismatch-equiv (implies (equal (snippet-mismatch-fix x) y) (snippet-mismatch-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-snippet-mismatch-fix-2-forward-to-snippet-mismatch-equiv (implies (equal x (snippet-mismatch-fix y)) (snippet-mismatch-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm snippet-mismatch-equiv-of-snippet-mismatch-fix-1-forward (implies (snippet-mismatch-equiv (snippet-mismatch-fix x) y) (snippet-mismatch-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm snippet-mismatch-equiv-of-snippet-mismatch-fix-2-forward (implies (snippet-mismatch-equiv x (snippet-mismatch-fix y)) (snippet-mismatch-equiv x y)) :rule-classes :forward-chaining)