(tree-set-fix x) is a usual ACL2::fty set fixing function.
(tree-set-fix x) → *
In the logic, we apply tree-fix to each member of the x. In the execution, none of that is actually necessary and this is just an inlined identity function.
Function:
(defun tree-set-fix (x) (declare (xargs :guard (tree-setp x))) (mbe :logic (if (tree-setp x) x nil) :exec x))
Theorem:
(defthm tree-setp-of-tree-set-fix (tree-setp (tree-set-fix x)))
Theorem:
(defthm tree-set-fix-when-tree-setp (implies (tree-setp x) (equal (tree-set-fix x) x)))
Theorem:
(defthm emptyp-tree-set-fix (implies (or (emptyp x) (not (tree-setp x))) (emptyp (tree-set-fix x))))
Theorem:
(defthm emptyp-of-tree-set-fix (equal (emptyp (tree-set-fix x)) (or (not (tree-setp x)) (emptyp x))))
Function:
(defun tree-set-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (tree-setp acl2::x) (tree-setp acl2::y)))) (equal (tree-set-fix acl2::x) (tree-set-fix acl2::y)))
Theorem:
(defthm tree-set-equiv-is-an-equivalence (and (booleanp (tree-set-equiv x y)) (tree-set-equiv x x) (implies (tree-set-equiv x y) (tree-set-equiv y x)) (implies (and (tree-set-equiv x y) (tree-set-equiv y z)) (tree-set-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm tree-set-equiv-implies-equal-tree-set-fix-1 (implies (tree-set-equiv acl2::x x-equiv) (equal (tree-set-fix acl2::x) (tree-set-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm tree-set-fix-under-tree-set-equiv (tree-set-equiv (tree-set-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-tree-set-fix-1-forward-to-tree-set-equiv (implies (equal (tree-set-fix acl2::x) acl2::y) (tree-set-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-tree-set-fix-2-forward-to-tree-set-equiv (implies (equal acl2::x (tree-set-fix acl2::y)) (tree-set-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm tree-set-equiv-of-tree-set-fix-1-forward (implies (tree-set-equiv (tree-set-fix acl2::x) acl2::y) (tree-set-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm tree-set-equiv-of-tree-set-fix-2-forward (implies (tree-set-equiv acl2::x (tree-set-fix acl2::y)) (tree-set-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)