Fixing function for jaccess structures.
Function:
(defun jaccess-fix$inline (x) (declare (xargs :guard (jaccessp x))) (let ((__function__ 'jaccess-fix)) (declare (ignorable __function__)) (mbe :logic (case (jaccess-kind x) (:public (cons :public (list))) (:protected (cons :protected (list))) (:private (cons :private (list))) (:default (cons :default (list)))) :exec x)))
Theorem:
(defthm jaccessp-of-jaccess-fix (b* ((new-x (jaccess-fix$inline x))) (jaccessp new-x)) :rule-classes :rewrite)
Theorem:
(defthm jaccess-fix-when-jaccessp (implies (jaccessp x) (equal (jaccess-fix x) x)))
Function:
(defun jaccess-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (jaccessp acl2::x) (jaccessp acl2::y)))) (equal (jaccess-fix acl2::x) (jaccess-fix acl2::y)))
Theorem:
(defthm jaccess-equiv-is-an-equivalence (and (booleanp (jaccess-equiv x y)) (jaccess-equiv x x) (implies (jaccess-equiv x y) (jaccess-equiv y x)) (implies (and (jaccess-equiv x y) (jaccess-equiv y z)) (jaccess-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm jaccess-equiv-implies-equal-jaccess-fix-1 (implies (jaccess-equiv acl2::x x-equiv) (equal (jaccess-fix acl2::x) (jaccess-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm jaccess-fix-under-jaccess-equiv (jaccess-equiv (jaccess-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-jaccess-fix-1-forward-to-jaccess-equiv (implies (equal (jaccess-fix acl2::x) acl2::y) (jaccess-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-jaccess-fix-2-forward-to-jaccess-equiv (implies (equal acl2::x (jaccess-fix acl2::y)) (jaccess-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm jaccess-equiv-of-jaccess-fix-1-forward (implies (jaccess-equiv (jaccess-fix acl2::x) acl2::y) (jaccess-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm jaccess-equiv-of-jaccess-fix-2-forward (implies (jaccess-equiv acl2::x (jaccess-fix acl2::y)) (jaccess-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm jaccess-kind$inline-of-jaccess-fix-x (equal (jaccess-kind$inline (jaccess-fix x)) (jaccess-kind$inline x)))
Theorem:
(defthm jaccess-kind$inline-jaccess-equiv-congruence-on-x (implies (jaccess-equiv x x-equiv) (equal (jaccess-kind$inline x) (jaccess-kind$inline x-equiv))) :rule-classes :congruence)
Theorem:
(defthm consp-of-jaccess-fix (consp (jaccess-fix x)) :rule-classes :type-prescription)