swipl 8.4.2, trill 6.0.2
Hi, in the example donvito.pl is defined:
:-use_module(library(trill)).
:- trill. % or :- trillp. or :- tornado.
/** <examples>
?- prob_instanceOf(goodPerson,donVito,Prob).
*/
classAssertion(cat, tom).
propertyAssertion(hasPet, donVito, tom).
subClassOf(cat, pet).
subClassOf(someValuesFrom(hasAnimal, pet), natureLover).
subClassOf(natureLover,goodPerson).
subPropertyOf(hasPet,hasAnimal).
annotationAssertion('disponte:probability',subClassOf(natureLover,goodPerson),literal('0.2')).
and I can ask:
(ins)?- sub_class(cat, pet).
true.
(ins)?- sub_class(cat, pet, Explanation).
Explanation = [subClassOf(cat, pet)] ;
false.
(ins)?- prob_sub_class(cat, pet, Prob).
Prob = 1.0.
So far so good.
But in the example commander.pl :
:-use_module(library(trill)).
:- trill. % or :- trillp. or :- tornado.
/** <examples>
?- instanceOf(commander,john,Expl).
*/
subClassOf(allValuesFrom(commands,soldier),commander).
classAssertion(guard,pete).
classAssertion(guard,al).
classAssertion(allValuesFrom(commands,guard),john).
equivalentClasses([guard,soldier]).
subPropertyOf(commands,commands1).
I can ask :
(ins)?- sub_class(allValuesFrom(commands,soldier),commander).
true.
(cmd)?- sub_class(soldier,commander).
true.
(ins)?- sub_class(commands,commander).
true.
(ins)?- sub_class(allValuesFrom(commands,soldier),commander, Explanation).
Explanation = [subClassOf(allValuesFrom(commands, soldier), commander)] ;
false.
(cmd)?- sub_class(commands,commander, Explanation).
false. % wrong?
(ins)?- sub_class(soldier,commander, Explanation).
false. % wrong?
(ins)?- prob_sub_class(allValuesFrom(commands,soldier),commander, Prob).
Prob = 1.0.
(cmd)?- prob_sub_class(commands,commander, Prob).
Prob = 0.0. % wrong?
(ins)?- prob_sub_class(soldier,commander, Prob).
Prob = 0.0. % wrong?
Tthe same in : review_example.pl
:- use_module(library(trill)).
:- trill.
subClassOf(a,f).
subClassOf(f,b).
subClassOf(a,unionOf([b,c,d])).
subClassOf(a,minCardinality(5,r)).
subClassOf(c,maxCardinality(4,r)).
subClassOf(d,maxCardinality(3,r)).
% query: sub_class(a,b).
I can ask:
(cmd)?- sub_class(a, d).
true.
(ins)?- sub_class(a, unionOf([b,c,d])).
true.
(ins)?- sub_class(a, unionOf([b,c,d]), E).
E = [subClassOf(a, unionOf([b, c, d]))] ;
E = [subClassOf(a, f), subClassOf(f, b)] ; % 1 term missing
false.
(cmd)?- sub_class(a, d, E).
false. % wrong ?
(cmd)?- sub_class(a, b, E).
E = [subClassOf(a, f), subClassOf(f, b)] ;
false.
(ins)?- prob_sub_class(a, b, P).
P = 1.0.
(ins)?- prob_sub_class(a, unionOf([b,c,d]), P).
P = 1.0.
(cmd)?- prob_sub_class(a, d, P).
P = 0.0. % wrong?
And you can see some unexpected answers.
Is that a bug?
Regards,
Frank.