Fixing function for flatten-res structures.
(flatten-res-fix x) → new-x
Function:
(defun flatten-res-fix$inline (x) (declare (xargs :guard (flatten-res-p x))) (let ((__function__ 'flatten-res-fix)) (declare (ignorable __function__)) (mbe :logic (b* ((assigns (assigns-fix (cdr (std::da-nth 0 x)))) (fixups (assigns-fix (cdr (std::da-nth 1 x)))) (constraints (constraintlist-fix (cdr (std::da-nth 2 x)))) (var-decl-map (var-decl-map-fix (cdr (std::da-nth 3 x))))) (list (cons 'assigns assigns) (cons 'fixups fixups) (cons 'constraints constraints) (cons 'var-decl-map var-decl-map))) :exec x)))
Theorem:
(defthm flatten-res-p-of-flatten-res-fix (b* ((new-x (flatten-res-fix$inline x))) (flatten-res-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm flatten-res-fix-when-flatten-res-p (implies (flatten-res-p x) (equal (flatten-res-fix x) x)))
Function:
(defun flatten-res-equiv$inline (x y) (declare (xargs :guard (and (flatten-res-p x) (flatten-res-p y)))) (equal (flatten-res-fix x) (flatten-res-fix y)))
Theorem:
(defthm flatten-res-equiv-is-an-equivalence (and (booleanp (flatten-res-equiv x y)) (flatten-res-equiv x x) (implies (flatten-res-equiv x y) (flatten-res-equiv y x)) (implies (and (flatten-res-equiv x y) (flatten-res-equiv y z)) (flatten-res-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm flatten-res-equiv-implies-equal-flatten-res-fix-1 (implies (flatten-res-equiv x x-equiv) (equal (flatten-res-fix x) (flatten-res-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm flatten-res-fix-under-flatten-res-equiv (flatten-res-equiv (flatten-res-fix x) x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-flatten-res-fix-1-forward-to-flatten-res-equiv (implies (equal (flatten-res-fix x) y) (flatten-res-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-flatten-res-fix-2-forward-to-flatten-res-equiv (implies (equal x (flatten-res-fix y)) (flatten-res-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm flatten-res-equiv-of-flatten-res-fix-1-forward (implies (flatten-res-equiv (flatten-res-fix x) y) (flatten-res-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm flatten-res-equiv-of-flatten-res-fix-2-forward (implies (flatten-res-equiv x (flatten-res-fix y)) (flatten-res-equiv x y)) :rule-classes :forward-chaining)