compiler would break with g :- a:[u].
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@396 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
parent
63c30bc7b3
commit
44a00eb7fc
21
C/compiler.c
21
C/compiler.c
@ -1130,16 +1130,7 @@ c_goal(Term Goal, int mod)
|
|||||||
if (IsVarTerm(Goal)) {
|
if (IsVarTerm(Goal)) {
|
||||||
Goal = MkApplTerm(FunctorCall, 1, &Goal);
|
Goal = MkApplTerm(FunctorCall, 1, &Goal);
|
||||||
}
|
}
|
||||||
if (IsNumTerm(Goal)) {
|
if (IsApplTerm(Goal) && FunctorOfTerm(Goal) == FunctorModule) {
|
||||||
FAIL("goal can not be a number", TYPE_ERROR_CALLABLE, Goal);
|
|
||||||
}
|
|
||||||
else if (IsRefTerm(Goal)) {
|
|
||||||
Error_TYPE = TYPE_ERROR_DBREF;
|
|
||||||
Error_Term = Goal;
|
|
||||||
FAIL("goal argument in static procedure can not be a data base reference", TYPE_ERROR_CALLABLE, Goal);
|
|
||||||
} else if (IsPairTerm(Goal)) {
|
|
||||||
Goal = MkApplTerm(FunctorCall, 1, &Goal);
|
|
||||||
} else if (IsApplTerm(Goal) && FunctorOfTerm(Goal) == FunctorModule) {
|
|
||||||
Term M = ArgOfTerm(1, Goal);
|
Term M = ArgOfTerm(1, Goal);
|
||||||
|
|
||||||
if (IsVarTerm(M) || !IsAtomTerm(M)) {
|
if (IsVarTerm(M) || !IsAtomTerm(M)) {
|
||||||
@ -1152,7 +1143,15 @@ c_goal(Term Goal, int mod)
|
|||||||
Goal = ArgOfTerm(2, Goal);
|
Goal = ArgOfTerm(2, Goal);
|
||||||
mod = LookupModule(M);
|
mod = LookupModule(M);
|
||||||
}
|
}
|
||||||
if (IsVarTerm(Goal)) {
|
if (IsNumTerm(Goal)) {
|
||||||
|
FAIL("goal can not be a number", TYPE_ERROR_CALLABLE, Goal);
|
||||||
|
} else if (IsRefTerm(Goal)) {
|
||||||
|
Error_TYPE = TYPE_ERROR_DBREF;
|
||||||
|
Error_Term = Goal;
|
||||||
|
FAIL("goal argument in static procedure can not be a data base reference", TYPE_ERROR_CALLABLE, Goal);
|
||||||
|
} else if (IsPairTerm(Goal)) {
|
||||||
|
Goal = MkApplTerm(FunctorCall, 1, &Goal);
|
||||||
|
} else if (IsVarTerm(Goal)) {
|
||||||
Goal = MkApplTerm(FunctorCall, 1, &Goal);
|
Goal = MkApplTerm(FunctorCall, 1, &Goal);
|
||||||
}
|
}
|
||||||
if (IsAtomTerm(Goal)) {
|
if (IsAtomTerm(Goal)) {
|
||||||
|
16
C/stdpreds.c
16
C/stdpreds.c
@ -2071,6 +2071,19 @@ p_dump_active_goals(void) {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef INES
|
||||||
|
static Int
|
||||||
|
p_euc_dist(void) {
|
||||||
|
Term t1 = Deref(ARG1);
|
||||||
|
Term t2 = Deref(ARG2);
|
||||||
|
double d1 = (double)(IntegerOfTerm(ArgOfTerm(1,t1))-IntegerOfTerm(ArgOfTerm(1,t2)));
|
||||||
|
double d2 = (double)(IntegerOfTerm(ArgOfTerm(2,t1))-IntegerOfTerm(ArgOfTerm(2,t2)));
|
||||||
|
double d3 = (double)(IntegerOfTerm(ArgOfTerm(3,t1))-IntegerOfTerm(ArgOfTerm(3,t2)));
|
||||||
|
Int result = (Int)sqrt(d1*d1+d2*d2+d3*d3);
|
||||||
|
return(unify(ARG3,MkIntegerTerm(result)));
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void
|
void
|
||||||
InitBackCPreds(void)
|
InitBackCPreds(void)
|
||||||
{
|
{
|
||||||
@ -2146,6 +2159,9 @@ InitCPreds(void)
|
|||||||
#ifndef YAPOR
|
#ifndef YAPOR
|
||||||
InitCPred("$default_sequential", 1, p_default_sequential, SafePredFlag|SyncPredFlag);
|
InitCPred("$default_sequential", 1, p_default_sequential, SafePredFlag|SyncPredFlag);
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef INES
|
||||||
|
InitCPred("euc_dist", 3, p_euc_dist, SafePredFlag);
|
||||||
|
#endif
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
InitCPred("dump_active_goals", 0, p_dump_active_goals, SafePredFlag|SyncPredFlag);
|
InitCPred("dump_active_goals", 0, p_dump_active_goals, SafePredFlag|SyncPredFlag);
|
||||||
#endif
|
#endif
|
||||||
|
@ -112,7 +112,7 @@ low_level_trace(yap_low_level_port port, PredEntry *pred, CELL *args)
|
|||||||
/* extern int gc_calls; */
|
/* extern int gc_calls; */
|
||||||
|
|
||||||
vsc_count++;
|
vsc_count++;
|
||||||
if (vsc_count < 84600) return;
|
/* if (vsc_count < 84600) return; */
|
||||||
/* if (vsc_count == 6469) {
|
/* if (vsc_count == 6469) {
|
||||||
printf("Here I go\n");
|
printf("Here I go\n");
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user