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