    [clojure.set :as set]
    [dag_unify.core :refer [copy fail? get-in strip-refs unify]]))
 
+;; TODO: move this from babel.test.it to babel.lexicon or similar.
 (btest/init-db)
 (log/info (str "recompiling and writing lexicon to database.."))
 (write-lexicon "it" (lexicon/compile-lexicon))
 (log/info (str "done."))
-(def model @@(get models :it))
 
 ;; TODO: consider removing special-purpose grammars like grammar/np-grammar
 ;; and just use model instead.
+;; TODO: create np-grammar here as we do with tiny-model (below).
 (def np-grammar (delay (grammar/np-grammar)))
+
+(defn generate-speed-test [spec & [times]]
+  (btest/generate-speed-test spec @@(get models :it) times))
+
+(defn run-passato-prossimo-test []
+  (generate-speed-test {:synsem {:cat :verb :subcat []
+                                 :sem {:reflexive true
+                                       :tense :present
+                                       :aspect :perfect}}}))
+(defn tiny-model []
+  (babel.italiano.grammar/model-plus-lexicon
+   ;; filtered lexicon:
+   (into {}
+         (for [[k lexemes] (babel.lexiconfn/read-lexicon "it")]
+           (let [filtered-lexemes
+                 (filter (fn [lexeme]
+                           (or (= k "vedere")
+                               (and (= (get-in lexeme [:synsem :cat])
+                                       :noun)
+                                    (= (get-in lexeme [:synsem :pronoun])
+                                       true))))
+                         lexemes)]
+             (if (not (empty? filtered-lexemes))
+               [k filtered-lexemes]))))
+
+   ;; filtered grammar:
+   (fn [rule]
+     (or (= (:rule rule)
+            "s-present-phrasal")
+         (= (:rule rule)
+            "vp-pronoun-nonphrasal")))))
+
 
 (defmacro deftest [test-name & arguments]
   (let [wrapped-arguments

             generate
             morph))))

(defn generate-speed-test [spec & [times]]
  (btest/generate-speed-test spec model times))

(defn run-passato-prossimo-test []
  (generate-speed-test {:synsem {:cat :verb :subcat []
                                 :sem {:reflexive true
                                       :tense :present
                                       :aspect :perfect}}}))

(deftest io-lo-vedo
  (is (= "io lo vedo"
         (let [spec

        (repeatedly #(let [generated
                           (morph (generate {:synsem {:cat :verb
                                                      :subcat []}}))
                           parsed (reduce concat (map :parses (parse generated)))]
                       (log/info (str "generated: " generated))
                       (log/info (str "semantics: "
                                      (or
