• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
      • Theories
      • Rule-classes
      • Proof-builder
      • Hons-and-memoization
      • Events
      • History
      • Parallelism
      • Programming
      • 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
              • ACL2s-faq
              • Match
              • ACL2s-intro
              • ACL2s-defaults
              • Definec
              • ACL2s-utilities
              • ACL2s-installation
            • Talks
            • Nqthm-to-ACL2
            • Emacs
          • About-ACL2
        • Real
        • Debugging
        • Miscellaneous
        • Output-controls
        • Macros
        • Interfacing-tools
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Testing-utilities
      • Math
    • Defdata

    Register-user-combinator

    Register a user-defined combinator (to add sugar to defdata language)

    Introduction

    User-defined combinators add syntactic sugar on top of the core defdata language. In addition it is also possible to specify the theory support for such a construct via the :post-pred-hook-fns keyword option. (See alistof.lisp for example usage).

    Example

    Here is how we added alistof to the defdata language:
    (register-user-combinator alistof 
     :arity 2 :verbose t
     :aliases (acl2::alistof)
     :expansion (lambda (_name _args) `(OR nil (acons ,(car _args) ,(cadr _args) ,_name)))
     :syntax-restriction-fn proper-symbol-listp
     :polymorphic-type-form (alistof :a :b)
     :post-pred-hook-fns (user-alistof-theory-events))

    General Form:

    (register-user-combinator combinator-name 
                              :arity num 
                              :expansion term 
                              [optional args])