Fixing function for jcunit structures.
Function:
(defun jcunit-fix$inline (x) (declare (xargs :guard (jcunitp x))) (let ((__function__ 'jcunit-fix)) (declare (ignorable __function__)) (mbe :logic (b* ((package? (acl2::maybe-string-fix (cdr (std::da-nth 0 x)))) (imports (jimport-list-fix (cdr (std::da-nth 1 x)))) (types (jclass-list-fix (cdr (std::da-nth 2 x))))) (list (cons 'package? package?) (cons 'imports imports) (cons 'types types))) :exec x)))
Theorem:
(defthm jcunitp-of-jcunit-fix (b* ((new-x (jcunit-fix$inline x))) (jcunitp new-x)) :rule-classes :rewrite)
Theorem:
(defthm jcunit-fix-when-jcunitp (implies (jcunitp x) (equal (jcunit-fix x) x)))
Function:
(defun jcunit-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (jcunitp acl2::x) (jcunitp acl2::y)))) (equal (jcunit-fix acl2::x) (jcunit-fix acl2::y)))
Theorem:
(defthm jcunit-equiv-is-an-equivalence (and (booleanp (jcunit-equiv x y)) (jcunit-equiv x x) (implies (jcunit-equiv x y) (jcunit-equiv y x)) (implies (and (jcunit-equiv x y) (jcunit-equiv y z)) (jcunit-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm jcunit-equiv-implies-equal-jcunit-fix-1 (implies (jcunit-equiv acl2::x x-equiv) (equal (jcunit-fix acl2::x) (jcunit-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm jcunit-fix-under-jcunit-equiv (jcunit-equiv (jcunit-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-jcunit-fix-1-forward-to-jcunit-equiv (implies (equal (jcunit-fix acl2::x) acl2::y) (jcunit-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-jcunit-fix-2-forward-to-jcunit-equiv (implies (equal acl2::x (jcunit-fix acl2::y)) (jcunit-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm jcunit-equiv-of-jcunit-fix-1-forward (implies (jcunit-equiv (jcunit-fix acl2::x) acl2::y) (jcunit-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm jcunit-equiv-of-jcunit-fix-2-forward (implies (jcunit-equiv acl2::x (jcunit-fix acl2::y)) (jcunit-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)