Fixing function for tree-option structures.
(tree-option-fix x) → new-x
Function:
(defun tree-option-fix$inline (x) (declare (xargs :guard (tree-optionp x))) (let ((__function__ 'tree-option-fix)) (declare (ignorable __function__)) (mbe :logic (cond ((not x) nil) (t (b* ((fty::val (tree-fix x))) fty::val))) :exec x)))
Theorem:
(defthm tree-optionp-of-tree-option-fix (b* ((new-x (tree-option-fix$inline x))) (tree-optionp new-x)) :rule-classes :rewrite)
Theorem:
(defthm tree-option-fix-when-tree-optionp (implies (tree-optionp x) (equal (tree-option-fix x) x)))
Function:
(defun tree-option-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (tree-optionp acl2::x) (tree-optionp acl2::y)))) (equal (tree-option-fix acl2::x) (tree-option-fix acl2::y)))
Theorem:
(defthm tree-option-equiv-is-an-equivalence (and (booleanp (tree-option-equiv x y)) (tree-option-equiv x x) (implies (tree-option-equiv x y) (tree-option-equiv y x)) (implies (and (tree-option-equiv x y) (tree-option-equiv y z)) (tree-option-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm tree-option-equiv-implies-equal-tree-option-fix-1 (implies (tree-option-equiv acl2::x x-equiv) (equal (tree-option-fix acl2::x) (tree-option-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm tree-option-fix-under-tree-option-equiv (tree-option-equiv (tree-option-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-tree-option-fix-1-forward-to-tree-option-equiv (implies (equal (tree-option-fix acl2::x) acl2::y) (tree-option-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-tree-option-fix-2-forward-to-tree-option-equiv (implies (equal acl2::x (tree-option-fix acl2::y)) (tree-option-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm tree-option-equiv-of-tree-option-fix-1-forward (implies (tree-option-equiv (tree-option-fix acl2::x) acl2::y) (tree-option-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm tree-option-equiv-of-tree-option-fix-2-forward (implies (tree-option-equiv acl2::x (tree-option-fix acl2::y)) (tree-option-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)