Fixing function for maybe-stat structures.
(maybe-stat-fix x) → new-x
Function:
(defun maybe-stat-fix$inline (x) (declare (xargs :guard (maybe-statp x))) (let ((__function__ 'maybe-stat-fix)) (declare (ignorable __function__)) (mbe :logic (cond ((not x) nil) (t (b* ((fty::val (stat-fix x))) fty::val))) :exec x)))
Theorem:
(defthm maybe-statp-of-maybe-stat-fix (b* ((new-x (maybe-stat-fix$inline x))) (maybe-statp new-x)) :rule-classes :rewrite)
Theorem:
(defthm maybe-stat-fix-when-maybe-statp (implies (maybe-statp x) (equal (maybe-stat-fix x) x)))
Function:
(defun maybe-stat-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (maybe-statp acl2::x) (maybe-statp acl2::y)))) (equal (maybe-stat-fix acl2::x) (maybe-stat-fix acl2::y)))
Theorem:
(defthm maybe-stat-equiv-is-an-equivalence (and (booleanp (maybe-stat-equiv x y)) (maybe-stat-equiv x x) (implies (maybe-stat-equiv x y) (maybe-stat-equiv y x)) (implies (and (maybe-stat-equiv x y) (maybe-stat-equiv y z)) (maybe-stat-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm maybe-stat-equiv-implies-equal-maybe-stat-fix-1 (implies (maybe-stat-equiv acl2::x x-equiv) (equal (maybe-stat-fix acl2::x) (maybe-stat-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm maybe-stat-fix-under-maybe-stat-equiv (maybe-stat-equiv (maybe-stat-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-maybe-stat-fix-1-forward-to-maybe-stat-equiv (implies (equal (maybe-stat-fix acl2::x) acl2::y) (maybe-stat-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-maybe-stat-fix-2-forward-to-maybe-stat-equiv (implies (equal acl2::x (maybe-stat-fix acl2::y)) (maybe-stat-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm maybe-stat-equiv-of-maybe-stat-fix-1-forward (implies (maybe-stat-equiv (maybe-stat-fix acl2::x) acl2::y) (maybe-stat-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm maybe-stat-equiv-of-maybe-stat-fix-2-forward (implies (maybe-stat-equiv acl2::x (maybe-stat-fix acl2::y)) (maybe-stat-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)