Stacktraces in Package Trill

swipl 8.4.1, trill 6.0.3

Hi, I get Stack Traces in Package Trill:


:- use_module(library(trill)).


:- trill. % or :- trillp. or :- tornado.

classAssertion( smartphone, sm0815).

propertyAssertion( has, egon, sm0815).

equivalentClasses( [someValuesFrom( has, smartphone), smartperson]).

/*

(ins)?- instanceOf( smartperson, egon, E).
E = [equivalentClasses([someValuesFrom(has, smartphone), smartperson]), classAssertion(smartphone, sm0815), propertyAssertion(has, egon, sm0815)] ;
false.

(ins)?- axiom(A).
A = equivalentClasses([someValuesFrom(has, smartphone), smartperson]) ;
A = propertyAssertion(has, egon, sm0815) ;
A = classAssertion(smartphone, sm0815) ;
false.

(ins)?- property_value(has, egon, sm0815, E).
E = [propertyAssertion(has, egon, sm0815)] ;
false.

% now the interesting part:

(ins)?- property_value(has, sm0815, egon, E).
ERROR: Stack limit (1.0Gb) exceeded
ERROR:   Stack sizes: local: 0.8Gb, global: 0.1Gb, trail: 40.1Mb
ERROR:   Stack depth: 1,753,754, last-call: 0%, Choice points: 3,507,452
ERROR:   Possible non-terminating recursion:
ERROR:     [1,753,752] trill:ancestor1([length:1], [length:2], [length:2], _31595778)
ERROR:     [1,753,751] trill:ancestor1([length:1], [length:2], [length:2], _31595820)
   Exception: (1,753,753) trill:add_all_n([sm0815], [], _31595700) ? abort
% Execution Aborted

(ins)?- property_value(has, egon, egon, E).
ERROR: Stack limit (1.0Gb) exceeded
ERROR:   Stack sizes: local: 0.8Gb, global: 0.1Gb, trail: 41.8Mb
ERROR:   Stack depth: 2,738,385, last-call: 0%, Choice points: 2,738,367
ERROR:   Probable infinite recursion (cycle):
ERROR:     [2,738,382] trill:ancestor1([length:1], [length:2], [length:1], _32868790)
ERROR:     [2,738,381] trill:ancestor1([length:1], [length:2], [length:1], _32868832)
   Exception: (2,738,383) trill:add_all_n([egon], [egon], _32868718) ? abort
% Execution Aborted

(ins)?- property_value(has, sm0815, sm0815, E).
ERROR: Stack limit (1.0Gb) exceeded
ERROR:   Stack sizes: local: 0.9Gb, global: 74.0Mb, trail: 37.0Mb
ERROR:   Stack depth: 1,616,599, last-call: 0%, Choice points: 3,233,144
ERROR:   Probable infinite recursion (cycle):
ERROR:     [1,616,595] trill:ancestor1([length:2], [length:2], [length:2], _19407406)
ERROR:     [1,616,594] trill:ancestor1([length:2], [length:2], [length:2], _19407448)
   Exception: (1,616,597) trill:add_all_n([sm0815], [egon, sm0815], _19407334) ? abort
% Execution Aborted

*/

Thanks in advance,
Frank

Dear Frank,
thank you for your help. You have spotted another bug.

Now, it should work.

Riccardo

1 Like

Thank you very much, it is working.

Now also the following is functioning:


:- use_module(library(trill)).

:- trill. % or :- trillp. or :- tornado.

classAssertion( c_class, c).
classAssertion( b_class, b).
classAssertion( a_class, a).

propertyAssertion( is, a, b).

symmetricProperty( is).

equivalentClasses( [is_bclass, someValuesFrom( is, b_class)]).

equivalentClasses( [is_aclass, someValuesFrom( is, a_class)]).


/*

(ins)?- property_value( is, b, a). % old (wrong)
ERROR: Stack limit (1.0Gb) exceeded

(ins)?- property_value( is, b, a). % new (functioning)
true.

(ins)?- instanceOf( is_bclass, a).
true.

(cmd)?- instanceOf( is_aclass, b).
true.

*/

propertyAssertion( owns, a, b).

inverseProperties( owns, is_owned_by).

equivalentClasses( [owns_bclass, someValuesFrom( owns, b_class)]).

equivalentClasses( [is_owned_by, someValuesFrom( is_owned_by, a_class)]).


/*

(ins)?- property_value( is_owned_by, b, a). % old
ERROR: Stack limit (1.0Gb) exceeded
...

(ins)?- property_value( is_owned_by, b, a). % new
true.

(cmd)?- instanceOf(owns_bclass, a).
true.

(cmd)?- instanceOf(is_owned_by, b).
true.




*/


But I have still no clue how I get ‘transitiveProperty’ working. Can you provide an example?

Regards,
Frank.

Dear Frank,
if you update the code you can run the example transitive_property.pl.
It contains also axioms for testing symmetric properties.

With this file, queries such as

1 ?- property_value(tp,a,c,E).
2 ?- property_value(tp,c,a,E).
3 ?- property_value(tpi,c,a,E).
4 ?- property_value(tpi,a,c,E).

should return correct explanations.

1 Like

Thank you very much. The version number of trill is still 6.0.3 in the last 2 edits. Would it be possible to change the version number on the swipl server on every edit or to introduce an additional change number for unambiguousness?

Theoretically the commit id can change on several git operations. Git rebase for instance. So it is not a secure sign for a difference in the code. And it can vanish for the same reason. So it is not a unique reference for a specific version.

Regards,
Frank.

Done, now the version number is 6.0.4

Best regards,
Riccardo

1 Like