Trealla items

Trealla Prolog, Current

Unexpected. Deleted, no longer relevant, inserted.

See source for modification dates.

$ make OPT=-std=gnu99
75: * non-conforming read-options trealla#329
variable_names#47
74: * dif/2 incomplete trealla#403
?- A=A*C,B=A*A,dif(A,B),C=1.
   false, unexpected.
73: * dif/2 unsound trealla#400
?-          A=A*B,B=C*C,B=C,dif(A,B).
   false.
?- dif(A,B),A=A*B,B=C*C,B=C.
   A = A*(C*C), B = C*C, C = C*C, unexpected, unsound.
72: * dif/2 answers not shown, redundant constraint
?- dif(A,B),A=B*[],B=A*B.
   A = B*[], unexpected. % missing B = ...
?- A=B*[],B=A*B,dif(A,B).
   A = B*[], dif:dif(B*[],B*[]*B), unexpected. % and missing B = ...
71: * dif/2 sometimes no residuals trealla#394
?- [issue394].
   true.
?- ti(G=Rs).
   G = (dif(_A,_B),_B=[]*[],_A=[]*_C), Rs = [0], unexpected
;  G = (_A=[]*[],_B=[]*_C,dif(_B,_A)), Rs = [1].
?- ti(G=Rs), G.
   G = (dif([]*_A,[]*[]),[]*[]=[]*[],[]*_A=[]*_A), Rs = [0] % plus missing dif
;  G = ([]*[]=[]*[],[]*_A=[]*_A,dif([]*_A,[]*[])), Rs = [1]. % missing dif
70: * dif/2 incomplete trealla#393
?-           A=C*B, C = c, B = b, dif(A,B).
   A = c*b, C = c, B = b.
?- dif(A,B), A=C*B, C = c, B = b.
   false, unexpected.
69: * dif/2 incomplete for simpler case
?- A=B*A,dif([],A).
   A = B*A.
?- dif([],A),A=B*A.
   false, unexpected, incomplete.
68: * clpz broken cont. trealla#339
?- A+B#=C.
   false, unexpected.
67: * dif/2 and trees incorrect
?-           L=A*L,L=L*A,A=a.
   false.
?- dif([],A),L=A*L,L=L*A,A=a.
   A = a, L = a*L, unexpected.
   false.
66: * clpz loops
Trealla Prolog (c) Infradig 2020-2023, v2.27.60
?- findall(t,(B in 0..1,(B=0;B=1),A#>B,v(A,B)=v(1,0)),C).
   loops, unexpected.
65: * dif/2, findall/3 spurious instantiation_error trealla#354
?- findall(t,(dif([],A),[]*[]=A*a),Res).
   Res = []
;   error(instantiation_error,callable), unexpected.
64: * dif/2 incomplete trealla#353
?- dif([],A),L=[]*a,L=B*A.
   false, unexpected, incomplete.
   A = a, L = []*a, B = []. % expected, but not found
63: * dif/2 and trees broken, top level broken trealla#350
?- dif(A,[]),A=B*A.
   A = B*(B*(B*(B*(B*(B*(B*(B*(B*(B*(B*(B*(B*(B*(B*(B*(B*(B*(B* ...)))))))))))))))))), % good so far
   dif:dif(B*(B*(B* ...(B*(*()))... ))). % unexpected, bad syntax, too deep
Full text now:
?- dif(A,[]),A=B*A.
   A = B*A, dif:dif(B*(B*A),[]), unexpected.
   A = B*A.  % expected, but not found
62: * clpz broken trealla#339
?- [A,B] ins 0..1,A#= -B.
   false, unexpected, incomplete.
?- A=0, [A,B] ins 0..1,A#= -B.
   A = 0, B = A  % good
;  false, unexpected. % determinism expected
   A = 0, B = A. % perfect

?- A in 0..1, A#= -B.
   clpz:(-1*B#=A),clpz:(A in 0..1),clpz:(B in -1..0) % good
;  false, unexpected.
   clpz:(-1*B#=A),clpz:(A in 0..1),clpz:(B in -1..0).
?- A in 0..1, A#= -B, B in 0..1.
   A = 0, B = A
;  false, unexpected.
   A = 0, B = A.
?- A in 0..1,         B in 0..1, A#= -B.
   false, unexpected, incomplete.
?- A in 0..1,         B in 0..1, A #= -B, A = 0, B = 0.
   false, unexpected, incomplete.
   A = 0, B = 0. % expected, but not found
2.27.21
61: * Unification broken IX trealla#328
?- A=B,A=A*1,B=B*B.
   false.
?-     A=A*1,B=B*B,A=B.
   A = ... * ... * 1*1*1*1*1*1*1*1*1*1*1*1*1*1*1*1*1*1, B = 1, unexpected.
   false. % expected, but not found
(Same as Item#55) Still in 2.27.21
2.26.0
60: * set_prolog_flag/2 as directive ignored trealla#327
?- [user].
:- set_prolog_flag(occurs_check,true).
   true.
?- current_prolog_flag(occurs_check,V).
   V = false, unexpected.
59: * Occurs-check error disabled trealla#326
?- [user].
p(X,X).

   true.
?- set_prolog_flag(occurs_check,error).
   true.
?- A=f(A).
   error(representation_error(term),(=)/2).
?- p(A,f(A)).
   false, unexpected.
58: * Unification broken VIII trealla#325
v2.25.29
?- A=B,A=B*1,B=B*A*B,A=B.
   false.
?- set_prolog_flag(answer_write_options,[max_depth(2)]).
   true.
?-     A=B*1,B=B*A*B,A=B.
   A = ... * ... * 1,
   B = ... * ... * ( ... * ...), unexpected.

57: * set_prolog_flag/2 wrong errors trealla#324
?- set_prolog_flag(answer_write_options, non_list).
   error(type_error(list,non_list),set_prolog_flag/2), unexpected.
   domain_error(flag_value, answer_write_options+non_list). % 8.17.1.3 e
?- set_prolog_flag(answer_write_options, double_quotes(ummy)).
   error(type_error(atomic,double_quotes(ummy)),set_prolog_flag/2), unexpected.
   domain_error(flag_value, answer_write_options+double_quotes(ummy)).
?- set_prolog_flag(answer_write_options, [double_quotes(ummy)]).
   error(domain_error(flag_value,double_quotes(ummy)),set_prolog_flag/2), unexpected.
   domain_error(flag_value, answer_write_options+double_quotes(ummy)).
Use the second argument of error/2 in case more specific errors are desired.
56: * Odd answer write options trealla#323
?- current_prolog_flag(answer_write_options,Opts).
   Opts = [max_depth(19),quoted(ummy),double_quotes(ummy)], unexpected.
55: * Unification broken VII, shorter trealla#322
reflist v2.25.18-54-g065a2
?- A=B,A=A*1,B=B*B,A=B.
   false.
?-     A=A*1,B=B*B,A=B.
   A = ... * ... * 1*1*1*1*1, B = 1, unexpected.
54: * Unification loops trealla#321
reflist cost: 5:32
?- B=C*(A*B),A=B*B,A=B.
   loops, unexpected.
?- B=C*(A*B),A=B*B,A=B, false.
   loops, unexpected.
   false. % expected, but not found
?- B=B*(A*B),A=B*B,A=B.
   B = ... * ... * ( ... * ...)*( ... * ... * ( ... * ...))*( ... * ... * ( ... * ...)*( ... * ... * ( ... * ...))),
   A = ... * ... * ( ... * ...)*( ... * ... * ( ... * ...))*( ... * ... * ( ... * ...)*( ... * ... * ( ... * ...))), unclear.
   false, unexpected. % would be unexpected
?- B=B*(A*B),A=B*B,A=B, A == B.
   false, unexpected.
?- time((B=B*(A*B),A=B*B,A=B,false)).
% Time elapsed 0.514s, 5 Inferences, 0.000 MLips
   false.
?- B+A+A=_*(A*B)+B*B+B.
   loops, unexpected.
Still open:
?- \+ \+ ( B=B*(A*B),A=B*B,A=B ).
   true.
?- \+ \+ ( B=B*(A*B),A=B*B,A=B, A == B ).
   false, unexpected.
Now incorrect
?- \+ \+ ( B=B*(A*B),A=B*B,A=B ).
   false, unexpected.
   true.
53: * Unification broken VI trealla#320
reflist cost: 53:14 edift-nth(4:109939449)
?- A=B,C=A*1,A=B*A,B=B*C*A,A=B.
   false.
?- C=A*1,A=B*A,B=B*C*A,A=B.
   C = ... * ... * ( ... * ...)*1,
   A = ... * ... * ( ... * ...)*( ... * ... * ( ... * ...)),
   B = ... * ... * ( ... * ...)*( ... * ... * ( ... * ...)), unexpected.
?- C=A*1,A=B*A,B=B*C*A,A=B, A == B.
   false.
?- set_prolog_flag(answer_write_options,[max_depth(4)]).
   true.
?- C=A*1,A=B*A,B=B*C*A.
   C = ... * ... * ( ... * ...)*( ... * ... * ( ... * ...))*1,
   A = ... * ... * ( ... * ...)*( ... * ... * ( ... * ...))*( ... * ... * ( ... * ...)*( ... * ... * ( ... * ...))),
   B = ... * ... * ( ... * ...)*           ( ... * ... * 1)*( ... * ... * ( ... * ...)*( ... * ... * ( ... * ...))), unclear.
   false, unexpected. % would there be failure, then this would be unexpected
?- C=A*1,A=B*A,B=B*C*A, A = B.
   C = ... * ... * ( ... * ...)*( ... * ... * ( ... * ...))*1,
   A = ... * ... * ( ... * ...)*( ... * ... * ( ... * ...))*( ... * ... * ( ... * ...)*( ... * ... * ( ... * ...))),
   B = ... * ... * ( ... * ...)*           ( ... * ... * 1)*( ... * ... * ( ... * ...)*( ... * ... * ( ... * ...))), unexpected.
52: * Unification broken V trealla#319
reflist v2.25.18-23-g1504 (not in main)
?- set_prolog_flag(answer_write_options,[max_depth(2)]).
   true.
?- A=B,B=B*A*A,A=B*1,A=B.
   false.
?-     B=B*A*A,A=B*1,A=B.
   B = ... * ... * ( ... * ...),
   A = ... * ... * 1, unexpected.
51: * Answer write options somehow incomplete trealla#317
?- current_prolog_flag(N,V), V = [_|_].
   N = answer_write_options, V = [max_depth(19),quoted(true)], unexpected.
?- L = [a,b,c].
   L = "abc". % ok only with double_quotes(true)
?- write_term([a,b,c],[max_depth(19),quoted(true)]).
[a,b,c]   true.
?- write_term([a,b,c],[max_depth(19),quoted(true),double_quotes(true)]).
"abc"   true.
50: * Unification broken IV trealla#316
v2.25.18-22-g0370
?- A=B,A=B*1,A=1*1*1.
   A = ... * ... * 1*1*1*1*1*1*1*1*1*1*1*1*1*1*1*1*1*1,
   B = ... * ... * 1*1*1*1*1*1*1*1*1*1*1*1*1*1*1*1*1*1, unexpected.
49: * Syntax: too many round brackets in tail trealla#318
?- writeq([a|\+1]).
[a|(\+1)]   true.
48: * Unification broken III trealla#315
?- set_prolog_flag(answer_write_options,[max_depth(2)]).
   true.
?- A=B,A=B*1,B=B*A*B,A=B.
   false.
?-     A=B*1,B=B*A*B,A=B.
   A = ... * ... * 1,
   B = ... * ... * ( ... * ...), unexpected.
?- A=B,A+B=B*1+B*A*B.
   false.
?-     A+B=B*1+B*A*B.
   A = ... * ... * 1,
   B = ... * ... * ( ... * ...).
?-     A+B=B*1+B*A*B,A=B.
   A = ... * ... * 1,
   B = ... * ... * ( ... * ...), unexpected.
With branch reflist v2.25.18-17-gce4a
?- A=B,B=B*A*A,A=B*1,A=B.
   false.
?-     B=B*A*A,A=B*1,A=B.
   B = ... * ... * ( ... * ...),
   A = ... * ... * 1, unexpected.
?-     A=B*1,B=B*A*A,A=B.
   false.
(still broken in main not in reflist)
47: * max_depth/1 leaks representation trealla#314
?- set_prolog_flag(answer_write_options,[max_depth(1)]).
   true.
?- A = [a,b,c].
   A = "ab|...", unexpected.
   A = [a|...]
|  % alternative from Ciao
   A = "a"||... .
?- A = "abc".
   A = "abc", unexpected.
   A = [a|...]
|  % alternative from Ciao
   A = "a"||... .
?- A = [1,2,3].
   A = [1|...].
Ciao: A possible more compact syntax for partial strings.
46: * Unification broken II trealla#312
Trealla Prolog (c) Infradig 2020-2023, v2.25.15
?- A=B,A=B*1,B=B*A*A,A=B.
   false.
?-     A=B*1,B=B*A*A,A=B.
   A = ... * ... * ( ... * ...)*( ... * ... * 1)*( ... * ... * ( ... * ...)*1)*( ... * ... * ( ... * ...)*( ... * ... * 1)*1)*( ... * ... * ( ... * ...)*( ... * ... * 1)*( ... * ... * ( ... * ...)*1)*1)*( ... * ... * ( ... * ...)*( ... * ... * 1)*( ... * ... * ( ... * ...)*1)*( ... * ... * ( ... * ...)*( ... * ... * 1)*1)*1)*( ... * ... * ( ... * ...)*( ... * ... * 1)*( ... * ... * ( ... * ...)*1)*( ... * ... * ( ... * ...)*( ... * ... * 1)*1)*( ... * ... * ( ... * ...)*( ... * ... * 1)*( ... * ... * ( ... * ...)*1)*1)*1)*1,
   B = ... * ... * ( ... * ...)*( ... * ... * 1)*( ... * ... * ( ... * ...)*1)*( ... * ... * ( ... * ...)*( ... * ... * 1)*1)*( ... * ... * ( ... * ...)*( ... * ... * 1)*( ... * ... * ( ... * ...)*1)*1)*( ... * ... * ( ... * ...)*( ... * ... * 1)*( ... * ... * ( ... * ...)*1)*( ... * ... * ( ... * ...)*( ... * ... * 1)*1)*1)*( ... * ... * ( ... * ...)*( ... * ... * 1)*( ... * ... * ( ... * ...)*1)*( ... * ... * ( ... * ...)*( ... * ... * 1)*1)*( ... * ... * ( ... * ...)*( ... * ... * 1)*( ... * ... * ( ... * ...)*1)*1)*1)*( ... * ... * ( ... * ...)*( ... * ... * 1)*( ... * ... * ( ... * ...)*1)*( ... * ... * ( ... * ...)*( ... * ... * 1)*1)*( ... * ... * ( ... * ...)*( ... * ... * 1)*( ... * ... * ( ... * ...)*1)*1)*( ... * ... * ( ... * ...)*( ... * ... * 1)*( ... * ... * ( ... * ...)*1)*( ... * ... * ( ... * ...)*( ... * ... * 1)*1)*1)*1), unexpected.
?- set_prolog_flag(answer_write_options,[max_depth(2)]).
   true.
?- A=B*1,B=B*A*A,A=B.
   A = ... * ... * 1,
   B = ... * ... * ( ... * ...), unexpected.
45: * Unification broken trealla#309
Trealla Prolog (c) Infradig 2020-2023, v2.23.47
?- A=B,A+B+C=C*2+A*2+C*1*2,A=B.
   false.
?-     A+B+C=C*2+A*2+C*1*2,A=B.
   A = ... * ... * 2*1*2*1*2*1*2*2,
   B = ... * ... * 1*2*1*2*1*2*2*2,
   C = ... * ... * 1*2*1*2*1*2*1*2, unexpected.
edift-nth(4:101988473)
Last version that correctly failed was v2.20.16. Fixed in v2.25.15
44: * Repeated deletion of comments
Due to the repeated deletion of comments on GitHub 2023-07-23, GitHub will no longer be used for reporting errors in Trealla.
2.21.11
2.21.8
43: * Syntax: invalid writing trealla#236
#18:
?- writeq('\033\').
'\e'   true.
?- write_canonical('\033\').
'\e'   true.
?- writeq('\e').
'\e'   true.
As a consequence, Trealla writes Prolog text that cannot be read by standard conforming processors.
2.21.7
42: * setof/3 incorrect trealla#233
?- L=[_,_,_], setof(t,member(E,L),_).
   L = [_,_,_], E = _, unexpected, unsound.
   L = [E,_A,_B]
;  L = [_A,E,_B]
;  L = [_A,_B,E]
|  other_answer_sequence. % expected but not found
?- setof(t,(A=E;B=E;C=E),_).
   E = A, B = E, C = E, unexpected, incomplete.
   A = E
;  B = E
;  C = E
|  other_answer_sequence.  % expected but not found
2.21.4
41: * portray_clause/1 stateful numbering of variables trealla#220
?- (N=0;N=1;N=3),length(_,N),length(E,2),portray_clause(E),false.
[A,B].
[B,C]. % unexpected, expected as above
[D,E]. % idem
   false.
Also
?- use_module(library(format)).
   true.
?- (N=0;N=1;N=3),length(_,N),length(E,2),phrase(portray_clause_(E),Xs).
   N = 0, E = [_A,_B], Xs = "[_22,_26]|...", unexpected
;  N = 1, E = [_A,_B], Xs = "[_26,_30]|...", unexpected
;  N = 3, E = [_A,_B], Xs = "[_34,_38]|...", unexpected.
while Scryer gives:
?- (N=0;N=1;N=3),length(_,N),length(E,2),phrase(portray_clause_(E),Xs).
   N = 0, E = [_A,_B], Xs = "[A,B].\n"
;  N = 1, E = [_A,_B], Xs = "[A,B].\n"
;  N = 3, E = [_A,_B], Xs = "[A,B].\n".
2.20.23
40: * Unexpected additional initialization error trealla#217
ulrich@p0:~/ftp/trealla-prolog$ /opt/gupu/new-trealla/tpl -f item40.pl -g halt
Warning: call(c=c,a=a) failed  unexpected
Warning: call(\+ (ti(_3,_4),_3)) failed
The second warning is fine, but the first is not. Where does it come from? And sometimes (with another program text) only the first warning is shown. And here another variation that loops:
ulrich@p0:~/ftp/trealla-prolog$ /opt/gupu/new-trealla/tpl -f item40b.pl -g halt
loops, unexpected
2.21.0
2.20.22
39: * dif/2 incorrect with cyclic trees trealla#216
ti(G_0,(A_0,B_0, Dif_0)) :-
    G_0 = (Dif_0, A_0,B_0),
    Dif_0 = dif(_,_),
	 skel(A_0),
	 skel(B_0),
    f(G_0).

f((dif(A,B),A=B*A,B=A*_C)).

skel(_=_*_).

?- ti(G_0,_),G_0.
   G_0 = (dif(_A*(_A*_B),_A*_B*_C),_A*_B*_C*(_B*_C*_B)=_B*_C*_B*_C*(_A*_B*_C*(_B*_C*_B)),_B*_C*_B*_C=_A*_B*_C*(_B*_C*_B)*_C).
?- ti(_,R_0),R_0.
   false, unexpected, incomplete.
38: * Version number noisy and unreliable
Currently, you are producing many versions per day, but still there are also intermediate versions. It so just happend with *.21. This renders the version numbers useless. They only fill up the notification box, so I will turn it off, if this does not stop. Instead, git describe should give a combination of an official version number plus some counting integer plus a couple of hash bits just to be safe. The least noise inducing way to get updates is git pull && make && ./tpl
2.20.21
37: * (==)/2 incorrect with cyclic trees trealla#214
?- C=[],A=[A|C],B=[A|A],A=B.
   false.
?- C=[],A=[A|C],B=[A|A],A==B.
   C = [], A = [A], B = [[A],A|C], unexpected.
?- C=[],A=[A],  B=[A|A],A==B.
   false.
36: * dif/2 incorrect with cyclic trees trealla#213
?- dif(A,B),A=[A|C],B=[A|A].
   A = [A|C], B = [[A|C],A|C], dif:dif(_A,_B).
?-          A=[A|C],B=[A|A],dif(A,B).
   false, unexpected, incomplete.
2.20.20
35: * dif/2 loops with cyclic trees trealla#212
?- dif(A,B),A=[A|A],B=[B|B].
   loops, unexpected.
Haven't we had this already?
2.20.18
34: * Top level syntax: .% not recognized as end token trealla#211
?- dif(1,2).%.
Error: syntax error, incomplete, user:1
   true.
?- dif(X,1).%.
   dif(X,1).
   dif(X,1).
2.20.15
33: * Unreliable NSTO-unifications trealla#209
ti(G_0, (A_0,B_0,C_0)) :-
   G_0 = (C_0,A_0,B_0),
   C_0 = unify_with_occurs_check(_,_),
   skel(A_0),
   skel(B_0),
   f(G_0).

f((unify_with_occurs_check(A,B),unify_with_occurs_check(A,[]*C),unify_with_occurs_check(C,B*_D))).

skel(unify_with_occurs_check(_,_*_)).
?- ti(G_0,_),G_0.
   false.
?- ti(_,R_0),R_0.
   R_0 = (unify_with_occurs_check([]*([]*_A*_A),[]*([]*(_B*_A)*_A)),unify_with_occurs_check([]*(_B*_A)*_A,[]*([]*_A*_A)*_A),unify_with_occurs_check([]*(_B*_A),[]*(_B*_A))), unexpected.
Again, we have three goals this time without any cyclic trees, so only terms are involved. Therefore, this problem must be related to the structure sharing representation only.
32: * dif/2: Redundant constraint trealla#208 iso-prolog/dif#21
?- dif([],A), A = [B].
   A = [B], dif([],[B]), unexpected.
?- dif(Nihil,[B]).
   dif(Nihil,[B]).
?- dif(Nihil,[B]), Nihil = [].
   Nihil = [], dif([],[B]), unexpected.
suggested solution
31: * Cyclic tree unification loops trealla#206
?- A=B*A,B=B*A*B,A=B.
   loops, unexpected.
v2.20.13
30: * Cyclic tree unification with another unwanted OOPS... trealla#205
?- _0=_1* [],_1=_1* [] * [],_0=_1.
*** OOPS src/unify.c 1262
   error(representation_error(term),(=)/2), unexpected.
(Using your currrent portray_clause/1 ...)
29: * Cyclic tree unification with unwanted OOPS and unwanted representation error trealla#202
?-  A=B*A,A=B*B*B.
*** OOPS src/unify.c 1267
   error(representation_error(term),(=)/2), unexpected.
28: * can_be/2 incorrect trealla#201
27: * Cyclic tree unification loops in the presence of call_residue_vars/2 trealla#200
?- A=[A|B],B=[A,B|B],A=B, false.
   sto, false.
?- call_residue_vars((A=[A|B],B=[A,B|B],A=B, false),Vs), false.
   loops, unexpected.
v2.20.8
26: * Cyclic tree unification incorrect trealla#198
?-     A=[A|A],A=[B,A].
   false.
?- A=B,A=[A|A],A=[B,A].
   A = [A|A], B = A, unexpected, unsound.
25: * Top level: wrong naming of variables trealla#197
ti(A=A).

?- ti(G_0).
   G_0 = (G_0=G_0), unexpected.
(This used to be an incorrect program with dif/2...)
24: * Unreliable binding of variables trealla#195
Two goals are essentially the same, the three unifications are only differently arranged.
ti(G_0, R_0) :-
   G_0 = (A_0,B_0,C_0),
   R_0 = (B_0,C_0,A_0),
   A_0 = unify_with_occurs_check(_,_),
   skel(B_0),
   skel(C_0),
   g(G_0).

g((unify_with_occurs_check(A,B),unify_with_occurs_check(A,[B|C]),unify_with_occurs_check(C,[B|_]))).

skel(unify_with_occurs_check(_,[_|_])).

?- ti(G_0,R_0).
   G_0 = (unify_with_occurs_check(_A,_B),unify_with_occurs_check(_A,[_B|_C]),unify_with_occurs_check(_C,[_B|_C])),
   R_0 = (unify_with_occurs_check(_A,[_B|_C]),unify_with_occurs_check(_C,[_B|_C]),unify_with_occurs_check(_A,_B)).
?- ti(G_0,R_0), G_0.
   false.
?- ti(G_0,R_0), R_0.
   G_0 = (unify_with_occurs_check([[_A,_A|_B]|_B],[_A|_B]),unify_with_occurs_check([[_A|_B]|_B],[[[_A|_B]|_B]|_B]),unify_with_occurs_check([[_A|_B]|_B],[[[_A|_B]|_B]|_B])),
   R_0 = G_0,
   unexpected.
And, on a second reading of above it's worse!
?- ti(G_0,_).
   G_0 = (  unify_with_occurs_check(_A,_B),
            unify_with_occurs_check(_A,[_B|_C]),
            unify_with_occurs_check(_C,[_B|_C])), unexpected. % should be a _D
?- ti((_,_,C_0),_).
   C_0 = unify_with_occurs_check(C_0,[_A|_B]), unexpected.
Below is the correct interaction with Scryer:
?- ti(G_0,_).
   G_0 = (unify_with_occurs_check(_A,_B),unify_with_occurs_check(_A,[_B|_C]),unify_with_occurs_check(_C,[_B|_D])).
?- ti(G_0,_),G_0.
   false.
?- ti(_,R_0),R_0.
   false.
?- ti((_,_,C_0),_).
   C_0 = unify_with_occurs_check(_A,[_B|_C]).

Unfixed in v2.20.8.
These are all solved, but the following problem remains trealla#207
?- ti(G_0,_).
   G_0 =
   (unify_with_occurs_check(_A,_B),unify_with_occurs_check(_A,[_B|_C]),unify_with_occurs_check(_D,[_B|_E])), unexpected.
?- ti((_,B_0,C_0),_).
   B_0 = unify_with_occurs_check(_A,[_B|_C]),
   C_0 = unify_with_occurs_check(_C,[_B|_D]). % here OK
?- g((A_0,B_0,C_0)).
   A_0 = unify_with_occurs_check(_A,_B),
   B_0 = unify_with_occurs_check(_A,[_B|_C]),
   C_0 = unify_with_occurs_check(_C,[_B|_D]). % perfect
?- g(G_0).
   G_0 = ( unify_with_occurs_check(_A,_B),
           unify_with_occurs_check(_A,[_B|_C]),
           unify_with_occurs_check(_A,[_B|_D])
         ), unexpected.
23: * unify_with_occurs_check/2 loops trealla#194
?- unify_with_occurs_check(A,[[[]]|A]).
   loops, unexpected, non_conforming.
   false. % expected
22: * Cyclic tree unification loops IV trealla#192
?- A=[[]|B],B=[[],[]|B],A=B, false.
   loops, unexpected.
21: * Cyclic tree unification loops III trealla#191
?- dif(A,B),A=[A|A],B=[B|B].
   loops, unexpected.
?- A=[A|A],B=[B|B].
   loops, unexpected.
20: * Cyclic tree unification loops II trealla#189
?- A=[A|A],B=[A|B], A=B, false.
   loops, unexpected.
?- A=[A|A],B=[A|B], false.
   false. % good
?- A=[A|A],B=[A|B].
   loops, unexpected. % seems to be a top level problem
19: * Top level: underscore in dif/2 leads to invalid answer
?- dif([],A), A = [[]|B].
   A = [[]|B], dif([],[[]|B]).
?- dif([],A), A = [[]|_].
   A = [[]|_A], .
18: * dif/2 loops and cannot be interrupted trealla#185
$ /opt/gupu/new-trealla/tpl -f
Trealla Prolog (c) Infradig 2020-2023, v2.19.7
?- dif([],A),A=[[]|B].
   A = [[]|B], dif([],[[]|B]).
?- dif([],A),A=[[]|B], B=[[]|A].
   sto, loops, unexpected.  % and cannot be interrupted

One clarification. The problem is not infinite trees, but already:
?- dif([],A), A = [[]|B].
   A = [[]|B], dif([],[[]|B]), unexpected.
   A = [[]|B]. % expected, but not found
For this the followup is Item#32
17: A Top level: unexpected false
?- X=1;X=2.
   X = 1
;  ... .
 false.
16: * Unusual initialization file
In the past, .tplrc was the initialization file. But now a suffix .pl, .pro, or .prolog is needed. In other systems like SICStus it is just .sicstusrc. Also, strace reveals
ulrich@p0:/tmp$ strace -e file  /opt/gupu/new-trealla/tpl
execve("/opt/gupu/new-trealla/tpl", ["/opt/gupu/new-trealla/tpl"], [/* 70 vars */]) = 0
...
lstat("/opt/gupu/new-trealla/tpl", {st_mode=S_IFREG|0775, st_size=2431091, ...}) = 0
getcwd("/tmp", 4096)                    = 5
lstat("/tmp/~", 0x7ffe3ec45bc0)         = -1 ENOENT (No such file or directory)
lstat("/home", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat("/home/ulrich", {st_mode=S_IFDIR|0755, st_size=32768, ...}) = 0
lstat("/home/ulrich/.tplrc.pl", 0x7ffe3ec45bc0) = -1 ENOENT (No such
file or directory)
...
Why is this /tmp/~ looked at?
15: * Cyclic tree unification loops trealla#179
?- A=[A|A],A=[A].
   sto, loops, unexpected.
   sto, false. % expected, but not obtained
14: * dif/2 with trees incorrect
?- -X+ -Y=X+Y.
   X = -X, Y = X.
?- -X+ -Y=X+Y, dif(X,Y).
   false.
?- dif(X,Y), -X+ -Y=X+Y.
   X = -X, Y = X, unexpected.
?- dif(X,Y), -X=X,-Y=Y.
   X = -X, Y = X, unexpected.
?- dif(X,Y), -X=X.
   X = -X, dif(_A,_B), unexpected, unsound. % trealla#210
   X = - - - - - - - - - ...,  unexpected.  % missing dif/2
   X = -X, dif(X,Y). % expected, but not found
?- -X=X, dif(X,Y), -Y=Y.
   X = -X, Y = X, unexpected.
?- -X=X, -Y=Y, dif(X,Y).
   false.
13: * Syntax: quoted atom not recognized
#213 does not work both at the toplevel and with read/1. There are probably many more cases in above table.
2.4.12 2022-10-17
2.0.19 2022-08-23
2.0.16 2022-08-21
12: * nth0/3 incorrect trealla#25
?- nth0(N, [[]|Es], Es), ground(Es).
   N = 0, Es = []
;  N = 2, Es = [2|2], unexpected
;  ... .
11: * must_be/2 further errors trealla#18
?- L=[a|L], must_be(chars,L).
   error(type_error(character,[a|_1]),must_be/2), unexpected.
   type_error(list, _).  % expected
?- L=[_], must_be(chars,L).
   error(type_error(character,[_2]),must_be/2), unexpected.
   instantiation_error.  % expected
?- L=[1|L], must_be(chars,L).
   error(type_error(character,[1|_1]),must_be/2),  unexpected.
   type_error(character,1)
|  type_error(list,_).      % one of both expected
2.0.14
10: * Syntax: Underscores in numbers
Trealla currently supports spaces and underscores in numbers. In the past, we had several approaches: SWI, WG17 proposal, Richard O'Keefe's revision. Trealla has, however, its own way of doing this:
?- number_chars(N,"1 _0").
   N = 10, unexpected. % none proposes this
   syntax_error(_). % expected
?- number_chars(N,"1_ \n000").
   error(syntax_error(number),number_chars/2), unexpected.
   N = 1000. % expected
Note that sensitivity to trailing spaces makes syntax very brittle.
9: * must_be/2: Add not_less_than_zero trealla#17
?- must_be(not_less_than_zero,non_integer).
   error(type_error(type,not_less_than_zero),must_be/2), unexpected.
   type_error(integer,non_integer). % expected
?- must_be(not_less_than_zero,-1).
   error(type_error(type,not_less_than_zero),must_be/2), unexpected.
   domain_error(not_less_than_zero,-1). % expected
And, is type a good name when also domains are accepted?

Scryer

8: * must_be/2 incorrect error trealla#16
?- must_be(chars,[non_character]).
   error(type_error(list,[non_character]),must_be/2), unexpected.
   type_error(character, non_character). % expected outcome
7: * must_be/2 loops trealla#15
?- L=[a|L], must_be(chars,L).
   loops, unexpected.
?- L=[a|L], must_be(list,L).
   error(type_error(list,[a|_1]),must_be/2). % better, culprit not OK
?- L=[1|L], must_be(chars,L).
   error(type_error(list,[1|_1]),must_be/2). % fine, but why?
?- L=[a|L], catch(must_be(chars,L), Error, true).
   L = [a|L], Error = error(type_error(list,[a,a|_A]),must_be/2). % good! Why?
Isn't there '$skip_max_list'/4 in the system? It seems that there is a lot of highly specialized code in the system. Why is the list sometimes detected and sometimes not?
v2.0.13
6: * unify_with_occurs_check/2 incorrect in the presence of dif/2 trealla#12
?- unify_with_occurs_check(B,[A|B]).
   false.
?- unify_with_occurs_check(B,[C|C]),unify_with_occurs_check(B,[A|B]).
   false.
?- dif([],A),unify_with_occurs_check(B,[A|B]).
   false.
?- dif([],A),unify_with_occurs_check(B,[C|C]),unify_with_occurs_check(B,[A|B]).
   A = [C|C], B = A, C = A, unexpected.
?- dif([],A),B=[C|C],unify_with_occurs_check(B,[A|B]).
   A = [C|C], B = A, C = A, unexpected.
?- B=[C|C],unify_with_occurs_check(B,[A|B]).
   false.
5: * Top level, dif/2: unexpected residual goal trealla#11
?- dif([],A).
   dif:dif([],dummyA), unexpected.
?- dif([],A), var(A).
   dif:dif([],dummyA), unexpected. % but probably a top level issue
   only.
4: * dif/2 incorrect trealla#10
?- dif(A,B),A=[[]|A],B=[[]|A].
   A = [[]|A], B = A, unexpected.
   loops.
?- A=[[]|A],B=[[]|A], dif(A,B).
   false.
3: F dif/2, findall/3: unexpected overflow trealla#7
ulrich@p0:/opt/gupu/new-trealla$ ulimit -v
99999
ulrich@p0:/opt/gupu/new-trealla$ ./tpl -f
?- findall(t,(dif([],A),A=[[]|A]),Ts).
   error(resource_error(finite_memory),top_level/0), unexpected.
?- catch(findall(t,(dif([],A),A=[[]|A]),Ts),Error,true).
   Error = error(resource_error(finite_memory),top_level/0), unexpected.
2: * Top level: incorrect/redundant overflow message trealla#6
ulrich@p0:/opt/gupu/new-trealla$ ulimit -v 99999
ulrich@p0:/opt/gupu/new-trealla$ ./tpl -f
?- length(L, 1000000).
   error(resource_error(finite_memory),length_rundown/2), unexpected.
   error(resource_error(memory),length_rundown/2).
?- catch(length(L, 1000000),Error,true).
   error(resource_error(memory),top_level/0).
The resource finite_memory is here to indicate that any finite memory would not be enough. But in this case, a larger size would suffice.
v2.0.4, Sun Aug 14 08:37:32 CEST 2022 (new-trealla)
1: * Recreation of old issues trealla#5 Recovery possibilities
.
Validated HTML
[ICO]NameLast modifiedSizeDescription

[PARENTDIR]Parent Directory  -  
[TXT]Current.html2024-06-03 12:35 1.9K 
[TXT]Item.html2025-02-01 12:35 41K 
[TXT]TREALLA-HEADER.html2025-02-01 12:35 41K 
[TXT]fichier.pl2022-01-17 12:34 6  
[TXT]issue394.pl2023-11-19 19:53 233  
[TXT]item33.pl2023-06-27 18:09 267  
[TXT]item40.pl2023-06-27 17:53 118  
[TXT]item40b.pl2023-06-27 18:14 106  
[TXT]item63.txt2023-09-26 21:35 32K 
[TXT]t.pl2022-01-13 08:11 366  
[TXT]t2.pl2022-01-13 08:44 326  
[TXT]t3.pl2022-01-13 13:23 197  

Apache/2.4.62 (Debian) OpenSSL/3.0.15 Server at www.complang.tuwien.ac.at Port 80