            (lazy-cat lexical phrasal)
            (lazy-cat phrasal lexical))))))
 
-(defn add-all-comps [bolts language-model total-depth truncate-children max-total-depth]
+(defn add-all-comps
   "At each point in each bolt in the list of list of bolts,
-_bolt-groups_, add all possible complements at all open nodes in the
-bolt, from deepest and working upward to the top. Return a lazy
-sequence of having added all possible complements at each node in the
-bolt."
+  _bolt-groups_, add all possible complements at all open nodes in the
+  bolt, from deepest and working upward to the top. Return a lazy
+  sequence of having added all possible complements at each node in
+  the bolt."
+   [bolts language-model total-depth truncate-children max-total-depth]
   (lazy-mapcat
    (fn [bolt]
      (add-all-comps-with-paths [bolt] language-model total-depth


;; FIXME: truncate-children=false (the non-default option) is not propagated through all calls,
;; causing trees to be unexpectedly truncated.
(defn generate [spec language-model
                & {:keys [max-total-depth truncate-children lexicon]
                   :or {max-total-depth max-total-depth
                        lexicon nil
                        truncate-children true}}]
  "Returns a single expression generated by the given language model, constrained by the given spec."
  (let [lexicon (if lexicon lexicon (:lexicon language-model))
        morph (:morph language-model)
        morph-ps (:morph-ps language-model)]

    (cons (vec (concat (take (- depth 1) (repeatedly (fn [] :head))) [:comp]))
          (find-comp-paths-in (- depth 1)))))

(defn candidate-parents
  "find subset of _rules_ for which each member unifies successfully with _spec_"
  [rules spec]
  (log/trace (str "candidate-parents: spec: " (strip-refs spec)))
  (filter #(not (= :fail %))
          (pmap (fn [rule]
