Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
infradig committed Oct 1, 2024
1 parent ffa547a commit 2930829
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
16 changes: 8 additions & 8 deletions samples/tco.pl
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
test1(0) :- !, statistics, fail.
test1(0) :- !, statistics.
test1(N) :- N1 is N-1, test1(N1).

f.

test2(0) :- !, statistics, fail.
test2(0) :- !, statistics.
test2(N) :- f, N1 is N-1, test2(N1).

f(1).

test3(0) :- !, statistics, fail.
test3(0) :- !, statistics.
test3(N) :- f(_), N1 is N-1, test3(N1).

f(_, _).

test4(0) :- !, statistics, fail.
test4(0) :- !, statistics.
test4(I) :- f(I, _), I2 is I-1, test4(I2).

statistics.

main :-
test1(100000);
test2(200000);
test3(300000);
test4(400000);
test1(1000000),
test2(1000000),
test3(1000000),
test4(1000000),
true.

2 changes: 0 additions & 2 deletions src/query.c
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,6 @@ static void commit_frame(query *q)
) {
leave_predicate(q, q->st.pr);
drop_choice(q);
//cut(q); // ???
trim_trail(q);
Trace(q, head, q->st.curr_frame, EXIT);
q->st.curr_instr += q->st.curr_instr->nbr_cells;
Expand All @@ -731,7 +730,6 @@ static void commit_frame(query *q)
if (last_match) {
leave_predicate(q, q->st.pr);
drop_choice(q);
//cut(q); // ???
trim_trail(q);
} else {
choice *ch = GET_CURR_CHOICE();
Expand Down

0 comments on commit 2930829

Please sign in to comment.