   (s/keys :req-un []
           :opt-un [::text]))
 
-(s/def ::pred-result boolean?)
-
-(s/fdef ::pred
-         :args (s/cat :node ::node)
-         :ret ::pred-result)
-
+(s/def ::node-pred (s/with-gen (s/fspec :args (s/cat :node ::node) :ret boolean?)
+                               #(gen/return
+                                  (memoize
+                                    (first
+                                      (gen/sample
+                                        (s/gen (s/fspec :args (s/cat :node ::node) :ret boolean?))
+                                        1))))))
 
 
 (defn create-node

(ns evermind.domain.core
    (:require [clojure.spec.alpha :as s]
      [clojure.set :as cljset]
      [clojure.spec.gen.alpha :as gen]))

(s/def ::node
  (s/keys :req-un []



(defn set-attributes
  ([node attributes]
   (assoc node :attributes attributes)))

(s/fdef set-attributes
        :args (s/cat :node ::node :attributes ::attributes)
        :ret ::node
        :fn #(= (-> % :ret :attributes)
                (-> % :args :attributes)))



(defn add-child
  ([node child]
   (assoc node :children (set (conj (:children node) child)))))

(s/fdef add-child
        :args (s/cat :node ::node :child ::node)
