• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
        • Proof-support
        • Abstract-syntax
        • R1cs-subset
        • Semantics
          • Semantics-deeply-embedded
            • Exec-proof-tree
            • Assertion-list->constr-list
            • Assertion-list->asg-list
            • Eval-expr
            • Eval-expr-list
            • Assertion
            • Assignment-wfp
            • Proof-outcome
              • Proof-outcome-fix
              • Proof-outcome-case
                • Proof-outcome-equiv
                • Proof-outcomep
                • Proof-outcome-assertion
                • Proof-outcome-kind
                • Proof-outcome-fail
                • Proof-outcome-error
              • Proof-list-outcome
              • Assertion-list-from
              • Definition-satp
              • Constraint-satp
              • Assignment
              • System-satp
              • Constraint-list-satp
              • Assertion-list
              • Assignment-list
              • Proof-trees
            • Lifting
            • Semantics-shallowly-embedded
          • Abstract-syntax-operations
          • Indexed-names
          • Well-formedness
          • Concrete-syntax
          • R1cs-bridge
          • Parser-interface
        • 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
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Proof-outcome

    Proof-outcome-case

    Case macro for the different kinds of proof-outcome structures.

    This is an ACL2::fty sum-type case macro, typically introduced by fty::defflexsum or fty::deftagsum. It allows you to safely check the type of a proof-outcome structure, or to split into cases based on its type.

    Short Form

    In its short form, proof-outcome-case allows you to safely check the type of a proof-outcome structure. For example:

    (proof-outcome-case x :assertion)

    is essentially just a safer alternative to writing:

    (equal (proof-outcome-kind x) :assertion)

    Why is using proof-outcome-case safer? When we directly inspect the kind with equal, there is no static checking being done to ensure that, e.g., :assertion is a valid kind of proof-outcome structure. That means there is nothing to save you if, later, you change the kind keyword for this type from :assertion to something else. It also means you get no help if you just make a typo when writing the :assertion symbol. Over the course of developing VL, we found that such issues were very frequent sources of errors!

    Long Form

    In its longer form, proof-outcome-case allows you to split into cases based on the kind of structure you are looking at. A typical example would be:

    (proof-outcome-case x
      :assertion ...
      :fail ...
      :error ...)

    It is also possible to consolidate ``uninteresting'' cases using :otherwise.

    For convenience, the case macro automatically binds the fields of x for you, as appropriate for each case. That is, in the :assertion case, you can use fty::defprod-style foo.bar style accessors for x without having to explicitly add a assertion b* binder.