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,8 +9705,12 @@ 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);
@ -9746,8 +9750,12 @@ 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;
@ -9783,8 +9791,12 @@ 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;
@ -9831,8 +9843,12 @@ 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);
@ -9875,8 +9891,12 @@ 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);
@ -9916,8 +9936,12 @@ 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;
@ -9953,8 +9977,12 @@ 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;
@ -10001,8 +10029,12 @@ 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);
@ -10045,8 +10077,12 @@ 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);
@ -10086,8 +10122,12 @@ 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;
@ -10123,8 +10163,12 @@ 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;
@ -10171,8 +10215,12 @@ 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);
@ -10222,8 +10270,12 @@ 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);
@ -10263,8 +10315,12 @@ 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;
@ -10302,8 +10358,12 @@ 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;
@ -10346,8 +10406,12 @@ 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;
@ -10394,8 +10458,12 @@ 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);
@ -10441,8 +10509,12 @@ 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);
@ -10486,8 +10558,12 @@ 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);
@ -10527,8 +10603,12 @@ 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;
@ -10564,8 +10644,12 @@ 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;
@ -10612,8 +10696,12 @@ 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);
@ -10657,8 +10745,12 @@ 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);
@ -10697,8 +10789,12 @@ 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;
@ -10734,8 +10830,12 @@ 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;
@ -10782,8 +10882,12 @@ 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);
@ -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,8 +11263,12 @@ 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;
@ -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,8 +11401,12 @@ 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);
@ -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,95 +17,195 @@
break;
case _get_2atoms:
if (is_regcopy(myregs, nofregs, Yap_regnotoreg(1))) {
clause->Tag = cl->u.cc.c1;
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))) {
clause->Tag = cl->u.cc.c2;
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;
}
cl = NEXTOP(cl,cc);
break;
case _get_3atoms:
if (is_regcopy(myregs, nofregs, Yap_regnotoreg(1))) {
clause->Tag = cl->u.ccc.c1;
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))) {
clause->Tag = cl->u.ccc.c2;
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))) {
clause->Tag = cl->u.ccc.c3;
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;
}
cl = NEXTOP(cl,ccc);
break;
case _get_4atoms:
if (is_regcopy(myregs, nofregs, Yap_regnotoreg(1))) {
clause->Tag = cl->u.cccc.c1;
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))) {
clause->Tag = cl->u.cccc.c2;
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))) {
clause->Tag = cl->u.cccc.c3;
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))) {
clause->Tag = cl->u.cccc.c4;
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;
}
cl = NEXTOP(cl,cccc);
break;
case _get_5atoms:
if (is_regcopy(myregs, nofregs, Yap_regnotoreg(1))) {
clause->Tag = cl->u.ccccc.c1;
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))) {
clause->Tag = cl->u.ccccc.c2;
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))) {
clause->Tag = cl->u.ccccc.c3;
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))) {
clause->Tag = cl->u.ccccc.c4;
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))) {
clause->Tag = cl->u.ccccc.c5;
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;
}
cl = NEXTOP(cl,ccccc);
break;
case _get_6atoms:
if (is_regcopy(myregs, nofregs, Yap_regnotoreg(1))) {
clause->Tag = cl->u.cccccc.c1;
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))) {
clause->Tag = cl->u.cccccc.c2;
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))) {
clause->Tag = cl->u.cccccc.c3;
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))) {
clause->Tag = cl->u.cccccc.c4;
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))) {
clause->Tag = cl->u.cccccc.c5;
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))) {
clause->Tag = cl->u.cccccc.c6;
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;
}
cl = NEXTOP(cl,cccccc);
@ -558,7 +658,12 @@
break;
case _get_atom:
if (is_regcopy(myregs, nofregs, cl->u.xc.x)) {
clause->Tag = cl->u.xc.c;
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;
}
cl = NEXTOP(cl,xc);

View File

@ -11,95 +11,195 @@
break;
case _get_2atoms:
if (iarg == Yap_regnotoreg(1)) {
clause->Tag = cl->u.cc.c1;
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)) {
clause->Tag = cl->u.cc.c2;
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;
}
cl = NEXTOP(cl,cc);
break;
case _get_3atoms:
if (iarg == Yap_regnotoreg(1)) {
clause->Tag = cl->u.ccc.c1;
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)) {
clause->Tag = cl->u.ccc.c2;
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)) {
clause->Tag = cl->u.ccc.c3;
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;
}
cl = NEXTOP(cl,ccc);
break;
case _get_4atoms:
if (iarg == Yap_regnotoreg(1)) {
clause->Tag = cl->u.cccc.c1;
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)) {
clause->Tag = cl->u.cccc.c2;
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)) {
clause->Tag = cl->u.cccc.c3;
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)) {
clause->Tag = cl->u.cccc.c4;
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;
}
cl = NEXTOP(cl,cccc);
break;
case _get_5atoms:
if (iarg == Yap_regnotoreg(1)) {
clause->Tag = cl->u.ccccc.c1;
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)) {
clause->Tag = cl->u.ccccc.c2;
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)) {
clause->Tag = cl->u.ccccc.c3;
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)) {
clause->Tag = cl->u.ccccc.c4;
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)) {
clause->Tag = cl->u.ccccc.c5;
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;
}
cl = NEXTOP(cl,ccccc);
break;
case _get_6atoms:
if (iarg == Yap_regnotoreg(1)) {
clause->Tag = cl->u.cccccc.c1;
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)) {
clause->Tag = cl->u.cccccc.c2;
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)) {
clause->Tag = cl->u.cccccc.c3;
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)) {
clause->Tag = cl->u.cccccc.c4;
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)) {
clause->Tag = cl->u.cccccc.c5;
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)) {
clause->Tag = cl->u.cccccc.c6;
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;
}
cl = NEXTOP(cl,cccccc);
@ -455,7 +555,12 @@
break;
case _get_atom:
if (iarg == cl->u.xc.x) {
clause->Tag = cl->u.xc.c;
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;
}
cl = NEXTOP(cl,xc);

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;
@ -532,7 +534,20 @@ dump_action(logical, _, _, L) :-
clause->Tag = (CELL)NULL;
}
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