9:- assert_if_new( use_inference_engine(resolution) ).   10:- assert_if_new( use_algebra(alg_lukasiewicz) ).   11%:- use_module('pl/yadlr').
   12
   13
   14/*
   15CURRENTLY SUPPORTED SYNTAX:
   16F :== dlnot(F)
   17F :== dland(F, F)
   18F :== dlor(F, F)
   19F :== dlimplies(F, F)
   20F :== dlequiv(F, F)
   21F :== C(I)
   22C :== PredicateName  
   23I :== InstanceName(s)
   24
   25TODO:
   26F :== all(X, F)
   27F :== exists(X, F)
   28F :==  atmost(X, N, F)
   29F :== atleast(X, N, F)
   30F :== box F
   31F :== dia F
   32F :== cir F
   33F :== until(F, F)
   34
   35X :== VariableName
   36N :== Integer
   37*/
   38
   39symbol_declarations :-
   40	yadlr_concept( kb, team ),
   41	yadlr_concept( kb, sports_club ),
   42	yadlr_concept( kb, national_team ),
   43	yadlr_concept( kb, competition ),
   44	yadlr_concept( kb, world_cup_final ),
   45	yadlr_concept( kb, champions_league ),
   46	yadlr_concept( kb, uefa_cup ),
   47	yadlr_concept( kb, serieA ),
   48	yadlr_concept( kb, superleague ),
   49	yadlr_concept( kb, good ),
   50	yadlr_concept( kb, good_team ),
   51	yadlr_concept( kb, very_good_team ),
   52	yadlr_concept( kb, good_competition ),
   53	yadlr_instance( kb, panathinaikos ),
   54	yadlr_instance( kb, napoli ),
   55	yadlr_instance( kb, argentina ),
   56	yadlr_instance( kb, ec88 ),
   57	yadlr_instance( kb, ec92 ),
   58	yadlr_instance( kb, uefa89 ),
   59	yadlr_instance( kb, serieA87 ),
   60	yadlr_instance( kb, serieA88 ),
   61	yadlr_instance( kb, serieA89 ),
   62	yadlr_instance( kb, serieA90 ),
   63	yadlr_instance( kb, serieA91 ),
   64	yadlr_instance( kb, superleague91 ).
   65
   66
   67crisp_domain_axioms :-
   68	yadlr_assert( kb, all(X, dlimplies(sports_club(X), team(X)) ), 1.0 ),
   69	yadlr_assert( kb, all(X, dlimplies(national_team(X), team(X))), 1.0 ),
   70	yadlr_assert( kb, all(X, dlimplies(world_cup_final(X), competition(X))), 1.0 ),
   71	yadlr_assert( kb, all(X, dlimplies(champions_league(X), competition(X))), 1.0 ),
   72	yadlr_assert( kb, all(X, dlimplies(uefa_cup(X), competition(X))), 1.0 ),
   73	yadlr_assert( kb, all(X, dlimplies(serieA(X), competition(X))), 1.0 ),
   74	yadlr_assert( kb, all(X, dlimplies(superleague(X), competition(X))), 1.0 ),
   75	yadlr_assert( kb, all(X, dlimplies(dland(good(X),competition(X)), good_competition(X))), 1.0 ).
   76
   77domain_facts :-
   78	yadlr_assert( kb, ( national_team(argentina) ), 1.0 ),
   79	yadlr_assert( kb, ( sports_club(panathinaikos) ), 1.0 ),
   80	yadlr_assert( kb, ( sports_club(napoli) ), 1.0 ),
   81	yadlr_assert( kb, ( champions_league(ec88) ), 1.0 ),
   82	yadlr_assert( kb, ( champions_league(ec92) ), 1.0 ),
   83	yadlr_assert( kb, ( uefa_cup(uefa89) ), 1.0 ),
   84	yadlr_assert( kb, ( serieA(serieA87) ), 1.0 ),
   85	yadlr_assert( kb, ( serieA(serieA88) ), 1.0 ),
   86	yadlr_assert( kb, ( superleague(superleague91) ), 1.0 ),
   87	yadlr_assert( kb, ( good(serieA87) ), 0.8 ),
   88	yadlr_assert( kb, ( good(serieA88) ), 0.8 ),
   89	yadlr_assert( kb, ( good(serieA89) ), 0.8 ),
   90	yadlr_assert( kb, ( good(serieA90) ), 0.75 ),
   91	yadlr_assert( kb, ( good(uefa89) ), 0.9 ),
   92	yadlr_assert( kb, ( good(ec88) ), 0.95 ),
   93	yadlr_assert( kb, ( good(ec92) ), 0.95 ).
   94
   95relation_declarations :-
   96	yadlr_relation( kb, has_won ),
   97	yadlr_relation( kb, has_participated ).
   98	
   99relational_domain_axioms :-
  100	% good teams have won at least one competition
  101	yadlr_assert( kb, all(X, dlimplies(exists(Y,dland(good_competition(Y),has_won(X,Y))),
  102					   good_team(X)) ), 1.0 ).
  103
  104relational_domain_facts :-
  105	yadlr_assert( kb, ( has_participated(panathinaikos,superleague91) ), 1.0 ),
  106	yadlr_assert( kb, ( has_participated(panathinaikos,ec92) ), 1.0 ),
  107	yadlr_assert( kb, ( has_won(panathinaikos,superleague91) ), 1.0 ),
  108	yadlr_assert( kb, ( has_participated(napoli,serieA87) ), 1.0 ),
  109	yadlr_assert( kb, ( has_participated(napoli,serieA88) ), 1.0 ),
  110	yadlr_assert( kb, ( has_participated(napoli,serieA89) ), 1.0 ),
  111	yadlr_assert( kb, ( has_participated(napoli,serieA90) ), 1.0 ),
  112	yadlr_assert( kb, ( has_participated(napoli,ec88) ), 1.0 ),
  113	yadlr_assert( kb, ( has_participated(napoli,uefa89) ), 1.0 ),
  114	yadlr_assert( kb, ( has_won(napoli,serieA87) ), 1.0 ),
  115	yadlr_assert( kb, ( has_won(napoli,serieA90) ), 1.0 ),
  116	yadlr_assert( kb, ( has_won(napoli,uefa89) ), 1.0 ).
  117
  118extended_quantification_axioms :-
  119	% very good teams have won at least two competitions
  120	yadlr_assert( kb,
  121		      all(X,
  122			  dlimplies(exists(Y1,
  123					   exists(Y2,
  124						  dland(dland(dland(has_won(X,Y1),
  125								    good_competition(Y1)),
  126							      dland(has_won(X,Y2),
  127								    good_competition(Y2))),
  128							dlalldifferent([Y1,Y2]) ))),
  129				    very_good_team(X)) ), 1.0 )