In order for the pre- and post-conditions map to be recognized as such, it must immediately follow the parameter vector. See http://clojure.org/special_forms#toc10.
An acceptable albeit not very common way to package these would be to wrap your defn
in a let
(let [tipos-transicoes-peso #{:troca-peso :mesmo-peso}
tipos-estados-peso #{:d :e}]
(defn executa-peso-individuo
[estado-individuo transicao-individuo]
{:pre [(contains? tipos-transicoes-peso
(:peso transicao-individuo))
(contains? tipos-estados-peso
(:peso estado-individuo))]
...
In general, reserve def
and defn
for top-level use only. Inside a top-level let
is okay, but again, not common. But, definitely do not use inside a function body as in your example.