         ;; total-depth, on the other hand, is the depth all the way to the top of the entire
         ;; expression, which might involve several parent lightning bolts.
         parents (shuffle (candidate-parents grammar spec))]
+    (log/debug (str "lightning-bolt: candidate-parents:" (string/join "," (map :rule parents))))
+    (log/debug (str "lightning-bolt:  for spec: " (strip-refs spec)))
     (let [lexical ;; 1. generate list of all phrases where the head child of each parent is a lexeme.
           (mapfn (fn [parent]
                          (if (= false (get-in parent [:head :phrasal] false))

  (log/trace (str "candidate-parents: spec: " (strip-refs spec)))
  (filter #(not (fail? %))
          (mapfn (fn [rule]
                   (if (and (not (fail? (unifyc (get-in rule [:synsem :cat] :top)
                                                (get-in spec [:synsem :cat] :top))))
                            (not (fail? (unifyc (get-in rule [:synsem :infl] :top)

                    & {:keys [max-total-depth truncate-children]
                       :or {max-total-depth max-total-depth
                            truncate-children true}}]
  (log/debug (str "generate-all: spec:" (strip-refs spec)))
  
  (let [language-model (if (future? language-model) @language-model language-model)
        total-depth (if total-depth total-depth 0)]
