Fixing function for function-recursion structures.
(function-recursion-fix x) → new-x
Function:
(defun function-recursion-fix$inline (x) (declare (xargs :guard (function-recursionp x))) (let ((__function__ 'function-recursion-fix)) (declare (ignorable __function__)) (mbe :logic (b* ((definitions (function-definition-list-fix (cdr (std::da-nth 0 x))))) (list (cons 'definitions definitions))) :exec x)))
Theorem:
(defthm function-recursionp-of-function-recursion-fix (b* ((new-x (function-recursion-fix$inline x))) (function-recursionp new-x)) :rule-classes :rewrite)
Theorem:
(defthm function-recursion-fix-when-function-recursionp (implies (function-recursionp x) (equal (function-recursion-fix x) x)))
Function:
(defun function-recursion-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (function-recursionp acl2::x) (function-recursionp acl2::y)))) (equal (function-recursion-fix acl2::x) (function-recursion-fix acl2::y)))
Theorem:
(defthm function-recursion-equiv-is-an-equivalence (and (booleanp (function-recursion-equiv x y)) (function-recursion-equiv x x) (implies (function-recursion-equiv x y) (function-recursion-equiv y x)) (implies (and (function-recursion-equiv x y) (function-recursion-equiv y z)) (function-recursion-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm function-recursion-equiv-implies-equal-function-recursion-fix-1 (implies (function-recursion-equiv acl2::x x-equiv) (equal (function-recursion-fix acl2::x) (function-recursion-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm function-recursion-fix-under-function-recursion-equiv (function-recursion-equiv (function-recursion-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-function-recursion-fix-1-forward-to-function-recursion-equiv (implies (equal (function-recursion-fix acl2::x) acl2::y) (function-recursion-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-function-recursion-fix-2-forward-to-function-recursion-equiv (implies (equal acl2::x (function-recursion-fix acl2::y)) (function-recursion-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm function-recursion-equiv-of-function-recursion-fix-1-forward (implies (function-recursion-equiv (function-recursion-fix acl2::x) acl2::y) (function-recursion-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm function-recursion-equiv-of-function-recursion-fix-2-forward (implies (function-recursion-equiv acl2::x (function-recursion-fix acl2::y)) (function-recursion-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)