Register a user-defined combinator (to add sugar to defdata language)
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).
(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))
(register-user-combinator combinator-name :arity num :expansion term [optional args])