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