When I invoke trace/0, the nested arguments are sometimes abbreviated with …, and I can get the full text with ‘w’, shorthand for write.
For illustration, consider this little toy example:
mylist([], empty) :-
unknown. % raises an error
mylist([H | T], mylist(H, U)) :-
mylist(T, U).
Now I invoke the predicate with a long list:
?- [mylist].
true.
?- trace.
true.
[trace] ?- mylist([1,2,3,4,5,6,7,8,9], L).
Call: (10) mylist([1, 2, 3, 4, 5, 6, 7, 8|...], _13658) ? write
Call: (10) mylist([1, 2, 3, 4, 5, 6, 7, 8, 9], _13658) ? creep
Ok this works, I get the full display in the trace. Creeping on…
Call: (11) mylist([2, 3, 4, 5, 6, 7, 8, 9], _14274) ? creep
Call: (12) mylist([3, 4, 5, 6, 7, 8, 9], _14328) ? creep
Call: (13) mylist([4, 5, 6, 7, 8, 9], _14382) ? creep
Call: (14) mylist([5, 6, 7, 8, 9], _14436) ? creep
Call: (15) mylist([6, 7, 8, 9], _14490) ? creep
Call: (16) mylist([7, 8, 9], _14544) ? creep
Call: (17) mylist([8, 9], _14598) ? creep
Call: (18) mylist([9], _14652) ? creep
Call: (19) mylist([], _14706) ? creep
ERROR: Unknown procedure: unknown/0
ERROR: In:
ERROR: [20] unknown
ERROR: [19] mylist([],empty) at c:/users/c7201178/documents/prolog/mylist.pl:2
ERROR: [18] mylist([9],mylist(9,empty)) at c:/users/c7201178/documents/prolog/mylist.pl:5
ERROR: [17] mylist([8,9],mylist(8,mylist(9,empty))) at c:/users/c7201178/documents/prolog/mylist.pl:5
ERROR: [16] mylist([7,8|...],mylist(7,mylist(8,...))) at c:/users/c7201178/documents/prolog/mylist.pl:5
ERROR: [15] mylist([6,7|...],mylist(6,mylist(7,...))) at c:/users/c7201178/documents/prolog/mylist.pl:5
ERROR: [14] mylist([5,6|...],mylist(5,mylist(6,...))) at c:/users/c7201178/documents/prolog/mylist.pl:5
In the stack trace, the list is still abbreviated. Is there a way to enable expansion of … in the stack trace, as well?
My use case is debugging the http server, that is, use_module(library(http/http_error)). In other words, the interactive “w” during the trace would be less helpful, rather a little command-line switch such as debug(…, [abbreviation(false)]).
Thank you for your consideration.
Best wishes,
Matthias