From e47679aa016408e675bbb70acac4740bdeb43a1b Mon Sep 17 00:00:00 2001 From: vsc Date: Fri, 10 Sep 2004 21:04:46 +0000 Subject: [PATCH] don't allow defining as dynamic a predicate which already has clauses. git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1133 b08c6af1-5177-4d33-ba66-4b1c6b8b522a --- pl/preds.yap | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pl/preds.yap b/pl/preds.yap index 984da9e78..640ed8c5e 100644 --- a/pl/preds.yap +++ b/pl/preds.yap @@ -679,15 +679,16 @@ dynamic(X) :- '$dynamic'([], _) :- !. '$dynamic'([H|L], M) :- !, '$dynamic'(H, M), '$dynamic'(L, M). '$dynamic'((A,B),M) :- !, '$dynamic'(A,M), '$dynamic'(B,M). -'$dynamic'(X,M) :- !, +'$dynamic'(X,M) :- '$dynamic2'(X,M). '$dynamic2'(X, Mod) :- '$log_upd'(Stat), Stat\=0, !, '$logical_updatable'(X, Mod). -'$dynamic2'(A/N, Mod) :- integer(N), atom(A), !, +'$dynamic2'(A/N, Mod) :- + integer(N), atom(A), !, functor(T,A,N), '$flags'(T,Mod,F,F), % LogUpd,BinaryTest,Safe,C,Dynamic,Compiled,Standard,Asm, - ( F/\ 0x19D1FA80 =:= 0 -> NF is F \/ 0x00002000, '$flags'(T, Mod, F, NF); + ( F/\ 0x19D1FA80 =:= 0, '$undefined'(T,Mod) -> NF is F \/ 0x00002000, '$flags'(T, Mod, F, NF); F /\ 0x00002000 =:= 0x00002000 -> true; % dynamic F /\ 0x08000000 =:= 0x08000000 -> true ; % LU F /\ 0x00000400 =:= 0x00000400, '$undefined'(T,Mod) -> F1 is F /\ \(0x400), N1F is F1 \/ 0x00002000, NF is N1F /\ \(0x00420000), '$flags'(T,Mod,F,NF); @@ -700,7 +701,7 @@ dynamic(X) :- '$logical_updatable'(A/N,Mod) :- integer(N), atom(A), !, functor(T,A,N), '$flags'(T,Mod,F,F), ( - F/\ 0x19D1FA80 =:= 0 -> NF is F \/ 0x08000400, '$flags'(T,Mod,F,NF); + F/\ 0x19D1FA80 =:= 0, '$undefined'(T,Mod) -> NF is F \/ 0x08000400, '$flags'(T,Mod,F,NF); F /\ 0x08000000 =:= 0x08000000 -> true ; % LU F /\ 0x00002000 =:= 0x00002000 -> true; % dynamic F /\ 0x00000400 =:= 0x00000400 , '$undefined'(T,Mod) -> N1F is F \/ 0x08000000, NF is N1F /\ \(0x00420000), '$flags'(T,Mod,F,NF);