• 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
                • Committees
                • System-states
                • Certificates
                • Transactions
                • Proposals
                • Messages
                • Validator-states
                • Blocks
                  • Blocks-last-round
                  • Blocks-orderedp
                  • Block
                    • Block-fix
                      • Block-equiv
                      • Make-block
                      • Block->transactions
                      • Change-block
                      • Block->round
                      • Blockp
                    • Block-list
                  • Addresses
                • Events
                • 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
    • Block

    Block-fix

    Fixing function for block structures.

    Signature
    (block-fix x) → new-x
    Arguments
    x — Guard (blockp x).
    Returns
    new-x — Type (blockp new-x).

    Definitions and Theorems

    Function: block-fix$inline

    (defun block-fix$inline (x)
     (declare (xargs :guard (blockp x)))
     (let ((__function__ 'block-fix))
      (declare (ignorable __function__))
      (mbe
        :logic
        (b*
          ((transactions (transaction-list-fix (cdr (std::da-nth 0 x))))
           (round (pos-fix (cdr (std::da-nth 1 x)))))
          (let ((round (if (evenp round) round 2)))
            (list (cons 'transactions transactions)
                  (cons 'round round))))
        :exec x)))

    Theorem: blockp-of-block-fix

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

    Theorem: block-fix-when-blockp

    (defthm block-fix-when-blockp
      (implies (blockp x)
               (equal (block-fix x) x)))

    Function: block-equiv$inline

    (defun block-equiv$inline (acl2::x acl2::y)
      (declare (xargs :guard (and (blockp acl2::x)
                                  (blockp acl2::y))))
      (equal (block-fix acl2::x)
             (block-fix acl2::y)))

    Theorem: block-equiv-is-an-equivalence

    (defthm block-equiv-is-an-equivalence
      (and (booleanp (block-equiv x y))
           (block-equiv x x)
           (implies (block-equiv x y)
                    (block-equiv y x))
           (implies (and (block-equiv x y)
                         (block-equiv y z))
                    (block-equiv x z)))
      :rule-classes (:equivalence))

    Theorem: block-equiv-implies-equal-block-fix-1

    (defthm block-equiv-implies-equal-block-fix-1
      (implies (block-equiv acl2::x x-equiv)
               (equal (block-fix acl2::x)
                      (block-fix x-equiv)))
      :rule-classes (:congruence))

    Theorem: block-fix-under-block-equiv

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

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

    (defthm equal-of-block-fix-1-forward-to-block-equiv
      (implies (equal (block-fix acl2::x) acl2::y)
               (block-equiv acl2::x acl2::y))
      :rule-classes :forward-chaining)

    Theorem: equal-of-block-fix-2-forward-to-block-equiv

    (defthm equal-of-block-fix-2-forward-to-block-equiv
      (implies (equal acl2::x (block-fix acl2::y))
               (block-equiv acl2::x acl2::y))
      :rule-classes :forward-chaining)

    Theorem: block-equiv-of-block-fix-1-forward

    (defthm block-equiv-of-block-fix-1-forward
      (implies (block-equiv (block-fix acl2::x)
                            acl2::y)
               (block-equiv acl2::x acl2::y))
      :rule-classes :forward-chaining)

    Theorem: block-equiv-of-block-fix-2-forward

    (defthm block-equiv-of-block-fix-2-forward
      (implies (block-equiv acl2::x (block-fix acl2::y))
               (block-equiv acl2::x acl2::y))
      :rule-classes :forward-chaining)