• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
      • Theories
      • Rule-classes
      • Proof-builder
      • Recursion-and-induction
      • Hons-and-memoization
      • Events
      • Parallelism
      • History
      • Programming
      • Operational-semantics
      • Real
      • Start-here
        • Gentle-introduction-to-ACL2-programming
        • ACL2-tutorial
          • Introduction-to-the-theorem-prover
          • Pages Written Especially for the Tours
          • The-method
          • Advanced-features
          • Interesting-applications
          • Tips
          • Alternative-introduction
          • Tidbits
          • Annotated-ACL2-scripts
          • Startup
          • ACL2-as-standalone-program
          • ACL2-sedan
            • Defunc
            • Cgen
            • Ccg
            • Defdata
              • Match
              • Sig
              • Register-data-constructor
              • Register-type
              • Defdata-attach
                • Register-user-combinator
              • ACL2s-user-guide
              • ACL2s-tutorial
              • ACL2s-implementation-notes
              • Match
              • ACL2s-faq
              • ACL2s-intro
              • ACL2s-defaults
              • Definec
              • ACL2s-utilities
              • ACL2s-interface
              • ACL2s-installation
            • Talks
            • Nqthm-to-ACL2
            • Tours
            • Emacs
          • About-ACL2
            • Recursion-and-induction
            • Operational-semantics
            • Soundness
            • Release-notes
            • Workshops
            • ACL2-tutorial
              • Introduction-to-the-theorem-prover
              • Pages Written Especially for the Tours
              • The-method
              • Advanced-features
              • Interesting-applications
              • Tips
              • Alternative-introduction
              • Tidbits
              • Annotated-ACL2-scripts
              • Startup
              • ACL2-as-standalone-program
              • ACL2-sedan
                • Defunc
                • Cgen
                • Ccg
                • Defdata
                  • Match
                  • Sig
                  • Register-data-constructor
                  • Register-type
                  • Defdata-attach
                    • Register-user-combinator
                  • ACL2s-user-guide
                  • ACL2s-tutorial
                  • ACL2s-implementation-notes
                  • Match
                  • ACL2s-faq
                  • ACL2s-intro
                  • ACL2s-defaults
                  • Definec
                  • ACL2s-utilities
                  • ACL2s-interface
                  • ACL2s-installation
                • Talks
                • Nqthm-to-ACL2
                • Tours
                • Emacs
              • Version
              • Acknowledgments
              • Using-ACL2
              • Releases
              • How-to-contribute
              • Pre-built-binary-distributions
              • Common-lisp
              • Installation
              • Mailing-lists
              • Git-quick-start
              • Copyright
              • ACL2-help
          • Miscellaneous
          • Output-controls
          • Bdd
          • Macros
          • Installation
          • Mailing-lists
        • 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.