From 62513e0c6ad0955531f69eaa3330a1eba2fb4991 Mon Sep 17 00:00:00 2001 From: Mark Thom Date: Mon, 25 Jul 2022 13:52:24 -0600 Subject: [PATCH] try to invoke '$call_inline' a second time in call/N (#1543) --- src/loader.pl | 529 ++++++++++++++++++++++-------------- src/machine/dispatch.rs | 4 +- src/machine/system_calls.rs | 34 ++- 3 files changed, 354 insertions(+), 213 deletions(-) diff --git a/src/loader.pl b/src/loader.pl index b0905149d..09b7c2f03 100644 --- a/src/loader.pl +++ b/src/loader.pl @@ -833,7 +833,6 @@ % % The program used to generate the call/N predicates: % -% % :- use_module(library(between)). % :- use_module(library(error)). % :- use_module(library(lists)). @@ -855,9 +854,11 @@ % CallClause, % '$call_with_inference_counting'(ModuleCallClause0)), % (Head :- CallClause, -% expand_goal(G1, M1, G2), -% strip_subst_module(G2, M1, M2, G3), -% '$call_with_inference_counting'(ModuleCallClause1))]. +% ( '$call_inline'(G1) +% ; expand_goal(G1, M1, G2), +% strip_subst_module(G2, M1, M2, G3), +% '$call_with_inference_counting'(ModuleCallClause1) +% ))]. % % generate_call_forms :- % between(1, 64, N), @@ -885,9 +886,11 @@ '$call_with_inference_counting'('$module_call'(M, G)). call(G) :- '$prepare_call_clause'(G0,M1,G), - expand_goal(G0, M1, G1), - strip_subst_module(G1, M1, M2, G2), - '$call_with_inference_counting'('$module_call'(M2, G2)). + ( '$call_inline'(G0) + ; expand_goal(G0, M1, G1), + strip_subst_module(G1, M1, M2, G2), + '$call_with_inference_counting'('$module_call'(M2, G2)) + ). :-non_counted_backtracking call/2. call(A,B) :- @@ -901,9 +904,11 @@ '$call_with_inference_counting'('$module_call'(D,C)). call(A,B) :- '$prepare_call_clause'(C,D,A,B), - expand_goal(C,D,E), - strip_subst_module(E,D,F,G), - '$call_with_inference_counting'('$module_call'(F,G)). + ( '$call_inline'(C) + ; expand_goal(C,D,E), + strip_subst_module(E,D,F,G), + '$call_with_inference_counting'('$module_call'(F,G)) + ). :-non_counted_backtracking call/3. call(A,B,C) :- @@ -917,9 +922,11 @@ '$call_with_inference_counting'('$module_call'(E,D)). call(A,B,C) :- '$prepare_call_clause'(D,E,A,B,C), - expand_goal(D,E,F), - strip_subst_module(F,E,G,H), - '$call_with_inference_counting'('$module_call'(G,H)). + ( '$call_inline'(D) + ; expand_goal(D,E,F), + strip_subst_module(F,E,G,H), + '$call_with_inference_counting'('$module_call'(G,H)) + ). :-non_counted_backtracking call/4. call(A,B,C,D) :- @@ -933,9 +940,11 @@ '$call_with_inference_counting'('$module_call'(F,E)). call(A,B,C,D) :- '$prepare_call_clause'(E,F,A,B,C,D), - expand_goal(E,F,G), - strip_subst_module(G,F,H,I), - '$call_with_inference_counting'('$module_call'(H,I)). + ( '$call_inline'(E) + ; expand_goal(E,F,G), + strip_subst_module(G,F,H,I), + '$call_with_inference_counting'('$module_call'(H,I)) + ). :-non_counted_backtracking call/5. call(A,B,C,D,E) :- @@ -949,9 +958,11 @@ '$call_with_inference_counting'('$module_call'(G,F)). call(A,B,C,D,E) :- '$prepare_call_clause'(F,G,A,B,C,D,E), - expand_goal(F,G,H), - strip_subst_module(H,G,I,J), - '$call_with_inference_counting'('$module_call'(I,J)). + ( '$call_inline'(F) + ; expand_goal(F,G,H), + strip_subst_module(H,G,I,J), + '$call_with_inference_counting'('$module_call'(I,J)) + ). :-non_counted_backtracking call/6. call(A,B,C,D,E,F) :- @@ -965,9 +976,11 @@ '$call_with_inference_counting'('$module_call'(H,G)). call(A,B,C,D,E,F) :- '$prepare_call_clause'(G,H,A,B,C,D,E,F), - expand_goal(G,H,I), - strip_subst_module(I,H,J,K), - '$call_with_inference_counting'('$module_call'(J,K)). + ( '$call_inline'(G) + ; expand_goal(G,H,I), + strip_subst_module(I,H,J,K), + '$call_with_inference_counting'('$module_call'(J,K)) + ). :-non_counted_backtracking call/7. call(A,B,C,D,E,F,G) :- @@ -981,9 +994,11 @@ '$call_with_inference_counting'('$module_call'(I,H)). call(A,B,C,D,E,F,G) :- '$prepare_call_clause'(H,I,A,B,C,D,E,F,G), - expand_goal(H,I,J), - strip_subst_module(J,I,K,L), - '$call_with_inference_counting'('$module_call'(K,L)). + ( '$call_inline'(H) + ; expand_goal(H,I,J), + strip_subst_module(J,I,K,L), + '$call_with_inference_counting'('$module_call'(K,L)) + ). :-non_counted_backtracking call/8. call(A,B,C,D,E,F,G,H) :- @@ -997,9 +1012,11 @@ '$call_with_inference_counting'('$module_call'(J,I)). call(A,B,C,D,E,F,G,H) :- '$prepare_call_clause'(I,J,A,B,C,D,E,F,G,H), - expand_goal(I,J,K), - strip_subst_module(K,J,L,M), - '$call_with_inference_counting'('$module_call'(L,M)). + ( '$call_inline'(I) + ; expand_goal(I,J,K), + strip_subst_module(K,J,L,M), + '$call_with_inference_counting'('$module_call'(L,M)) + ). :-non_counted_backtracking call/9. call(A,B,C,D,E,F,G,H,I) :- @@ -1013,9 +1030,11 @@ '$call_with_inference_counting'('$module_call'(K,J)). call(A,B,C,D,E,F,G,H,I) :- '$prepare_call_clause'(J,K,A,B,C,D,E,F,G,H,I), - expand_goal(J,K,L), - strip_subst_module(L,K,M,N), - '$call_with_inference_counting'('$module_call'(M,N)). + ( '$call_inline'(J) + ; expand_goal(J,K,L), + strip_subst_module(L,K,M,N), + '$call_with_inference_counting'('$module_call'(M,N)) + ). :-non_counted_backtracking call/10. call(A,B,C,D,E,F,G,H,I,J) :- @@ -1029,9 +1048,11 @@ '$call_with_inference_counting'('$module_call'(L,K)). call(A,B,C,D,E,F,G,H,I,J) :- '$prepare_call_clause'(K,L,A,B,C,D,E,F,G,H,I,J), - expand_goal(K,L,M), - strip_subst_module(M,L,N,O), - '$call_with_inference_counting'('$module_call'(N,O)). + ( '$call_inline'(K) + ; expand_goal(K,L,M), + strip_subst_module(M,L,N,O), + '$call_with_inference_counting'('$module_call'(N,O)) + ). :-non_counted_backtracking call/11. call(A,B,C,D,E,F,G,H,I,J,K) :- @@ -1045,9 +1066,11 @@ '$call_with_inference_counting'('$module_call'(M,L)). call(A,B,C,D,E,F,G,H,I,J,K) :- '$prepare_call_clause'(L,M,A,B,C,D,E,F,G,H,I,J,K), - expand_goal(L,M,N), - strip_subst_module(N,M,O,P), - '$call_with_inference_counting'('$module_call'(O,P)). + ( '$call_inline'(L) + ; expand_goal(L,M,N), + strip_subst_module(N,M,O,P), + '$call_with_inference_counting'('$module_call'(O,P)) + ). :-non_counted_backtracking call/12. call(A,B,C,D,E,F,G,H,I,J,K,L) :- @@ -1061,9 +1084,11 @@ '$call_with_inference_counting'('$module_call'(N,M)). call(A,B,C,D,E,F,G,H,I,J,K,L) :- '$prepare_call_clause'(M,N,A,B,C,D,E,F,G,H,I,J,K,L), - expand_goal(M,N,O), - strip_subst_module(O,N,P,Q), - '$call_with_inference_counting'('$module_call'(P,Q)). + ( '$call_inline'(M) + ; expand_goal(M,N,O), + strip_subst_module(O,N,P,Q), + '$call_with_inference_counting'('$module_call'(P,Q)) + ). :-non_counted_backtracking call/13. call(A,B,C,D,E,F,G,H,I,J,K,L,M) :- @@ -1077,9 +1102,11 @@ '$call_with_inference_counting'('$module_call'(O,N)). call(A,B,C,D,E,F,G,H,I,J,K,L,M) :- '$prepare_call_clause'(N,O,A,B,C,D,E,F,G,H,I,J,K,L,M), - expand_goal(N,O,P), - strip_subst_module(P,O,Q,R), - '$call_with_inference_counting'('$module_call'(Q,R)). + ( '$call_inline'(N) + ; expand_goal(N,O,P), + strip_subst_module(P,O,Q,R), + '$call_with_inference_counting'('$module_call'(Q,R)) + ). :-non_counted_backtracking call/14. call(A,B,C,D,E,F,G,H,I,J,K,L,M,N) :- @@ -1093,9 +1120,11 @@ '$call_with_inference_counting'('$module_call'(P,O)). call(A,B,C,D,E,F,G,H,I,J,K,L,M,N) :- '$prepare_call_clause'(O,P,A,B,C,D,E,F,G,H,I,J,K,L,M,N), - expand_goal(O,P,Q), - strip_subst_module(Q,P,R,S), - '$call_with_inference_counting'('$module_call'(R,S)). + ( '$call_inline'(O) + ; expand_goal(O,P,Q), + strip_subst_module(Q,P,R,S), + '$call_with_inference_counting'('$module_call'(R,S)) + ). :-non_counted_backtracking call/15. call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O) :- @@ -1109,9 +1138,11 @@ '$call_with_inference_counting'('$module_call'(Q,P)). call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O) :- '$prepare_call_clause'(P,Q,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O), - expand_goal(P,Q,R), - strip_subst_module(R,Q,S,T), - '$call_with_inference_counting'('$module_call'(S,T)). + ( '$call_inline'(P) + ; expand_goal(P,Q,R), + strip_subst_module(R,Q,S,T), + '$call_with_inference_counting'('$module_call'(S,T)) + ). :-non_counted_backtracking call/16. call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P) :- @@ -1125,9 +1156,11 @@ '$call_with_inference_counting'('$module_call'(R,Q)). call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P) :- '$prepare_call_clause'(Q,R,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P), - expand_goal(Q,R,S), - strip_subst_module(S,R,T,U), - '$call_with_inference_counting'('$module_call'(T,U)). + ( '$call_inline'(Q) + ; expand_goal(Q,R,S), + strip_subst_module(S,R,T,U), + '$call_with_inference_counting'('$module_call'(T,U)) + ). :-non_counted_backtracking call/17. call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q) :- @@ -1141,9 +1174,11 @@ '$call_with_inference_counting'('$module_call'(S,R)). call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q) :- '$prepare_call_clause'(R,S,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q), - expand_goal(R,S,T), - strip_subst_module(T,S,U,V), - '$call_with_inference_counting'('$module_call'(U,V)). + ( '$call_inline'(R) + ; expand_goal(R,S,T), + strip_subst_module(T,S,U,V), + '$call_with_inference_counting'('$module_call'(U,V)) + ). :-non_counted_backtracking call/18. call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R) :- @@ -1157,9 +1192,11 @@ '$call_with_inference_counting'('$module_call'(T,S)). call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R) :- '$prepare_call_clause'(S,T,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R), - expand_goal(S,T,U), - strip_subst_module(U,T,V,W), - '$call_with_inference_counting'('$module_call'(V,W)). + ( '$call_inline'(S) + ; expand_goal(S,T,U), + strip_subst_module(U,T,V,W), + '$call_with_inference_counting'('$module_call'(V,W)) + ). :-non_counted_backtracking call/19. call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S) :- @@ -1173,9 +1210,11 @@ '$call_with_inference_counting'('$module_call'(U,T)). call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S) :- '$prepare_call_clause'(T,U,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S), - expand_goal(T,U,V), - strip_subst_module(V,U,W,X), - '$call_with_inference_counting'('$module_call'(W,X)). + ( '$call_inline'(T) + ; expand_goal(T,U,V), + strip_subst_module(V,U,W,X), + '$call_with_inference_counting'('$module_call'(W,X)) + ). :-non_counted_backtracking call/20. call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T) :- @@ -1189,9 +1228,11 @@ '$call_with_inference_counting'('$module_call'(V,U)). call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T) :- '$prepare_call_clause'(U,V,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T), - expand_goal(U,V,W), - strip_subst_module(W,V,X,Y), - '$call_with_inference_counting'('$module_call'(X,Y)). + ( '$call_inline'(U) + ; expand_goal(U,V,W), + strip_subst_module(W,V,X,Y), + '$call_with_inference_counting'('$module_call'(X,Y)) + ). :-non_counted_backtracking call/21. call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U) :- @@ -1205,9 +1246,11 @@ '$call_with_inference_counting'('$module_call'(W,V)). call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U) :- '$prepare_call_clause'(V,W,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U), - expand_goal(V,W,X), - strip_subst_module(X,W,Y,Z), - '$call_with_inference_counting'('$module_call'(Y,Z)). + ( '$call_inline'(V) + ; expand_goal(V,W,X), + strip_subst_module(X,W,Y,Z), + '$call_with_inference_counting'('$module_call'(Y,Z)) + ). :-non_counted_backtracking call/22. call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V) :- @@ -1221,9 +1264,11 @@ '$call_with_inference_counting'('$module_call'(X,W)). call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V) :- '$prepare_call_clause'(W,X,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V), - expand_goal(W,X,Y), - strip_subst_module(Y,X,Z,A1), - '$call_with_inference_counting'('$module_call'(Z,A1)). + ( '$call_inline'(W) + ; expand_goal(W,X,Y), + strip_subst_module(Y,X,Z,A1), + '$call_with_inference_counting'('$module_call'(Z,A1)) + ). :-non_counted_backtracking call/23. call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W) :- @@ -1237,9 +1282,11 @@ '$call_with_inference_counting'('$module_call'(Y,X)). call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W) :- '$prepare_call_clause'(X,Y,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W), - expand_goal(X,Y,Z), - strip_subst_module(Z,Y,A1,B1), - '$call_with_inference_counting'('$module_call'(A1,B1)). + ( '$call_inline'(X) + ; expand_goal(X,Y,Z), + strip_subst_module(Z,Y,A1,B1), + '$call_with_inference_counting'('$module_call'(A1,B1)) + ). :-non_counted_backtracking call/24. call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X) :- @@ -1253,9 +1300,11 @@ '$call_with_inference_counting'('$module_call'(Z,Y)). call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X) :- '$prepare_call_clause'(Y,Z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X), - expand_goal(Y,Z,A1), - strip_subst_module(A1,Z,B1,C1), - '$call_with_inference_counting'('$module_call'(B1,C1)). + ( '$call_inline'(Y) + ; expand_goal(Y,Z,A1), + strip_subst_module(A1,Z,B1,C1), + '$call_with_inference_counting'('$module_call'(B1,C1)) + ). :-non_counted_backtracking call/25. call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y) :- @@ -1269,9 +1318,11 @@ '$call_with_inference_counting'('$module_call'(A1,Z)). call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y) :- '$prepare_call_clause'(Z,A1,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y), - expand_goal(Z,A1,B1), - strip_subst_module(B1,A1,C1,D1), - '$call_with_inference_counting'('$module_call'(C1,D1)). + ( '$call_inline'(Z) + ; expand_goal(Z,A1,B1), + strip_subst_module(B1,A1,C1,D1), + '$call_with_inference_counting'('$module_call'(C1,D1)) + ). :-non_counted_backtracking call/26. call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z) :- @@ -1285,9 +1336,11 @@ '$call_with_inference_counting'('$module_call'(B1,A1)). call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z) :- '$prepare_call_clause'(A1,B1,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z), - expand_goal(A1,B1,C1), - strip_subst_module(C1,B1,D1,E1), - '$call_with_inference_counting'('$module_call'(D1,E1)). + ( '$call_inline'(A1) + ; expand_goal(A1,B1,C1), + strip_subst_module(C1,B1,D1,E1), + '$call_with_inference_counting'('$module_call'(D1,E1)) + ). :-non_counted_backtracking call/27. call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1) :- @@ -1301,9 +1354,11 @@ '$call_with_inference_counting'('$module_call'(C1,B1)). call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1) :- '$prepare_call_clause'(B1,C1,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1), - expand_goal(B1,C1,D1), - strip_subst_module(D1,C1,E1,F1), - '$call_with_inference_counting'('$module_call'(E1,F1)). + ( '$call_inline'(B1) + ; expand_goal(B1,C1,D1), + strip_subst_module(D1,C1,E1,F1), + '$call_with_inference_counting'('$module_call'(E1,F1)) + ). :-non_counted_backtracking call/28. call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1) :- @@ -1317,9 +1372,11 @@ '$call_with_inference_counting'('$module_call'(D1,C1)). call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1) :- '$prepare_call_clause'(C1,D1,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1), - expand_goal(C1,D1,E1), - strip_subst_module(E1,D1,F1,G1), - '$call_with_inference_counting'('$module_call'(F1,G1)). + ( '$call_inline'(C1) + ; expand_goal(C1,D1,E1), + strip_subst_module(E1,D1,F1,G1), + '$call_with_inference_counting'('$module_call'(F1,G1)) + ). :-non_counted_backtracking call/29. call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1) :- @@ -1333,9 +1390,11 @@ '$call_with_inference_counting'('$module_call'(E1,D1)). call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1) :- '$prepare_call_clause'(D1,E1,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1), - expand_goal(D1,E1,F1), - strip_subst_module(F1,E1,G1,H1), - '$call_with_inference_counting'('$module_call'(G1,H1)). + ( '$call_inline'(D1) + ; expand_goal(D1,E1,F1), + strip_subst_module(F1,E1,G1,H1), + '$call_with_inference_counting'('$module_call'(G1,H1)) + ). :-non_counted_backtracking call/30. call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1) :- @@ -1349,9 +1408,11 @@ '$call_with_inference_counting'('$module_call'(F1,E1)). call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1) :- '$prepare_call_clause'(E1,F1,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1), - expand_goal(E1,F1,G1), - strip_subst_module(G1,F1,H1,I1), - '$call_with_inference_counting'('$module_call'(H1,I1)). + ( '$call_inline'(E1) + ; expand_goal(E1,F1,G1), + strip_subst_module(G1,F1,H1,I1), + '$call_with_inference_counting'('$module_call'(H1,I1)) + ). :-non_counted_backtracking call/31. call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1) :- @@ -1365,9 +1426,11 @@ '$call_with_inference_counting'('$module_call'(G1,F1)). call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1) :- '$prepare_call_clause'(F1,G1,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1), - expand_goal(F1,G1,H1), - strip_subst_module(H1,G1,I1,J1), - '$call_with_inference_counting'('$module_call'(I1,J1)). + ( '$call_inline'(F1) + ; expand_goal(F1,G1,H1), + strip_subst_module(H1,G1,I1,J1), + '$call_with_inference_counting'('$module_call'(I1,J1)) + ). :-non_counted_backtracking call/32. call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1) :- @@ -1381,9 +1444,11 @@ '$call_with_inference_counting'('$module_call'(H1,G1)). call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1) :- '$prepare_call_clause'(G1,H1,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1), - expand_goal(G1,H1,I1), - strip_subst_module(I1,H1,J1,K1), - '$call_with_inference_counting'('$module_call'(J1,K1)). + ( '$call_inline'(G1) + ; expand_goal(G1,H1,I1), + strip_subst_module(I1,H1,J1,K1), + '$call_with_inference_counting'('$module_call'(J1,K1)) + ). :-non_counted_backtracking call/33. call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1) :- @@ -1397,9 +1462,11 @@ '$call_with_inference_counting'('$module_call'(I1,H1)). call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1) :- '$prepare_call_clause'(H1,I1,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1), - expand_goal(H1,I1,J1), - strip_subst_module(J1,I1,K1,L1), - '$call_with_inference_counting'('$module_call'(K1,L1)). + ( '$call_inline'(H1) + ; expand_goal(H1,I1,J1), + strip_subst_module(J1,I1,K1,L1), + '$call_with_inference_counting'('$module_call'(K1,L1)) + ). :-non_counted_backtracking call/34. call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1) :- @@ -1413,9 +1480,11 @@ '$call_with_inference_counting'('$module_call'(J1,I1)). call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1) :- '$prepare_call_clause'(I1,J1,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1), - expand_goal(I1,J1,K1), - strip_subst_module(K1,J1,L1,M1), - '$call_with_inference_counting'('$module_call'(L1,M1)). + ( '$call_inline'(I1) + ; expand_goal(I1,J1,K1), + strip_subst_module(K1,J1,L1,M1), + '$call_with_inference_counting'('$module_call'(L1,M1)) + ). :-non_counted_backtracking call/35. call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1) :- @@ -1429,9 +1498,11 @@ '$call_with_inference_counting'('$module_call'(K1,J1)). call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1) :- '$prepare_call_clause'(J1,K1,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1), - expand_goal(J1,K1,L1), - strip_subst_module(L1,K1,M1,N1), - '$call_with_inference_counting'('$module_call'(M1,N1)). + ( '$call_inline'(J1) + ; expand_goal(J1,K1,L1), + strip_subst_module(L1,K1,M1,N1), + '$call_with_inference_counting'('$module_call'(M1,N1)) + ). :-non_counted_backtracking call/36. call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1) :- @@ -1445,9 +1516,11 @@ '$call_with_inference_counting'('$module_call'(L1,K1)). call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1) :- '$prepare_call_clause'(K1,L1,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1), - expand_goal(K1,L1,M1), - strip_subst_module(M1,L1,N1,O1), - '$call_with_inference_counting'('$module_call'(N1,O1)). + ( '$call_inline'(K1) + ; expand_goal(K1,L1,M1), + strip_subst_module(M1,L1,N1,O1), + '$call_with_inference_counting'('$module_call'(N1,O1)) + ). :-non_counted_backtracking call/37. call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1) :- @@ -1461,9 +1534,11 @@ '$call_with_inference_counting'('$module_call'(M1,L1)). call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1) :- '$prepare_call_clause'(L1,M1,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1), - expand_goal(L1,M1,N1), - strip_subst_module(N1,M1,O1,P1), - '$call_with_inference_counting'('$module_call'(O1,P1)). + ( '$call_inline'(L1) + ; expand_goal(L1,M1,N1), + strip_subst_module(N1,M1,O1,P1), + '$call_with_inference_counting'('$module_call'(O1,P1)) + ). :-non_counted_backtracking call/38. call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1) :- @@ -1477,9 +1552,11 @@ '$call_with_inference_counting'('$module_call'(N1,M1)). call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1) :- '$prepare_call_clause'(M1,N1,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1), - expand_goal(M1,N1,O1), - strip_subst_module(O1,N1,P1,Q1), - '$call_with_inference_counting'('$module_call'(P1,Q1)). + ( '$call_inline'(M1) + ; expand_goal(M1,N1,O1), + strip_subst_module(O1,N1,P1,Q1), + '$call_with_inference_counting'('$module_call'(P1,Q1)) + ). :-non_counted_backtracking call/39. call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1) :- @@ -1493,9 +1570,11 @@ '$call_with_inference_counting'('$module_call'(O1,N1)). call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1) :- '$prepare_call_clause'(N1,O1,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1), - expand_goal(N1,O1,P1), - strip_subst_module(P1,O1,Q1,R1), - '$call_with_inference_counting'('$module_call'(Q1,R1)). + ( '$call_inline'(N1) + ; expand_goal(N1,O1,P1), + strip_subst_module(P1,O1,Q1,R1), + '$call_with_inference_counting'('$module_call'(Q1,R1)) + ). :-non_counted_backtracking call/40. call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1) :- @@ -1509,9 +1588,11 @@ '$call_with_inference_counting'('$module_call'(P1,O1)). call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1) :- '$prepare_call_clause'(O1,P1,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1), - expand_goal(O1,P1,Q1), - strip_subst_module(Q1,P1,R1,S1), - '$call_with_inference_counting'('$module_call'(R1,S1)). + ( '$call_inline'(O1) + ; expand_goal(O1,P1,Q1), + strip_subst_module(Q1,P1,R1,S1), + '$call_with_inference_counting'('$module_call'(R1,S1)) + ). :-non_counted_backtracking call/41. call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1) :- @@ -1525,9 +1606,11 @@ '$call_with_inference_counting'('$module_call'(Q1,P1)). call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1) :- '$prepare_call_clause'(P1,Q1,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1), - expand_goal(P1,Q1,R1), - strip_subst_module(R1,Q1,S1,T1), - '$call_with_inference_counting'('$module_call'(S1,T1)). + ( '$call_inline'(P1) + ; expand_goal(P1,Q1,R1), + strip_subst_module(R1,Q1,S1,T1), + '$call_with_inference_counting'('$module_call'(S1,T1)) + ). :-non_counted_backtracking call/42. call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1,P1) :- @@ -1541,9 +1624,11 @@ '$call_with_inference_counting'('$module_call'(R1,Q1)). call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1,P1) :- '$prepare_call_clause'(Q1,R1,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1,P1), - expand_goal(Q1,R1,S1), - strip_subst_module(S1,R1,T1,U1), - '$call_with_inference_counting'('$module_call'(T1,U1)). + ( '$call_inline'(Q1) + ; expand_goal(Q1,R1,S1), + strip_subst_module(S1,R1,T1,U1), + '$call_with_inference_counting'('$module_call'(T1,U1)) + ). :-non_counted_backtracking call/43. call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1,P1,Q1) :- @@ -1557,9 +1642,11 @@ '$call_with_inference_counting'('$module_call'(S1,R1)). call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1,P1,Q1) :- '$prepare_call_clause'(R1,S1,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1,P1,Q1), - expand_goal(R1,S1,T1), - strip_subst_module(T1,S1,U1,V1), - '$call_with_inference_counting'('$module_call'(U1,V1)). + ( '$call_inline'(R1) + ; expand_goal(R1,S1,T1), + strip_subst_module(T1,S1,U1,V1), + '$call_with_inference_counting'('$module_call'(U1,V1)) + ). :-non_counted_backtracking call/44. call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1,P1,Q1,R1) :- @@ -1573,9 +1660,11 @@ '$call_with_inference_counting'('$module_call'(T1,S1)). call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1,P1,Q1,R1) :- '$prepare_call_clause'(S1,T1,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1,P1,Q1,R1), - expand_goal(S1,T1,U1), - strip_subst_module(U1,T1,V1,W1), - '$call_with_inference_counting'('$module_call'(V1,W1)). + ( '$call_inline'(S1) + ; expand_goal(S1,T1,U1), + strip_subst_module(U1,T1,V1,W1), + '$call_with_inference_counting'('$module_call'(V1,W1)) + ). :-non_counted_backtracking call/45. call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1,P1,Q1,R1,S1) :- @@ -1589,9 +1678,11 @@ '$call_with_inference_counting'('$module_call'(U1,T1)). call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1,P1,Q1,R1,S1) :- '$prepare_call_clause'(T1,U1,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1,P1,Q1,R1,S1), - expand_goal(T1,U1,V1), - strip_subst_module(V1,U1,W1,X1), - '$call_with_inference_counting'('$module_call'(W1,X1)). + ( '$call_inline'(T1) + ; expand_goal(T1,U1,V1), + strip_subst_module(V1,U1,W1,X1), + '$call_with_inference_counting'('$module_call'(W1,X1)) + ). :-non_counted_backtracking call/46. call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1,P1,Q1,R1,S1,T1) :- @@ -1605,9 +1696,11 @@ '$call_with_inference_counting'('$module_call'(V1,U1)). call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1,P1,Q1,R1,S1,T1) :- '$prepare_call_clause'(U1,V1,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1,P1,Q1,R1,S1,T1), - expand_goal(U1,V1,W1), - strip_subst_module(W1,V1,X1,Y1), - '$call_with_inference_counting'('$module_call'(X1,Y1)). + ( '$call_inline'(U1) + ; expand_goal(U1,V1,W1), + strip_subst_module(W1,V1,X1,Y1), + '$call_with_inference_counting'('$module_call'(X1,Y1)) + ). :-non_counted_backtracking call/47. call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1,P1,Q1,R1,S1,T1,U1) :- @@ -1621,9 +1714,11 @@ '$call_with_inference_counting'('$module_call'(W1,V1)). call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1,P1,Q1,R1,S1,T1,U1) :- '$prepare_call_clause'(V1,W1,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1,P1,Q1,R1,S1,T1,U1), - expand_goal(V1,W1,X1), - strip_subst_module(X1,W1,Y1,Z1), - '$call_with_inference_counting'('$module_call'(Y1,Z1)). + ( '$call_inline'(V1) + ; expand_goal(V1,W1,X1), + strip_subst_module(X1,W1,Y1,Z1), + '$call_with_inference_counting'('$module_call'(Y1,Z1)) + ). :-non_counted_backtracking call/48. call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1,P1,Q1,R1,S1,T1,U1,V1) :- @@ -1637,9 +1732,11 @@ '$call_with_inference_counting'('$module_call'(X1,W1)). call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1,P1,Q1,R1,S1,T1,U1,V1) :- '$prepare_call_clause'(W1,X1,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1,P1,Q1,R1,S1,T1,U1,V1), - expand_goal(W1,X1,Y1), - strip_subst_module(Y1,X1,Z1,A2), - '$call_with_inference_counting'('$module_call'(Z1,A2)). + ( '$call_inline'(W1) + ; expand_goal(W1,X1,Y1), + strip_subst_module(Y1,X1,Z1,A2), + '$call_with_inference_counting'('$module_call'(Z1,A2)) + ). :-non_counted_backtracking call/49. call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1,P1,Q1,R1,S1,T1,U1,V1,W1) :- @@ -1653,9 +1750,11 @@ '$call_with_inference_counting'('$module_call'(Y1,X1)). call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1,P1,Q1,R1,S1,T1,U1,V1,W1) :- '$prepare_call_clause'(X1,Y1,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1,P1,Q1,R1,S1,T1,U1,V1,W1), - expand_goal(X1,Y1,Z1), - strip_subst_module(Z1,Y1,A2,B2), - '$call_with_inference_counting'('$module_call'(A2,B2)). + ( '$call_inline'(X1) + ; expand_goal(X1,Y1,Z1), + strip_subst_module(Z1,Y1,A2,B2), + '$call_with_inference_counting'('$module_call'(A2,B2)) + ). :-non_counted_backtracking call/50. call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1,P1,Q1,R1,S1,T1,U1,V1,W1,X1) :- @@ -1669,9 +1768,11 @@ '$call_with_inference_counting'('$module_call'(Z1,Y1)). call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1,P1,Q1,R1,S1,T1,U1,V1,W1,X1) :- '$prepare_call_clause'(Y1,Z1,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1,P1,Q1,R1,S1,T1,U1,V1,W1,X1), - expand_goal(Y1,Z1,A2), - strip_subst_module(A2,Z1,B2,C2), - '$call_with_inference_counting'('$module_call'(B2,C2)). + ( '$call_inline'(Y1) + ; expand_goal(Y1,Z1,A2), + strip_subst_module(A2,Z1,B2,C2), + '$call_with_inference_counting'('$module_call'(B2,C2)) + ). :-non_counted_backtracking call/51. call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1,P1,Q1,R1,S1,T1,U1,V1,W1,X1,Y1) :- @@ -1685,9 +1786,11 @@ '$call_with_inference_counting'('$module_call'(A2,Z1)). call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1,P1,Q1,R1,S1,T1,U1,V1,W1,X1,Y1) :- '$prepare_call_clause'(Z1,A2,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1,P1,Q1,R1,S1,T1,U1,V1,W1,X1,Y1), - expand_goal(Z1,A2,B2), - strip_subst_module(B2,A2,C2,D2), - '$call_with_inference_counting'('$module_call'(C2,D2)). + ( '$call_inline'(Z1) + ; expand_goal(Z1,A2,B2), + strip_subst_module(B2,A2,C2,D2), + '$call_with_inference_counting'('$module_call'(C2,D2)) + ). :-non_counted_backtracking call/52. call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1,P1,Q1,R1,S1,T1,U1,V1,W1,X1,Y1,Z1) :- @@ -1701,9 +1804,11 @@ '$call_with_inference_counting'('$module_call'(B2,A2)). call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1,P1,Q1,R1,S1,T1,U1,V1,W1,X1,Y1,Z1) :- '$prepare_call_clause'(A2,B2,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1,P1,Q1,R1,S1,T1,U1,V1,W1,X1,Y1,Z1), - expand_goal(A2,B2,C2), - strip_subst_module(C2,B2,D2,E2), - '$call_with_inference_counting'('$module_call'(D2,E2)). + ( '$call_inline'(A2) + ; expand_goal(A2,B2,C2), + strip_subst_module(C2,B2,D2,E2), + '$call_with_inference_counting'('$module_call'(D2,E2)) + ). :-non_counted_backtracking call/53. call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1,P1,Q1,R1,S1,T1,U1,V1,W1,X1,Y1,Z1,A2) :- @@ -1717,9 +1822,11 @@ '$call_with_inference_counting'('$module_call'(C2,B2)). call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1,P1,Q1,R1,S1,T1,U1,V1,W1,X1,Y1,Z1,A2) :- '$prepare_call_clause'(B2,C2,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1,P1,Q1,R1,S1,T1,U1,V1,W1,X1,Y1,Z1,A2), - expand_goal(B2,C2,D2), - strip_subst_module(D2,C2,E2,F2), - '$call_with_inference_counting'('$module_call'(E2,F2)). + ( '$call_inline'(B2) + ; expand_goal(B2,C2,D2), + strip_subst_module(D2,C2,E2,F2), + '$call_with_inference_counting'('$module_call'(E2,F2)) + ). :-non_counted_backtracking call/54. call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1,P1,Q1,R1,S1,T1,U1,V1,W1,X1,Y1,Z1,A2,B2) :- @@ -1733,9 +1840,11 @@ '$call_with_inference_counting'('$module_call'(D2,C2)). call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1,P1,Q1,R1,S1,T1,U1,V1,W1,X1,Y1,Z1,A2,B2) :- '$prepare_call_clause'(C2,D2,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1,P1,Q1,R1,S1,T1,U1,V1,W1,X1,Y1,Z1,A2,B2), - expand_goal(C2,D2,E2), - strip_subst_module(E2,D2,F2,G2), - '$call_with_inference_counting'('$module_call'(F2,G2)). + ( '$call_inline'(C2) + ; expand_goal(C2,D2,E2), + strip_subst_module(E2,D2,F2,G2), + '$call_with_inference_counting'('$module_call'(F2,G2)) + ). :-non_counted_backtracking call/55. call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1,P1,Q1,R1,S1,T1,U1,V1,W1,X1,Y1,Z1,A2,B2,C2) :- @@ -1749,9 +1858,11 @@ '$call_with_inference_counting'('$module_call'(E2,D2)). call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1,P1,Q1,R1,S1,T1,U1,V1,W1,X1,Y1,Z1,A2,B2,C2) :- '$prepare_call_clause'(D2,E2,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1,P1,Q1,R1,S1,T1,U1,V1,W1,X1,Y1,Z1,A2,B2,C2), - expand_goal(D2,E2,F2), - strip_subst_module(F2,E2,G2,H2), - '$call_with_inference_counting'('$module_call'(G2,H2)). + ( '$call_inline'(D2) + ; expand_goal(D2,E2,F2), + strip_subst_module(F2,E2,G2,H2), + '$call_with_inference_counting'('$module_call'(G2,H2)) + ). :-non_counted_backtracking call/56. call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1,P1,Q1,R1,S1,T1,U1,V1,W1,X1,Y1,Z1,A2,B2,C2,D2) :- @@ -1765,9 +1876,11 @@ '$call_with_inference_counting'('$module_call'(F2,E2)). call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1,P1,Q1,R1,S1,T1,U1,V1,W1,X1,Y1,Z1,A2,B2,C2,D2) :- '$prepare_call_clause'(E2,F2,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1,P1,Q1,R1,S1,T1,U1,V1,W1,X1,Y1,Z1,A2,B2,C2,D2), - expand_goal(E2,F2,G2), - strip_subst_module(G2,F2,H2,I2), - '$call_with_inference_counting'('$module_call'(H2,I2)). + ( '$call_inline'(E2) + ; expand_goal(E2,F2,G2), + strip_subst_module(G2,F2,H2,I2), + '$call_with_inference_counting'('$module_call'(H2,I2)) + ). :-non_counted_backtracking call/57. call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1,P1,Q1,R1,S1,T1,U1,V1,W1,X1,Y1,Z1,A2,B2,C2,D2,E2) :- @@ -1781,9 +1894,11 @@ '$call_with_inference_counting'('$module_call'(G2,F2)). call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1,P1,Q1,R1,S1,T1,U1,V1,W1,X1,Y1,Z1,A2,B2,C2,D2,E2) :- '$prepare_call_clause'(F2,G2,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1,P1,Q1,R1,S1,T1,U1,V1,W1,X1,Y1,Z1,A2,B2,C2,D2,E2), - expand_goal(F2,G2,H2), - strip_subst_module(H2,G2,I2,J2), - '$call_with_inference_counting'('$module_call'(I2,J2)). + ( '$call_inline'(F2) + ; expand_goal(F2,G2,H2), + strip_subst_module(H2,G2,I2,J2), + '$call_with_inference_counting'('$module_call'(I2,J2)) + ). :-non_counted_backtracking call/58. call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1,P1,Q1,R1,S1,T1,U1,V1,W1,X1,Y1,Z1,A2,B2,C2,D2,E2,F2) :- @@ -1797,9 +1912,11 @@ '$call_with_inference_counting'('$module_call'(H2,G2)). call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1,P1,Q1,R1,S1,T1,U1,V1,W1,X1,Y1,Z1,A2,B2,C2,D2,E2,F2) :- '$prepare_call_clause'(G2,H2,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1,P1,Q1,R1,S1,T1,U1,V1,W1,X1,Y1,Z1,A2,B2,C2,D2,E2,F2), - expand_goal(G2,H2,I2), - strip_subst_module(I2,H2,J2,K2), - '$call_with_inference_counting'('$module_call'(J2,K2)). + ( '$call_inline'(G2) + ; expand_goal(G2,H2,I2), + strip_subst_module(I2,H2,J2,K2), + '$call_with_inference_counting'('$module_call'(J2,K2)) + ). :-non_counted_backtracking call/59. call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1,P1,Q1,R1,S1,T1,U1,V1,W1,X1,Y1,Z1,A2,B2,C2,D2,E2,F2,G2) :- @@ -1813,9 +1930,11 @@ '$call_with_inference_counting'('$module_call'(I2,H2)). call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1,P1,Q1,R1,S1,T1,U1,V1,W1,X1,Y1,Z1,A2,B2,C2,D2,E2,F2,G2) :- '$prepare_call_clause'(H2,I2,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1,P1,Q1,R1,S1,T1,U1,V1,W1,X1,Y1,Z1,A2,B2,C2,D2,E2,F2,G2), - expand_goal(H2,I2,J2), - strip_subst_module(J2,I2,K2,L2), - '$call_with_inference_counting'('$module_call'(K2,L2)). + ( '$call_inline'(H2) + ; expand_goal(H2,I2,J2), + strip_subst_module(J2,I2,K2,L2), + '$call_with_inference_counting'('$module_call'(K2,L2)) + ). :-non_counted_backtracking call/60. call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1,P1,Q1,R1,S1,T1,U1,V1,W1,X1,Y1,Z1,A2,B2,C2,D2,E2,F2,G2,H2) :- @@ -1829,9 +1948,11 @@ '$call_with_inference_counting'('$module_call'(J2,I2)). call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1,P1,Q1,R1,S1,T1,U1,V1,W1,X1,Y1,Z1,A2,B2,C2,D2,E2,F2,G2,H2) :- '$prepare_call_clause'(I2,J2,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1,P1,Q1,R1,S1,T1,U1,V1,W1,X1,Y1,Z1,A2,B2,C2,D2,E2,F2,G2,H2), - expand_goal(I2,J2,K2), - strip_subst_module(K2,J2,L2,M2), - '$call_with_inference_counting'('$module_call'(L2,M2)). + ( '$call_inline'(I2) + ; expand_goal(I2,J2,K2), + strip_subst_module(K2,J2,L2,M2), + '$call_with_inference_counting'('$module_call'(L2,M2)) + ). :-non_counted_backtracking call/61. call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1,P1,Q1,R1,S1,T1,U1,V1,W1,X1,Y1,Z1,A2,B2,C2,D2,E2,F2,G2,H2,I2) :- @@ -1845,9 +1966,11 @@ '$call_with_inference_counting'('$module_call'(K2,J2)). call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1,P1,Q1,R1,S1,T1,U1,V1,W1,X1,Y1,Z1,A2,B2,C2,D2,E2,F2,G2,H2,I2) :- '$prepare_call_clause'(J2,K2,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1,P1,Q1,R1,S1,T1,U1,V1,W1,X1,Y1,Z1,A2,B2,C2,D2,E2,F2,G2,H2,I2), - expand_goal(J2,K2,L2), - strip_subst_module(L2,K2,M2,N2), - '$call_with_inference_counting'('$module_call'(M2,N2)). + ( '$call_inline'(J2) + ; expand_goal(J2,K2,L2), + strip_subst_module(L2,K2,M2,N2), + '$call_with_inference_counting'('$module_call'(M2,N2)) + ). :-non_counted_backtracking call/62. call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1,P1,Q1,R1,S1,T1,U1,V1,W1,X1,Y1,Z1,A2,B2,C2,D2,E2,F2,G2,H2,I2,J2) :- @@ -1861,9 +1984,11 @@ '$call_with_inference_counting'('$module_call'(L2,K2)). call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1,P1,Q1,R1,S1,T1,U1,V1,W1,X1,Y1,Z1,A2,B2,C2,D2,E2,F2,G2,H2,I2,J2) :- '$prepare_call_clause'(K2,L2,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1,P1,Q1,R1,S1,T1,U1,V1,W1,X1,Y1,Z1,A2,B2,C2,D2,E2,F2,G2,H2,I2,J2), - expand_goal(K2,L2,M2), - strip_subst_module(M2,L2,N2,O2), - '$call_with_inference_counting'('$module_call'(N2,O2)). + ( '$call_inline'(K2) + ; expand_goal(K2,L2,M2), + strip_subst_module(M2,L2,N2,O2), + '$call_with_inference_counting'('$module_call'(N2,O2)) + ). :-non_counted_backtracking call/63. call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1,P1,Q1,R1,S1,T1,U1,V1,W1,X1,Y1,Z1,A2,B2,C2,D2,E2,F2,G2,H2,I2,J2,K2) :- @@ -1877,9 +2002,11 @@ '$call_with_inference_counting'('$module_call'(M2,L2)). call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1,P1,Q1,R1,S1,T1,U1,V1,W1,X1,Y1,Z1,A2,B2,C2,D2,E2,F2,G2,H2,I2,J2,K2) :- '$prepare_call_clause'(L2,M2,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1,P1,Q1,R1,S1,T1,U1,V1,W1,X1,Y1,Z1,A2,B2,C2,D2,E2,F2,G2,H2,I2,J2,K2), - expand_goal(L2,M2,N2), - strip_subst_module(N2,M2,O2,P2), - '$call_with_inference_counting'('$module_call'(O2,P2)). + ( '$call_inline'(L2) + ; expand_goal(L2,M2,N2), + strip_subst_module(N2,M2,O2,P2), + '$call_with_inference_counting'('$module_call'(O2,P2)) + ). :-non_counted_backtracking call/64. call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1,P1,Q1,R1,S1,T1,U1,V1,W1,X1,Y1,Z1,A2,B2,C2,D2,E2,F2,G2,H2,I2,J2,K2,L2) :- @@ -1893,9 +2020,11 @@ '$call_with_inference_counting'('$module_call'(N2,M2)). call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1,P1,Q1,R1,S1,T1,U1,V1,W1,X1,Y1,Z1,A2,B2,C2,D2,E2,F2,G2,H2,I2,J2,K2,L2) :- '$prepare_call_clause'(M2,N2,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1,P1,Q1,R1,S1,T1,U1,V1,W1,X1,Y1,Z1,A2,B2,C2,D2,E2,F2,G2,H2,I2,J2,K2,L2), - expand_goal(M2,N2,O2), - strip_subst_module(O2,N2,P2,Q2), - '$call_with_inference_counting'('$module_call'(P2,Q2)). + ( '$call_inline'(M2) + ; expand_goal(M2,N2,O2), + strip_subst_module(O2,N2,P2,Q2), + '$call_with_inference_counting'('$module_call'(P2,Q2)) + ). :-non_counted_backtracking call/65. call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1,P1,Q1,R1,S1,T1,U1,V1,W1,X1,Y1,Z1,A2,B2,C2,D2,E2,F2,G2,H2,I2,J2,K2,L2,M2) :- @@ -1909,6 +2038,8 @@ '$call_with_inference_counting'('$module_call'(O2,N2)). call(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1,P1,Q1,R1,S1,T1,U1,V1,W1,X1,Y1,Z1,A2,B2,C2,D2,E2,F2,G2,H2,I2,J2,K2,L2,M2) :- '$prepare_call_clause'(N2,O2,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1,P1,Q1,R1,S1,T1,U1,V1,W1,X1,Y1,Z1,A2,B2,C2,D2,E2,F2,G2,H2,I2,J2,K2,L2,M2), - expand_goal(N2,O2,P2), - strip_subst_module(P2,O2,Q2,R2), - '$call_with_inference_counting'('$module_call'(Q2,R2)). + ( '$call_inline'(N2) + ; expand_goal(N2,O2,P2), + strip_subst_module(P2,O2,Q2,R2), + '$call_with_inference_counting'('$module_call'(Q2,R2)) + ). diff --git a/src/machine/dispatch.rs b/src/machine/dispatch.rs index 8101cfea2..20e76b24b 100644 --- a/src/machine/dispatch.rs +++ b/src/machine/dispatch.rs @@ -4998,11 +4998,11 @@ impl Machine { step_or_fail!(self, self.machine_st.p = self.machine_st.cp); } &Instruction::CallIsExpandedOrInlined(_) => { - self.is_expanded_or_inlined(); + self.machine_st.fail = !self.is_expanded_or_inlined(); step_or_fail!(self, self.machine_st.p += 1); } &Instruction::ExecuteIsExpandedOrInlined(_) => { - self.is_expanded_or_inlined(); + self.machine_st.fail = !self.is_expanded_or_inlined(); step_or_fail!(self, self.machine_st.p = self.machine_st.cp); } &Instruction::CallInlineCallN(arity, _) => { diff --git a/src/machine/system_calls.rs b/src/machine/system_calls.rs index 73bfaa3be..9c88601da 100644 --- a/src/machine/system_calls.rs +++ b/src/machine/system_calls.rs @@ -1223,7 +1223,7 @@ impl Machine { } #[inline(always)] - pub(crate) fn is_expanded_or_inlined(&mut self) { + pub(crate) fn is_expanded_or_inlined(&self) -> bool { let (_module_loc, qualified_goal) = self.machine_st.strip_module( self.machine_st.registers[1], empty_list_as_cell!(), @@ -1235,7 +1235,7 @@ impl Machine { .get_name_and_arity(); if name == atom!("$call") { - return; + return false; } if self.machine_st.heap.len() > s + 1 + arity { @@ -1244,7 +1244,7 @@ impl Machine { if HeapCellValueTag::Cons == idx_cell.get_tag() { match_untyped_arena_ptr!(cell_as_untyped_arena_ptr!(idx_cell), (ArenaHeaderTag::IndexPtr, _ip) => { - return; + return true; } _ => { } @@ -1253,7 +1253,7 @@ impl Machine { } } - self.machine_st.fail = true; + false } #[inline(always)] @@ -1301,11 +1301,12 @@ impl Machine { // assemble goal from pre-loaded (narity) and supplementary // (arity) arguments. - let h = self.machine_st.heap.len(); - - self.machine_st.heap.push(atom_as_cell!(name, narity + arity)); + let target_goal = if arity == 0 { + qualified_goal + } else { // if narity + arity > 0 { + let h = self.machine_st.heap.len(); + self.machine_st.heap.push(atom_as_cell!(name, narity + arity)); - let target_goal = if narity + arity > 0 { for idx in 1 .. narity + 1 { self.machine_st.heap.push(self.machine_st.heap[s + idx]); } @@ -1314,9 +1315,16 @@ impl Machine { self.machine_st.heap.push(self.machine_st.registers[3 + idx]); } - str_loc_as_cell!(h) - } else { - heap_loc_as_cell!(h) + let index_cell = self.machine_st.heap[s + narity + 1]; + + if get_structure_index(index_cell).is_some() { + self.machine_st.heap.push(index_cell); + str_loc_as_cell!(h) + } else if narity + arity > 0 { + str_loc_as_cell!(h) + } else { + heap_loc_as_cell!(h) + } }; let target_qualified_goal = self.machine_st.registers[1]; @@ -3438,11 +3446,13 @@ impl Machine { Ordering::Equal => {} } + let key = (name, arity + narity); + for i in 1..arity + 1 { self.machine_st.registers[i] = self.machine_st.heap[s + i]; } - Ok((module_name, (name, arity + narity))) + Ok((module_name, key)) } #[inline(always)]