How to expand a resulting list in SWI-Prolog?

爱⌒轻易说出口 提交于 2019-11-30 23:36:52

There is a limit on the depth to prevent too long output. You can change it with set_prolog_flag/1.

?- length(L, 25).
L = [_G257, _G260, _G263, _G266, _G269, _G272, _G275, _G278, _G281|...].

?- current_prolog_flag(toplevel_print_options, V).
V = [quoted(true), portray(true), max_depth(10), priority(699)].

?- set_prolog_flag(toplevel_print_options, [quoted(true), portray(true), max_depth(100), priority(699)]).
true.

?- length(L, 25).
L = [_G257, _G260, _G263, _G266, _G269, _G272, _G275, _G278, _G281, _G284, _G287, _G290, _G293, _G296, _G299, _G302, _G305, _G308, _G311, _G314, _G317, _G320, _G323, _G326, _G329].

Edit: You can also remove the limit completely by removing it from the options list.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!