From fda0b76f187c2347357a042a7536a7ffcd13837b Mon Sep 17 00:00:00 2001 From: vsc Date: Mon, 22 Nov 2004 05:48:43 +0000 Subject: [PATCH] fix meta-call on system predicates bug git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1181 b08c6af1-5177-4d33-ba66-4b1c6b8b522a --- C/exec.c | 6 +++++- pl/boot.yap | 8 ++++---- pl/init.yap | 12 ++++++------ 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/C/exec.c b/C/exec.c index 6df95e281..5f1c49296 100644 --- a/C/exec.c +++ b/C/exec.c @@ -77,7 +77,11 @@ inline static Int CallMetaCall(Term mod) { ARG2 = cp_as_integer(B); /* p_save_cp */ ARG3 = ARG1; - ARG4 = mod; + if (mod) { + ARG4 = mod; + } else { + ARG4 = TermProlog; + } return (CallPredicate(PredMetaCall, B, PredMetaCall->CodeOfPred)); } diff --git a/pl/boot.yap b/pl/boot.yap index 26dc4aac7..ee4c99863 100644 --- a/pl/boot.yap +++ b/pl/boot.yap @@ -675,10 +675,10 @@ incore(G) :- '$execute'(G). ; '$call'(B,CP,G0,M) ). -'$call'(\+ X, _, _,_) :- !, - \+ '$execute'(X). -'$call'(not(X), _, _,_) :- !, - \+ '$execute'(X). +'$call'(\+ X, CP, G0, M) :- !, + \+ '$call'(X, CP, G0, M). +'$call'(not(X), CP, G0, M) :- !, + \+ '$call'(X, CP, G0, M). '$call'(!, CP, _,_) :- !, '$$cut_by'(CP). '$call'([A|B], _, _, M) :- !, diff --git a/pl/init.yap b/pl/init.yap index 7a782bd8a..d47b8b076 100644 --- a/pl/init.yap +++ b/pl/init.yap @@ -27,12 +27,12 @@ false :- fail. (:- G) :- '$execute'(G), !. '$$!'(CP) :- '$cut_by'(CP). [] :- true. -','(A,B) :- '$current_module'(Module), '$meta_call'((A,B),Module). -';'(A,B) :- '$current_module'(Module), '$meta_call'((A;B),Module). -'|'(A,B) :- '$current_module'(Module), '$meta_call'((A;B),Module). -'->'(A,B) :- '$current_module'(Module), '$meta_call'((A->B),Module). -\+(G) :- '$current_module'(Module), '$meta_call'(\+(G),Module). -not(G) :- '$current_module'(Module), '$meta_call'(not(G),Module). +','(A,B) :- '$execute'(A), '$execute'(B). +';'(A,B) :- ('$execute'(A) ; '$execute'(B)). +'|'(A,B) :- ('$execute'(A) ; '$execute'(B)). +'->'(A,B) :- ('$execute'(A) -> '$execute'(B)). +\+(G) :- \+ '$execute'(G). +not(G) :- \+ '$execute'(G). :- set_value('$doindex',true).