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