• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
      • B*
      • Defunc
      • Fty
        • Deftagsum
        • Defprod
        • Defflexsum
        • Defbitstruct
        • Deflist
        • Defalist
        • Defbyte
        • Deffixequiv
        • Defresult
        • Deffixtype
        • Defoption
        • Fty-discipline
        • Fold
        • Fty-extensions
          • Defbyte
          • Defresult
          • Fold
          • Defsubtype
          • Defset
          • Specific-types
          • Defflatsum
          • Deflist-of-len
          • Pos-list
          • Defbytelist
          • Defomap
          • Defbyte-standard-instances
          • Deffixtype-alias
          • Defbytelist-standard-instances
          • Defunit
          • Byte-list
          • Byte
          • Database
          • Pos-option
            • Pos-option-fix
            • Pos-option-case
              • Pos-option-equiv
              • Pos-option-some
              • Pos-option-none
              • Pos-optionp
            • Nibble
            • Nat-option
            • String-option
            • Byte-list20
            • Byte-list32
            • Byte-list64
            • Pseudo-event-form
            • Natoption/natoptionlist
            • Nati
            • Character-list
            • Nat/natlist
            • Maybe-string
            • Nibble-list
            • Natoption/natoptionlist-result
            • Nat/natlist-result
            • Nat-option-list-result
            • Set
            • String-result
            • String-list-result
            • Nat-result
            • Nat-option-result
            • Nat-list-result
            • Maybe-string-result
            • Integer-result
            • Character-result
            • Character-list-result
            • Boolean-result
            • Map
            • Bag
            • Pos-set
            • Hex-digit-char-list
            • Dec-digit-char-list
            • Pseudo-event-form-list
            • Nat-option-list
            • Symbol-set
            • String-set
            • Nat-set
            • Oct-digit-char-list
            • Bin-digit-char-list
            • Bit-list
          • Defsubtype
          • Defset
          • Deftypes
          • Specific-types
          • Defflatsum
          • Deflist-of-len
          • Defbytelist
          • Fty::basetypes
          • Defomap
          • Defvisitors
          • Deffixtype-alias
          • Deffixequiv-sk
          • Defunit
          • Multicase
          • Deffixequiv-mutual
          • Fty::baselists
          • Def-enumcase
          • Defmap
        • Apt
        • Std/util
        • Defdata
        • Defrstobj
        • Seq
        • Match-tree
        • Defrstobj
        • With-supporters
        • Def-partial-measure
        • Template-subst
        • Soft
        • Defthm-domain
        • Event-macros
        • Def-universal-equiv
        • Def-saved-obligs
        • With-supporters-after
        • Definec
        • Sig
        • Outer-local
        • Data-structures
      • ACL2
        • Theories
        • Rule-classes
        • Proof-builder
        • Recursion-and-induction
        • Hons-and-memoization
        • Events
        • Parallelism
        • History
        • Programming
        • Operational-semantics
        • Real
        • Start-here
        • Debugging
        • Miscellaneous
        • Output-controls
        • Macros
          • Make-event
          • Defmacro
          • Untranslate-patterns
          • Tc
          • Trans*
          • Macro-aliases-table
          • Macro-args
          • Defabbrev
          • User-defined-functions-table
          • Trans
          • Untranslate-for-execution
          • Add-macro-fn
          • Check-vars-not-free
          • Safe-mode
          • Macro-libraries
            • B*
            • Defunc
            • Fty
              • Deftagsum
              • Defprod
              • Defflexsum
              • Defbitstruct
              • Deflist
              • Defalist
              • Defbyte
              • Deffixequiv
              • Defresult
              • Deffixtype
              • Defoption
              • Fty-discipline
              • Fold
              • Fty-extensions
                • Defbyte
                • Defresult
                • Fold
                • Defsubtype
                • Defset
                • Specific-types
                • Defflatsum
                • Deflist-of-len
                • Pos-list
                • Defbytelist
                • Defomap
                • Defbyte-standard-instances
                • Deffixtype-alias
                • Defbytelist-standard-instances
                • Defunit
                • Byte-list
                • Byte
                • Database
                • Pos-option
                  • Pos-option-fix
                  • Pos-option-case
                    • Pos-option-equiv
                    • Pos-option-some
                    • Pos-option-none
                    • Pos-optionp
                  • Nibble
                  • Nat-option
                  • String-option
                  • Byte-list20
                  • Byte-list32
                  • Byte-list64
                  • Pseudo-event-form
                  • Natoption/natoptionlist
                  • Nati
                  • Character-list
                  • Nat/natlist
                  • Maybe-string
                  • Nibble-list
                  • Natoption/natoptionlist-result
                  • Nat/natlist-result
                  • Nat-option-list-result
                  • Set
                  • String-result
                  • String-list-result
                  • Nat-result
                  • Nat-option-result
                  • Nat-list-result
                  • Maybe-string-result
                  • Integer-result
                  • Character-result
                  • Character-list-result
                  • Boolean-result
                  • Map
                  • Bag
                  • Pos-set
                  • Hex-digit-char-list
                  • Dec-digit-char-list
                  • Pseudo-event-form-list
                  • Nat-option-list
                  • Symbol-set
                  • String-set
                  • Nat-set
                  • Oct-digit-char-list
                  • Bin-digit-char-list
                  • Bit-list
                • Defsubtype
                • Defset
                • Deftypes
                • Specific-types
                • Defflatsum
                • Deflist-of-len
                • Defbytelist
                • Fty::basetypes
                • Defomap
                • Defvisitors
                • Deffixtype-alias
                • Deffixequiv-sk
                • Defunit
                • Multicase
                • Deffixequiv-mutual
                • Fty::baselists
                • Def-enumcase
                • Defmap
              • Apt
              • Std/util
              • Defdata
              • Defrstobj
              • Seq
              • Match-tree
              • Defrstobj
              • With-supporters
              • Def-partial-measure
              • Template-subst
              • Soft
              • Defthm-domain
              • Event-macros
              • Def-universal-equiv
              • Def-saved-obligs
              • With-supporters-after
              • Definec
              • Sig
              • Outer-local
              • Data-structures
            • Trans1
            • Defmacro-untouchable
            • Set-duplicate-keys-action
            • Add-macro-alias
            • Magic-macroexpand
            • Defmacroq
            • Trans!
            • Remove-macro-fn
            • Remove-macro-alias
            • Add-binop
            • Untrans-table
            • Trans*-
            • Remove-binop
            • Tcp
            • Tca
          • Interfacing-tools
        • Interfacing-tools
        • Hardware-verification
        • Software-verification
        • Math
        • Testing-utilities
      • Pos-option

      Pos-option-case

      Case macro for the different kinds of pos-option structures.

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

      Short Form

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

      (pos-option-case x :none)

      can be used to determine whether x is a none instead of some other kind of pos-option structure.

      Long Form

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

      (pos-option-case x
        :none ...
        :some ...)

      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 :none case, you can use fty::defprod-style foo.bar style accessors for x without having to explicitly add a none b* binder.