• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
    • Proof-automation
    • 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
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • 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])