TABLING FIXED: table and yap_flag(tabling_mode,_) declarations
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1352 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
parent
b36b836820
commit
d6a2f6ac94
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
Copyright: R. Rocha and NCC - University of Porto, Portugal
|
Copyright: R. Rocha and NCC - University of Porto, Portugal
|
||||||
File: opt.preds.c
|
File: opt.preds.c
|
||||||
version: $Id: opt.preds.c,v 1.22 2005-08-01 15:40:38 ricroc Exp $
|
version: $Id: opt.preds.c,v 1.23 2005-08-01 17:59:49 ricroc Exp $
|
||||||
|
|
||||||
**********************************************************************/
|
**********************************************************************/
|
||||||
|
|
||||||
@ -540,10 +540,16 @@ int p_table(void) {
|
|||||||
arity = ArityOfFunctor(func);
|
arity = ArityOfFunctor(func);
|
||||||
} else
|
} else
|
||||||
return (FALSE);
|
return (FALSE);
|
||||||
|
if (pe->cs.p_code.FirstClause) /* predicate already defined */
|
||||||
|
return (FALSE);
|
||||||
if (!(pe->PredFlags & TabledPredFlag)) {
|
if (!(pe->PredFlags & TabledPredFlag)) {
|
||||||
pe->PredFlags |= TabledPredFlag;
|
pe->PredFlags |= TabledPredFlag;
|
||||||
new_subgoal_trie_node(sg_node, 0, NULL, NULL, NULL);
|
new_subgoal_trie_node(sg_node, 0, NULL, NULL, NULL);
|
||||||
new_table_entry(tab_ent, pe, arity, sg_node);
|
new_table_entry(tab_ent, pe, arity, sg_node);
|
||||||
|
if (IsMode_Local(yap_flags[TABLING_MODE_FLAG]))
|
||||||
|
SetMode_Local(TabEnt_mode(tab_ent));
|
||||||
|
if (IsMode_LoadAnswers(yap_flags[TABLING_MODE_FLAG]))
|
||||||
|
SetMode_LoadAnswers(TabEnt_mode(tab_ent));
|
||||||
pe->TableOfPred = tab_ent;
|
pe->TableOfPred = tab_ent;
|
||||||
}
|
}
|
||||||
return (TRUE);
|
return (TRUE);
|
||||||
|
@ -52,8 +52,8 @@ table(Pred) :-
|
|||||||
'$c_table'(Mod,PredFunctor).
|
'$c_table'(Mod,PredFunctor).
|
||||||
'$set_table'(Mod,PredFunctor) :-
|
'$set_table'(Mod,PredFunctor) :-
|
||||||
'$flags'(PredFunctor,Mod,Flags,Flags),
|
'$flags'(PredFunctor,Mod,Flags,Flags),
|
||||||
Flags /\ 0x1991F880 =:= 0, !,
|
Flags /\ 0x1991F880 =:= 0,
|
||||||
'$c_table'(Mod,PredFunctor).
|
'$c_table'(Mod,PredFunctor), !.
|
||||||
'$set_table'(Mod,PredFunctor) :-
|
'$set_table'(Mod,PredFunctor) :-
|
||||||
functor(PredFunctor,PredName,PredArity),
|
functor(PredFunctor,PredName,PredArity),
|
||||||
'$do_error'(permission_error(modify,table,Mod:PredName/PredArity),table(Mod:PredName/PredArity)).
|
'$do_error'(permission_error(modify,table,Mod:PredName/PredArity),table(Mod:PredName/PredArity)).
|
||||||
|
Reference in New Issue
Block a user