# Stacktraces in Package Trill

**URL:** <https://swi-prolog.discourse.group/t/stacktraces-in-package-trill/5247>\
**Category:** Pack\
**Tags:** bug\
**Created:** [April 8, 2022, 4:31pm UTC](https://swi-prolog.discourse.group/t/stacktraces-in-package-trill/5247 "2022-04-08T16:31:58Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Frank\_Schwidom](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/frank_schwidom/32/7662_2.png) [@Frank\_Schwidom](https://swi-prolog.discourse.group/u/Frank_Schwidom)\
**Post date:** [April 8, 2022, 4:31pm UTC](https://swi-prolog.discourse.group/t/stacktraces-in-package-trill/5247/1 "2022-04-08T16:31:58Z")

</div>

swipl 8.4.1, trill 6.0.3

Hi, I get Stack Traces in Package Trill:

```prolog

:- 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

---

<div class="post-metadata">

**Author:** ![zsercr](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/zsercr/32/4329_2.png) [@zsercr](https://swi-prolog.discourse.group/u/zsercr)\
**Post date:** [April 11, 2022, 12:23pm UTC](https://swi-prolog.discourse.group/t/stacktraces-in-package-trill/5247/2 "2022-04-11T12:23:17Z")

</div>

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

Now, it should work.

Riccardo

---

<div class="post-metadata">

**Author:** ![Frank\_Schwidom](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/frank_schwidom/32/7662_2.png) [@Frank\_Schwidom](https://swi-prolog.discourse.group/u/Frank_Schwidom)\
**Post date:** [April 11, 2022, 9:19pm UTC](https://swi-prolog.discourse.group/t/stacktraces-in-package-trill/5247/3 "2022-04-11T21:19:56Z")

</div>

> [@zsercr](#):
>
> Now, it should work.

Thank you very much, it is working.

Now also the following is functioning:

```prolog

:- 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.

---

<div class="post-metadata">

**Author:** ![zsercr](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/zsercr/32/4329_2.png) [@zsercr](https://swi-prolog.discourse.group/u/zsercr)\
**Post date:** [April 13, 2022, 8:20am UTC](https://swi-prolog.discourse.group/t/stacktraces-in-package-trill/5247/4 "2022-04-13T08:20:36Z")

</div>

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

```prolog
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.

---

<div class="post-metadata">

**Author:** ![Frank\_Schwidom](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/frank_schwidom/32/7662_2.png) [@Frank\_Schwidom](https://swi-prolog.discourse.group/u/Frank_Schwidom)\
**Post date:** [April 13, 2022, 10:44am UTC](https://swi-prolog.discourse.group/t/stacktraces-in-package-trill/5247/5 "2022-04-13T10:44:31Z")

</div>

> [@zsercr](#):
>
> should return correct explanations.

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.

---

<div class="post-metadata">

**Author:** ![zsercr](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/zsercr/32/4329_2.png) [@zsercr](https://swi-prolog.discourse.group/u/zsercr)\
**Post date:** [April 13, 2022, 12:03pm UTC](https://swi-prolog.discourse.group/t/stacktraces-in-package-trill/5247/6 "2022-04-13T12:03:46Z")

</div>

Done, now the version number is 6.0.4

Best regards,  
Riccardo
