Fixing function for scratchobj structures.
(scratchobj-fix x) → new-x
Function:
(defun scratchobj-fix$inline (x) (declare (xargs :guard (scratchobj-p x))) (let ((__function__ 'scratchobj-fix)) (declare (ignorable __function__)) (mbe :logic (case (scratchobj-kind x) (:fgl-obj (b* ((val (fgl-object-fix (cdr x)))) (cons :fgl-obj val))) (:fgl-objlist (b* ((val (fgl-objectlist-fix (cdr x)))) (cons :fgl-objlist val))) (:bfr (b* ((val (cdr x))) (cons :bfr val))) (:bfrlist (b* ((val (list-fix (cdr x)))) (cons :bfrlist val))) (:cinst (b* ((val (constraint-instance-fix (cdr x)))) (cons :cinst val))) (:cinstlist (b* ((val (constraint-instancelist-fix (cdr x)))) (cons :cinstlist val)))) :exec x)))
Theorem:
(defthm scratchobj-p-of-scratchobj-fix (b* ((new-x (scratchobj-fix$inline x))) (scratchobj-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm scratchobj-fix-when-scratchobj-p (implies (scratchobj-p x) (equal (scratchobj-fix x) x)))
Function:
(defun scratchobj-equiv$inline (x y) (declare (xargs :guard (and (scratchobj-p x) (scratchobj-p y)))) (equal (scratchobj-fix x) (scratchobj-fix y)))
Theorem:
(defthm scratchobj-equiv-is-an-equivalence (and (booleanp (scratchobj-equiv x y)) (scratchobj-equiv x x) (implies (scratchobj-equiv x y) (scratchobj-equiv y x)) (implies (and (scratchobj-equiv x y) (scratchobj-equiv y z)) (scratchobj-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm scratchobj-equiv-implies-equal-scratchobj-fix-1 (implies (scratchobj-equiv x x-equiv) (equal (scratchobj-fix x) (scratchobj-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm scratchobj-fix-under-scratchobj-equiv (scratchobj-equiv (scratchobj-fix x) x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-scratchobj-fix-1-forward-to-scratchobj-equiv (implies (equal (scratchobj-fix x) y) (scratchobj-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-scratchobj-fix-2-forward-to-scratchobj-equiv (implies (equal x (scratchobj-fix y)) (scratchobj-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm scratchobj-equiv-of-scratchobj-fix-1-forward (implies (scratchobj-equiv (scratchobj-fix x) y) (scratchobj-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm scratchobj-equiv-of-scratchobj-fix-2-forward (implies (scratchobj-equiv x (scratchobj-fix y)) (scratchobj-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm scratchobj-kind$inline-of-scratchobj-fix-x (equal (scratchobj-kind$inline (scratchobj-fix x)) (scratchobj-kind$inline x)))
Theorem:
(defthm scratchobj-kind$inline-scratchobj-equiv-congruence-on-x (implies (scratchobj-equiv x x-equiv) (equal (scratchobj-kind$inline x) (scratchobj-kind$inline x-equiv))) :rule-classes :congruence)
Theorem:
(defthm consp-of-scratchobj-fix (consp (scratchobj-fix x)) :rule-classes :type-prescription)