Fixing function for svstate structures.
Function:
(defun svstate-fix$inline (x) (declare (xargs :guard (svstate-p x))) (let ((__function__ 'svstate-fix)) (declare (ignorable __function__)) (mbe :logic (b* ((blkst (svstack-fix (std::prod-car x))) (nonblkst (svex-alist-fix (std::prod-cdr x)))) (let ((blkst (svstack-nonempty-fix blkst))) (std::prod-cons blkst nonblkst))) :exec x)))
Theorem:
(defthm svstate-p-of-svstate-fix (b* ((new-x (svstate-fix$inline x))) (svstate-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm svstate-fix-when-svstate-p (implies (svstate-p x) (equal (svstate-fix x) x)))
Function:
(defun svstate-equiv$inline (x y) (declare (xargs :guard (and (svstate-p x) (svstate-p y)))) (equal (svstate-fix x) (svstate-fix y)))
Theorem:
(defthm svstate-equiv-is-an-equivalence (and (booleanp (svstate-equiv x y)) (svstate-equiv x x) (implies (svstate-equiv x y) (svstate-equiv y x)) (implies (and (svstate-equiv x y) (svstate-equiv y z)) (svstate-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm svstate-equiv-implies-equal-svstate-fix-1 (implies (svstate-equiv x x-equiv) (equal (svstate-fix x) (svstate-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm svstate-fix-under-svstate-equiv (svstate-equiv (svstate-fix x) x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-svstate-fix-1-forward-to-svstate-equiv (implies (equal (svstate-fix x) y) (svstate-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-svstate-fix-2-forward-to-svstate-equiv (implies (equal x (svstate-fix y)) (svstate-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm svstate-equiv-of-svstate-fix-1-forward (implies (svstate-equiv (svstate-fix x) y) (svstate-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm svstate-equiv-of-svstate-fix-2-forward (implies (svstate-equiv x (svstate-fix y)) (svstate-equiv x y)) :rule-classes :forward-chaining)