Fixing function for rewrite structures.
Function:
(defun rewrite-fix$inline (x) (declare (xargs :guard (rewrite-p x))) (let ((__function__ 'rewrite-fix)) (declare (ignorable __function__)) (mbe :logic (b* ((hyps (pseudo-term-list-fix (std::da-nth 0 x))) (equiv (pseudo-fnsym-fix (std::da-nth 1 x))) (lhs (pseudo-term-fix (std::da-nth 2 x))) (rhs (pseudo-term-fix (std::da-nth 3 x)))) (list hyps equiv lhs rhs)) :exec x)))
Theorem:
(defthm rewrite-p-of-rewrite-fix (b* ((new-x (rewrite-fix$inline x))) (rewrite-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm rewrite-fix-when-rewrite-p (implies (rewrite-p x) (equal (rewrite-fix x) x)))
Function:
(defun rewrite-equiv$inline (x y) (declare (xargs :guard (and (rewrite-p x) (rewrite-p y)))) (equal (rewrite-fix x) (rewrite-fix y)))
Theorem:
(defthm rewrite-equiv-is-an-equivalence (and (booleanp (rewrite-equiv x y)) (rewrite-equiv x x) (implies (rewrite-equiv x y) (rewrite-equiv y x)) (implies (and (rewrite-equiv x y) (rewrite-equiv y z)) (rewrite-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm rewrite-equiv-implies-equal-rewrite-fix-1 (implies (rewrite-equiv x x-equiv) (equal (rewrite-fix x) (rewrite-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm rewrite-fix-under-rewrite-equiv (rewrite-equiv (rewrite-fix x) x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-rewrite-fix-1-forward-to-rewrite-equiv (implies (equal (rewrite-fix x) y) (rewrite-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-rewrite-fix-2-forward-to-rewrite-equiv (implies (equal x (rewrite-fix y)) (rewrite-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm rewrite-equiv-of-rewrite-fix-1-forward (implies (rewrite-equiv (rewrite-fix x) y) (rewrite-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm rewrite-equiv-of-rewrite-fix-2-forward (implies (rewrite-equiv x (rewrite-fix y)) (rewrite-equiv x y)) :rule-classes :forward-chaining)