(match-1 'x 'y)
(match-1 ['a []] ['a []])
(match-1 ['a '(?)] ['a []])
(match-1 ['(?)] [])

(match-2 ['(*)] ['a])
(match-2 ['(*)] 'a)
(match-2 ['(*) 'u '(*)] ['a 'u 'b 'c])

(match-3 ['(* a)] ['x 'y] [['a ['x 'y]]])
(match-3 ['(* a) '(* a)] ['x] [['a []]])
(match-3 ['(*) '(? a) '(*)] ['u 'v 'w] [['a 'w]])

(match-4 ['(* a) 'x '(? b) '(*)] ['u 'x 'v 'w 'z])
(match-4 ['(*) '(? x) '(*)] [])
(match-4 ['(*) '(? a) '(*) '(? a) '(*)] ['u 'v 'v 'w 'u])

(match-5 '(? x) '(? x) [])
(match-5 ['(? x)] '(? x) [['x ['(? y)]]])
(match-5 '(? x) ['a] [['x ['(? y)]] ['y 'a]])

(match-6 ['(? x) '(? y) '(? y)] ['a 'b '(? x)])
(match-6 ['(? x) ['(? y)] '(? y)] ['a ['a] '(? x)])
(match-5 ['(? x) '(? x)] ['(? y) 'a] it)

(clone '[[a (? x) [(?)]] (? x)])

(set db-1 '[[(grot z)]])

(nano-prolog '(grot (? x)) db-1)

;;; (set db-3 '[[append [[[] (? x) (? x)]]
;;;                     [[[(? x) (? y)] (? z) [(? x) (? u)]]
;;;                      [append (? y) (? z) (? u)]]]])

(set db-2 '[[(append [] (? x) (? x))]
            [(append [(? x) (? y)] (? z) [(? x) (? u)])
             (append (? y) (? z) (? u))]])

(nano-prolog '(append [] [z []] (? x))
             db-2)

(nano-prolog '(append [a []] [] (? x)) db-2)

(nano-prolog '(append [a [b [c []]]] [d []] (? x))
             db-2)

(nano-prolog '(foo (? x) (? y) (? z))
             '[[(foo a (? x) (? y)) (bar (? x) (? y))]
               [(foo b (? x) (? y)) (bar (? x) (? y))]
               [(bar c (? x)) (zot (? x))]
               [(bar d (? x)) (zot (? x))]
               [(zot e)]
               [(zot f)]])

(set db-3 '[[(member (? x) [(? x) (?)])]
            [(member (? x) [(?) (? y)]) (member (? x) (? y))]])

(nano-prolog '(member (? x) [a [b [c [d []]]]]) db-3)

(set db-4 (append db-3
                  '[[(lookup (? x) (? y) (? z))
                     (member [(? x) (? z)]  (? y))]]))

(nano-prolog '(lookup b [[a eh] [[b bee] [[c sea] []]]] (? x)) db-4)