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