Construct a definition with zero or more constraints.
Each of the
Macro:
(defmacro pfdef (defname params &rest constraints) (cons 'make-definition (cons ':name (cons defname (cons ':para (cons params (cons ':body (cons (cons 'pfdef-join (cons (cons 'list constraints) 'nil)) 'nil))))))))
Function:
(defun pfdef-join (list) (declare (xargs :guard (constraint/constraintlist-listp list))) (let ((__function__ 'pfdef-join)) (declare (ignorable __function__)) (b* (((when (endp list)) nil) (first (car list))) (cond ((constraintp first) (cons first (pfdef-join (cdr list)))) ((constraint-listp first) (append first (pfdef-join (cdr list)))) (t (acl2::impossible))))))
Theorem:
(defthm constraint-listp-of-pfdef-join (b* ((constrs (pfdef-join list))) (constraint-listp constrs)) :rule-classes :rewrite)