• 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
      • Riscv
      • Taspi
      • 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
      • Community
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Proposals

    Props-with-author+round

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

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

    Definitions and Theorems

    Function: props-with-author+round

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

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

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

    Theorem: props-with-author+round-subset

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

    Theorem: props-with-author+round-of-empty

    (defthm props-with-author+round-of-empty
      (equal (props-with-author+round author round nil)
             nil))

    Theorem: in-of-props-with-author+round

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

    Theorem: not-emptyp-of-props-with-author+round

    (defthm not-emptyp-of-props-with-author+round
      (implies
           (and (in prop props)
                (proposal-setp props)
                (equal (proposal->author prop) author)
                (equal (proposal->round prop) round))
           (not (emptyp (props-with-author+round author round props)))))

    Theorem: props-with-author+round-when-none-author

    (defthm props-with-author+round-when-none-author
      (implies (prop-set-none-author-p author props)
               (equal (props-with-author+round author round props)
                      nil)))

    Theorem: props-with-author+round-of-address-fix-author

    (defthm props-with-author+round-of-address-fix-author
      (equal (props-with-author+round (address-fix author)
                                      round props)
             (props-with-author+round author round props)))

    Theorem: props-with-author+round-address-equiv-congruence-on-author

    (defthm props-with-author+round-address-equiv-congruence-on-author
      (implies
           (address-equiv author author-equiv)
           (equal (props-with-author+round author round props)
                  (props-with-author+round author-equiv round props)))
      :rule-classes :congruence)

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

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

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

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

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

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

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

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