Demonstrate how to pick a random element from a list.




:set-state-ok t
 
(defun pick-random-element (xs state)
   (mv-let (idx state)
           (random$ (len xs) state)
      (mv (nth idx xs) state)))