• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • Proof-automation
    • 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
          • Apt
          • Std/util
            • Defprojection
            • Deflist
            • Defaggregate
            • Define
            • Defmapping
            • Defenum
            • Add-io-pairs
            • Defalist
            • Defmapappend
            • Returns-specifiers
            • Defarbrec
            • Defines
            • Define-sk
            • Error-value-tuples
            • Defmax-nat
            • Defmin-int
            • Deftutorial
            • Extended-formals
            • Defrule
            • Defval
            • Defsurj
            • Defiso
            • Defconstrained-recognizer
              • Deffixer
              • Defmvtypes
              • Defconsts
              • Defthm-unsigned-byte-p
              • Support
              • Defthm-signed-byte-p
              • Defthm-natp
              • Defund-sk
              • Defmacro+
              • Defsum
              • Defthm-commutative
              • Definj
              • Defirrelevant
              • Defredundant
            • 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
        • Mailing-lists
        • Interfacing-tools
      • Macro-libraries
        • B*
        • Defunc
        • Fty
        • Apt
        • Std/util
          • Defprojection
          • Deflist
          • Defaggregate
          • Define
          • Defmapping
          • Defenum
          • Add-io-pairs
          • Defalist
          • Defmapappend
          • Returns-specifiers
          • Defarbrec
          • Defines
          • Define-sk
          • Error-value-tuples
          • Defmax-nat
          • Defmin-int
          • Deftutorial
          • Extended-formals
          • Defrule
          • Defval
          • Defsurj
          • Defiso
          • Defconstrained-recognizer
            • Deffixer
            • Defmvtypes
            • Defconsts
            • Defthm-unsigned-byte-p
            • Support
            • Defthm-signed-byte-p
            • Defthm-natp
            • Defund-sk
            • Defmacro+
            • Defsum
            • Defthm-commutative
            • Definj
            • Defirrelevant
            • Defredundant
          • 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
        • Interfacing-tools
        • Hardware-verification
        • Software-verification
        • Math
        • Testing-utilities
      • Std/util

      Defconstrained-recognizer

      Introduce a constrained recognizer.

      Introduction

      ACL2 support the introduction of arbitrary consistency-preserving constrained functions via encapsulate. The defconstrained-recognizer macro abbreviates encapsulates to introduce certain common kinds of constrained recognizers.

      This macro currently provides just a few options. More will be added as the need for them arises.

      General Form

      (defconstrained-recognizer name
                                 :nonempty ...
        )

      Inputs

      name

      The name of the recognizer.

      :nonempty

      Determines whether the recognizer is constrained be non-empty or not, and if so it provides the name of a witness function for the non-emptiness of the recognizer.

      It must be one of the following:

      • A symbol that is not nil. In this case, the recognizer is constrained to be non-empty, by introducing, besides the recognizer, also a nullary function, whose name is this input, constrained to satisfy the recognizer.
      • nil (the default). In this case, the recognizer is not constrained to be non-empty, i.e. it may be empty or non-empty. No constrained nullary function is introduced in this case.

      Generated Events

      This macro generates an encapsulate that introduces the following functions with the following constraining theorems.

      name

      The recognizer, a unary function.

      Its executable counterpart is disabled.

      booleanp-of-name

      A rewrite and type prescription rule saying that the recognizer returns a boolean:

      (defthm booleanp-of-name
        (booleanp (name x))
        :rule-classes (:rewrite :type-prescription))

      nonempty

      A nullary function witnessing the non-emptiness of the recognizer.

      This is generated exactly when :nonempty is not nil.

      name-of-nonempty

      (defthm name-of-nonempty
        (name (nonempty)))

      This is generated exactly when :nonempty is not nil.