I need to try and show a function that finds the minimum of a list works and I fell like I'm close to getting it but can't actually get it.
The instructor gives us this function:
(defun minlist (l)
(if (<= (len l) 1)
(first l)
(if (<= (first l) (minlist (rest l)))
(first l)
(minlist (rest l)))))
And then says
;;; TODO: Write a little theory that verifies that the minlist of a list is
;;; less than or equal to any element of the list
;;; Hint: Use this declaration to generate a non-empty list
;;; (n :value (random-between 1 10)
;;; l :value (random-natural-list-of-length n))
Which I then did:
(defproperty-program minlist-<=-member (n)
(if ((n :value (random-between 1 10)
l :value (random-natural-list-of-length n)))
(<= (min-list l) (first l))
(nil)))
Which in Proof Pad gives me an error and I cannot figure out what I've done wrong.
The Error is:
HARD ACL2 ERROR: Missing :value parameter for N
ACL2 Error in TOP-LEVEL: In the attempt to macroexpand the form
(EXPAND-VARS (N)
(IF ((N :VALUE (RANDOM-BETWEEN 1 10)
L
:VALUE (RANDOM-NATURAL-LIST-OF-LENGTH N)))
(<= (MIN-LIST L) (FIRST L))
(NIL))),
evaluation of the macro body caused the following error:
Evaluation aborted. To debug see :DOC print-gv, see :DOC trace, and see :DOC wet.