Fixing function for closure structures.
Function:
(defun closure-fix$inline (x) (declare (xargs :guard (closurep x))) (let ((__function__ 'closure-fix)) (declare (ignorable __function__)) (mbe :logic (b* ((name (identifier-fix (cdr (std::da-nth 0 (cdr x))))) (inputs (closure-input-list-fix (cdr (std::da-nth 1 (cdr x))))) (instrs (instruction-list-fix (cdr (std::da-nth 2 (cdr x))))) (outputs (closure-output-list-fix (cdr (std::da-nth 3 (cdr x)))))) (cons :closure (list (cons 'name name) (cons 'inputs inputs) (cons 'instrs instrs) (cons 'outputs outputs)))) :exec x)))
Theorem:
(defthm closurep-of-closure-fix (b* ((new-x (closure-fix$inline x))) (closurep new-x)) :rule-classes :rewrite)
Theorem:
(defthm closure-fix-when-closurep (implies (closurep x) (equal (closure-fix x) x)))
Function:
(defun closure-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (closurep acl2::x) (closurep acl2::y)))) (equal (closure-fix acl2::x) (closure-fix acl2::y)))
Theorem:
(defthm closure-equiv-is-an-equivalence (and (booleanp (closure-equiv x y)) (closure-equiv x x) (implies (closure-equiv x y) (closure-equiv y x)) (implies (and (closure-equiv x y) (closure-equiv y z)) (closure-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm closure-equiv-implies-equal-closure-fix-1 (implies (closure-equiv acl2::x x-equiv) (equal (closure-fix acl2::x) (closure-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm closure-fix-under-closure-equiv (closure-equiv (closure-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-closure-fix-1-forward-to-closure-equiv (implies (equal (closure-fix acl2::x) acl2::y) (closure-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-closure-fix-2-forward-to-closure-equiv (implies (equal acl2::x (closure-fix acl2::y)) (closure-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm closure-equiv-of-closure-fix-1-forward (implies (closure-equiv (closure-fix acl2::x) acl2::y) (closure-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm closure-equiv-of-closure-fix-2-forward (implies (closure-equiv acl2::x (closure-fix acl2::y)) (closure-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)