From: Nicolas Luck Date: Fri, 21 Jul 2023 22:30:51 +0000 (+0200) Subject: Add missing list_last_item to lib_toplevel.pl and increase MaxDepth of write_eq to... X-Git-Tag: remove^2~53 X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=d8a947546084843ca7700cdd5c885eb78868ac8a;p=scryer-prolog.git Add missing list_last_item to lib_toplevel.pl and increase MaxDepth of write_eq to avoid truncation of results --- diff --git a/src/lib_toplevel.pl b/src/lib_toplevel.pl index 70ece273..a7c8df13 100644 --- a/src/lib_toplevel.pl +++ b/src/lib_toplevel.pl @@ -101,6 +101,10 @@ write_eq((G1, G2), VarList, MaxDepth) :- write_eq(G, VarList, MaxDepth) :- write_last_goal(G, VarList, MaxDepth). +list_last_item([C], C) :- !. +list_last_item([_|Cs], D) :- + list_last_item(Cs, D). + term_variables_under_max_depth(Term, MaxDepth, Vars) :- '$term_variables_under_max_depth'(Term, MaxDepth, Vars). @@ -134,12 +138,12 @@ write_eqs_and_read_input(B, VarList) :- ( Goals == [] -> write('true.'), nl ; loader:thread_goals(Goals, ThreadedGoals, (',')), - write_eq(ThreadedGoals, NewVarList0, 20), + write_eq(ThreadedGoals, NewVarList0, 200000), write('.'), nl ) ; loader:thread_goals(Goals, ThreadedGoals, (',')), - write_eq(ThreadedGoals, NewVarList0, 20), + write_eq(ThreadedGoals, NewVarList0, 200000), read_input(ThreadedGoals, NewVarList0) ).