Fixing function for constraint structures.
(constraint-fix x) → new-x
Function:
(defun constraint-fix$inline (x) (declare (xargs :guard (constraintp x))) (let ((__function__ 'constraint-fix)) (declare (ignorable __function__)) (mbe :logic (case (constraint-kind x) (:equal (b* ((left (expression-fix (std::da-nth 0 (cdr x)))) (right (expression-fix (std::da-nth 1 (cdr x))))) (cons :equal (list left right)))) (:relation (b* ((name (str-fix (std::da-nth 0 (cdr x)))) (args (expression-list-fix (std::da-nth 1 (cdr x))))) (cons :relation (list name args))))) :exec x)))
Theorem:
(defthm constraintp-of-constraint-fix (b* ((new-x (constraint-fix$inline x))) (constraintp new-x)) :rule-classes :rewrite)
Theorem:
(defthm constraint-fix-when-constraintp (implies (constraintp x) (equal (constraint-fix x) x)))
Function:
(defun constraint-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (constraintp acl2::x) (constraintp acl2::y)))) (equal (constraint-fix acl2::x) (constraint-fix acl2::y)))
Theorem:
(defthm constraint-equiv-is-an-equivalence (and (booleanp (constraint-equiv x y)) (constraint-equiv x x) (implies (constraint-equiv x y) (constraint-equiv y x)) (implies (and (constraint-equiv x y) (constraint-equiv y z)) (constraint-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm constraint-equiv-implies-equal-constraint-fix-1 (implies (constraint-equiv acl2::x x-equiv) (equal (constraint-fix acl2::x) (constraint-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm constraint-fix-under-constraint-equiv (constraint-equiv (constraint-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-constraint-fix-1-forward-to-constraint-equiv (implies (equal (constraint-fix acl2::x) acl2::y) (constraint-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-constraint-fix-2-forward-to-constraint-equiv (implies (equal acl2::x (constraint-fix acl2::y)) (constraint-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm constraint-equiv-of-constraint-fix-1-forward (implies (constraint-equiv (constraint-fix acl2::x) acl2::y) (constraint-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm constraint-equiv-of-constraint-fix-2-forward (implies (constraint-equiv acl2::x (constraint-fix acl2::y)) (constraint-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm constraint-kind$inline-of-constraint-fix-x (equal (constraint-kind$inline (constraint-fix x)) (constraint-kind$inline x)))
Theorem:
(defthm constraint-kind$inline-constraint-equiv-congruence-on-x (implies (constraint-equiv x x-equiv) (equal (constraint-kind$inline x) (constraint-kind$inline x-equiv))) :rule-classes :congruence)
Theorem:
(defthm consp-of-constraint-fix (consp (constraint-fix x)) :rule-classes :type-prescription)