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