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