 (def ^:const mapfn map)
 
 ;; deterministic generation:
-(def ^:const shufflefn (fn [x] x))
+;;(def ^:const shufflefn (fn [x] x))
 
 ;; nondeterministic generation
-;;(def ^:const shufflefn shuffle)
+(def ^:const shufflefn shuffle)
 
 (def ^:const randomize-lexemes-before-phrases
   false)

(defn comp-path-to-complements
  "return a lazy sequence of bolts for all possible complements that can be added to the end of the _path_ within _bolt_."
  [bolt path model depth max-depth]
  (log/info (str "comp-path-to-complements:" depth "/" max-depth ":" ((:morph-ps model) bolt) "@" path))
  (let [spec (get-in bolt path)
        lexemes (shufflefn (get-lexemes model spec))
        bolts-at (if (< depth max-depth)
                   (generate-all
                    (get-in bolt path)
                    model
                    (+ 1 depth) max-depth))
        lexemes-before-phrases
        (lexemes-before-phrases depth max-depth)]
    (if lexemes-before-phrases


;; TODO: rewrite using (recur)
(defn comp-paths-to-complements [bolt comp-paths model depth max-depth]
  (log/info (str "comp-paths-to-complements: depth=" depth "; max-depth: " max-depth ":" ((:morph-ps model) bolt)))
  (if (not (empty? comp-paths))
    (let [path (first comp-paths)
          comps (filter not-fail? (comp-path-to-complements bolt path model depth max-depth))]
