   END;  
 
   --create semimod gate
-  PERFORM create_gate(semimod_token,'semimod',ARRAY[token,value_token]);
+  PERFORM create_gate(semimod_token,'semimod',ARRAY[token::uuid,value_token]);
 
   RETURN semimod_token;
 END

BEGIN
  RETURN QUERY EXECUTE
    'WITH RECURSIVE transitive_closure(f,t,gate_type) AS (
      SELECT $1,t,provsql.get_gate_type($1) FROM unnest(provsql.get_children($1)) AS t
        UNION ALL
      SELECT p1.t,u,provsql.get_gate_type(p1.t) FROM transitive_closure p1, unnest(provsql.get_children(p1.t)) AS u)
    SELECT t1.*, infos FROM (
      SELECT f::uuid,t::uuid,gate_type,NULL FROM transitive_closure
        UNION ALL

    monus_token:=token1;
  ELSE  
    monus_token:=uuid_generate_v5(uuid_ns_provsql(),concat('monus',token1,token2));
    PERFORM create_gate(monus_token, 'monus', ARRAY[token1::uuid, token2::uuid]);
  END IF;  

  RETURN monus_token;
