Fixing function for vttree structures.
Function:
(defun vttree-fix$inline (x) (declare (xargs :guard (vttree-p x))) (let ((__function__ 'vttree-fix)) (declare (ignorable __function__)) (mbe :logic (common-lisp::case (vttree-kind x) (:none nil) (:warnings (b* ((warnings (vl-warninglist-fix (cdr x)))) (cons :warnings warnings))) (:constraints (b* ((constraints (sv::constraintlist-fix (cdr x)))) (cons :constraints constraints))) (:context (b* ((ctx (cadr x)) (subtree (vttree-fix (cddr x)))) (cons :context (cons ctx subtree)))) (:branch (b* ((left (vttree-fix (car x))) (right (vttree-fix (cdr x)))) (cons left right)))) :exec x)))
Theorem:
(defthm vttree-p-of-vttree-fix (b* ((new-x (vttree-fix$inline x))) (vttree-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm vttree-fix-when-vttree-p (implies (vttree-p x) (equal (vttree-fix x) x)))
Function:
(defun vttree-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (vttree-p acl2::x) (vttree-p acl2::y)))) (equal (vttree-fix acl2::x) (vttree-fix acl2::y)))
Theorem:
(defthm vttree-equiv-is-an-equivalence (and (booleanp (vttree-equiv x y)) (vttree-equiv x x) (implies (vttree-equiv x y) (vttree-equiv y x)) (implies (and (vttree-equiv x y) (vttree-equiv y z)) (vttree-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm vttree-equiv-implies-equal-vttree-fix-1 (implies (vttree-equiv acl2::x x-equiv) (equal (vttree-fix acl2::x) (vttree-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm vttree-fix-under-vttree-equiv (vttree-equiv (vttree-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-vttree-fix-1-forward-to-vttree-equiv (implies (equal (vttree-fix acl2::x) acl2::y) (vttree-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-vttree-fix-2-forward-to-vttree-equiv (implies (equal acl2::x (vttree-fix acl2::y)) (vttree-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm vttree-equiv-of-vttree-fix-1-forward (implies (vttree-equiv (vttree-fix acl2::x) acl2::y) (vttree-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm vttree-equiv-of-vttree-fix-2-forward (implies (vttree-equiv acl2::x (vttree-fix acl2::y)) (vttree-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm vttree-kind$inline-of-vttree-fix-x (equal (vttree-kind$inline (vttree-fix x)) (vttree-kind$inline x)))
Theorem:
(defthm vttree-kind$inline-vttree-equiv-congruence-on-x (implies (vttree-equiv x x-equiv) (equal (vttree-kind$inline x) (vttree-kind$inline x-equiv))) :rule-classes :congruence)