Reputation: 145
If I assign something like
process([[baby],[boy],[[is]dancing],[with],[[the][family]]],A)
,
then it gives output as
A = [[baby],[boy],[[is]dancing],[with],[[..][..]]].
I want it to show all the values on terminal.
Something like
A = [[baby],[boy],[[is]dancing],[with],[[the][family]]].
Upvotes: 0
Views: 283
Reputation: 18381
Use the current_prolog_flag/2
predicate with the toplevel_print_options
flag. Something like this:
?- current_prolog_flag(toplevel_print_options, X). X = [quoted(true), portray(true), max_depth(10), spacing(next_argument)].
You can modify the max_depth
option value, or alternatively you can type w after getting the abbreviated answer, and prolog will print the answer fully. Pressing p will restore the original format. To make the Prolog wait wor your input after printing the answer, you might want to add some non-determinism to the query by appending ; true.
to it. For more information see here.
Upvotes: 2
Reputation: 22585
The problem is that the toplevel is truncating the list when they are shown.
You can configure the depth of the maximum nesting with the prolog flag toplevel_print_option
, with option max_depth(0)
, with 0 meaning to show everything.
The helper procedure will modify the prolog flag to change only max_depth to 0, leaving the other options unchanged:
set_toplevel_flags:-
current_prolog_flag(toplevel_print_options, Opts),
(select(max_depth(_), Opts, TOpts) -> NOpts=TOpts ; NOpts=Opts),
set_prolog_flag(toplevel_print_options, [max_depth(0)|NOpts]).
Upvotes: 2