Fixing function for eval-state structures.
(eval-state-fix x) → new-x
Function:
(defun eval-state-fix$inline (x) (declare (xargs :guard (eval-state-p x))) (let ((__function__ 'eval-state-fix)) (declare (ignorable __function__)) (mbe :logic (case (eval-state-kind x) (:init (b* ((function (symbol-value-fix (std::da-nth 0 (cdr x)))) (arguments (value-list-fix (std::da-nth 1 (cdr x))))) (cons :init (list function arguments)))) (:trans (b* ((stack (stack-fix (std::da-nth 0 (cdr x))))) (cons :trans (list stack)))) (:final (b* ((result (value-fix (std::da-nth 0 (cdr x))))) (cons :final (list result)))) (:error (cons :error (list)))) :exec x)))
Theorem:
(defthm eval-state-p-of-eval-state-fix (b* ((new-x (eval-state-fix$inline x))) (eval-state-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm eval-state-fix-when-eval-state-p (implies (eval-state-p x) (equal (eval-state-fix x) x)))
Function:
(defun eval-state-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (eval-state-p acl2::x) (eval-state-p acl2::y)))) (equal (eval-state-fix acl2::x) (eval-state-fix acl2::y)))
Theorem:
(defthm eval-state-equiv-is-an-equivalence (and (booleanp (eval-state-equiv x y)) (eval-state-equiv x x) (implies (eval-state-equiv x y) (eval-state-equiv y x)) (implies (and (eval-state-equiv x y) (eval-state-equiv y z)) (eval-state-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm eval-state-equiv-implies-equal-eval-state-fix-1 (implies (eval-state-equiv acl2::x x-equiv) (equal (eval-state-fix acl2::x) (eval-state-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm eval-state-fix-under-eval-state-equiv (eval-state-equiv (eval-state-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-eval-state-fix-1-forward-to-eval-state-equiv (implies (equal (eval-state-fix acl2::x) acl2::y) (eval-state-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-eval-state-fix-2-forward-to-eval-state-equiv (implies (equal acl2::x (eval-state-fix acl2::y)) (eval-state-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm eval-state-equiv-of-eval-state-fix-1-forward (implies (eval-state-equiv (eval-state-fix acl2::x) acl2::y) (eval-state-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm eval-state-equiv-of-eval-state-fix-2-forward (implies (eval-state-equiv acl2::x (eval-state-fix acl2::y)) (eval-state-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm eval-state-kind$inline-of-eval-state-fix-x (equal (eval-state-kind$inline (eval-state-fix x)) (eval-state-kind$inline x)))
Theorem:
(defthm eval-state-kind$inline-eval-state-equiv-congruence-on-x (implies (eval-state-equiv x x-equiv) (equal (eval-state-kind$inline x) (eval-state-kind$inline x-equiv))) :rule-classes :congruence)
Theorem:
(defthm consp-of-eval-state-fix (consp (eval-state-fix x)) :rule-classes :type-prescription)