Merge branch 'master' of gitosis@yap.dcc.fc.up.pt:yap-6

This commit is contained in:
Vítor Santos Costa 2010-02-18 12:12:08 +00:00
commit c3fb089eeb
8 changed files with 473 additions and 91 deletions

228
C/absmi.c
View File

@ -9705,9 +9705,13 @@ Yap_absmi(int inp)
saveregs();
d0 = p_plus(Yap_Eval(d0), Yap_Eval(d1));
setregs();
if (PREG == (yamop *)FAILCODE)
if (d0 == 0L) {
saveregs();
Yap_Error(Yap_Error_TYPE, Yap_Error_Term, Yap_ErrorMessage);
setregs();
FAIL();
}
}
XREG(PREG->u.xxx.x) = d0;
PREG = NEXTOP(PREG, xxx);
GONext();
@ -9746,10 +9750,14 @@ Yap_absmi(int inp)
saveregs();
d0 = p_plus(Yap_Eval(d0), MkIntegerTerm(d1));
setregs();
if (PREG == (yamop *)FAILCODE)
if (d0 == 0L) {
saveregs();
Yap_Error(Yap_Error_TYPE, Yap_Error_Term, Yap_ErrorMessage);
setregs();
FAIL();
}
}
}
XREG(PREG->u.xxn.x) = d0;
PREG = NEXTOP(PREG, xxn);
GONext();
@ -9783,9 +9791,13 @@ Yap_absmi(int inp)
saveregs();
d0 = p_plus(Yap_Eval(d0), Yap_Eval(d1));
setregs();
if (PREG == (yamop *)FAILCODE)
if (d0 == 0L) {
saveregs();
Yap_Error(Yap_Error_TYPE, Yap_Error_Term, Yap_ErrorMessage);
setregs();
FAIL();
}
}
BEGP(pt0);
pt0 = YREG + PREG->u.yxx.y;
PREG = NEXTOP(PREG, yxx);
@ -9831,10 +9843,14 @@ Yap_absmi(int inp)
saveregs();
d0 = p_plus(Yap_Eval(d0), MkIntegerTerm(d1));
setregs();
if (PREG == (yamop *)FAILCODE)
if (d0 == 0L) {
saveregs();
Yap_Error(Yap_Error_TYPE, Yap_Error_Term, Yap_ErrorMessage);
setregs();
FAIL();
}
}
}
BEGP(pt0);
pt0 = YREG + PREG->u.yxn.y;
PREG = NEXTOP(PREG, yxn);
@ -9875,9 +9891,13 @@ Yap_absmi(int inp)
saveregs();
d0 = p_minus(Yap_Eval(d0), Yap_Eval(d1));
setregs();
if (PREG == (yamop *)FAILCODE)
if (d0 == 0L) {
saveregs();
Yap_Error(Yap_Error_TYPE, Yap_Error_Term, Yap_ErrorMessage);
setregs();
FAIL();
}
}
XREG(PREG->u.xxx.x) = d0;
PREG = NEXTOP(PREG, xxx);
GONext();
@ -9916,10 +9936,14 @@ Yap_absmi(int inp)
saveregs();
d0 = p_minus(MkIntegerTerm(d1),Yap_Eval(d0));
setregs();
if (PREG == (yamop *)FAILCODE)
if (d0 == 0L) {
saveregs();
Yap_Error(Yap_Error_TYPE, Yap_Error_Term, Yap_ErrorMessage);
setregs();
FAIL();
}
}
}
XREG(PREG->u.xxn.x) = d0;
PREG = NEXTOP(PREG, xxn);
GONext();
@ -9953,9 +9977,13 @@ Yap_absmi(int inp)
saveregs();
d0 = p_minus(Yap_Eval(d0), Yap_Eval(d1));
setregs();
if (PREG == (yamop *)FAILCODE)
if (d0 == 0L) {
saveregs();
Yap_Error(Yap_Error_TYPE, Yap_Error_Term, Yap_ErrorMessage);
setregs();
FAIL();
}
}
BEGP(pt0);
pt0 = YREG + PREG->u.yxx.y;
PREG = NEXTOP(PREG, yxx);
@ -10001,10 +10029,14 @@ Yap_absmi(int inp)
saveregs();
d0 = p_minus(MkIntegerTerm(d1), Yap_Eval(d0));
setregs();
if (PREG == (yamop *)FAILCODE)
if (d0 == 0L) {
saveregs();
Yap_Error(Yap_Error_TYPE, Yap_Error_Term, Yap_ErrorMessage);
setregs();
FAIL();
}
}
}
BEGP(pt0);
pt0 = YREG + PREG->u.yxn.y;
PREG = NEXTOP(PREG, yxn);
@ -10045,9 +10077,13 @@ Yap_absmi(int inp)
saveregs();
d0 = p_times(Yap_Eval(d0), Yap_Eval(d1));
setregs();
if (PREG == (yamop *)FAILCODE)
if (d0 == 0L) {
saveregs();
Yap_Error(Yap_Error_TYPE, Yap_Error_Term, Yap_ErrorMessage);
setregs();
FAIL();
}
}
XREG(PREG->u.xxx.x) = d0;
PREG = NEXTOP(PREG, xxx);
GONext();
@ -10086,10 +10122,14 @@ Yap_absmi(int inp)
saveregs();
d0 = p_times(Yap_Eval(d0), MkIntegerTerm(d1));
setregs();
if (PREG == (yamop *)FAILCODE)
if (d0 == 0L) {
saveregs();
Yap_Error(Yap_Error_TYPE, Yap_Error_Term, Yap_ErrorMessage);
setregs();
FAIL();
}
}
}
XREG(PREG->u.xxn.x) = d0;
PREG = NEXTOP(PREG, xxn);
GONext();
@ -10123,9 +10163,13 @@ Yap_absmi(int inp)
saveregs();
d0 = p_times(Yap_Eval(d0), Yap_Eval(d1));
setregs();
if (PREG == (yamop *)FAILCODE)
if (d0 == 0L) {
saveregs();
Yap_Error(Yap_Error_TYPE, Yap_Error_Term, Yap_ErrorMessage);
setregs();
FAIL();
}
}
BEGP(pt0);
pt0 = YREG + PREG->u.yxx.y;
PREG = NEXTOP(PREG, yxx);
@ -10171,10 +10215,14 @@ Yap_absmi(int inp)
saveregs();
d0 = p_times(Yap_Eval(d0), MkIntegerTerm(d1));
setregs();
if (PREG == (yamop *)FAILCODE)
if (d0 == 0L) {
saveregs();
Yap_Error(Yap_Error_TYPE, Yap_Error_Term, Yap_ErrorMessage);
setregs();
FAIL();
}
}
}
BEGP(pt0);
pt0 = YREG + PREG->u.yxn.y;
PREG = NEXTOP(PREG, yxn);
@ -10222,9 +10270,13 @@ Yap_absmi(int inp)
saveregs();
d0 = p_div(Yap_Eval(d0), Yap_Eval(d1));
setregs();
if (PREG == (yamop *)FAILCODE)
if (d0 == 0L) {
saveregs();
Yap_Error(Yap_Error_TYPE, Yap_Error_Term, Yap_ErrorMessage);
setregs();
FAIL();
}
}
XREG(PREG->u.xxx.x) = d0;
PREG = NEXTOP(PREG, xxx);
GONext();
@ -10263,10 +10315,14 @@ Yap_absmi(int inp)
saveregs();
d0 = p_div(Yap_Eval(d0),MkIntegerTerm(d1));
setregs();
if (PREG == (yamop *)FAILCODE)
if (d0 == 0L) {
saveregs();
Yap_Error(Yap_Error_TYPE, Yap_Error_Term, Yap_ErrorMessage);
setregs();
FAIL();
}
}
}
XREG(PREG->u.xxn.x) = d0;
PREG = NEXTOP(PREG, xxn);
GONext();
@ -10302,10 +10358,14 @@ Yap_absmi(int inp)
else {
saveregs();
d0 = p_div(MkIntegerTerm(d1),Yap_Eval(d0));
if (PREG == (yamop *)FAILCODE)
if (d0 == 0L) {
saveregs();
Yap_Error(Yap_Error_TYPE, Yap_Error_Term, Yap_ErrorMessage);
setregs();
FAIL();
}
}
}
XREG(PREG->u.xxn.x) = d0;
PREG = NEXTOP(PREG, xxn);
GONext();
@ -10346,9 +10406,13 @@ Yap_absmi(int inp)
saveregs();
d0 = p_div(Yap_Eval(d0), Yap_Eval(d1));
setregs();
if (PREG == (yamop *)FAILCODE)
if (d0 == 0L) {
saveregs();
Yap_Error(Yap_Error_TYPE, Yap_Error_Term, Yap_ErrorMessage);
setregs();
FAIL();
}
}
BEGP(pt0);
pt0 = YREG + PREG->u.yxx.y;
PREG = NEXTOP(PREG, yxx);
@ -10394,10 +10458,14 @@ Yap_absmi(int inp)
saveregs();
d0 = p_div(Yap_Eval(d0),MkIntegerTerm(d1));
setregs();
if (PREG == (yamop *)FAILCODE)
if (d0 == 0L) {
saveregs();
Yap_Error(Yap_Error_TYPE, Yap_Error_Term, Yap_ErrorMessage);
setregs();
FAIL();
}
}
}
BEGP(pt0);
pt0 = YREG + PREG->u.yxn.y;
PREG = NEXTOP(PREG, yxn);
@ -10441,10 +10509,14 @@ Yap_absmi(int inp)
saveregs();
d0 = p_div(MkIntegerTerm(d1), Yap_Eval(d0));
setregs();
if (PREG == (yamop *)FAILCODE)
if (d0 == 0L) {
saveregs();
Yap_Error(Yap_Error_TYPE, Yap_Error_Term, Yap_ErrorMessage);
setregs();
FAIL();
}
}
}
BEGP(pt0);
pt0 = YREG + PREG->u.yxn.y;
PREG = NEXTOP(PREG, yxn);
@ -10486,9 +10558,13 @@ Yap_absmi(int inp)
saveregs();
d0 = p_and(Yap_Eval(d0), Yap_Eval(d1));
setregs();
if (PREG == (yamop *)FAILCODE)
if (d0 == 0L) {
saveregs();
Yap_Error(Yap_Error_TYPE, Yap_Error_Term, Yap_ErrorMessage);
setregs();
FAIL();
}
}
XREG(PREG->u.xxx.x) = d0;
PREG = NEXTOP(PREG, xxx);
GONext();
@ -10527,10 +10603,14 @@ Yap_absmi(int inp)
saveregs();
d0 = p_and(Yap_Eval(d0), MkIntegerTerm(d1));
setregs();
if (PREG == (yamop *)FAILCODE)
if (d0 == 0L) {
saveregs();
Yap_Error(Yap_Error_TYPE, Yap_Error_Term, Yap_ErrorMessage);
setregs();
FAIL();
}
}
}
XREG(PREG->u.xxn.x) = d0;
PREG = NEXTOP(PREG, xxn);
GONext();
@ -10564,9 +10644,13 @@ Yap_absmi(int inp)
saveregs();
d0 = p_and(Yap_Eval(d0), Yap_Eval(d1));
setregs();
if (PREG == (yamop *)FAILCODE)
if (d0 == 0L) {
saveregs();
Yap_Error(Yap_Error_TYPE, Yap_Error_Term, Yap_ErrorMessage);
setregs();
FAIL();
}
}
BEGP(pt0);
pt0 = YREG + PREG->u.yxx.y;
PREG = NEXTOP(PREG, yxx);
@ -10612,10 +10696,14 @@ Yap_absmi(int inp)
saveregs();
d0 = p_and(Yap_Eval(d0), MkIntegerTerm(d1));
setregs();
if (PREG == (yamop *)FAILCODE)
if (d0 == 0L) {
saveregs();
Yap_Error(Yap_Error_TYPE, Yap_Error_Term, Yap_ErrorMessage);
setregs();
FAIL();
}
}
}
BEGP(pt0);
pt0 = YREG + PREG->u.yxn.y;
PREG = NEXTOP(PREG, yxn);
@ -10657,9 +10745,13 @@ Yap_absmi(int inp)
saveregs();
d0 = p_or(Yap_Eval(d0), Yap_Eval(d1));
setregs();
if (PREG == (yamop *)FAILCODE)
if (d0 == 0L) {
saveregs();
Yap_Error(Yap_Error_TYPE, Yap_Error_Term, Yap_ErrorMessage);
setregs();
FAIL();
}
}
XREG(PREG->u.xxx.x) = d0;
PREG = NEXTOP(PREG, xxx);
GONext();
@ -10697,10 +10789,14 @@ Yap_absmi(int inp)
else {
saveregs();
d0 = p_or(Yap_Eval(d0), MkIntegerTerm(d1));
if (PREG == (yamop *)FAILCODE)
if (d0 == 0L) {
saveregs();
Yap_Error(Yap_Error_TYPE, Yap_Error_Term, Yap_ErrorMessage);
setregs();
FAIL();
}
}
}
XREG(PREG->u.xxn.x) = d0;
PREG = NEXTOP(PREG, xxn);
GONext();
@ -10734,9 +10830,13 @@ Yap_absmi(int inp)
saveregs();
d0 = p_or(Yap_Eval(d0), Yap_Eval(d1));
setregs();
if (PREG == (yamop *)FAILCODE)
if (d0 == 0L) {
saveregs();
Yap_Error(Yap_Error_TYPE, Yap_Error_Term, Yap_ErrorMessage);
setregs();
FAIL();
}
}
BEGP(pt0);
pt0 = YREG + PREG->u.yxx.y;
PREG = NEXTOP(PREG, yxx);
@ -10782,10 +10882,14 @@ Yap_absmi(int inp)
saveregs();
d0 = p_or(Yap_Eval(d0), MkIntegerTerm(d1));
setregs();
if (PREG == (yamop *)FAILCODE)
if (d0 == 0L) {
saveregs();
Yap_Error(Yap_Error_TYPE, Yap_Error_Term, Yap_ErrorMessage);
setregs();
FAIL();
}
}
}
BEGP(pt0);
pt0 = YREG + PREG->u.yxn.y;
PREG = NEXTOP(PREG, yxn);
@ -10831,8 +10935,12 @@ Yap_absmi(int inp)
d0 = p_sll(Yap_Eval(d0), Yap_Eval(d1));
setregs();
}
if (PREG == (yamop *)FAILCODE)
if (d0 == 0L) {
saveregs();
Yap_Error(Yap_Error_TYPE, Yap_Error_Term, Yap_ErrorMessage);
setregs();
FAIL();
}
XREG(PREG->u.xxx.x) = d0;
PREG = NEXTOP(PREG, xxx);
GONext();
@ -10873,8 +10981,12 @@ Yap_absmi(int inp)
setregs();
}
}
if (PREG == (yamop *)FAILCODE)
if (d0 == 0L) {
saveregs();
Yap_Error(Yap_Error_TYPE, Yap_Error_Term, Yap_ErrorMessage);
setregs();
FAIL();
}
XREG(PREG->u.xxn.x) = d0;
PREG = NEXTOP(PREG, xxn);
GONext();
@ -10910,8 +11022,12 @@ Yap_absmi(int inp)
setregs();
}
}
if (PREG == (yamop *)FAILCODE)
if (d0 == 0L) {
saveregs();
Yap_Error(Yap_Error_TYPE, Yap_Error_Term, Yap_ErrorMessage);
setregs();
FAIL();
}
XREG(PREG->u.xxn.x) = d0;
PREG = NEXTOP(PREG, xxn);
GONext();
@ -10950,8 +11066,12 @@ Yap_absmi(int inp)
d0 = p_sll(Yap_Eval(d0), Yap_Eval(d1));
setregs();
}
if (PREG == (yamop *)FAILCODE)
if (d0 == 0L) {
saveregs();
Yap_Error(Yap_Error_TYPE, Yap_Error_Term, Yap_ErrorMessage);
setregs();
FAIL();
}
BEGP(pt0);
pt0 = YREG + PREG->u.yxx.y;
PREG = NEXTOP(PREG, yxx);
@ -10999,8 +11119,12 @@ Yap_absmi(int inp)
setregs();
}
}
if (PREG == (yamop *)FAILCODE)
if (d0 == 0L) {
saveregs();
Yap_Error(Yap_Error_TYPE, Yap_Error_Term, Yap_ErrorMessage);
setregs();
FAIL();
}
BEGP(pt0);
pt0 = YREG + PREG->u.yxn.y;
PREG = NEXTOP(PREG, yxn);
@ -11044,8 +11168,12 @@ Yap_absmi(int inp)
setregs();
}
}
if (PREG == (yamop *)FAILCODE)
if (d0 == 0L) {
saveregs();
Yap_Error(Yap_Error_TYPE, Yap_Error_Term, Yap_ErrorMessage);
setregs();
FAIL();
}
BEGP(pt0);
pt0 = YREG + PREG->u.yxn.y;
PREG = NEXTOP(PREG, yxn);
@ -11091,8 +11219,12 @@ Yap_absmi(int inp)
d0 = p_slr(Yap_Eval(d0), Yap_Eval(d1));
setregs();
}
if (PREG == (yamop *)FAILCODE)
if (d0 == 0L) {
saveregs();
Yap_Error(Yap_Error_TYPE, Yap_Error_Term, Yap_ErrorMessage);
setregs();
FAIL();
}
XREG(PREG->u.xxx.x) = d0;
PREG = NEXTOP(PREG, xxx);
GONext();
@ -11131,10 +11263,14 @@ Yap_absmi(int inp)
saveregs();
d0 = p_slr(Yap_Eval(d0), MkIntegerTerm(d1));
setregs();
if (PREG == (yamop *)FAILCODE)
if (d0 == 0L) {
saveregs();
Yap_Error(Yap_Error_TYPE, Yap_Error_Term, Yap_ErrorMessage);
setregs();
FAIL();
}
}
}
XREG(PREG->u.xxn.x) = d0;
PREG = NEXTOP(PREG, xxn);
GONext();
@ -11170,8 +11306,12 @@ Yap_absmi(int inp)
setregs();
}
}
if (PREG == (yamop *)FAILCODE)
if (d0 == 0L) {
saveregs();
Yap_Error(Yap_Error_TYPE, Yap_Error_Term, Yap_ErrorMessage);
setregs();
FAIL();
}
XREG(PREG->u.xxn.x) = d0;
PREG = NEXTOP(PREG, xxn);
GONext();
@ -11211,8 +11351,12 @@ Yap_absmi(int inp)
setregs();
}
BEGP(pt0);
if (PREG == (yamop *)FAILCODE)
if (d0 == 0L) {
saveregs();
Yap_Error(Yap_Error_TYPE, Yap_Error_Term, Yap_ErrorMessage);
setregs();
FAIL();
}
pt0 = YREG + PREG->u.yxx.y;
PREG = NEXTOP(PREG, yxx);
#if defined(SBA) && defined(FROZEN_STACKS)
@ -11257,10 +11401,14 @@ Yap_absmi(int inp)
saveregs();
d0 = p_slr(Yap_Eval(d0), MkIntegerTerm(d1));
setregs();
if (PREG == (yamop *)FAILCODE)
if (d0 == 0L) {
saveregs();
Yap_Error(Yap_Error_TYPE, Yap_Error_Term, Yap_ErrorMessage);
setregs();
FAIL();
}
}
}
BEGP(pt0);
pt0 = YREG + PREG->u.yxn.y;
PREG = NEXTOP(PREG, yxn);
@ -11302,8 +11450,12 @@ Yap_absmi(int inp)
setregs();
}
}
if (PREG == (yamop *)FAILCODE)
if (d0 == 0L) {
saveregs();
Yap_Error(Yap_Error_TYPE, Yap_Error_Term, Yap_ErrorMessage);
setregs();
FAIL();
}
BEGP(pt0);
pt0 = YREG + PREG->u.yxn.y;
PREG = NEXTOP(PREG, yxn);

View File

@ -1171,6 +1171,8 @@ Yap_tokenizer(int inp_stream, Term *tposp)
t->Tok = Ord(kind = Name_tok);
if (ch == '(')
solo_flag = FALSE;
else
solo_flag = TRUE;
}
break;

View File

@ -17,10 +17,20 @@
break;
case _get_2atoms:
if (is_regcopy(myregs, nofregs, Yap_regnotoreg(1))) {
if (IsApplTerm(cl->u.cc.c1)) {
CELL *pt = RepAppl(cl->u.cc.c1);
clause->Tag = AbsAppl((CELL *)pt[0]);
clause->u.t_ptr = cl->u.cc.c1;
} else
clause->Tag = cl->u.cc.c1;
return;
}
if (is_regcopy(myregs, nofregs, Yap_regnotoreg(2))) {
if (IsApplTerm(cl->u.cc.c2)) {
CELL *pt = RepAppl(cl->u.cc.c2);
clause->Tag = AbsAppl((CELL *)pt[0]);
clause->u.t_ptr = cl->u.cc.c2;
} else
clause->Tag = cl->u.cc.c2;
return;
}
@ -28,14 +38,29 @@
break;
case _get_3atoms:
if (is_regcopy(myregs, nofregs, Yap_regnotoreg(1))) {
if (IsApplTerm(cl->u.ccc.c1)) {
CELL *pt = RepAppl(cl->u.ccc.c1);
clause->Tag = AbsAppl((CELL *)pt[0]);
clause->u.t_ptr = cl->u.ccc.c1;
} else
clause->Tag = cl->u.ccc.c1;
return;
}
if (is_regcopy(myregs, nofregs, Yap_regnotoreg(2))) {
if (IsApplTerm(cl->u.ccc.c2)) {
CELL *pt = RepAppl(cl->u.ccc.c2);
clause->Tag = AbsAppl((CELL *)pt[0]);
clause->u.t_ptr = cl->u.ccc.c2;
} else
clause->Tag = cl->u.ccc.c2;
return;
}
if (is_regcopy(myregs, nofregs, Yap_regnotoreg(3))) {
if (IsApplTerm(cl->u.ccc.c3)) {
CELL *pt = RepAppl(cl->u.ccc.c3);
clause->Tag = AbsAppl((CELL *)pt[0]);
clause->u.t_ptr = cl->u.ccc.c3;
} else
clause->Tag = cl->u.ccc.c3;
return;
}
@ -43,18 +68,38 @@
break;
case _get_4atoms:
if (is_regcopy(myregs, nofregs, Yap_regnotoreg(1))) {
if (IsApplTerm(cl->u.cccc.c1)) {
CELL *pt = RepAppl(cl->u.cccc.c1);
clause->Tag = AbsAppl((CELL *)pt[0]);
clause->u.t_ptr = cl->u.cccc.c1;
} else
clause->Tag = cl->u.cccc.c1;
return;
}
if (is_regcopy(myregs, nofregs, Yap_regnotoreg(2))) {
if (IsApplTerm(cl->u.cccc.c2)) {
CELL *pt = RepAppl(cl->u.cccc.c2);
clause->Tag = AbsAppl((CELL *)pt[0]);
clause->u.t_ptr = cl->u.cccc.c2;
} else
clause->Tag = cl->u.cccc.c2;
return;
}
if (is_regcopy(myregs, nofregs, Yap_regnotoreg(3))) {
if (IsApplTerm(cl->u.cccc.c3)) {
CELL *pt = RepAppl(cl->u.cccc.c3);
clause->Tag = AbsAppl((CELL *)pt[0]);
clause->u.t_ptr = cl->u.cccc.c3;
} else
clause->Tag = cl->u.cccc.c3;
return;
}
if (is_regcopy(myregs, nofregs, Yap_regnotoreg(4))) {
if (IsApplTerm(cl->u.cccc.c4)) {
CELL *pt = RepAppl(cl->u.cccc.c4);
clause->Tag = AbsAppl((CELL *)pt[0]);
clause->u.t_ptr = cl->u.cccc.c4;
} else
clause->Tag = cl->u.cccc.c4;
return;
}
@ -62,22 +107,47 @@
break;
case _get_5atoms:
if (is_regcopy(myregs, nofregs, Yap_regnotoreg(1))) {
if (IsApplTerm(cl->u.ccccc.c1)) {
CELL *pt = RepAppl(cl->u.ccccc.c1);
clause->Tag = AbsAppl((CELL *)pt[0]);
clause->u.t_ptr = cl->u.ccccc.c1;
} else
clause->Tag = cl->u.ccccc.c1;
return;
}
if (is_regcopy(myregs, nofregs, Yap_regnotoreg(2))) {
if (IsApplTerm(cl->u.ccccc.c2)) {
CELL *pt = RepAppl(cl->u.ccccc.c2);
clause->Tag = AbsAppl((CELL *)pt[0]);
clause->u.t_ptr = cl->u.ccccc.c2;
} else
clause->Tag = cl->u.ccccc.c2;
return;
}
if (is_regcopy(myregs, nofregs, Yap_regnotoreg(3))) {
if (IsApplTerm(cl->u.ccccc.c3)) {
CELL *pt = RepAppl(cl->u.ccccc.c3);
clause->Tag = AbsAppl((CELL *)pt[0]);
clause->u.t_ptr = cl->u.ccccc.c3;
} else
clause->Tag = cl->u.ccccc.c3;
return;
}
if (is_regcopy(myregs, nofregs, Yap_regnotoreg(4))) {
if (IsApplTerm(cl->u.ccccc.c4)) {
CELL *pt = RepAppl(cl->u.ccccc.c4);
clause->Tag = AbsAppl((CELL *)pt[0]);
clause->u.t_ptr = cl->u.ccccc.c4;
} else
clause->Tag = cl->u.ccccc.c4;
return;
}
if (is_regcopy(myregs, nofregs, Yap_regnotoreg(5))) {
if (IsApplTerm(cl->u.ccccc.c5)) {
CELL *pt = RepAppl(cl->u.ccccc.c5);
clause->Tag = AbsAppl((CELL *)pt[0]);
clause->u.t_ptr = cl->u.ccccc.c5;
} else
clause->Tag = cl->u.ccccc.c5;
return;
}
@ -85,26 +155,56 @@
break;
case _get_6atoms:
if (is_regcopy(myregs, nofregs, Yap_regnotoreg(1))) {
if (IsApplTerm(cl->u.cccccc.c1)) {
CELL *pt = RepAppl(cl->u.cccccc.c1);
clause->Tag = AbsAppl((CELL *)pt[0]);
clause->u.t_ptr = cl->u.cccccc.c1;
} else
clause->Tag = cl->u.cccccc.c1;
return;
}
if (is_regcopy(myregs, nofregs, Yap_regnotoreg(2))) {
if (IsApplTerm(cl->u.cccccc.c2)) {
CELL *pt = RepAppl(cl->u.cccccc.c2);
clause->Tag = AbsAppl((CELL *)pt[0]);
clause->u.t_ptr = cl->u.cccccc.c2;
} else
clause->Tag = cl->u.cccccc.c2;
return;
}
if (is_regcopy(myregs, nofregs, Yap_regnotoreg(3))) {
if (IsApplTerm(cl->u.cccccc.c3)) {
CELL *pt = RepAppl(cl->u.cccccc.c3);
clause->Tag = AbsAppl((CELL *)pt[0]);
clause->u.t_ptr = cl->u.cccccc.c3;
} else
clause->Tag = cl->u.cccccc.c3;
return;
}
if (is_regcopy(myregs, nofregs, Yap_regnotoreg(4))) {
if (IsApplTerm(cl->u.cccccc.c4)) {
CELL *pt = RepAppl(cl->u.cccccc.c4);
clause->Tag = AbsAppl((CELL *)pt[0]);
clause->u.t_ptr = cl->u.cccccc.c4;
} else
clause->Tag = cl->u.cccccc.c4;
return;
}
if (is_regcopy(myregs, nofregs, Yap_regnotoreg(5))) {
if (IsApplTerm(cl->u.cccccc.c5)) {
CELL *pt = RepAppl(cl->u.cccccc.c5);
clause->Tag = AbsAppl((CELL *)pt[0]);
clause->u.t_ptr = cl->u.cccccc.c5;
} else
clause->Tag = cl->u.cccccc.c5;
return;
}
if (is_regcopy(myregs, nofregs, Yap_regnotoreg(6))) {
if (IsApplTerm(cl->u.cccccc.c6)) {
CELL *pt = RepAppl(cl->u.cccccc.c6);
clause->Tag = AbsAppl((CELL *)pt[0]);
clause->u.t_ptr = cl->u.cccccc.c6;
} else
clause->Tag = cl->u.cccccc.c6;
return;
}
@ -558,6 +658,11 @@
break;
case _get_atom:
if (is_regcopy(myregs, nofregs, cl->u.xc.x)) {
if (IsApplTerm(cl->u.xc.c)) {
CELL *pt = RepAppl(cl->u.xc.c);
clause->Tag = AbsAppl((CELL *)pt[0]);
clause->u.t_ptr = cl->u.xc.c;
} else
clause->Tag = cl->u.xc.c;
return;
}

View File

@ -11,10 +11,20 @@
break;
case _get_2atoms:
if (iarg == Yap_regnotoreg(1)) {
if (IsApplTerm(cl->u.cc.c1)) {
CELL *pt = RepAppl(cl->u.cc.c1);
clause->Tag = AbsAppl((CELL *)pt[0]);
clause->u.t_ptr = cl->u.cc.c1;
} else
clause->Tag = cl->u.cc.c1;
return;
}
if (iarg == Yap_regnotoreg(2)) {
if (IsApplTerm(cl->u.cc.c2)) {
CELL *pt = RepAppl(cl->u.cc.c2);
clause->Tag = AbsAppl((CELL *)pt[0]);
clause->u.t_ptr = cl->u.cc.c2;
} else
clause->Tag = cl->u.cc.c2;
return;
}
@ -22,14 +32,29 @@
break;
case _get_3atoms:
if (iarg == Yap_regnotoreg(1)) {
if (IsApplTerm(cl->u.ccc.c1)) {
CELL *pt = RepAppl(cl->u.ccc.c1);
clause->Tag = AbsAppl((CELL *)pt[0]);
clause->u.t_ptr = cl->u.ccc.c1;
} else
clause->Tag = cl->u.ccc.c1;
return;
}
if (iarg == Yap_regnotoreg(2)) {
if (IsApplTerm(cl->u.ccc.c2)) {
CELL *pt = RepAppl(cl->u.ccc.c2);
clause->Tag = AbsAppl((CELL *)pt[0]);
clause->u.t_ptr = cl->u.ccc.c2;
} else
clause->Tag = cl->u.ccc.c2;
return;
}
if (iarg == Yap_regnotoreg(3)) {
if (IsApplTerm(cl->u.ccc.c3)) {
CELL *pt = RepAppl(cl->u.ccc.c3);
clause->Tag = AbsAppl((CELL *)pt[0]);
clause->u.t_ptr = cl->u.ccc.c3;
} else
clause->Tag = cl->u.ccc.c3;
return;
}
@ -37,18 +62,38 @@
break;
case _get_4atoms:
if (iarg == Yap_regnotoreg(1)) {
if (IsApplTerm(cl->u.cccc.c1)) {
CELL *pt = RepAppl(cl->u.cccc.c1);
clause->Tag = AbsAppl((CELL *)pt[0]);
clause->u.t_ptr = cl->u.cccc.c1;
} else
clause->Tag = cl->u.cccc.c1;
return;
}
if (iarg == Yap_regnotoreg(2)) {
if (IsApplTerm(cl->u.cccc.c2)) {
CELL *pt = RepAppl(cl->u.cccc.c2);
clause->Tag = AbsAppl((CELL *)pt[0]);
clause->u.t_ptr = cl->u.cccc.c2;
} else
clause->Tag = cl->u.cccc.c2;
return;
}
if (iarg == Yap_regnotoreg(3)) {
if (IsApplTerm(cl->u.cccc.c3)) {
CELL *pt = RepAppl(cl->u.cccc.c3);
clause->Tag = AbsAppl((CELL *)pt[0]);
clause->u.t_ptr = cl->u.cccc.c3;
} else
clause->Tag = cl->u.cccc.c3;
return;
}
if (iarg == Yap_regnotoreg(4)) {
if (IsApplTerm(cl->u.cccc.c4)) {
CELL *pt = RepAppl(cl->u.cccc.c4);
clause->Tag = AbsAppl((CELL *)pt[0]);
clause->u.t_ptr = cl->u.cccc.c4;
} else
clause->Tag = cl->u.cccc.c4;
return;
}
@ -56,22 +101,47 @@
break;
case _get_5atoms:
if (iarg == Yap_regnotoreg(1)) {
if (IsApplTerm(cl->u.ccccc.c1)) {
CELL *pt = RepAppl(cl->u.ccccc.c1);
clause->Tag = AbsAppl((CELL *)pt[0]);
clause->u.t_ptr = cl->u.ccccc.c1;
} else
clause->Tag = cl->u.ccccc.c1;
return;
}
if (iarg == Yap_regnotoreg(2)) {
if (IsApplTerm(cl->u.ccccc.c2)) {
CELL *pt = RepAppl(cl->u.ccccc.c2);
clause->Tag = AbsAppl((CELL *)pt[0]);
clause->u.t_ptr = cl->u.ccccc.c2;
} else
clause->Tag = cl->u.ccccc.c2;
return;
}
if (iarg == Yap_regnotoreg(3)) {
if (IsApplTerm(cl->u.ccccc.c3)) {
CELL *pt = RepAppl(cl->u.ccccc.c3);
clause->Tag = AbsAppl((CELL *)pt[0]);
clause->u.t_ptr = cl->u.ccccc.c3;
} else
clause->Tag = cl->u.ccccc.c3;
return;
}
if (iarg == Yap_regnotoreg(4)) {
if (IsApplTerm(cl->u.ccccc.c4)) {
CELL *pt = RepAppl(cl->u.ccccc.c4);
clause->Tag = AbsAppl((CELL *)pt[0]);
clause->u.t_ptr = cl->u.ccccc.c4;
} else
clause->Tag = cl->u.ccccc.c4;
return;
}
if (iarg == Yap_regnotoreg(5)) {
if (IsApplTerm(cl->u.ccccc.c5)) {
CELL *pt = RepAppl(cl->u.ccccc.c5);
clause->Tag = AbsAppl((CELL *)pt[0]);
clause->u.t_ptr = cl->u.ccccc.c5;
} else
clause->Tag = cl->u.ccccc.c5;
return;
}
@ -79,26 +149,56 @@
break;
case _get_6atoms:
if (iarg == Yap_regnotoreg(1)) {
if (IsApplTerm(cl->u.cccccc.c1)) {
CELL *pt = RepAppl(cl->u.cccccc.c1);
clause->Tag = AbsAppl((CELL *)pt[0]);
clause->u.t_ptr = cl->u.cccccc.c1;
} else
clause->Tag = cl->u.cccccc.c1;
return;
}
if (iarg == Yap_regnotoreg(2)) {
if (IsApplTerm(cl->u.cccccc.c2)) {
CELL *pt = RepAppl(cl->u.cccccc.c2);
clause->Tag = AbsAppl((CELL *)pt[0]);
clause->u.t_ptr = cl->u.cccccc.c2;
} else
clause->Tag = cl->u.cccccc.c2;
return;
}
if (iarg == Yap_regnotoreg(3)) {
if (IsApplTerm(cl->u.cccccc.c3)) {
CELL *pt = RepAppl(cl->u.cccccc.c3);
clause->Tag = AbsAppl((CELL *)pt[0]);
clause->u.t_ptr = cl->u.cccccc.c3;
} else
clause->Tag = cl->u.cccccc.c3;
return;
}
if (iarg == Yap_regnotoreg(4)) {
if (IsApplTerm(cl->u.cccccc.c4)) {
CELL *pt = RepAppl(cl->u.cccccc.c4);
clause->Tag = AbsAppl((CELL *)pt[0]);
clause->u.t_ptr = cl->u.cccccc.c4;
} else
clause->Tag = cl->u.cccccc.c4;
return;
}
if (iarg == Yap_regnotoreg(5)) {
if (IsApplTerm(cl->u.cccccc.c5)) {
CELL *pt = RepAppl(cl->u.cccccc.c5);
clause->Tag = AbsAppl((CELL *)pt[0]);
clause->u.t_ptr = cl->u.cccccc.c5;
} else
clause->Tag = cl->u.cccccc.c5;
return;
}
if (iarg == Yap_regnotoreg(6)) {
if (IsApplTerm(cl->u.cccccc.c6)) {
CELL *pt = RepAppl(cl->u.cccccc.c6);
clause->Tag = AbsAppl((CELL *)pt[0]);
clause->u.t_ptr = cl->u.cccccc.c6;
} else
clause->Tag = cl->u.cccccc.c6;
return;
}
@ -455,6 +555,11 @@
break;
case _get_atom:
if (iarg == cl->u.xc.x) {
if (IsApplTerm(cl->u.xc.c)) {
CELL *pt = RepAppl(cl->u.xc.c);
clause->Tag = AbsAppl((CELL *)pt[0]);
clause->u.t_ptr = cl->u.xc.c;
} else
clause->Tag = cl->u.xc.c;
return;
}

View File

@ -58,6 +58,7 @@
AtomCut = Yap_LookupAtom("!");
AtomCutBy = Yap_FullLookupAtom("$cut_by");
AtomDAbort = Yap_FullLookupAtom("$abort");
AtomDBREF = Yap_LookupAtom("DBRef");
AtomDBReference = Yap_LookupAtom("db_reference");
AtomDBTerm = Yap_LookupAtom("db_term");
AtomDBref = Yap_FullLookupAtom("$dbref");

View File

@ -67,7 +67,7 @@ A CurrentModule F "$current_module"
A Cut N "!"
A CutBy F "$cut_by"
A DAbort F "$abort"
A DBREF A "DBRef"
A DBREF N "DBRef"
A DBReference N "db_reference"
A DBTerm N "db_term"
A DBref F "$dbref"

View File

@ -483,17 +483,19 @@ dump_action(bind(Who,What,Extra), _, T, L) :-
integer(Who), !,
handle_bind_extra(Extra, T, Command),
handle_constant(What, T, Constant),
check_atom_dbref(What, Constant, ExtraAction),
format(L,' if (is_regcopy(myregs, nofregs, Yap_regnotoreg(~d))) {
clause->Tag = ~s;~s
~sclause->Tag = ~s;~s
return;
}~n', [Who,Constant,Command]).
}~n', [Who, ExtraAction, Constant, Command]).
dump_action(bind(Who,What,Extra), _, T, L) :-
handle_bind_extra(Extra, T, Command),
handle_constant(What, T, Constant),
check_atom_dbref(What, Constant, ExtraAction),
format(L,' if (is_regcopy(myregs, nofregs, cl->u.~s.~s)) {
clause->Tag = ~s;~s
~sclause->Tag = ~s;~s
return;
}~n', [T,Who,Constant,Command]).
}~n', [T, Who, ExtraAction, Constant, Command]).
dump_action(new(Who), _, T, L) :-
format(L,' if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.~s.~s))) {
clause->Tag = (CELL)NULL;
@ -533,6 +535,19 @@ dump_action(logical, _, _, L) :-
}
return;~n', []).
%
% atoms may actually be dbrefs :(
check_atom_dbref(Constant, What, ExtraAction) :-
Constant = [0'c|_], !, %0'c
format_to_chars("if (IsApplTerm(~s)) {
CELL *pt = RepAppl(~s);
clause->Tag = AbsAppl((CELL *)pt[0]);
clause->u.t_ptr = ~s;
} else
",[What,What,What], ExtraAction).
check_atom_dbref(_, _, "").
handle_bind_extra([], _, "").
handle_bind_extra(t_ptr=[], _,S) :- !,
format_to_chars("~n clause->u.t_ptr = (CELL)NULL;",[],S).
@ -589,17 +604,19 @@ dump_head_action(bind(Who,What,Extra), _, T, L) :-
integer(Who), !,
handle_bind_extra(Extra, T, Command),
handle_constant(What, T, Constant),
check_atom_dbref(What, Constant, ExtraAction),
format(L,' if (iarg == Yap_regnotoreg(~d)) {
clause->Tag = ~s;~s
~sclause->Tag = ~s;~s
return;
}~n', [Who,Constant,Command]).
}~n', [Who,ExtraAction,Constant,Command]).
dump_head_action(bind(Who,What,Extra), _, T, L) :-
handle_constant(What, T, Constant),
handle_bind_extra(Extra, T, Command),
check_atom_dbref(What, Constant, ExtraAction),
format(L,' if (iarg == cl->u.~s.~s) {
clause->Tag = ~s;~s
~sclause->Tag = ~s;~s
return;
}~n', [T,Who,Constant,Command]).
}~n', [T,Who,ExtraAction,Constant,Command]).
dump_head_action(new(Who), _, _, _) :- Who = [0'y|_], !. % 0'y done
dump_head_action(new(Who), _, T, L) :-
format(L,' if (iarg == cl->u.~s.~s) {

@ -1 +1 @@
Subproject commit d9614e99dc98f8546fdc213c9e45003cf6efd520
Subproject commit 9f80255cce18ee268792631aa1180e19a496346f