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