• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Pfcs
      • Wp-gen
      • Dimacs-reader
      • Legacy-defrstobj
      • Proof-checker-array
      • Soft
      • C
      • Farray
      • Rp-rewriter
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Leftist-trees
      • Java
      • Taspi
      • Riscv
      • Bitcoin
      • 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
      • Aleo
        • Aleobft
          • Correctness
          • Definition
            • Initialization
            • Transitions
            • States
              • Committees
              • System-states
              • Certificates
              • Messages
              • Transactions
              • Proposals
                • Proposal
                • Props-with-author+round
                • Props-with-round
                  • Prop-set-unequivp
                  • Proposal-option
                  • Prop-set-none-author-p
                  • Prop-set-all-author-p
                  • Proposal-set
                • Validator-states
                • Blocks
                • Addresses
              • Events
              • Reachability
            • Library-extensions
          • Aleovm
          • Leo
        • Bigmems
        • Builtins
        • Execloader
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Community
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Proposals

    Props-with-round

    Retrieve, from a set of proposals, the subset of proposals with a given round.

    Signature
    (props-with-round round props) → props-with-round
    Arguments
    round — Guard (posp round).
    props — Guard (proposal-setp props).
    Returns
    props-with-round — Type (proposal-setp props-with-round).

    Definitions and Theorems

    Function: props-with-round

    (defun props-with-round (round props)
      (declare (xargs :guard (and (posp round)
                                  (proposal-setp props))))
      (let ((__function__ 'props-with-round))
        (declare (ignorable __function__))
        (b* (((when (emptyp (proposal-set-fix props)))
              nil)
             ((proposal prop) (head props)))
          (if (equal (pos-fix round) prop.round)
              (insert (proposal-fix prop)
                      (props-with-round round (tail props)))
            (props-with-round round (tail props))))))

    Theorem: proposal-setp-of-props-with-round

    (defthm proposal-setp-of-props-with-round
      (b* ((props-with-round (props-with-round round props)))
        (proposal-setp props-with-round))
      :rule-classes :rewrite)

    Theorem: props-with-round-subset

    (defthm props-with-round-subset
      (implies (proposal-setp props)
               (b* ((?props-with-round (props-with-round round props)))
                 (subset props-with-round props))))

    Theorem: in-of-props-with-round

    (defthm in-of-props-with-round
      (equal (in prop (props-with-round round props))
             (and (in prop (proposal-set-fix props))
                  (equal (proposal->round prop)
                         (pos-fix round)))))

    Theorem: not-in-prop-set-when-none-with-round

    (defthm not-in-prop-set-when-none-with-round
      (implies (and (emptyp (props-with-round (proposal->round prop)
                                              props))
                    (proposal-setp props))
               (not (in prop props))))

    Theorem: not-in-prop-subset-when-none-with-round

    (defthm not-in-prop-subset-when-none-with-round
      (implies (and (emptyp (props-with-round (proposal->round prop)
                                              props))
                    (subset props0 props)
                    (proposal-setp props0)
                    (proposal-setp props))
               (not (in prop props0))))

    Theorem: props-with-author+round-to-props-with-round

    (defthm props-with-author+round-to-props-with-round
      (implies (prop-set-all-author-p author props)
               (equal (props-with-author+round author round props)
                      (props-with-round round props))))

    Theorem: props-with-round-of-pos-fix-round

    (defthm props-with-round-of-pos-fix-round
      (equal (props-with-round (pos-fix round) props)
             (props-with-round round props)))

    Theorem: props-with-round-pos-equiv-congruence-on-round

    (defthm props-with-round-pos-equiv-congruence-on-round
      (implies (acl2::pos-equiv round round-equiv)
               (equal (props-with-round round props)
                      (props-with-round round-equiv props)))
      :rule-classes :congruence)

    Theorem: props-with-round-of-proposal-set-fix-props

    (defthm props-with-round-of-proposal-set-fix-props
      (equal (props-with-round round (proposal-set-fix props))
             (props-with-round round props)))

    Theorem: props-with-round-proposal-set-equiv-congruence-on-props

    (defthm props-with-round-proposal-set-equiv-congruence-on-props
      (implies (proposal-set-equiv props props-equiv)
               (equal (props-with-round round props)
                      (props-with-round round props-equiv)))
      :rule-classes :congruence)