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