MiniKanren listo

(define listo
  (lambda (l)
    (conde 
      ((nullo l) #s) ;; Succeed if l null
      ((pairo l)     ;; If l pair
        (fresh (d)
          (cdro l d) ;; Associate tail of l to d
          (listo d))) ;; d has to be a list -> l is a list
      (else #u))))