Fixing function for atj-type structures.
Function:
(defun atj-type-fix$inline (x) (declare (xargs :guard (atj-typep x))) (let ((__function__ 'atj-type-fix)) (declare (ignorable __function__)) (mbe :logic (case (atj-type-kind x) (:acl2 (b* ((get (atj-atype-fix (std::da-nth 0 (cdr x))))) (cons :acl2 (list get)))) (:jprim (b* ((get (primitive-type-fix (std::da-nth 0 (cdr x))))) (cons :jprim (list get)))) (:jprimarr (b* ((comp (primitive-type-fix (std::da-nth 0 (cdr x))))) (cons :jprimarr (list comp))))) :exec x)))
Theorem:
(defthm atj-typep-of-atj-type-fix (b* ((new-x (atj-type-fix$inline x))) (atj-typep new-x)) :rule-classes :rewrite)
Theorem:
(defthm atj-type-fix-when-atj-typep (implies (atj-typep x) (equal (atj-type-fix x) x)))
Function:
(defun atj-type-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (atj-typep acl2::x) (atj-typep acl2::y)))) (equal (atj-type-fix acl2::x) (atj-type-fix acl2::y)))
Theorem:
(defthm atj-type-equiv-is-an-equivalence (and (booleanp (atj-type-equiv x y)) (atj-type-equiv x x) (implies (atj-type-equiv x y) (atj-type-equiv y x)) (implies (and (atj-type-equiv x y) (atj-type-equiv y z)) (atj-type-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm atj-type-equiv-implies-equal-atj-type-fix-1 (implies (atj-type-equiv acl2::x x-equiv) (equal (atj-type-fix acl2::x) (atj-type-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm atj-type-fix-under-atj-type-equiv (atj-type-equiv (atj-type-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-atj-type-fix-1-forward-to-atj-type-equiv (implies (equal (atj-type-fix acl2::x) acl2::y) (atj-type-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-atj-type-fix-2-forward-to-atj-type-equiv (implies (equal acl2::x (atj-type-fix acl2::y)) (atj-type-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm atj-type-equiv-of-atj-type-fix-1-forward (implies (atj-type-equiv (atj-type-fix acl2::x) acl2::y) (atj-type-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm atj-type-equiv-of-atj-type-fix-2-forward (implies (atj-type-equiv acl2::x (atj-type-fix acl2::y)) (atj-type-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm atj-type-kind$inline-of-atj-type-fix-x (equal (atj-type-kind$inline (atj-type-fix x)) (atj-type-kind$inline x)))
Theorem:
(defthm atj-type-kind$inline-atj-type-equiv-congruence-on-x (implies (atj-type-equiv x x-equiv) (equal (atj-type-kind$inline x) (atj-type-kind$inline x-equiv))) :rule-classes :congruence)
Theorem:
(defthm consp-of-atj-type-fix (consp (atj-type-fix x)) :rule-classes :type-prescription)