• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
      • B*
      • Defunc
      • Fty
      • 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
        • Deflist
        • Defalist
        • Memory
        • Defstructure
        • Array1
        • Utilities
          • Defloop
          • Get-option
            • Get-option-argument
            • Get-option-member
              • Get-option-check-syntax
              • Get-option-subset
              • Get-option-as-flag
              • Get-option-entries
              • Keyword-option-listp
              • Get-option-entry
              • Get-option-keywords
            • Get-guards-from-body
            • Unique-symbols
            • Pack-intern
            • Pack-string
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Get-option

    Get-option-member

    Process an option whose (optional) argument is a MEMBER of a set of choices.

    This function checks for an option that may be specified as either :OPTION, (:OPTION), or (:OPTION choice), where in the latter form the choice must be a member of the set of choices. The choice is returned if the option is specified by the latter form, otherwise the default-if-missing is returned if the option is not present in the option-list, and default-if-unspecified is returned if the option if specified as :OPTION or (:OPTION).

    Definitions and Theorems

    Function: get-option-member

    (defun get-option-member (ctx option
                                  option-list choices default-if-missing
                                  default-if-unspecified)
      (declare (xargs :guard (and (keywordp option)
                                  (keyword-option-listp option-list)
                                  (eqlable-listp choices))))
      (mv-let
            (msg value)
            (get-option-member-mv option
                                  option-list choices default-if-missing
                                  default-if-unspecified)
        (if msg (bomb ctx "~@0" msg) value)))