1:- module(test_tornado,
    2  [test_tornado/0]).    3:- use_module(library(plunit)).    4
    5test_tornado:-
    6    trill:set_algorithm(tornado),
    7    run_tests([tornado_biopax,
    8    %tornado_biopax_rdf,
    9    tornado_dbpedia,
   10    tornado_brca,
   11    tornado_commander,
   12    tornado_johnEmployee,
   13    tornado_peoplePets,
   14    tornado_vicodi,
   15    tornado_pizza,
   16    non_det,
   17    local_cons]).
   18
   19:- use_module(library(trill_test/trill_test)).   20
   21:- begin_tests(tornado_brca, []).   22
   23:- ensure_loaded(library('examples/BRCA.pl')).   24
   25test(p_wlbrcr_h):-
   26  run((prob_instanceOf('WomanUnderLifetimeBRCRisk','Helen',Prob),close_to(Prob,0.123))).
   27test(p_wa_wulbrcr):-
   28  run((prob_sub_class('WomanAged3040','WomanUnderLifetimeBRCRisk',Prob),close_to(Prob,0.123))).
   29
   30:- end_tests(tornado_brca).   31
   32
   33:- begin_tests(tornado_vicodi, []).   34
   35:-ensure_loaded(library(examples/vicodi)).   36
   37test(p_r_avdpf):-
   38  run((prob_instanceOf('vicodi:Role','vicodi:Anthony-van-Dyck-is-Painter-in-Flanders',Prob),close_to(Prob,0.27540000000000003))).
   39test(p_p_r):-
   40  run((prob_sub_class('vicodi:Painter','vicodi:Role',Prob),close_to(Prob,0.30600000000000005))).
   41
   42:- end_tests(tornado_vicodi).   43
   44
   45:- begin_tests(tornado_commander, []).   46
   47:-ensure_loaded(library(examples/commander)).   48
   49test(e_c_j):-
   50  run((prob_instanceOf(commander,john,Prob),close_to(Prob,1))).
   51
   52:- end_tests(tornado_commander).   53
   54
   55:- begin_tests(tornado_peoplePets, []).   56
   57:-ensure_loaded(library(examples/peoplePets)).   58
   59test(p_nl_k):-
   60  run((prob_instanceOf('natureLover','Kevin',Prob),close_to(Prob,0.8696))).
   61
   62:- end_tests(tornado_peoplePets).   63
   64
   65:- begin_tests(tornado_biopax, []).   66
   67:-ensure_loaded(library(examples/biopaxLevel3)).   68
   69test(p_twbr_e):-
   70  run((prob_sub_class('biopax:TransportWithBiochemicalReaction','biopax:Entity',Prob),close_to(Prob,0.98))).
   71
   72:- end_tests(tornado_biopax).   73
   74:- begin_tests(tornado_biopax_rdf, []).   75
   76:-ensure_loaded(library(trill)).   77
   78test(p_twbr_e):-
   79  run((init_trill(tornado),load_owl_kb('../examples/biopaxLevel3_rdf.owl'),prob_sub_class('biopax:TransportWithBiochemicalReaction','biopax:Entity',Prob),close_to(Prob,0.98))).
   80
   81:- end_tests(tornado_biopax_rdf).   82
   83
   84:- begin_tests(tornado_dbpedia, []).   85
   86:-ensure_loaded(library('examples/DBPedia.pl')).   87
   88test(p_p_pp):-
   89  run((prob_sub_class('dbpedia:Place','dbpedia:PopulatedPlace',Prob),close_to(Prob,0.8273765902816))).
   90
   91:- end_tests(tornado_dbpedia).   92
   93
   94:- begin_tests(tornado_johnEmployee, []).   95
   96:-ensure_loaded(library(examples/johnEmployee)).   97
   98test(p_p_j):-
   99  run((prob_instanceOf('johnEmployee:person','johnEmployee:john',Prob),close_to(Prob,1))).
  100  
  101:- end_tests(tornado_johnEmployee).  102
  103:- begin_tests(tornado_pizza, []).  104
  105:- ensure_loaded(library(examples/pizza)).  106
  107test(p_inc_kb):-
  108  run((prob_inconsistent_theory(Prob),close_to(Prob,0.0))).
  109test(p_uns_tof):-
  110  run((prob_unsat('tofu',Prob),close_to(Prob,1.0))).
  111
  112:- end_tests(tornado_pizza).  113
  114:- begin_tests(non_det, []).  115
  116:-ensure_loaded(library(examples/example_or_rule)).  117
  118test(p_u_a):-
  119  run((prob_unsat(a,Prob),close_to(Prob,0.03393568))).
  120
  121:- end_tests(non_det).  122
  123
  124:- begin_tests(local_cons, []).  125
  126:-ensure_loaded(library(examples/local_inconsistent_kb)).  127
  128%test(p_in):-
  129%  run((prob_inconsistent_theory(Prob),close_to(Prob,1.0))).
  130
  131test(p_pv_3_4):-
  132  run((prob_property_value(r,ind3,ind4,Prob),close_to(Prob,1.0))).
  133
  134test(p_i_x_4):-
  135  run((prob_instanceOf(x,ind4,Prob),close_to(Prob,1.0))).
  136
  137:- end_tests(local_cons).