Fixing function for use-set structures.
Function:
(defun use-set-fix$inline (x) (declare (xargs :guard (use-set-p x))) (let ((__function__ 'use-set-fix)) (declare (ignorable __function__)) (mbe :logic (b* ((uses (rangemap-fix (std::prod-car x))) (sets (rangemap-fix (std::prod-cdr x)))) (std::prod-cons uses sets)) :exec x)))
Theorem:
(defthm use-set-p-of-use-set-fix (b* ((new-x (use-set-fix$inline x))) (use-set-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm use-set-fix-when-use-set-p (implies (use-set-p x) (equal (use-set-fix x) x)))
Function:
(defun use-set-equiv$inline (x y) (declare (xargs :guard (and (use-set-p x) (use-set-p y)))) (equal (use-set-fix x) (use-set-fix y)))
Theorem:
(defthm use-set-equiv-is-an-equivalence (and (booleanp (use-set-equiv x y)) (use-set-equiv x x) (implies (use-set-equiv x y) (use-set-equiv y x)) (implies (and (use-set-equiv x y) (use-set-equiv y z)) (use-set-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm use-set-equiv-implies-equal-use-set-fix-1 (implies (use-set-equiv x x-equiv) (equal (use-set-fix x) (use-set-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm use-set-fix-under-use-set-equiv (use-set-equiv (use-set-fix x) x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-use-set-fix-1-forward-to-use-set-equiv (implies (equal (use-set-fix x) y) (use-set-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-use-set-fix-2-forward-to-use-set-equiv (implies (equal x (use-set-fix y)) (use-set-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm use-set-equiv-of-use-set-fix-1-forward (implies (use-set-equiv (use-set-fix x) y) (use-set-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm use-set-equiv-of-use-set-fix-2-forward (implies (use-set-equiv x (use-set-fix y)) (use-set-equiv x y)) :rule-classes :forward-chaining)