• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Aleobft
        • Aleobft-static
        • Aleobft-stake2
        • Aleobft-dynamic
        • Aleobft-stake
          • Correctness
          • Definition
            • Initialization
            • Transitions
            • States
              • Committees
              • System-states
              • Certificates
                • Certificate-set-unequivocalp
                • Certificate-sets-unequivocalp
                • Cert-with-author+round
                • Certificate
                  • Certificatep
                  • Certificate-fix
                    • Make-certificate
                    • Certificate-equiv
                    • Certificate->transactions
                    • Change-certificate
                    • Certificate->round
                    • Certificate->previous
                    • Certificate->endorsers
                    • Certificate->author
                  • Certs-with-authors+round
                  • Certs-with-author
                  • Certs-with-round
                  • Unequivocal-certs-with-authors+round
                  • Unequivocal-cert-with-author+round
                  • Certificate-option
                  • Certs-with-authors
                  • Certificates-ordered-even-p
                  • Certs-with-signer
                  • Cert-set->author-set
                  • Cert-set->round-set
                  • Certificate->signers
                  • Certificate-set
                  • Certificate-list
                • Messages
                • Validator-states
                • Transactions
                • Blocks
                • Addresses
              • Events
          • Aleobft-proposals
          • Library-extensions
        • 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
        • Solidity
        • Leo
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Certificate

    Certificate-fix

    Fixing function for certificate structures.

    Signature
    (certificate-fix x) → new-x
    Arguments
    x — Guard (certificatep x).
    Returns
    new-x — Type (certificatep new-x).

    Definitions and Theorems

    Function: certificate-fix$inline

    (defun certificate-fix$inline (x)
     (declare (xargs :guard (certificatep x)))
     (let ((__function__ 'certificate-fix))
      (declare (ignorable __function__))
      (mbe
        :logic
        (b*
          ((author (address-fix (cdr (std::da-nth 0 x))))
           (round (pos-fix (cdr (std::da-nth 1 x))))
           (transactions (transaction-list-fix (cdr (std::da-nth 2 x))))
           (previous (address-set-fix (cdr (std::da-nth 3 x))))
           (endorsers (address-set-fix (cdr (std::da-nth 4 x)))))
          (list (cons 'author author)
                (cons 'round round)
                (cons 'transactions transactions)
                (cons 'previous previous)
                (cons 'endorsers endorsers)))
        :exec x)))

    Theorem: certificatep-of-certificate-fix

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

    Theorem: certificate-fix-when-certificatep

    (defthm certificate-fix-when-certificatep
      (implies (certificatep x)
               (equal (certificate-fix x) x)))

    Function: certificate-equiv$inline

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

    Theorem: certificate-equiv-is-an-equivalence

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

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

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

    Theorem: certificate-fix-under-certificate-equiv

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

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

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

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

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

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

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

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

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