 (ns babel.generate
-  (:refer-clojure :exclude [get-in deref resolve find parents])
+  (:refer-clojure :exclude [assoc-in get-in deref resolve find parents])
   (:require
    [babel.index :refer [intersection-with-identity]]
    [babel.over :as over :refer [show-bolt spec-info truncate truncate-expressions]]
    #?(:clj [clojure.tools.logging :as log])
    #?(:cljs [babel.logjs :as log]) 
    [clojure.string :as string]
-   [dag_unify.core :refer [copy fail-path get-in fail? strip-refs unify unify!]]))
+   [dag_unify.core :refer [assoc-in copy fail-path get-in fail? strip-refs unify unify!]]))
                                         
 ;; during generation, will not decend deeper than this when creating a tree:
 ;; TODO: should also be possible to override per-language.
-(def ^:const max-total-depth 6)
+(def ^:const max-total-depth 2)
 
 ;; TODO support setting max-generated-complements to :unlimited
 (def ^:const max-generated-complements 20000)

        []))

(defn find-comp-paths [bolt & [path]]
  (let [path (if (nil? path)
               (rest (find-end-of-bolt bolt))
               path)]
    (if (not (empty? path))
      (concat 
       [(vec (concat path [:comp]))]
       (find-comp-paths bolt (rest path)))
      [[:comp]])))

(defn find-comp-paths-in [depth]
  (cond

                    (string/join "," (map :rule result))
                    " for spec: " (strip-refs spec)))
    (if (empty? result)
      (log/trace (str "candidate-parents: " 
                      "no parents found for spec: " (spec-info spec)))
      (log/trace (str "candidate-parents: " 
                    (string/join "," (map :rule result))
                    " for: " (spec-info spec))))
    result))
