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