• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • Proof-checker-array
      • Soft
      • C
      • Farray
      • Rp-rewriter
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Leftist-trees
      • Java
      • Taspi
      • Bitcoin
      • Riscv
      • Des
      • Ethereum
      • X86isa
      • Sha-2
      • Yul
      • Zcash
      • Proof-checker-itp13
      • Regex
      • ACL2-programming-language
      • Json
      • Jfkr
      • Equational
      • Cryptography
      • Poseidon
      • Where-do-i-place-my-book
      • Axe
      • Bigmems
      • Builtins
      • Execloader
      • Aleo
        • Aleobft
          • Aleobft-static
          • Aleobft-stake2
          • Aleobft-dynamic
          • Aleobft-stake
          • Aleobft-proposals
            • Correctness
            • Definition
              • Initialization
              • Transitions
              • States
              • Events
                • Event
                  • Event-fix
                    • Event-case
                    • Eventp
                    • Event-equiv
                    • Event-propose
                    • Event-certify
                    • Event-endorse
                    • Event-augment
                    • Event-accept
                    • Event-commit
                    • Event-advance
                    • Event-kind
                  • Messages
                  • Event-list
                • Reachability
            • Library-extensions
          • Leo
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Event

    Event-fix

    Fixing function for event structures.

    Signature
    (event-fix x) → new-x
    Arguments
    x — Guard (eventp x).
    Returns
    new-x — Type (eventp new-x).

    Definitions and Theorems

    Function: event-fix$inline

    (defun event-fix$inline (x)
     (declare (xargs :guard (eventp x)))
     (let ((__function__ 'event-fix))
      (declare (ignorable __function__))
      (mbe
       :logic
       (case (event-kind x)
        (:propose
          (b* ((proposal (proposal-fix (std::da-nth 0 (cdr x))))
               (destinations (address-set-fix (std::da-nth 1 (cdr x)))))
            (cons :propose (list proposal destinations))))
        (:endorse (b* ((proposal (proposal-fix (std::da-nth 0 (cdr x))))
                       (endorser (address-fix (std::da-nth 1 (cdr x)))))
                    (cons :endorse (list proposal endorser))))
        (:augment (b* ((proposal (proposal-fix (std::da-nth 0 (cdr x))))
                       (endorser (address-fix (std::da-nth 1 (cdr x)))))
                    (cons :augment (list proposal endorser))))
        (:certify
          (b* ((certificate (certificate-fix (std::da-nth 0 (cdr x))))
               (destinations (address-set-fix (std::da-nth 1 (cdr x)))))
            (cons :certify (list certificate destinations))))
        (:accept
           (b* ((validator (address-fix (std::da-nth 0 (cdr x))))
                (certificate (certificate-fix (std::da-nth 1 (cdr x)))))
             (cons :accept (list validator certificate))))
        (:advance
             (b* ((validator (address-fix (std::da-nth 0 (cdr x)))))
               (cons :advance (list validator))))
        (:commit (b* ((validator (address-fix (std::da-nth 0 (cdr x)))))
                   (cons :commit (list validator)))))
       :exec x)))

    Theorem: eventp-of-event-fix

    (defthm eventp-of-event-fix
      (b* ((new-x (event-fix$inline x)))
        (eventp new-x))
      :rule-classes :rewrite)

    Theorem: event-fix-when-eventp

    (defthm event-fix-when-eventp
      (implies (eventp x)
               (equal (event-fix x) x)))

    Function: event-equiv$inline

    (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: event-equiv-is-an-equivalence

    (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: event-equiv-implies-equal-event-fix-1

    (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: event-fix-under-event-equiv

    (defthm event-fix-under-event-equiv
      (event-equiv (event-fix acl2::x)
                   acl2::x)
      :rule-classes (:rewrite :rewrite-quoted-constant))

    Theorem: equal-of-event-fix-1-forward-to-event-equiv

    (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: equal-of-event-fix-2-forward-to-event-equiv

    (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: event-equiv-of-event-fix-1-forward

    (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: event-equiv-of-event-fix-2-forward

    (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: event-kind$inline-of-event-fix-x

    (defthm event-kind$inline-of-event-fix-x
      (equal (event-kind$inline (event-fix x))
             (event-kind$inline x)))

    Theorem: event-kind$inline-event-equiv-congruence-on-x

    (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: consp-of-event-fix

    (defthm consp-of-event-fix
      (consp (event-fix x))
      :rule-classes :type-prescription)