fix bug in index emulator
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1905 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
parent
50e39bef80
commit
7a98e7df59
18
C/index.c
18
C/index.c
@ -11,8 +11,11 @@
|
||||
* File: index.c *
|
||||
* comments: Indexing a Prolog predicate *
|
||||
* *
|
||||
* Last rev: $Date: 2007-05-02 11:01:37 $,$Author: vsc $ *
|
||||
* Last rev: $Date: 2007-06-20 13:48:45 $,$Author: vsc $ *
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.185 2007/05/02 11:01:37 vsc
|
||||
* get rid of type punning warnings.
|
||||
*
|
||||
* Revision 1.184 2007/03/26 15:18:43 vsc
|
||||
* debugging and clause/3 over tabled predicates would kill YAP.
|
||||
*
|
||||
@ -8104,13 +8107,14 @@ Yap_FollowIndexingCode(PredEntry *ap, yamop *ipc, Term Terms[3], yamop *ap_pc, y
|
||||
} else if (IsPairTerm(t)) {
|
||||
jlbl = &(ipc->u.llll.l1);
|
||||
ipc = ipc->u.llll.l1;
|
||||
s_reg = RepPair(t);
|
||||
S = s_reg = RepPair(t);
|
||||
} else if (IsAtomOrIntTerm(t)) {
|
||||
jlbl = &(ipc->u.llll.l2);
|
||||
ipc = ipc->u.llll.l2;
|
||||
} else {
|
||||
jlbl = &(ipc->u.llll.l3);
|
||||
ipc = ipc->u.llll.l3;
|
||||
S = RepAppl(t);
|
||||
}
|
||||
break;
|
||||
case _switch_list_nl:
|
||||
@ -8121,13 +8125,14 @@ Yap_FollowIndexingCode(PredEntry *ap, yamop *ipc, Term Terms[3], yamop *ap_pc, y
|
||||
} else if (IsPairTerm(t)) {
|
||||
jlbl = &(ipc->u.ollll.l1);
|
||||
ipc = ipc->u.ollll.l1;
|
||||
s_reg = RepPair(t);
|
||||
S = s_reg = RepPair(t);
|
||||
} else if (t == TermNil) {
|
||||
jlbl = &(ipc->u.ollll.l2);
|
||||
ipc = ipc->u.ollll.l2;
|
||||
} else {
|
||||
jlbl = &(ipc->u.ollll.l3);
|
||||
ipc = ipc->u.ollll.l3;
|
||||
S = RepAppl(t);
|
||||
}
|
||||
break;
|
||||
case _switch_on_arg_type:
|
||||
@ -8138,13 +8143,14 @@ Yap_FollowIndexingCode(PredEntry *ap, yamop *ipc, Term Terms[3], yamop *ap_pc, y
|
||||
} else if (IsPairTerm(t)) {
|
||||
jlbl = &(ipc->u.xllll.l1);
|
||||
ipc = ipc->u.xllll.l1;
|
||||
s_reg = RepPair(t);
|
||||
S = s_reg = RepPair(t);
|
||||
} else if (IsAtomOrIntTerm(t)) {
|
||||
jlbl = &(ipc->u.xllll.l1);
|
||||
ipc = ipc->u.xllll.l2;
|
||||
} else {
|
||||
jlbl = &(ipc->u.xllll.l3);
|
||||
ipc = ipc->u.xllll.l3;
|
||||
S = RepAppl(t);
|
||||
}
|
||||
break;
|
||||
case _switch_on_sub_arg_type:
|
||||
@ -8155,13 +8161,14 @@ Yap_FollowIndexingCode(PredEntry *ap, yamop *ipc, Term Terms[3], yamop *ap_pc, y
|
||||
} else if (IsPairTerm(t)) {
|
||||
jlbl = &(ipc->u.sllll.l1);
|
||||
ipc = ipc->u.sllll.l1;
|
||||
s_reg = RepPair(t);
|
||||
S = s_reg = RepPair(t);
|
||||
} else if (IsAtomOrIntTerm(t)) {
|
||||
jlbl = &(ipc->u.sllll.l2);
|
||||
ipc = ipc->u.sllll.l2;
|
||||
} else {
|
||||
jlbl = &(ipc->u.sllll.l3);
|
||||
ipc = ipc->u.sllll.l3;
|
||||
S = RepAppl(t);
|
||||
}
|
||||
break;
|
||||
case _if_not_then:
|
||||
@ -8188,6 +8195,7 @@ Yap_FollowIndexingCode(PredEntry *ap, yamop *ipc, Term Terms[3], yamop *ap_pc, y
|
||||
s_reg = RepAppl(t);
|
||||
f = (Functor)s_reg[0];
|
||||
s_reg++;
|
||||
S = s_reg;
|
||||
if (op == _switch_on_func) {
|
||||
fe = lookup_f_hash(f, ipc->u.sssl.l, ipc->u.sssl.s);
|
||||
} else {
|
||||
|
@ -16,6 +16,8 @@
|
||||
|
||||
<h2>Yap-5.1.2:</h2>
|
||||
<ul>
|
||||
<li> FIXED: indexing-code emulator should update S (obs from Rui
|
||||
Camacho).</li>
|
||||
<li> FIXED: error with atoms in arithmetic messages (obs from Paulo Moura).</li>
|
||||
<li> FIXED: bug in meta-calls to external C code (obs from Bernd Gutmann).</li>
|
||||
<li> NEW: matlab interface.</li>
|
||||
|
@ -1273,6 +1273,15 @@ performance can be achieved in the context of one solution
|
||||
computations, or in the context of tabling where order of clauses and
|
||||
solutions does not matter and repeated solutions are discarded.
|
||||
|
||||
\paragragh{Acknowledgments}
|
||||
|
||||
This work is dedicated to the memory of our friend and colleague
|
||||
Ricardo Lopes. We miss you! V\{\i}tor Santos Costa was partially
|
||||
supported by CNPq and would like to acknowledge support received while
|
||||
visiting at UW-Madison and the support of the YAP user community.
|
||||
This work has been partially supported by MYDDAS (POSC/EIA/59154/2004)
|
||||
and by funds granted to LIACC through the Programa de Financiamento
|
||||
Plurianual, Fundação para a Ciência e Tecnologia and Programa POSC.
|
||||
|
||||
\Paragraph{Acknowledgments}
|
||||
%--------------------------
|
||||
|
@ -62,7 +62,7 @@ check_opts([A|L],I0,IF,G) :- !,
|
||||
check_opts(Opts,_,_,G) :-
|
||||
throw(error(type_error(variable,Opts),G)).
|
||||
|
||||
process_opt(V,I,G) :- var(V), !,
|
||||
process_opt(V,_,G) :- var(V), !,
|
||||
throw(error(instantiation_error,G)).
|
||||
process_opt(nocase,1,_) :- !.
|
||||
process_opt(indices,2,_) :- !.
|
||||
|
Reference in New Issue
Block a user