Fixing function for event structures.
Function:
(defun event-fix$inline (x) (declare (xargs :guard (eventp x))) (let ((__function__ 'event-fix)) (declare (ignorable __function__)) (mbe :logic (case (event-kind x) (:create-certificate (b* ((certificate (certificate-fix (std::da-nth 0 (cdr x))))) (cons :create-certificate (list certificate)))) (:receive-certificate (b* ((message (message-fix (std::da-nth 0 (cdr x))))) (cons :receive-certificate (list message)))) (:store-certificate (b* ((certificate (certificate-fix (std::da-nth 0 (cdr x)))) (validator (address-fix (std::da-nth 1 (cdr x))))) (cons :store-certificate (list certificate validator)))) (:advance-round (b* ((validator (address-fix (std::da-nth 0 (cdr x))))) (cons :advance-round (list validator)))) (:commit-anchors (b* ((validator (address-fix (std::da-nth 0 (cdr x))))) (cons :commit-anchors (list validator)))) (:timer-expires (b* ((validator (address-fix (std::da-nth 0 (cdr x))))) (cons :timer-expires (list validator))))) :exec x)))
Theorem:
(defthm eventp-of-event-fix (b* ((new-x (event-fix$inline x))) (eventp new-x)) :rule-classes :rewrite)
Theorem:
(defthm event-fix-when-eventp (implies (eventp x) (equal (event-fix x) x)))
Function:
(defun event-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (eventp acl2::x) (eventp acl2::y)))) (equal (event-fix acl2::x) (event-fix acl2::y)))
Theorem:
(defthm event-equiv-is-an-equivalence (and (booleanp (event-equiv x y)) (event-equiv x x) (implies (event-equiv x y) (event-equiv y x)) (implies (and (event-equiv x y) (event-equiv y z)) (event-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm event-equiv-implies-equal-event-fix-1 (implies (event-equiv acl2::x x-equiv) (equal (event-fix acl2::x) (event-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm event-fix-under-event-equiv (event-equiv (event-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-event-fix-1-forward-to-event-equiv (implies (equal (event-fix acl2::x) acl2::y) (event-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-event-fix-2-forward-to-event-equiv (implies (equal acl2::x (event-fix acl2::y)) (event-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm event-equiv-of-event-fix-1-forward (implies (event-equiv (event-fix acl2::x) acl2::y) (event-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm event-equiv-of-event-fix-2-forward (implies (event-equiv acl2::x (event-fix acl2::y)) (event-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm event-kind$inline-of-event-fix-x (equal (event-kind$inline (event-fix x)) (event-kind$inline x)))
Theorem:
(defthm event-kind$inline-event-equiv-congruence-on-x (implies (event-equiv x x-equiv) (equal (event-kind$inline x) (event-kind$inline x-equiv))) :rule-classes :congruence)
Theorem:
(defthm consp-of-event-fix (consp (event-fix x)) :rule-classes :type-prescription)