Fixing function for rule structures.
Function:
(defun rule-fix$inline (x) (declare (xargs :guard (rulep x))) (let ((__function__ 'rule-fix)) (declare (ignorable __function__)) (mbe :logic (b* ((name (rulename-fix (std::da-nth 0 (cdr x)))) (incremental (acl2::bool-fix (std::da-nth 1 (cdr x)))) (definiens (alternation-fix (std::da-nth 2 (cdr x))))) (cons :rule (list name incremental definiens))) :exec x)))
Theorem:
(defthm rulep-of-rule-fix (b* ((new-x (rule-fix$inline x))) (rulep new-x)) :rule-classes :rewrite)
Theorem:
(defthm rule-fix-when-rulep (implies (rulep x) (equal (rule-fix x) x)))
Function:
(defun rule-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (rulep acl2::x) (rulep acl2::y)))) (equal (rule-fix acl2::x) (rule-fix acl2::y)))
Theorem:
(defthm rule-equiv-is-an-equivalence (and (booleanp (rule-equiv x y)) (rule-equiv x x) (implies (rule-equiv x y) (rule-equiv y x)) (implies (and (rule-equiv x y) (rule-equiv y z)) (rule-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm rule-equiv-implies-equal-rule-fix-1 (implies (rule-equiv acl2::x x-equiv) (equal (rule-fix acl2::x) (rule-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm rule-fix-under-rule-equiv (rule-equiv (rule-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-rule-fix-1-forward-to-rule-equiv (implies (equal (rule-fix acl2::x) acl2::y) (rule-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-rule-fix-2-forward-to-rule-equiv (implies (equal acl2::x (rule-fix acl2::y)) (rule-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm rule-equiv-of-rule-fix-1-forward (implies (rule-equiv (rule-fix acl2::x) acl2::y) (rule-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm rule-equiv-of-rule-fix-2-forward (implies (rule-equiv acl2::x (rule-fix acl2::y)) (rule-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)