Fixing function for jexpr-rank structures.
(jexpr-rank-fix x) → new-x
Function:
(defun jexpr-rank-fix$inline (x) (declare (xargs :guard (jexpr-rankp x))) (let ((__function__ 'jexpr-rank-fix)) (declare (ignorable __function__)) (mbe :logic (case (jexpr-rank-kind x) (:expression (cons :expression (list))) (:assignment (cons :assignment (list))) (:conditional (cons :conditional (list))) (:conditional-or (cons :conditional-or (list))) (:conditional-and (cons :conditional-and (list))) (:inclusive-or (cons :inclusive-or (list))) (:exclusive-or (cons :exclusive-or (list))) (:and (cons :and (list))) (:equality (cons :equality (list))) (:relational (cons :relational (list))) (:shift (cons :shift (list))) (:additive (cons :additive (list))) (:multiplicative (cons :multiplicative (list))) (:unary (cons :unary (list))) (:postfix (cons :postfix (list))) (:primary (cons :primary (list)))) :exec x)))
Theorem:
(defthm jexpr-rankp-of-jexpr-rank-fix (b* ((new-x (jexpr-rank-fix$inline x))) (jexpr-rankp new-x)) :rule-classes :rewrite)
Theorem:
(defthm jexpr-rank-fix-when-jexpr-rankp (implies (jexpr-rankp x) (equal (jexpr-rank-fix x) x)))
Function:
(defun jexpr-rank-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (jexpr-rankp acl2::x) (jexpr-rankp acl2::y)))) (equal (jexpr-rank-fix acl2::x) (jexpr-rank-fix acl2::y)))
Theorem:
(defthm jexpr-rank-equiv-is-an-equivalence (and (booleanp (jexpr-rank-equiv x y)) (jexpr-rank-equiv x x) (implies (jexpr-rank-equiv x y) (jexpr-rank-equiv y x)) (implies (and (jexpr-rank-equiv x y) (jexpr-rank-equiv y z)) (jexpr-rank-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm jexpr-rank-equiv-implies-equal-jexpr-rank-fix-1 (implies (jexpr-rank-equiv acl2::x x-equiv) (equal (jexpr-rank-fix acl2::x) (jexpr-rank-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm jexpr-rank-fix-under-jexpr-rank-equiv (jexpr-rank-equiv (jexpr-rank-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-jexpr-rank-fix-1-forward-to-jexpr-rank-equiv (implies (equal (jexpr-rank-fix acl2::x) acl2::y) (jexpr-rank-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-jexpr-rank-fix-2-forward-to-jexpr-rank-equiv (implies (equal acl2::x (jexpr-rank-fix acl2::y)) (jexpr-rank-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm jexpr-rank-equiv-of-jexpr-rank-fix-1-forward (implies (jexpr-rank-equiv (jexpr-rank-fix acl2::x) acl2::y) (jexpr-rank-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm jexpr-rank-equiv-of-jexpr-rank-fix-2-forward (implies (jexpr-rank-equiv acl2::x (jexpr-rank-fix acl2::y)) (jexpr-rank-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm jexpr-rank-kind$inline-of-jexpr-rank-fix-x (equal (jexpr-rank-kind$inline (jexpr-rank-fix x)) (jexpr-rank-kind$inline x)))
Theorem:
(defthm jexpr-rank-kind$inline-jexpr-rank-equiv-congruence-on-x (implies (jexpr-rank-equiv x x-equiv) (equal (jexpr-rank-kind$inline x) (jexpr-rank-kind$inline x-equiv))) :rule-classes :congruence)
Theorem:
(defthm consp-of-jexpr-rank-fix (consp (jexpr-rank-fix x)) :rule-classes :type-prescription)