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