debugging and clause/3 over tabled predicates would kill YAP.

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1856 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc 2007-03-26 15:18:43 +00:00
parent 0b7083adb2
commit 57b7f544d1
5 changed files with 39 additions and 10 deletions

View File

@ -11,8 +11,12 @@
* File: cdmgr.c *
* comments: Code manager *
* *
* Last rev: $Date: 2007-01-25 22:11:55 $,$Author: vsc $ *
* Last rev: $Date: 2007-03-26 15:18:43 $,$Author: vsc $ *
* $Log: not supported by cvs2svn $
* Revision 1.204 2007/01/25 22:11:55 vsc
* all/3 should fail on no solutions.
* get rid of annoying gcc complaints.
*
* Revision 1.203 2007/01/24 10:01:38 vsc
* fix matrix mess
*
@ -1970,7 +1974,7 @@ addclause(Term t, yamop *cp, int mode, Term mod, Term *t4ref)
} else {
StaticClause *clp = ClauseCodeToStaticClause(cp);
clp->ClFlags |= StaticMask;
if (is_fact(t)) {
if (is_fact(t) && !(p->PredFlags & TabledPredFlag)) {
clp->ClFlags |= FactMask;
clp->usc.ClPred = p;
}
@ -5364,9 +5368,15 @@ fetch_next_static_clause(PredEntry *pe, yamop *i_code, Term th, Term tb, Term tr
}
}
rtn = Yap_MkStaticRefTerm(cl);
return(Yap_unify(th, ArgOfTerm(1,t)) &&
Yap_unify(tb, ArgOfTerm(2,t)) &&
Yap_unify(tr, rtn));
if (!IsApplTerm(t) || FunctorOfTerm(t) != FunctorAssert) {
return(Yap_unify(th, t) &&
Yap_unify(tb, MkAtomTerm(AtomTrue)) &&
Yap_unify(tr, rtn));
} else {
return(Yap_unify(th, ArgOfTerm(1,t)) &&
Yap_unify(tb, ArgOfTerm(2,t)) &&
Yap_unify(tr, rtn));
}
}
}

View File

@ -11,8 +11,11 @@
* File: compiler.c *
* comments: Clause compiler *
* *
* Last rev: $Date: 2006-11-06 18:35:03 $,$Author: vsc $ *
* Last rev: $Date: 2007-03-26 15:18:43 $,$Author: vsc $ *
* $Log: not supported by cvs2svn $
* Revision 1.82 2006/11/06 18:35:03 vsc
* 1estranha
*
* Revision 1.81 2006/10/11 15:08:03 vsc
* fix bb entries
* comment development code for timestamp overflow.
@ -3225,7 +3228,7 @@ Yap_cclause(volatile Term inp_clause, int NOfArgs, int mod, volatile Term src)
#endif
/* phase 3: assemble code */
acode = Yap_assemble(ASSEMBLING_CLAUSE, src, cglobs.cint.CurrentPred, (cglobs.is_a_fact && !cglobs.hasdbrefs), &cglobs.cint);
acode = Yap_assemble(ASSEMBLING_CLAUSE, src, cglobs.cint.CurrentPred, (cglobs.is_a_fact && !cglobs.hasdbrefs && !(cglobs.cint.CurrentPred->PredFlags & TabledPredFlag)), &cglobs.cint);
/* check first if there was space for us */
if (acode == NULL) {
return NULL;

View File

@ -11,8 +11,11 @@
* File: index.c *
* comments: Indexing a Prolog predicate *
* *
* Last rev: $Date: 2007-03-21 23:23:46 $,$Author: vsc $ *
* Last rev: $Date: 2007-03-26 15:18:43 $,$Author: vsc $ *
* $Log: not supported by cvs2svn $
* Revision 1.183 2007/03/21 23:23:46 vsc
* fix excessive trail cleaning in gc tr overflow.
*
* Revision 1.182 2007/01/28 14:26:36 vsc
* WIN32 support
*
@ -6457,15 +6460,18 @@ static StaticClause *
static_clause(yamop *ipc, PredEntry *ap)
{
StaticClause *c;
CELL *p = (CELL *)ipc;
CELL *p;
if (ipc == FAILCODE)
return NULL;
if (ap->PredFlags & MegaClausePredFlag)
return (StaticClause *)ipc;
if (ap->PredFlags & TabledPredFlag)
ipc = PREVOP(ipc, ld);
p = (CELL *)ipc;
while ((c = ClauseCodeToStaticClause(p))) {
UInt fls = c->ClFlags & ~HasBlobsMask;
if (fls == StaticMask) {
if ((fls & StaticMask) == StaticMask) {
if (ap->PredFlags & SourcePredFlag) {
if ((char *)c->usc.ClSource < (char *)c+c->ClSize &&
valid_instructions(ipc, c->ClCode))

View File

@ -16,6 +16,7 @@
<h2>Yap-5.1.2:</h2>
<ul>
<li> FIXED: debugging and clause/3 over tabled predicates would kill YAP.</li>
<li> FIXED: memory expansion in deallocate would lose cut pointer.</li>
<li> FIXED: make growtrail do more than grow chunks of 64KB.</li>
<li> FIXED: growtrail was broken if called while doing variable shunting.</li>

View File

@ -453,6 +453,11 @@ debugging :-
\+ '$is_metapredicate'(G,M),
!,
'$execute_nonstop'(G, M).
'$spycall'(G, M, InControl, _) :-
'$tabled_predicate'(G,M),
!,
'$continue_debugging'(InControl, G, M),
'$execute_nonstop'(G, M).
'$spycall'(G, M, InControl, InRedo) :-
'$flags'(G,M,F,F),
F /\ 0x18402000 =\= 0, !, % dynamic procedure, logical semantics, user-C, or source
@ -475,6 +480,10 @@ debugging :-
'$continue_debugging'(InControl, G, M),
( '$execute_clause'(G, M, R, CP) ; InRedo = true ).
'$tabled_predicate'(G,M) :-
'$flags'(G,M,F,F),
F /\ 0x00000040 =\= 0.
'$trace'(P,G,Module,L,Deterministic) :-
% at this point we are done with leap or skip
nb_setval('$debug_run',off),