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