debugger was making predicates meta instead of testing
fix handling of dbrefs in facts and in subarguments. git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1287 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
parent
d4d3a14c7a
commit
0b420f5493
@ -11,8 +11,13 @@
|
|||||||
* File: cdmgr.c *
|
* File: cdmgr.c *
|
||||||
* comments: Code manager *
|
* comments: Code manager *
|
||||||
* *
|
* *
|
||||||
* Last rev: $Date: 2005-04-20 04:02:15 $,$Author: vsc $ *
|
* Last rev: $Date: 2005-05-12 03:36:32 $,$Author: vsc $ *
|
||||||
* $Log: not supported by cvs2svn $
|
* $Log: not supported by cvs2svn $
|
||||||
|
* Revision 1.156 2005/04/20 04:02:15 vsc
|
||||||
|
* fix a few variable warnings
|
||||||
|
* fix erase clause to pass a pointer to clause, not code
|
||||||
|
* get rid of Yap4.4 code in Yap_EraseStaticClause
|
||||||
|
*
|
||||||
* Revision 1.155 2005/04/10 04:01:10 vsc
|
* Revision 1.155 2005/04/10 04:01:10 vsc
|
||||||
* bug fixes, I hope!
|
* bug fixes, I hope!
|
||||||
*
|
*
|
||||||
@ -3808,7 +3813,7 @@ fetch_next_lu_clause(PredEntry *pe, yamop *i_code, Term th, Term tb, Term tr, ya
|
|||||||
WPP = NULL;
|
WPP = NULL;
|
||||||
#endif
|
#endif
|
||||||
if (cl->ClFlags & FactMask) {
|
if (cl->ClFlags & FactMask) {
|
||||||
if (!Yap_unify(tb, MkAtomTerm(AtomTrue)) ||
|
if (!Yap_unify_constant(tb, MkAtomTerm(AtomTrue)) ||
|
||||||
!Yap_unify(tr, rtn))
|
!Yap_unify(tr, rtn))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
if (pe->ArityOfPE) {
|
if (pe->ArityOfPE) {
|
||||||
|
20
C/compiler.c
20
C/compiler.c
@ -11,8 +11,11 @@
|
|||||||
* File: compiler.c *
|
* File: compiler.c *
|
||||||
* comments: Clause compiler *
|
* comments: Clause compiler *
|
||||||
* *
|
* *
|
||||||
* Last rev: $Date: 2005-04-10 04:01:10 $,$Author: vsc $ *
|
* Last rev: $Date: 2005-05-12 03:36:32 $,$Author: vsc $ *
|
||||||
* $Log: not supported by cvs2svn $
|
* $Log: not supported by cvs2svn $
|
||||||
|
* Revision 1.65 2005/04/10 04:01:10 vsc
|
||||||
|
* bug fixes, I hope!
|
||||||
|
*
|
||||||
* Revision 1.64 2005/03/13 06:26:10 vsc
|
* Revision 1.64 2005/03/13 06:26:10 vsc
|
||||||
* fix excessive pruning in meta-calls
|
* fix excessive pruning in meta-calls
|
||||||
* fix Term->int breakage in compiler
|
* fix Term->int breakage in compiler
|
||||||
@ -104,6 +107,7 @@ typedef struct compiler_struct_struct {
|
|||||||
Ventry *vtable;
|
Ventry *vtable;
|
||||||
CExpEntry *common_exps;
|
CExpEntry *common_exps;
|
||||||
int is_a_fact;
|
int is_a_fact;
|
||||||
|
int hasdbrefs;
|
||||||
int n_common_exps;
|
int n_common_exps;
|
||||||
int goalno;
|
int goalno;
|
||||||
int onlast;
|
int onlast;
|
||||||
@ -606,8 +610,7 @@ c_arg(Int argno, Term t, unsigned int arity, unsigned int level, compiler_struct
|
|||||||
Yap_emit((cglobs->onhead ? (argno == (Int)arity ? unify_last_num_op
|
Yap_emit((cglobs->onhead ? (argno == (Int)arity ? unify_last_num_op
|
||||||
: unify_num_op) :
|
: unify_num_op) :
|
||||||
write_num_op), (CELL) t, Zero, &cglobs->cint);
|
write_num_op), (CELL) t, Zero, &cglobs->cint);
|
||||||
}
|
} else if (IsPairTerm(t)) {
|
||||||
else if (IsPairTerm(t)) {
|
|
||||||
if (optimizer_on && (!cglobs->onhead || argno != 1 || level > 1) && level < 6) {
|
if (optimizer_on && (!cglobs->onhead || argno != 1 || level > 1) && level < 6) {
|
||||||
t = optimize_ce(t, arity, level, cglobs);
|
t = optimize_ce(t, arity, level, cglobs);
|
||||||
if (IsVarTerm(t)) {
|
if (IsVarTerm(t)) {
|
||||||
@ -640,7 +643,13 @@ c_arg(Int argno, Term t, unsigned int arity, unsigned int level, compiler_struct
|
|||||||
FAIL("can not compile data base reference",TYPE_ERROR_CALLABLE,t);
|
FAIL("can not compile data base reference",TYPE_ERROR_CALLABLE,t);
|
||||||
} else {
|
} else {
|
||||||
READ_UNLOCK(cglobs->cint.CurrentPred->PRWLock);
|
READ_UNLOCK(cglobs->cint.CurrentPred->PRWLock);
|
||||||
Yap_emit((cglobs->onhead ? get_atom_op : put_atom_op), (CELL) t, argno, &cglobs->cint);
|
cglobs->hasdbrefs = TRUE;
|
||||||
|
if (level == 0)
|
||||||
|
Yap_emit((cglobs->onhead ? get_atom_op : put_atom_op), (CELL) t, argno, &cglobs->cint);
|
||||||
|
else
|
||||||
|
Yap_emit((cglobs->onhead ? (argno == (Int)arity ? unify_last_atom_op
|
||||||
|
: unify_atom_op) :
|
||||||
|
write_atom_op), (CELL) t, Zero, &cglobs->cint);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
@ -2898,6 +2907,7 @@ Yap_cclause(volatile Term inp_clause, int NOfArgs, int mod, volatile Term src)
|
|||||||
cglobs.n_common_exps = 0;
|
cglobs.n_common_exps = 0;
|
||||||
cglobs.labelno = 0L;
|
cglobs.labelno = 0L;
|
||||||
cglobs.is_a_fact = FALSE;
|
cglobs.is_a_fact = FALSE;
|
||||||
|
cglobs.hasdbrefs = FALSE;
|
||||||
if (IsVarTerm(my_clause)) {
|
if (IsVarTerm(my_clause)) {
|
||||||
Yap_Error_TYPE = INSTANTIATION_ERROR;
|
Yap_Error_TYPE = INSTANTIATION_ERROR;
|
||||||
Yap_Error_Term = my_clause;
|
Yap_Error_Term = my_clause;
|
||||||
@ -3006,7 +3016,7 @@ Yap_cclause(volatile Term inp_clause, int NOfArgs, int mod, volatile Term src)
|
|||||||
Yap_ShowCode(&cglobs.cint);
|
Yap_ShowCode(&cglobs.cint);
|
||||||
#endif
|
#endif
|
||||||
/* phase 3: assemble code */
|
/* phase 3: assemble code */
|
||||||
acode = Yap_assemble(ASSEMBLING_CLAUSE, src, cglobs.cint.CurrentPred, body == MkAtomTerm(AtomTrue), &cglobs.cint);
|
acode = Yap_assemble(ASSEMBLING_CLAUSE, src, cglobs.cint.CurrentPred, (cglobs.is_a_fact && !cglobs.hasdbrefs), &cglobs.cint);
|
||||||
|
|
||||||
|
|
||||||
/* check first if there was space for us */
|
/* check first if there was space for us */
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $Id: jpl.yap,v 1.3 2005-03-15 18:29:24 vsc Exp $
|
/* $Id: jpl.yap,v 1.4 2005-05-12 03:36:33 vsc Exp $
|
||||||
|
|
||||||
Part of JPL -- SWI-Prolog/Java interface
|
Part of JPL -- SWI-Prolog/Java interface
|
||||||
|
|
||||||
@ -4249,7 +4249,7 @@ setup_jvm :-
|
|||||||
setup_jvm :-
|
setup_jvm :-
|
||||||
add_jpl_to_classpath,
|
add_jpl_to_classpath,
|
||||||
add_java_to_ldpath,
|
add_java_to_ldpath,
|
||||||
libjpl(JPL),
|
% libjpl(_JPL),
|
||||||
% catch(load_foreign_library(JPL), E, report_java_setup_problem(E)),
|
% catch(load_foreign_library(JPL), E, report_java_setup_problem(E)),
|
||||||
assert(jvm_ready).
|
assert(jvm_ready).
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $Id: jpl.c,v 1.6 2005-04-15 20:27:57 vsc Exp $
|
/* $Id: jpl.c,v 1.7 2005-05-12 03:36:33 vsc Exp $
|
||||||
|
|
||||||
Part of JPL -- SWI-Prolog/Java interface
|
Part of JPL -- SWI-Prolog/Java interface
|
||||||
|
|
||||||
@ -1465,6 +1465,7 @@ jni_check_exception(void)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// (*env)->ExceptionDescribe(env); // send message
|
||||||
(*env)->ExceptionClear(env); // clear "exception-pending" state so we can do JNI calls
|
(*env)->ExceptionClear(env); // clear "exception-pending" state so we can do JNI calls
|
||||||
if ( (c=(*env)->GetObjectClass(env,ej)) != NULL )
|
if ( (c=(*env)->GetObjectClass(env,ej)) != NULL )
|
||||||
{ // we've got its class
|
{ // we've got its class
|
||||||
@ -1907,6 +1908,7 @@ jni_create_jvm_c(
|
|||||||
// opt[optn].optionString = "abort"; // I don't understand this yet...
|
// opt[optn].optionString = "abort"; // I don't understand this yet...
|
||||||
// opt[optn++].extraInfo = jvm_abort;
|
// opt[optn++].extraInfo = jvm_abort;
|
||||||
// opt[optn++].optionString = "-Xcheck:jni"; // extra checking of JNI calls
|
// opt[optn++].optionString = "-Xcheck:jni"; // extra checking of JNI calls
|
||||||
|
opt[optn++].optionString = "-Xmx1024m"; // give java enough space
|
||||||
// opt[optn++].optionString = "-Xnoclassgc"; // so method/field IDs remain valid (?)
|
// opt[optn++].optionString = "-Xnoclassgc"; // so method/field IDs remain valid (?)
|
||||||
// opt[optn].optionString = "vfprintf";
|
// opt[optn].optionString = "vfprintf";
|
||||||
// opt[optn++].extraInfo = fprintf; // no O/P, then SEGV
|
// opt[optn++].extraInfo = fprintf; // no O/P, then SEGV
|
||||||
|
@ -5600,7 +5600,7 @@ once_with_alarm(Time,Goal,DoOnAlarm) :-
|
|||||||
|
|
||||||
execute_once_with_alarm(Time, Goal) :-
|
execute_once_with_alarm(Time, Goal) :-
|
||||||
alarm(Time, alarm, _),
|
alarm(Time, alarm, _),
|
||||||
( call(Goal) -> alarm(0, alarm, _) ; alarm(0, alarm, _)).
|
( call(Goal) -> alarm(0, alarm, _) ; alarm(0, alarm, _), fail).
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
The procedure has three arguments: the @var{Time} before the alarm is
|
The procedure has three arguments: the @var{Time} before the alarm is
|
||||||
|
@ -404,7 +404,7 @@ debugging :-
|
|||||||
%
|
%
|
||||||
'$spycall'(G, M, _) :-
|
'$spycall'(G, M, _) :-
|
||||||
( '$access_yap_flags'(10,0);
|
( '$access_yap_flags'(10,0);
|
||||||
'$system_predicate'(G,M), \+ '$meta_predicate'(G,M)
|
'$system_predicate'(G,M), \+ '$is_metapredicate'(G,M)
|
||||||
), !,
|
), !,
|
||||||
'$execute_nonstop'(G, M).
|
'$execute_nonstop'(G, M).
|
||||||
'$spycall'(G, M, InControl) :-
|
'$spycall'(G, M, InControl) :-
|
||||||
|
Reference in New Issue
Block a user