• 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
          • Defdata
            • Match
            • Sig
            • Register-data-constructor
            • Register-type
            • Defdata-attach
              • Register-user-combinator
            • 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
        • Defdata
          • Match
          • Sig
          • Register-data-constructor
          • Register-type
          • Defdata-attach
            • Register-user-combinator
          • 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
      • Defdata
      • Cgen

      Defdata-attach

      Attach/modify metadata for a defdata type

      Examples:

      (defdata-attach pos :enumerator nth-small-pos-testing)
      
      (defdata-attach imem :enum/acc imem-custom-enum2)

      General Form:

      (defdata-attach typename 
           [:enum/test enum-fn]
           [:equiv eq-rel]
           [:equiv-fixer eq-fix-fn]
           [:constraint ... ]
           [:sampling constant-list]
           [overridable metadata]
           )

      Defdata-attach can be used to attach custom test enumerators for certain types. This provides a method to customize Cgen's test data generation capability for certain scenarios.

      (Advanced) Type refinement : User can attach rules that specify (to Cgen) how to refine/expand a variable of this type when certain additional constraints match (or subterm-match). For those who are familar with dest-elim rules, the :rule field has a similar form. For example:

      (defdata-attach imemory
               :constraint (mget a x) ;x is the variable of this type
               :constraint-variable x
               :rule (implies (and (natp a) ;additional hyps
                                   (instp x.a)
                                   (imemoryp x1))
                              (equal x (mset a x.a x1))) ;refine/expand
               :meta-precondition (or (variablep a)
                                      (fquotep a))
               :match-type :subterm-match)

      Warning: Other optional keyword arguments are currently unsupported and the use of :override-ok can be unsound.