   (let [total-depth (if total-depth total-depth 0)
         add-complements-to-bolts
         (fn [bolts path]
+          (log/debug (str "generate-all: "
+                          "add-complements-to-bolts@" path ":#bolts(" (count bolts) "):"
+                          (string/join ","
+                                       (map (fn [bolt]
+                                              (show-bolt bolt path morph))
+                                            bolts))))
           (mapcat
            #(if (not (= :none (get-in % path :none)))
               (add-complement % path :top grammar lexicon index morph 0 (+ total-depth (count path)))
               [%])
-           bolts))]
-    (-> (lightning-bolt (lazy-shuffle grammar)
-                        lexicon
-                        spec 0 index morph total-depth)
-        ;; TODO: allow more than a fixed maximum depth of generation (here, 4 levels from top of tree).
-        (add-complements-to-bolts [:head :head :head :comp] )
-        (add-complements-to-bolts [:head :head :comp])
-        (add-complements-to-bolts [:head :comp])
-        (add-complements-to-bolts [:comp]))))
+           bolts))
+
+        expressions
+        (-> (lightning-bolt (lazy-shuffle grammar)
+                            lexicon
+                            spec 0 index morph total-depth)
+            ;; TODO: allow more than a fixed maximum depth of generation (here, 4 levels from top of tree).
+            (add-complements-to-bolts [:head :head :head :comp] )
+            (add-complements-to-bolts [:head :head :comp])
+            (add-complements-to-bolts [:head :comp])
+            (add-complements-to-bolts [:comp]))]
+
+    (if (not (empty? expressions))
+      (log/info (str "generate-all: first expression generated for spec:" (strip-refs spec) " ):"
+                     "'" (morph (first expressions)) "'"))
+      (log/debug (str "generate-all: no expressions could be generated for spec:" (strip-refs expressions))))
+    expressions))
 
 (defn lightning-bolt [grammar lexicon spec depth index morph total-depth]
   "Returns a lazy-sequence of all possible trees given a spec, where

              (lightning-bolt grammar lexicon each-spec depth index morph total-depth))
            spec)
    (do
      (log/debug (str "lightning-bolt(depth=" depth ", total-depth=" total-depth "; cat=" (get-in spec [:synsem :cat]) ")"))
      (let [morph (if morph morph (fn [input] (get-in input [:rule] :default-morph-no-rule)))
            depth (if depth depth 0)        
            parents (filter #(not (fail? %)) (mapfn (fn [rule] (unifyc spec rule)) grammar))]
        (let [lexical ;; 1. generate list of all phrases where the head child of each parent is a lexeme.
              (mapcat (fn [parent]
                        (if (= false (get-in parent [:head :phrasal] false))
                          (let [candidate-lexemes (get-lex parent :head index spec)]
                            (over/overh parent
                                        (mapfn copy (lazy-shuffle candidate-lexemes))))))
                            parents)
              phrasal ;; 2. generate list of all phrases where the head child of each parent is itself a phrase.
              (if (< depth max-total-depth)
                (mapcat (fn [parent]

            (concat phrasal lexical)))))))

(defn add-complement [bolt path spec grammar lexicon cache morph depth total-depth]
  (log/debug (str "add-complement: " (show-bolt bolt path morph)))
  (let [input-spec spec
        from-bolt bolt ;; so we can show what (add-complement) did to the input bolt, for logging.
        spec (unifyc spec (get-in bolt path))
