From 11eed457c122e651fd26362bb9c1875b8fe60ecb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Santos=20Costa?= Date: Mon, 29 Dec 2008 00:14:47 +0000 Subject: [PATCH] use automatucally generate code to find indexing information. --- C/index.c | 1637 +---------------------------- H/findclause.h | 2714 ++++++++++++++++++++++++++++++++++++++++++++++++ H/headclause.h | 1797 ++++++++++++++++++++++++++++++++ H/walkclause.h | 7 +- misc/buildops | 590 ++++++++++- 5 files changed, 5138 insertions(+), 1607 deletions(-) create mode 100644 H/findclause.h create mode 100644 H/headclause.h diff --git a/C/index.c b/C/index.c index 508abf364..a0434cc76 100644 --- a/C/index.c +++ b/C/index.c @@ -830,17 +830,6 @@ sort_group(GroupDef *grp, CELL *top, struct intermediates *cint) copy_back(grp->FirstClause, top, max); } -/* add copy to register stack for original reg */ -static int -add_regcopy(wamreg regs[MAX_REG_COPIES], int regs_count, wamreg copy) -{ - if (regs_count == MAX_REG_COPIES) { - regs[0] = copy; - } - regs[regs_count] = copy; - return regs_count+1; -} - /* add copy to register stack for original reg */ static int init_regcopy(wamreg regs[MAX_REG_COPIES], wamreg copy) @@ -849,6 +838,21 @@ init_regcopy(wamreg regs[MAX_REG_COPIES], wamreg copy) return 1; } +/* add copy to register stack for original reg */ +static int +is_regcopy(wamreg regs[MAX_REG_COPIES], int regs_count, wamreg copy) +{ + int i = 0; + while (i < regs_count) { + if (regs[i] == copy) { + return TRUE; + } + i++; + } + /* this copy had overflowed, or it just was not there */ + return FALSE; +} + /* add copy to register stack for original reg */ static int delete_regcopy(wamreg regs[MAX_REG_COPIES], int regs_count, wamreg copy) @@ -866,18 +870,44 @@ delete_regcopy(wamreg regs[MAX_REG_COPIES], int regs_count, wamreg copy) return regs_count; } +/* add copy to register stack for original reg */ +static int +add_regcopy(wamreg regs[MAX_REG_COPIES], int regs_count, Int source, Int copy) +{ + int i = 0; + while (i < regs_count) { + if (regs[i] == source) { + /* we found it, add new element as last element */ + if (regs_count == MAX_REG_COPIES) { + return regs_count; + } + regs[regs_count] = copy; + return regs_count+1; + } + i++; + } + /* be careful: we may overwrite an existing copy */ + return delete_regcopy(regs, regs_count, copy); +} + + + /* add copy to register stack for original reg */ inline static int -regcopy_in(wamreg regs[MAX_REG_COPIES], int regs_count, wamreg copy) +link_regcopies(wamreg regs[MAX_REG_COPIES], int regs_count, Int c1, Int c2) { int i; for (i=0; iCurrentCode; - while (TRUE) { - op_numbers op = Yap_op_from_opcode(cl->opc); - switch (op) { - case _alloc_for_logical_pred: - cl = NEXTOP(cl,L); - break; - case _cut: - case _cut_t: - case _cut_e: - clause->Tag = (CELL)NULL; - return; - case _deallocate: - cl = NEXTOP(cl,p); - break; - case _allocate: - case _write_void: - case _write_list: - case _write_l_list: - case _enter_a_profiling: - case _count_a_call: - cl = NEXTOP(cl,e); - break; - case _commit_b_x: - clause->Tag = (CELL)NULL; - return; - case _write_x_val: - case _write_x_loc: - case _write_x_var: - cl = NEXTOP(cl,x); - break; - case _save_b_x: - case _put_list: - if (regcopy_in(myregs, nofregs, cl->u.x.x)) { - clause->Tag = (CELL)NULL; - clause->u.t_ptr = (CELL)NULL; - return; - } - cl = NEXTOP(cl,x); - break; - case _p_nonvar_x: - if (cl->u.xl.F != FAILCODE) { - clause->Tag = (CELL)NULL; - return; - } - if (regcopy_in(myregs, nofregs, cl->u.xl.x)) { - clause->Tag = (CELL)NULL; - clause->u.t_ptr = (CELL)NULL; - return; - } - cl = NEXTOP(cl,xl); - break; - case _p_number_x: - if (cl->u.xl.F != FAILCODE) { - clause->Tag = (CELL)NULL; - return; - } - if (regcopy_in(myregs, nofregs, cl->u.xl.x)) { - clause->Tag = (_number+1)*sizeof(CELL); - clause->u.t_ptr = (CELL)NULL; - return; - } - cl = NEXTOP(cl,xl); - break; - case _p_atomic_x: - if (cl->u.xl.F != FAILCODE) { - clause->Tag = (CELL)NULL; - return; - } - if (regcopy_in(myregs, nofregs, cl->u.xl.x)) { - clause->Tag = (_atomic+1)*sizeof(CELL); - clause->u.t_ptr = (CELL)NULL; - return; - } - cl = NEXTOP(cl,xl); - break; - case _p_integer_x: - if (cl->u.xl.F != FAILCODE) { - clause->Tag = (CELL)NULL; - return; - } - if (regcopy_in(myregs, nofregs, cl->u.xl.x)) { - clause->Tag = (_integer+1)*sizeof(CELL); - clause->u.t_ptr = (CELL)NULL; - return; - } - cl = NEXTOP(cl,xl); - break; - case _p_primitive_x: - if (cl->u.xl.F != FAILCODE) { - clause->Tag = (CELL)NULL; - return; - } - if (regcopy_in(myregs, nofregs, cl->u.xl.x)) { - clause->Tag = (_primitive+1)*sizeof(CELL); - clause->u.t_ptr = (CELL)NULL; - return; - } - cl = NEXTOP(cl,xl); - break; - case _p_compound_x: - if (cl->u.xl.F != FAILCODE) { - clause->Tag = (CELL)NULL; - return; - } - if (regcopy_in(myregs, nofregs, cl->u.xl.x)) { - clause->Tag = (_compound+1)*sizeof(CELL); - clause->u.t_ptr = (CELL)NULL; - return; - } - cl = NEXTOP(cl,xl); - break; - case _p_var_x: - if (cl->u.xl.F != FAILCODE) { - clause->Tag = (CELL)NULL; - return; - } - if (regcopy_in(myregs, nofregs, cl->u.xl.x)) { - clause->Tag = (_var+1)*sizeof(CELL); - clause->u.t_ptr = (CELL)NULL; - return; - } - cl = NEXTOP(cl,xl); - break; - case _p_db_ref_x: - if (cl->u.xl.F != FAILCODE) { - clause->Tag = (CELL)NULL; - return; - } - if (regcopy_in(myregs, nofregs, cl->u.xl.x)) { - clause->Tag = AbsAppl((CELL *)FunctorDBRef); - clause->u.t_ptr = (CELL)NULL; - return; - } - cl = NEXTOP(cl,xl); - break; - case _p_float_x: - if (cl->u.xl.F != FAILCODE) { - clause->Tag = (CELL)NULL; - return; - } - if (regcopy_in(myregs, nofregs, cl->u.xl.x)) { - clause->Tag = AbsAppl((CELL *)FunctorDouble); - clause->u.t_ptr = (CELL)NULL; - return; - } - cl = NEXTOP(cl,xl); - break; - case _p_atom_x: - if (cl->u.xl.F != FAILCODE) { - clause->Tag = (CELL)NULL; - return; - } - if (regcopy_in(myregs, nofregs, cl->u.xl.x)) { - clause->Tag = (_atom+1)*sizeof(CELL); - clause->u.t_ptr = (CELL)NULL; - return; - } - cl = NEXTOP(cl,xl); - break; - case _get_list: - if (regcopy_in(myregs, nofregs, cl->u.x.x)) { - clause->Tag = AbsPair(NULL); - clause->u.WorkPC = NEXTOP(cl,x); - return; - } - cl = NEXTOP(cl,x); - break; - case _p_cut_by_x: - clause->Tag = (CELL)NULL; - return; - case _commit_b_y: - clause->Tag = (CELL)NULL; - return; - case _save_b_y: - case _write_y_var: - case _write_y_val: - case _write_y_loc: - if (cl->u.y.y == ycopy) { - clause->Tag = (CELL)NULL; - clause->u.t_ptr = (CELL)NULL; - return; - } - cl = NEXTOP(cl,y); - break; - case _p_nonvar_y: - if (cl->u.yl.F != FAILCODE) { - clause->Tag = (CELL)NULL; - return; - } - if (cl->u.yl.y == ycopy) { - clause->Tag = (CELL)NULL; - clause->u.t_ptr = (CELL)NULL; - return; - } - cl = NEXTOP(cl,yl); - break; - case _p_atomic_y: - if (cl->u.yl.F != FAILCODE) { - clause->Tag = (CELL)NULL; - return; - } - if (ycopy == cl->u.yl.y) { - clause->Tag = (_atomic+1)*sizeof(CELL); - clause->u.t_ptr = (CELL)NULL; - return; - } - cl = NEXTOP(cl,yl); - break; - case _p_integer_y: - if (cl->u.yl.F != FAILCODE) { - clause->Tag = (CELL)NULL; - return; - } - if (ycopy == cl->u.yl.y) { - clause->Tag = (_integer+1)*sizeof(CELL); - clause->u.t_ptr = (CELL)NULL; - return; - } - cl = NEXTOP(cl,yl); - break; - case _p_number_y: - if (cl->u.yl.F != FAILCODE) { - clause->Tag = (CELL)NULL; - return; - } - if (ycopy == cl->u.yl.y) { - clause->Tag = (_number+1)*sizeof(CELL); - clause->u.t_ptr = (CELL)NULL; - return; - } - cl = NEXTOP(cl,yl); - break; - case _p_primitive_y: - if (cl->u.yl.F != FAILCODE) { - clause->Tag = (CELL)NULL; - return; - } - if (ycopy == cl->u.yl.y) { - clause->Tag = (_primitive+1)*sizeof(CELL); - clause->u.t_ptr = (CELL)NULL; - return; - } - cl = NEXTOP(cl,yl); - break; - case _p_compound_y: - if (cl->u.yl.F != FAILCODE) { - clause->Tag = (CELL)NULL; - return; - } - if (ycopy == cl->u.yl.y) { - clause->Tag = (_compound+1)*sizeof(CELL); - clause->u.t_ptr = (CELL)NULL; - return; - } - cl = NEXTOP(cl,yl); - break; - case _p_db_ref_y: - if (cl->u.yl.F != FAILCODE) { - clause->Tag = (CELL)NULL; - return; - } - if (ycopy == cl->u.yl.y) { - clause->Tag = AbsAppl((CELL *)FunctorDBRef); - clause->u.t_ptr = (CELL)NULL; - return; - } - cl = NEXTOP(cl,yl); - break; - case _p_float_y: - if (cl->u.yl.F != FAILCODE) { - clause->Tag = (CELL)NULL; - return; - } - if (ycopy == cl->u.yl.y) { - clause->Tag = AbsAppl((CELL *)FunctorDouble); - clause->u.t_ptr = (CELL)NULL; - return; - } - cl = NEXTOP(cl,yl); - break; - case _p_atom_y: - if (cl->u.yl.F != FAILCODE) { - clause->Tag = (CELL)NULL; - return; - } - if (cl->u.yl.y == ycopy) { - clause->Tag = (_atom+1)*sizeof(CELL); - clause->u.t_ptr = (CELL)NULL; - return; - } - cl = NEXTOP(cl,yl); - break; - case _p_var_y: - if (cl->u.yl.F != FAILCODE) { - clause->Tag = (CELL)NULL; - return; - } - if (cl->u.yl.y == ycopy) { - clause->Tag = (_var+1)*sizeof(CELL); - clause->u.t_ptr = (CELL)NULL; - return; - } - cl = NEXTOP(cl,yl); - break; - case _p_cut_by_y: - clause->Tag = (CELL)NULL; - return; - case _p_execute: - case _p_execute2: - case _fcall: - case _call: -#ifdef YAPOR - case _or_last: -#endif /* YAPOR */ - case _either: - case _or_else: - case _call_cpred: - case _call_usercpred: - clause->Tag = (CELL)NULL; - return; - case _get_x_var: - if (regcopy_in(myregs, nofregs, cl->u.xx.xr)) { - nofregs = add_regcopy(myregs, nofregs, cl->u.xx.xl); - cl = NEXTOP(cl,xx); - break; - } - case _put_x_var: - /* if the last slot I am using, get out */ - if (regcopy_in(myregs, nofregs, cl->u.xx.xl) && - (nofregs = delete_regcopy(myregs, nofregs, cl->u.xx.xl)) == 0 && - !ycopy) { - clause->Tag = (CELL)NULL; - return; - } - cl = NEXTOP(cl,xx); - break; - case _get_x_val: - /* alias two registers */ - if (regcopy_in(myregs, nofregs, cl->u.xx.xl)) { - nofregs = add_regcopy(myregs, nofregs, cl->u.xx.xr); - } else if (regcopy_in(myregs, nofregs, cl->u.xx.xr)) { - nofregs = add_regcopy(myregs, nofregs, cl->u.xx.xl); - } - cl = NEXTOP(cl,xx); - break; - case _put_x_val: - if (regcopy_in(myregs, nofregs, cl->u.xx.xl)) { - nofregs = add_regcopy(myregs, nofregs, cl->u.xx.xr); - } else if (regcopy_in(myregs, nofregs, cl->u.xx.xr) && - (nofregs = delete_regcopy(myregs, nofregs, cl->u.xx.xr)) == 0 && - !ycopy) { - clause->Tag = (CELL)NULL; - return; - } - cl = NEXTOP(cl,xx); - break; - case _put_xx_val: - if (regcopy_in(myregs, nofregs, cl->u.xxxx.xl1)) { - nofregs = add_regcopy(myregs, nofregs, cl->u.xxxx.xr1); - } else if (regcopy_in(myregs, nofregs, cl->u.xxxx.xr1) && - (nofregs = delete_regcopy(myregs, nofregs, cl->u.xxxx.xr1)) == 0 && - !ycopy) { - clause->Tag = (CELL)NULL; - return; - } - if (regcopy_in(myregs, nofregs, cl->u.xxxx.xl2)) { - nofregs = add_regcopy(myregs, nofregs, cl->u.xxxx.xr2); - } else if (regcopy_in(myregs, nofregs, cl->u.xxxx.xr2) && - (nofregs = delete_regcopy(myregs, nofregs, cl->u.xxxx.xr2)) == 0 && - !ycopy) { - clause->Tag = (CELL)NULL; - return; - } - cl = NEXTOP(cl,xxxx); - break; - case _glist_valx: - case _gl_void_varx: - case _gl_void_valx: - if (regcopy_in(myregs, nofregs, cl->u.xx.xl)) { - clause->u.WorkPC = cl; - clause->Tag = AbsPair(NULL); - return; - } - cl = NEXTOP(cl,xx); - break; - case _get_y_var: - if (regcopy_in(myregs, nofregs, cl->u.yx.x)) { - ycopy = cl->u.yx.y; - } - case _put_y_var: - cl = NEXTOP(cl,yx); - break; - case _put_y_val: - case _put_unsafe: - if (ycopy == cl->u.yx.y) { - nofregs = add_regcopy(myregs, nofregs, cl->u.yx.x); - } else { - nofregs = delete_regcopy(myregs, nofregs, cl->u.yx.x); - } - if (nofregs == 0 && !ycopy) { - clause->Tag = (CELL)NULL; - return; - } - cl = NEXTOP(cl,yx); - break; - case _get_y_val: - if (regcopy_in(myregs, nofregs, cl->u.yx.x)) { - ycopy = cl->u.yx.y; - } else if (ycopy == cl->u.yx.y) { - nofregs = add_regcopy(myregs, nofregs, cl->u.yx.x); - } - cl = NEXTOP(cl,yx); - break; - case _get_atom: - if (regcopy_in(myregs, nofregs, cl->u.xc.x)) { - clause->Tag = cl->u.xc.c; - return; - } else { - cl = NEXTOP(cl,xc); - } - break; - case _get_2atoms: - if (regcopy_in(myregs, nofregs, Yap_regnotoreg(1))) { - clause->Tag = cl->u.cc.c1; - return; - } else if (regcopy_in(myregs, nofregs, Yap_regnotoreg(2))) { - clause->Tag = cl->u.cc.c2; - return; - } else { - cl = NEXTOP(cl,cc); - } - break; - case _get_3atoms: - if (regcopy_in(myregs, nofregs,Yap_regnotoreg(1) )) { - clause->Tag = cl->u.ccc.c1; - return; - } else if (regcopy_in(myregs, nofregs, Yap_regnotoreg(2))) { - clause->Tag = cl->u.ccc.c2; - return; - } else if (regcopy_in(myregs, nofregs, Yap_regnotoreg(3))) { - clause->Tag = cl->u.ccc.c3; - return; - } else { - cl = NEXTOP(cl,ccc); - } - break; - case _get_4atoms: - if (regcopy_in(myregs, nofregs, Yap_regnotoreg(1))) { - clause->Tag = cl->u.cccc.c1; - return; - } else if (regcopy_in(myregs, nofregs, Yap_regnotoreg(2))) { - clause->Tag = cl->u.cccc.c2; - return; - } else if (regcopy_in(myregs, nofregs, Yap_regnotoreg(3))) { - clause->Tag = cl->u.cccc.c3; - return; - } else if (regcopy_in(myregs, nofregs, Yap_regnotoreg(4))) { - clause->Tag = cl->u.cccc.c4; - return; - } else { - cl = NEXTOP(cl,cccc); - } - break; - case _get_5atoms: - if (regcopy_in(myregs, nofregs, Yap_regnotoreg(1))) { - clause->Tag = cl->u.ccccc.c1; - return; - } else if (regcopy_in(myregs, nofregs, Yap_regnotoreg(2))) { - clause->Tag = cl->u.ccccc.c2; - return; - } else if (regcopy_in(myregs, nofregs, Yap_regnotoreg(3))) { - clause->Tag = cl->u.ccccc.c3; - return; - } else if (regcopy_in(myregs, nofregs, Yap_regnotoreg(4))) { - clause->Tag = cl->u.ccccc.c4; - return; - } else if (regcopy_in(myregs, nofregs, Yap_regnotoreg(5))) { - clause->Tag = cl->u.ccccc.c5; - return; - } else { - cl = NEXTOP(cl,ccccc); - } - break; - case _get_6atoms: - if (regcopy_in(myregs, nofregs, Yap_regnotoreg(1))) { - clause->Tag = cl->u.cccccc.c1; - return; - } else if (regcopy_in(myregs, nofregs, Yap_regnotoreg(2))) { - clause->Tag = cl->u.cccccc.c2; - return; - } else if (regcopy_in(myregs, nofregs, Yap_regnotoreg(3))) { - clause->Tag = cl->u.cccccc.c3; - return; - } else if (regcopy_in(myregs, nofregs, Yap_regnotoreg(4))) { - clause->Tag = cl->u.cccccc.c4; - return; - } else if (regcopy_in(myregs, nofregs, Yap_regnotoreg(5))) { - clause->Tag = cl->u.cccccc.c5; - return; - } else if (regcopy_in(myregs, nofregs, Yap_regnotoreg(6))) { - clause->Tag = cl->u.cccccc.c6; - return; - } else { - cl = NEXTOP(cl,cccccc); - } - break; - case _get_float: - if (regcopy_in(myregs, nofregs, cl->u.xd.x)) { - clause->u.t_ptr = AbsAppl(cl->u.xd.d); - clause->Tag = AbsAppl((CELL *)FunctorDouble); - return; - } else { - cl = NEXTOP(cl,xd); - } - break; - case _get_longint: - if (regcopy_in(myregs, nofregs, cl->u.xi.x)) { - clause->u.t_ptr = AbsAppl(cl->u.xi.i); - clause->Tag = AbsAppl((CELL *)FunctorLongInt); - return; - } else { - cl = NEXTOP(cl,xi); - } - break; - case _get_bigint: - clause->Tag = (CELL)NULL; - return; - /* - if (regcopy_in(myregs, nofregs, cl->u.xc.x)) { - clause->u.t_ptr = cl->u.xc.c; -#ifdef USE_GMP - clause->Tag = AbsAppl((CELL *)FunctorBigInt); -#else - clause->Tag = AbsAppl((CELL *)FunctorLongInt); -#endif - return; - } else { - cl = NEXTOP(cl,xc); - } - break; - */ - case _get_dbterm: - clause->Tag = (CELL)NULL; - return; - case _copy_idb_term: - case _unify_idb_term: - if (regno == 2) { - LogUpdClause *lcl = ClauseCodeToLogUpdClause(cl); - Term t = lcl->ClSource->Entry; - if (IsVarTerm(t)) { - clause->Tag = (CELL)NULL; - } else if (IsApplTerm(t)) { - CELL *pt = RepAppl(t); - - clause->Tag = AbsAppl((CELL *)pt[0]); - clause->u.c_sreg = pt; - } else if (IsPairTerm(t)) { - CELL *pt = RepPair(t); - - clause->Tag = AbsPair(NULL); - clause->u.c_sreg = pt-1; - } else { - clause->Tag = t; - } - } else { - clause->Tag = (CELL)NULL; - } - return; - case _put_atom: - if (regcopy_in(myregs, nofregs, cl->u.xc.x) && - (nofregs = delete_regcopy(myregs, nofregs, cl->u.xc.x)) == 0 && - !ycopy) { - clause->Tag = (CELL)NULL; - return; - } else { - cl = NEXTOP(cl,xc); - } - break; - case _put_float: - if (regcopy_in(myregs, nofregs, cl->u.xd.x) && - (nofregs = delete_regcopy(myregs, nofregs, cl->u.xd.x)) == 0 && - !ycopy) { - clause->Tag = (CELL)NULL; - return; - } else { - cl = NEXTOP(cl,xd); - } - break; - case _put_longint: - if (regcopy_in(myregs, nofregs, cl->u.xi.x) && - (nofregs = delete_regcopy(myregs, nofregs, cl->u.xi.x)) == 0 && - !ycopy) { - clause->Tag = (CELL)NULL; - return; - } else { - cl = NEXTOP(cl,xi); - } - break; - case _get_struct: - if (regcopy_in(myregs, nofregs, cl->u.xfa.x)) { - clause->u.WorkPC = NEXTOP(cl,xfa); - clause->Tag = AbsAppl((CELL *)cl->u.xfa.f); - return; - } else { - cl = NEXTOP(cl,xfa); - } - break; - case _put_struct: - if (regcopy_in(myregs, nofregs, cl->u.xfa.x) && - (nofregs = delete_regcopy(myregs, nofregs, cl->u.xfa.x)) == 0 && - !ycopy) { - clause->Tag = (CELL)NULL; - return; - } else { - cl = NEXTOP(cl,xfa); - } - break; - case _glist_valy: - case _gl_void_vary: - case _gl_void_valy: - if (regcopy_in(myregs, nofregs, cl->u.xy.x)) { - clause->u.WorkPC = cl; - clause->Tag = AbsPair(NULL); - return; - } - cl = NEXTOP(cl,xy); - break; - case _unify_x_var: - case _unify_x_var_write: - case _unify_l_x_var: - case _unify_l_x_var_write: - if (regcopy_in(myregs, nofregs, cl->u.ox.x) && - (nofregs = delete_regcopy(myregs, nofregs, cl->u.ox.x)) == 0 && - !ycopy) { - /* we just initialised the argument, so nothing can happen now */ - clause->Tag = (CELL)NULL; - return; - } - cl = NEXTOP(cl,ox); - break; - case _unify_x_val_write: - case _unify_x_val: - case _unify_l_x_val_write: - case _unify_l_x_val: - case _unify_x_loc_write: - case _unify_x_loc: - case _unify_l_x_loc_write: - case _unify_l_x_loc: - /* we're just done with the head of a list, but there - is nothing inside. - */ - cl = NEXTOP(cl,ox); - break; - case _save_pair_x_write: - case _save_pair_x: - case _save_appl_x_write: - case _save_appl_x: - if (regcopy_in(myregs, nofregs, cl->u.ox.x) && - (nofregs = delete_regcopy(myregs, nofregs, cl->u.ox.x)) == 0 && - !ycopy) { - /* we just initialised the argument, so nothing can happen now */ - clause->Tag = (CELL)NULL; - return; - } - cl = NEXTOP(cl,ox); - break; - case _unify_x_var2: - case _unify_x_var2_write: - case _unify_l_x_var2: - case _unify_l_x_var2_write: - if (regcopy_in(myregs, nofregs, cl->u.oxx.xl) && - (nofregs = delete_regcopy(myregs, nofregs, cl->u.oxx.xl)) == 0 && - !ycopy) { - /* we just initialised the argument, so nothing can happen now */ - clause->Tag = (CELL)NULL; - return; - } - if (regcopy_in(myregs, nofregs, cl->u.oxx.xr) && - (nofregs = delete_regcopy(myregs, nofregs, cl->u.oxx.xr)) == 0 && - !ycopy) { - /* we just initialised the argument, so nothing can happen now */ - clause->Tag = (CELL)NULL; - return; - } - cl = NEXTOP(cl,oxx); - break; - case _unify_y_var: - case _unify_y_var_write: - case _unify_l_y_var: - case _unify_l_y_var_write: - /* we're just done with the head of a list, but there - is nothing inside. - */ - if (cl->u.oy.y == ycopy) { - ycopy = 0; /* weird stuff, let's just reset ycopy */ - if (nofregs == 0) { - clause->Tag = (CELL)NULL; - return; - } - } - cl = NEXTOP(cl,oy); - break; - case _unify_y_val_write: - case _unify_y_val: - case _unify_l_y_val_write: - case _unify_l_y_val: - case _unify_y_loc_write: - case _unify_y_loc: - case _unify_l_y_loc_write: - case _unify_l_y_loc: - /* we're just done with the head of a list, but there - is nothing inside. - */ - cl = NEXTOP(cl,oy); - break; - case _save_pair_y_write: - case _save_pair_y: - case _save_appl_y_write: - case _save_appl_y: - if (cl->u.oy.y == ycopy) { - ycopy = 0; /* weird stuff, let's just reset ycopy */ - if (nofregs == 0) { - clause->Tag = (CELL)NULL; - return; - } - } - cl = NEXTOP(cl,oy); - break; - case _unify_void_write: - case _unify_void: - case _unify_l_void_write: - case _unify_l_void: - /* we're just done with the head of a list, but there - is nothing inside. - */ - cl = NEXTOP(cl,o); - break; - case _unify_list_write: - case _unify_list: - case _unify_l_list_write: - case _unify_l_list: - cl = NEXTOP(cl,o); - break; - case _unify_n_voids_write: - case _unify_n_voids: - case _unify_l_n_voids_write: - case _unify_l_n_voids: - cl = NEXTOP(cl,os); - break; - case _unify_atom_write: - case _unify_atom: - case _unify_l_atom_write: - case _unify_l_atom: - cl = NEXTOP(cl,oc); - break; - case _unify_float: - case _unify_l_float: - case _unify_float_write: - case _unify_l_float_write: - cl = NEXTOP(cl,od); - break; - case _write_float: - cl = NEXTOP(cl,d); - break; - case _unify_longint: - case _unify_longint_write: - case _unify_l_longint: - case _unify_l_longint_write: - cl = NEXTOP(cl,oi); - break; - case _write_longint: - cl = NEXTOP(cl,i); - break; - case _unify_bigint: - case _unify_l_bigint: - cl = NEXTOP(cl,oc); - break; - case _unify_dbterm: - case _unify_l_dbterm: - cl = NEXTOP(cl,oc); - break; - case _unify_n_atoms_write: - case _unify_n_atoms: - cl = NEXTOP(cl,osc); - break; - case _unify_struct_write: - case _unify_struct: - case _unify_l_struc_write: - case _unify_l_struc: - cl = NEXTOP(cl,ofa); - break; - case _write_n_voids: - case _pop_n: - cl = NEXTOP(cl,s); - break; - case _write_atom: - cl = NEXTOP(cl,c); - break; - case _write_n_atoms: - cl = NEXTOP(cl,sc); - break; - case _write_struct: - case _write_l_struc: - cl = NEXTOP(cl,fa); - break; - case _call_c_wfail: - case _try_c: - case _try_userc: - case _retry_c: - case _retry_userc: -#ifdef CUT_C - case _cut_c: - case _cut_userc: -#endif - case _switch_on_type: - case _switch_list_nl: - case _switch_on_arg_type: - case _switch_on_sub_arg_type: - case _if_not_then: - case _switch_on_func: - case _switch_on_cons: - case _go_on_func: - case _go_on_cons: - case _if_func: - case _if_cons: - clause->Tag = (CELL)NULL; - return; - case _p_plus_vv: - case _p_minus_vv: - case _p_times_vv: - case _p_div_vv: - case _p_and_vv: - case _p_or_vv: - case _p_sll_vv: - case _p_slr_vv: - case _p_arg_vv: - case _p_func2s_vv: - case _p_func2f_xx: - if (regcopy_in(myregs, nofregs, cl->u.xxx.x) && - (nofregs = delete_regcopy(myregs, nofregs, cl->u.xxx.x)) == 0 && - !ycopy) { - clause->Tag = (CELL)NULL; - return; - } - cl = NEXTOP(cl,xxx); - break; - case _p_plus_vc: - case _p_minus_cv: - case _p_times_vc: - case _p_div_cv: - case _p_and_vc: - case _p_or_vc: - case _p_sll_vc: - case _p_slr_vc: - case _p_func2s_vc: - if (regcopy_in(myregs, nofregs, cl->u.xxn.x) && - (nofregs = delete_regcopy(myregs, nofregs, cl->u.xxn.x)) == 0 && - !ycopy) { - clause->Tag = (CELL)NULL; - return; - } - cl = NEXTOP(cl,xxn); - break; - case _p_div_vc: - case _p_sll_cv: - case _p_slr_cv: - case _p_arg_cv: - case _p_func2s_cv: - if (regcopy_in(myregs, nofregs, cl->u.xxn.x) && - (nofregs = delete_regcopy(myregs, nofregs, cl->u.xxn.x)) == 0 && - !ycopy) { - clause->Tag = (CELL)NULL; - return; - } - cl = NEXTOP(cl,xxn); - break; - case _p_func2f_xy: - if (regcopy_in(myregs, nofregs, cl->u.xxy.x) && - (nofregs = delete_regcopy(myregs, nofregs, cl->u.xxy.x)) == 0 && - !ycopy) { - clause->Tag = (CELL)NULL; - return; - } - cl = NEXTOP(cl,xxy); - break; - case _p_plus_y_vv: - case _p_minus_y_vv: - case _p_times_y_vv: - case _p_div_y_vv: - case _p_and_y_vv: - case _p_or_y_vv: - case _p_sll_y_vv: - case _p_slr_y_vv: - case _p_arg_y_vv: - case _p_func2s_y_vv: - case _p_func2f_yx: - if (cl->u.yxx.y == ycopy) { - ycopy = 0; /* weird stuff, let's just reset ycopy */ - if (nofregs == 0) { - clause->Tag = (CELL)NULL; - return; - } - } - cl = NEXTOP(cl,yxx); - break; - case _p_func2f_yy: - if (regcopy_in(myregs, nofregs, cl->u.yyx.x) && - (nofregs = delete_regcopy(myregs, nofregs, cl->u.yyx.x)) == 0 && - !ycopy) { - clause->Tag = (CELL)NULL; - return; - } - cl = NEXTOP(cl,yyx); - break; - case _p_plus_y_vc: - case _p_minus_y_cv: - case _p_times_y_vc: - case _p_div_y_vc: - case _p_div_y_cv: - case _p_and_y_vc: - case _p_or_y_vc: - case _p_sll_y_vc: - case _p_slr_y_vc: - case _p_func2s_y_vc: - if (cl->u.yxn.y == ycopy) { - ycopy = 0; /* weird stuff, let's just reset ycopy */ - if (nofregs == 0) { - clause->Tag = (CELL)NULL; - return; - } - } - cl = NEXTOP(cl,yxn); - break; - case _p_sll_y_cv: - case _p_slr_y_cv: - case _p_arg_y_cv: - case _p_func2s_y_cv: - if (cl->u.yxn.y == ycopy) { - ycopy = 0; /* weird stuff, let's just reset ycopy */ - if (nofregs == 0) { - clause->Tag = (CELL)NULL; - return; - } - } - cl = NEXTOP(cl,yxn); - break; - case _a_eqc_float: - case _ltc_float: - case _gtc_float: - cl = NEXTOP(cl,sdll); - break; - case _a_eqc_int: - case _ltc_int: - case _gtc_int: - cl = NEXTOP(cl,snll); - break; - case _a_eq: - case _lt: - cl = NEXTOP(cl,snll); - break; - case _add_float_c: - case _sub_float_c: - case _mul_float_c: - case _fdiv_c1: - case _fdiv_c2: - cl = NEXTOP(cl,ssd); - break; - case _add_int_c: - case _sub_int_c: - case _mul_int_c: - case _idiv_c1: - case _idiv_c2: - case _mod_c1: - case _mod_c2: - case _rem_c1: - case _rem_c2: - case _a_or_c: - case _a_and_c: - case _xor_c: - case _sl_c1: - case _sl_c2: - case _sr_c1: - case _sr_c2: - cl = NEXTOP(cl,ssn); - break; - case _add: - case _sub: - case _mul: - case _fdiv: - case _idiv: - case _mod: - case _rem: - case _a_or: - case _a_and: - case _xor: - case _uminus: - case _sl: - case _sr: - cl = NEXTOP(cl,sss); - break; - case _get_fi_x: - case _get_i_x: - case _get_f_x: - case _put_fi_var_x: - case _put_i_var_x: - case _put_f_var_x: - if (regcopy_in(myregs, nofregs, cl->u.sxl.x) && - (nofregs = delete_regcopy(myregs, nofregs, cl->u.sxl.x)) == 0 && - !ycopy) { - clause->Tag = (CELL)NULL; - return; - } - cl = NEXTOP(cl,sxl); - break; - case _get_fi_y: - case _get_i_y: - case _get_f_y: - case _put_fi_var_y: - case _put_i_var_y: - case _put_f_var_y: - if (cl->u.syl.y == ycopy) { - ycopy = 0; /* weird stuff, let's just reset ycopy */ - if (nofregs == 0) { - clause->Tag = (CELL)NULL; - return; - } - } - cl = NEXTOP(cl,syl); - break; - case _put_fi_val_x: - case _put_i_val_x: - case _put_f_val_x: - if (regcopy_in(myregs, nofregs, cl->u.sxll.x) && - (nofregs = delete_regcopy(myregs, nofregs, cl->u.sxll.x)) == 0 && - !ycopy) { - clause->Tag = (CELL)NULL; - return; - } - cl = NEXTOP(cl,sxll); - break; - case _put_fi_val_y: - case _put_i_val_y: - case _put_f_val_y: - if (cl->u.syll.y == ycopy) { - ycopy = 0; /* weird stuff, let's just reset ycopy */ - if (nofregs == 0) { - clause->Tag = (CELL)NULL; - return; - } - } - cl = NEXTOP(cl,syll); - break; - case _lock_lu: - cl = NEXTOP(cl,p); - break; - case _call_bfunc_xx: - cl = NEXTOP(cl,plxxs); - break; - case _call_bfunc_yx: - case _call_bfunc_xy: - cl = NEXTOP(cl,plxys); - break; - case _call_bfunc_yy: - cl = NEXTOP(cl,plyys); - break; - case _pop: - cl = NEXTOP(cl,e); - break; - case _Ystop: - case _Nstop: - case _try_me: - case _retry_me: - case _trust_me: - case _profiled_retry_me: - case _profiled_trust_me: - case _count_retry_me: - case _count_trust_me: - case _spy_or_trymark: - case _try_and_mark: - case _profiled_retry_and_mark: - case _count_retry_and_mark: - case _retry_and_mark: - case _try_clause: - case _retry: - case _trust: - case _enter_lu_pred: -#ifdef YAPOR - case _getwork: - case _getwork_seq: - case _sync: -#endif /* YAPOR */ -#ifdef TABLING - case _table_try_single: - cl = NEXTOP(cl,Otapl); - break; - case _table_load_answer: - case _table_try_answer: - case _table_try_me: - case _table_retry_me: - case _table_trust_me: - case _table_try: - case _table_retry: - case _table_trust: - case _table_answer_resolution: - case _table_completion: -#endif /* TABLING */ - case _enter_profiling: - case _count_call: - case _retry_profiled: - case _count_retry: - case _execute: - case _execute_cpred: - case _dexecute: - case _jump: - case _move_back: - case _skip: - case _jump_if_var: - case _try_in: - case _unlock_lu: - case _try_clause2: - case _try_clause3: - case _try_clause4: - case _retry2: - case _retry3: - case _retry4: - case _try_logical: - case _retry_logical: - case _count_retry_logical: - case _profiled_retry_logical: - case _trust_logical: - case _count_trust_logical: - case _profiled_trust_logical: - clause->Tag = (CELL)NULL; - return; - case _jump_if_nonvar: - clause->Tag = (CELL)NULL; - return; - /* instructions type e */ - case _trust_fail: - case _op_fail: - case _procceed: -#if !defined(YAPOR) - case _or_last: -#endif /* !YAPOR */ - case _index_pred: - case _lock_pred: -#if THREADS - case _thread_local: -#endif - case _expand_index: - case _expand_clauses: - case _undef_p: - case _spy_pred: - case _p_equal: - case _p_dif: - case _p_eq: - case _p_functor: - case _p_execute_tail: - case _index_dbref: - case _index_blob: -#ifdef YAPOR - case _getwork_first_time: -#endif /* YAPOR */ -#ifdef TABLING - case _table_new_answer: - case _trie_do_null: - case _trie_trust_null: - case _trie_try_null: - case _trie_retry_null: - case _trie_do_var: - case _trie_trust_var: - case _trie_try_var: - case _trie_retry_var: - case _trie_do_val: - case _trie_trust_val: - case _trie_try_val: - case _trie_retry_val: - case _trie_do_atom: - case _trie_trust_atom: - case _trie_try_atom: - case _trie_retry_atom: - case _trie_do_list: - case _trie_trust_list: - case _trie_try_list: - case _trie_retry_list: - case _trie_do_struct: - case _trie_trust_struct: - case _trie_try_struct: - case _trie_retry_struct: - case _trie_do_extension: - case _trie_trust_extension: - case _trie_try_extension: - case _trie_retry_extension: - case _trie_do_float: - case _trie_trust_float: - case _trie_try_float: - case _trie_retry_float: - case _trie_do_long: - case _trie_trust_long: - case _trie_try_long: - case _trie_retry_long: -#endif /* TABLING */ - clause->Tag = (CELL)NULL; - return; -#ifdef BEAM - case _run_eam: - cl = NEXTOP(cl,os); - break; - case _retry_eam: - cl = NEXTOP(cl,e); - break; - -#endif - - } - } +#include "findclause.h" } static void @@ -2692,362 +1506,7 @@ add_head_info(ClauseDef *clause, UInt regno) wamreg iarg = Yap_regnotoreg(regno); yamop *cl = clause->CurrentCode; - while (TRUE) { - op_numbers op = Yap_op_from_opcode(cl->opc); - switch (op) { -#ifdef BEAM - case _run_eam: - cl = NEXTOP(cl,os); - break; -#endif - case _get_list: - if (cl->u.x.x == iarg) { - clause->Tag = AbsPair(NULL); - clause->u.WorkPC = NEXTOP(cl,x); - return; - } - cl = NEXTOP(cl,x); - break; - case _get_x_var: - if (cl->u.xx.xl == iarg) { - clause->Tag = (CELL)NULL; - return; - } - cl = NEXTOP(cl,xx); - break; - case _get_x_val: - if (cl->u.xx.xl == iarg || - cl->u.xx.xr == iarg) { - clause->Tag = (CELL)NULL; - return; - } - cl = NEXTOP(cl,xx); - break; - case _glist_valx: - case _gl_void_varx: - case _gl_void_valx: - if (cl->u.xx.xl == iarg) { - clause->u.WorkPC = cl; - clause->Tag = AbsPair(NULL); - return; - } - if (cl->u.xx.xr == iarg) { - clause->Tag = (CELL)NULL; - return; - } - cl = NEXTOP(cl,xx); - break; - case _get_y_val: - case _get_y_var: - if (cl->u.xx.xr == iarg) { - clause->Tag = (CELL)NULL; - return; - } - cl = NEXTOP(cl,yx); - break; - case _get_atom: - if (cl->u.xc.x == iarg) { - clause->Tag = cl->u.xc.c; - return; - } else { - cl = NEXTOP(cl,xc); - } - break; - case _get_2atoms: - if (Yap_regnotoreg(1) == iarg) { - clause->Tag = cl->u.cc.c1; - return; - } else if (Yap_regnotoreg(2) == iarg) { - clause->Tag = cl->u.cc.c2; - return; - } else { - cl = NEXTOP(cl,cc); - } - break; - case _get_3atoms: - if (Yap_regnotoreg(1) == iarg) { - clause->Tag = cl->u.ccc.c1; - return; - } else if (Yap_regnotoreg(2) == iarg) { - clause->Tag = cl->u.ccc.c2; - return; - } else if (Yap_regnotoreg(3) == iarg) { - clause->Tag = cl->u.ccc.c3; - return; - } else { - cl = NEXTOP(cl,ccc); - } - break; - case _get_4atoms: - if (Yap_regnotoreg(1) == iarg) { - clause->Tag = cl->u.cccc.c1; - return; - } else if (Yap_regnotoreg(2) == iarg) { - clause->Tag = cl->u.cccc.c2; - return; - } else if (Yap_regnotoreg(3) == iarg) { - clause->Tag = cl->u.cccc.c3; - return; - } else if (Yap_regnotoreg(4) == iarg) { - clause->Tag = cl->u.cccc.c4; - return; - } else { - cl = NEXTOP(cl,cccc); - } - break; - case _get_5atoms: - if (Yap_regnotoreg(1) == iarg) { - clause->Tag = cl->u.ccccc.c1; - return; - } else if (Yap_regnotoreg(2) == iarg) { - clause->Tag = cl->u.ccccc.c2; - return; - } else if (Yap_regnotoreg(3) == iarg) { - clause->Tag = cl->u.ccccc.c3; - return; - } else if (Yap_regnotoreg(4) == iarg) { - clause->Tag = cl->u.ccccc.c4; - return; - } else if (Yap_regnotoreg(5) == iarg) { - clause->Tag = cl->u.ccccc.c5; - return; - } else { - cl = NEXTOP(cl,ccccc); - } - break; - case _get_6atoms: - if (Yap_regnotoreg(1) == iarg) { - clause->Tag = cl->u.cccccc.c1; - return; - } else if (Yap_regnotoreg(2) == iarg) { - clause->Tag = cl->u.cccccc.c2; - return; - } else if (Yap_regnotoreg(3) == iarg) { - clause->Tag = cl->u.cccccc.c3; - return; - } else if (Yap_regnotoreg(4) == iarg) { - clause->Tag = cl->u.cccccc.c4; - return; - } else if (Yap_regnotoreg(5) == iarg) { - clause->Tag = cl->u.cccccc.c5; - return; - } else if (Yap_regnotoreg(6) == iarg) { - clause->Tag = cl->u.cccccc.c6; - return; - } else { - cl = NEXTOP(cl,cccccc); - } - break; - case _get_float: - if (cl->u.xd.x == iarg) { - clause->u.t_ptr = AbsAppl(cl->u.xd.d); - clause->Tag = AbsAppl((CELL *)FunctorDouble); - return; - } else { - cl = NEXTOP(cl,xd); - } - break; - case _get_longint: - if (cl->u.xi.x == iarg) { - clause->u.t_ptr = AbsAppl(cl->u.xi.i); - clause->Tag = AbsAppl((CELL *)FunctorLongInt); - return; - } else { - cl = NEXTOP(cl,xi); - } - break; - case _get_bigint: - clause->Tag = (CELL)NULL; - return; - /* - if (cl->u.xc.x == iarg) { - clause->u.t_ptr = cl->u.xc.c; -#ifdef USE_GMP - clause->Tag = AbsAppl((CELL *)FunctorBigInt); -#else - clause->Tag = AbsAppl((CELL *)FunctorLongInt); -#endif - return; - } else { - cl = NEXTOP(cl,xc); - } - break; - */ - case _get_struct: - if (cl->u.xfa.x == iarg) { - clause->u.WorkPC = NEXTOP(cl,xfa); - clause->Tag = AbsAppl((CELL *)cl->u.xfa.f); - return; - } else { - cl = NEXTOP(cl,xfa); - } - break; - case _glist_valy: - case _gl_void_vary: - case _gl_void_valy: - if (cl->u.xy.x == iarg) { - clause->u.WorkPC = cl; - clause->Tag = AbsPair(NULL); - return; - } - cl = NEXTOP(cl,xy); - break; - case _unify_x_var: - case _unify_x_var_write: - case _unify_l_x_var: - case _unify_l_x_var_write: - case _unify_x_val_write: - case _unify_x_val: - case _unify_l_x_val_write: - case _unify_l_x_val: - case _unify_x_loc_write: - case _unify_x_loc: - case _unify_l_x_loc_write: - case _unify_l_x_loc: - case _save_pair_x_write: - case _save_pair_x: - case _save_appl_x_write: - case _save_appl_x: - if (cl->u.ox.x == iarg) { - /* we just initialised the argument, so nothing can happen now */ - clause->Tag = (CELL)NULL; - return; - } - cl = NEXTOP(cl,ox); - break; - case _unify_x_var2: - case _unify_x_var2_write: - case _unify_l_x_var2: - case _unify_l_x_var2_write: - if (cl->u.oxx.xl == iarg || - cl->u.oxx.xr == iarg) { - /* we just initialised the argument, so nothing can happen now */ - clause->Tag = (CELL)NULL; - return; - } - cl = NEXTOP(cl,oxx); - break; - case _unify_y_var: - case _unify_y_var_write: - case _unify_l_y_var: - case _unify_l_y_var_write: - case _unify_y_val_write: - case _unify_y_val: - case _unify_l_y_val_write: - case _unify_l_y_val: - case _unify_y_loc_write: - case _unify_y_loc: - case _unify_l_y_loc_write: - case _unify_l_y_loc: - case _save_pair_y_write: - case _save_pair_y: - case _save_appl_y_write: - case _save_appl_y: - /* we're just done with the head of a list, but there - is nothing inside. - */ - cl = NEXTOP(cl,oy); - break; - case _unify_void_write: - case _unify_void: - case _unify_l_void_write: - case _unify_l_void: - /* we're just done with the head of a list, but there - is nothing inside. - */ - cl = NEXTOP(cl,o); - break; - case _unify_list_write: - case _unify_list: - case _unify_l_list_write: - case _unify_l_list: - cl = NEXTOP(cl,o); - break; - case _unify_n_voids_write: - case _unify_n_voids: - case _unify_l_n_voids_write: - case _unify_l_n_voids: - cl = NEXTOP(cl,os); - break; - case _unify_atom_write: - case _unify_atom: - case _unify_l_atom_write: - case _unify_l_atom: - cl = NEXTOP(cl,oc); - break; - case _unify_float: - case _unify_l_float: - case _unify_float_write: - case _unify_l_float_write: - cl = NEXTOP(cl,od); - break; - case _write_float: - cl = NEXTOP(cl,d); - break; - case _unify_longint: - case _unify_longint_write: - case _unify_l_longint: - case _unify_l_longint_write: - cl = NEXTOP(cl,oi); - break; - case _write_longint: - cl = NEXTOP(cl,i); - break; - case _unify_bigint: - case _unify_l_bigint: - cl = NEXTOP(cl,oc); - break; - case _unify_dbterm: - case _unify_l_dbterm: - cl = NEXTOP(cl,oc); - break; - case _unify_n_atoms_write: - case _unify_n_atoms: - cl = NEXTOP(cl,osc); - break; - case _unify_struct_write: - case _unify_struct: - case _unify_l_struc_write: - case _unify_l_struc: - cl = NEXTOP(cl,ofa); - break; - case _get_dbterm: - cl = NEXTOP(cl,xc); - return; - case _unify_idb_term: - case _copy_idb_term: - if (regno != 2) { - clause->Tag = (CELL)NULL; - } else { - LogUpdClause *lcl = ClauseCodeToLogUpdClause(cl); - Term t = lcl->ClSource->Entry; - - if (IsVarTerm(t)) { - clause->Tag = (CELL)NULL; - } else if (IsApplTerm(t)) { - CELL *pt = RepAppl(t); - - clause->Tag = AbsAppl((CELL *)pt[0]); - if (IsExtensionFunctor(FunctorOfTerm(t))) { - clause->u.t_ptr = t; - } else { - clause->u.c_sreg = pt; - } - } else if (IsPairTerm(t)) { - CELL *pt = RepPair(t); - - clause->Tag = AbsPair(NULL); - clause->u.c_sreg = pt-1; - } else { - clause->Tag = t; - } - } - return; - default: - clause->Tag = (CELL)NULL; - return; - } - } +#include "headclause.h" } static void diff --git a/H/findclause.h b/H/findclause.h new file mode 100644 index 000000000..4f4122d41 --- /dev/null +++ b/H/findclause.h @@ -0,0 +1,2714 @@ + + /* This file was generated automatically by "yap -L misc/buildops" + please do not update */ + + + while (TRUE) { + op_numbers op = Yap_op_from_opcode(cl->opc); + switch (op) { + case _alloc_for_logical_pred: + cl = NEXTOP(cl,L); + break; + case _write_atom: + cl = NEXTOP(cl,c); + break; + case _get_2atoms: + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(1))) { + clause->Tag = cl->u.cc.c1; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(2))) { + clause->Tag = cl->u.cc.c2; + return; + } + cl = NEXTOP(cl,cc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(2))) { + clause->Tag = cl->u.cc.c2; + return; + } + cl = NEXTOP(cl,cc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(1))) { + clause->Tag = cl->u.cc.c1; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(2))) { + clause->Tag = cl->u.cc.c2; + return; + } + cl = NEXTOP(cl,cc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(2))) { + 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; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(2))) { + clause->Tag = cl->u.ccc.c2; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(3))) { + clause->Tag = cl->u.ccc.c3; + return; + } + cl = NEXTOP(cl,ccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(3))) { + clause->Tag = cl->u.ccc.c3; + return; + } + cl = NEXTOP(cl,ccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(2))) { + clause->Tag = cl->u.ccc.c2; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(3))) { + clause->Tag = cl->u.ccc.c3; + return; + } + cl = NEXTOP(cl,ccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(3))) { + clause->Tag = cl->u.ccc.c3; + return; + } + cl = NEXTOP(cl,ccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(1))) { + clause->Tag = cl->u.ccc.c1; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(2))) { + clause->Tag = cl->u.ccc.c2; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(3))) { + clause->Tag = cl->u.ccc.c3; + return; + } + cl = NEXTOP(cl,ccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(3))) { + clause->Tag = cl->u.ccc.c3; + return; + } + cl = NEXTOP(cl,ccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(2))) { + clause->Tag = cl->u.ccc.c2; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(3))) { + clause->Tag = cl->u.ccc.c3; + return; + } + cl = NEXTOP(cl,ccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(3))) { + 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; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(2))) { + clause->Tag = cl->u.cccc.c2; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(3))) { + clause->Tag = cl->u.cccc.c3; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(4))) { + clause->Tag = cl->u.cccc.c4; + return; + } + cl = NEXTOP(cl,cccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(4))) { + clause->Tag = cl->u.cccc.c4; + return; + } + cl = NEXTOP(cl,cccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(3))) { + clause->Tag = cl->u.cccc.c3; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(4))) { + clause->Tag = cl->u.cccc.c4; + return; + } + cl = NEXTOP(cl,cccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(4))) { + clause->Tag = cl->u.cccc.c4; + return; + } + cl = NEXTOP(cl,cccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(2))) { + clause->Tag = cl->u.cccc.c2; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(3))) { + clause->Tag = cl->u.cccc.c3; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(4))) { + clause->Tag = cl->u.cccc.c4; + return; + } + cl = NEXTOP(cl,cccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(4))) { + clause->Tag = cl->u.cccc.c4; + return; + } + cl = NEXTOP(cl,cccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(3))) { + clause->Tag = cl->u.cccc.c3; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(4))) { + clause->Tag = cl->u.cccc.c4; + return; + } + cl = NEXTOP(cl,cccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(4))) { + clause->Tag = cl->u.cccc.c4; + return; + } + cl = NEXTOP(cl,cccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(1))) { + clause->Tag = cl->u.cccc.c1; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(2))) { + clause->Tag = cl->u.cccc.c2; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(3))) { + clause->Tag = cl->u.cccc.c3; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(4))) { + clause->Tag = cl->u.cccc.c4; + return; + } + cl = NEXTOP(cl,cccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(4))) { + clause->Tag = cl->u.cccc.c4; + return; + } + cl = NEXTOP(cl,cccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(3))) { + clause->Tag = cl->u.cccc.c3; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(4))) { + clause->Tag = cl->u.cccc.c4; + return; + } + cl = NEXTOP(cl,cccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(4))) { + clause->Tag = cl->u.cccc.c4; + return; + } + cl = NEXTOP(cl,cccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(2))) { + clause->Tag = cl->u.cccc.c2; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(3))) { + clause->Tag = cl->u.cccc.c3; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(4))) { + clause->Tag = cl->u.cccc.c4; + return; + } + cl = NEXTOP(cl,cccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(4))) { + clause->Tag = cl->u.cccc.c4; + return; + } + cl = NEXTOP(cl,cccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(3))) { + clause->Tag = cl->u.cccc.c3; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(4))) { + clause->Tag = cl->u.cccc.c4; + return; + } + cl = NEXTOP(cl,cccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(4))) { + 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; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(2))) { + clause->Tag = cl->u.ccccc.c2; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(3))) { + clause->Tag = cl->u.ccccc.c3; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(4))) { + clause->Tag = cl->u.ccccc.c4; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(5))) { + clause->Tag = cl->u.ccccc.c5; + return; + } + cl = NEXTOP(cl,ccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(5))) { + clause->Tag = cl->u.ccccc.c5; + return; + } + cl = NEXTOP(cl,ccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(4))) { + clause->Tag = cl->u.ccccc.c4; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(5))) { + clause->Tag = cl->u.ccccc.c5; + return; + } + cl = NEXTOP(cl,ccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(5))) { + clause->Tag = cl->u.ccccc.c5; + return; + } + cl = NEXTOP(cl,ccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(3))) { + clause->Tag = cl->u.ccccc.c3; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(4))) { + clause->Tag = cl->u.ccccc.c4; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(5))) { + clause->Tag = cl->u.ccccc.c5; + return; + } + cl = NEXTOP(cl,ccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(5))) { + clause->Tag = cl->u.ccccc.c5; + return; + } + cl = NEXTOP(cl,ccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(4))) { + clause->Tag = cl->u.ccccc.c4; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(5))) { + clause->Tag = cl->u.ccccc.c5; + return; + } + cl = NEXTOP(cl,ccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(5))) { + clause->Tag = cl->u.ccccc.c5; + return; + } + cl = NEXTOP(cl,ccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(2))) { + clause->Tag = cl->u.ccccc.c2; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(3))) { + clause->Tag = cl->u.ccccc.c3; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(4))) { + clause->Tag = cl->u.ccccc.c4; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(5))) { + clause->Tag = cl->u.ccccc.c5; + return; + } + cl = NEXTOP(cl,ccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(5))) { + clause->Tag = cl->u.ccccc.c5; + return; + } + cl = NEXTOP(cl,ccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(4))) { + clause->Tag = cl->u.ccccc.c4; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(5))) { + clause->Tag = cl->u.ccccc.c5; + return; + } + cl = NEXTOP(cl,ccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(5))) { + clause->Tag = cl->u.ccccc.c5; + return; + } + cl = NEXTOP(cl,ccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(3))) { + clause->Tag = cl->u.ccccc.c3; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(4))) { + clause->Tag = cl->u.ccccc.c4; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(5))) { + clause->Tag = cl->u.ccccc.c5; + return; + } + cl = NEXTOP(cl,ccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(5))) { + clause->Tag = cl->u.ccccc.c5; + return; + } + cl = NEXTOP(cl,ccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(4))) { + clause->Tag = cl->u.ccccc.c4; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(5))) { + clause->Tag = cl->u.ccccc.c5; + return; + } + cl = NEXTOP(cl,ccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(5))) { + clause->Tag = cl->u.ccccc.c5; + return; + } + cl = NEXTOP(cl,ccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(1))) { + clause->Tag = cl->u.ccccc.c1; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(2))) { + clause->Tag = cl->u.ccccc.c2; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(3))) { + clause->Tag = cl->u.ccccc.c3; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(4))) { + clause->Tag = cl->u.ccccc.c4; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(5))) { + clause->Tag = cl->u.ccccc.c5; + return; + } + cl = NEXTOP(cl,ccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(5))) { + clause->Tag = cl->u.ccccc.c5; + return; + } + cl = NEXTOP(cl,ccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(4))) { + clause->Tag = cl->u.ccccc.c4; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(5))) { + clause->Tag = cl->u.ccccc.c5; + return; + } + cl = NEXTOP(cl,ccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(5))) { + clause->Tag = cl->u.ccccc.c5; + return; + } + cl = NEXTOP(cl,ccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(3))) { + clause->Tag = cl->u.ccccc.c3; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(4))) { + clause->Tag = cl->u.ccccc.c4; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(5))) { + clause->Tag = cl->u.ccccc.c5; + return; + } + cl = NEXTOP(cl,ccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(5))) { + clause->Tag = cl->u.ccccc.c5; + return; + } + cl = NEXTOP(cl,ccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(4))) { + clause->Tag = cl->u.ccccc.c4; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(5))) { + clause->Tag = cl->u.ccccc.c5; + return; + } + cl = NEXTOP(cl,ccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(5))) { + clause->Tag = cl->u.ccccc.c5; + return; + } + cl = NEXTOP(cl,ccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(2))) { + clause->Tag = cl->u.ccccc.c2; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(3))) { + clause->Tag = cl->u.ccccc.c3; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(4))) { + clause->Tag = cl->u.ccccc.c4; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(5))) { + clause->Tag = cl->u.ccccc.c5; + return; + } + cl = NEXTOP(cl,ccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(5))) { + clause->Tag = cl->u.ccccc.c5; + return; + } + cl = NEXTOP(cl,ccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(4))) { + clause->Tag = cl->u.ccccc.c4; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(5))) { + clause->Tag = cl->u.ccccc.c5; + return; + } + cl = NEXTOP(cl,ccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(5))) { + clause->Tag = cl->u.ccccc.c5; + return; + } + cl = NEXTOP(cl,ccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(3))) { + clause->Tag = cl->u.ccccc.c3; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(4))) { + clause->Tag = cl->u.ccccc.c4; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(5))) { + clause->Tag = cl->u.ccccc.c5; + return; + } + cl = NEXTOP(cl,ccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(5))) { + clause->Tag = cl->u.ccccc.c5; + return; + } + cl = NEXTOP(cl,ccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(4))) { + clause->Tag = cl->u.ccccc.c4; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(5))) { + clause->Tag = cl->u.ccccc.c5; + return; + } + cl = NEXTOP(cl,ccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(5))) { + 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; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(2))) { + clause->Tag = cl->u.cccccc.c2; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(3))) { + clause->Tag = cl->u.cccccc.c3; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(4))) { + clause->Tag = cl->u.cccccc.c4; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(5))) { + clause->Tag = cl->u.cccccc.c5; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(6))) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(6))) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(5))) { + clause->Tag = cl->u.cccccc.c5; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(6))) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(6))) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(4))) { + clause->Tag = cl->u.cccccc.c4; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(5))) { + clause->Tag = cl->u.cccccc.c5; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(6))) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(6))) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(5))) { + clause->Tag = cl->u.cccccc.c5; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(6))) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(6))) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(3))) { + clause->Tag = cl->u.cccccc.c3; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(4))) { + clause->Tag = cl->u.cccccc.c4; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(5))) { + clause->Tag = cl->u.cccccc.c5; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(6))) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(6))) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(5))) { + clause->Tag = cl->u.cccccc.c5; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(6))) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(6))) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(4))) { + clause->Tag = cl->u.cccccc.c4; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(5))) { + clause->Tag = cl->u.cccccc.c5; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(6))) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(6))) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(5))) { + clause->Tag = cl->u.cccccc.c5; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(6))) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(6))) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(2))) { + clause->Tag = cl->u.cccccc.c2; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(3))) { + clause->Tag = cl->u.cccccc.c3; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(4))) { + clause->Tag = cl->u.cccccc.c4; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(5))) { + clause->Tag = cl->u.cccccc.c5; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(6))) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(6))) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(5))) { + clause->Tag = cl->u.cccccc.c5; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(6))) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(6))) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(4))) { + clause->Tag = cl->u.cccccc.c4; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(5))) { + clause->Tag = cl->u.cccccc.c5; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(6))) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(6))) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(5))) { + clause->Tag = cl->u.cccccc.c5; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(6))) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(6))) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(3))) { + clause->Tag = cl->u.cccccc.c3; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(4))) { + clause->Tag = cl->u.cccccc.c4; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(5))) { + clause->Tag = cl->u.cccccc.c5; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(6))) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(6))) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(5))) { + clause->Tag = cl->u.cccccc.c5; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(6))) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(6))) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(4))) { + clause->Tag = cl->u.cccccc.c4; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(5))) { + clause->Tag = cl->u.cccccc.c5; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(6))) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(6))) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(5))) { + clause->Tag = cl->u.cccccc.c5; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(6))) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(6))) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(1))) { + clause->Tag = cl->u.cccccc.c1; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(2))) { + clause->Tag = cl->u.cccccc.c2; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(3))) { + clause->Tag = cl->u.cccccc.c3; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(4))) { + clause->Tag = cl->u.cccccc.c4; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(5))) { + clause->Tag = cl->u.cccccc.c5; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(6))) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(6))) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(5))) { + clause->Tag = cl->u.cccccc.c5; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(6))) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(6))) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(4))) { + clause->Tag = cl->u.cccccc.c4; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(5))) { + clause->Tag = cl->u.cccccc.c5; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(6))) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(6))) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(5))) { + clause->Tag = cl->u.cccccc.c5; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(6))) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(6))) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(3))) { + clause->Tag = cl->u.cccccc.c3; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(4))) { + clause->Tag = cl->u.cccccc.c4; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(5))) { + clause->Tag = cl->u.cccccc.c5; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(6))) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(6))) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(5))) { + clause->Tag = cl->u.cccccc.c5; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(6))) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(6))) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(4))) { + clause->Tag = cl->u.cccccc.c4; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(5))) { + clause->Tag = cl->u.cccccc.c5; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(6))) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(6))) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(5))) { + clause->Tag = cl->u.cccccc.c5; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(6))) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(6))) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(2))) { + clause->Tag = cl->u.cccccc.c2; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(3))) { + clause->Tag = cl->u.cccccc.c3; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(4))) { + clause->Tag = cl->u.cccccc.c4; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(5))) { + clause->Tag = cl->u.cccccc.c5; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(6))) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(6))) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(5))) { + clause->Tag = cl->u.cccccc.c5; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(6))) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(6))) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(4))) { + clause->Tag = cl->u.cccccc.c4; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(5))) { + clause->Tag = cl->u.cccccc.c5; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(6))) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(6))) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(5))) { + clause->Tag = cl->u.cccccc.c5; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(6))) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(6))) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(3))) { + clause->Tag = cl->u.cccccc.c3; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(4))) { + clause->Tag = cl->u.cccccc.c4; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(5))) { + clause->Tag = cl->u.cccccc.c5; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(6))) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(6))) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(5))) { + clause->Tag = cl->u.cccccc.c5; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(6))) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(6))) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(4))) { + clause->Tag = cl->u.cccccc.c4; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(5))) { + clause->Tag = cl->u.cccccc.c5; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(6))) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(6))) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(5))) { + clause->Tag = cl->u.cccccc.c5; + return; + } + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(6))) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (is_regcopy(myregs, nofregs, Yap_regnotoreg(6))) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + case _write_float: + cl = NEXTOP(cl,d); + break; + case _allocate: + cl = NEXTOP(cl,e); + break; + case _copy_idb_term: + if (regno == 2) { + LogUpdClause *lcl = ClauseCodeToLogUpdClause(cl); + Term t = lcl->ClSource->Entry; + if (IsVarTerm(t)) { + clause->Tag = (CELL)NULL; + } else if (IsApplTerm(t)) { + CELL *pt = RepAppl(t); + + clause->Tag = AbsAppl((CELL *)pt[0]); + clause->u.c_sreg = pt; + } else if (IsPairTerm(t)) { + CELL *pt = RepPair(t); + + clause->Tag = AbsPair(NULL); + clause->u.c_sreg = pt-1; + } else { + clause->Tag = t; + } + } else { + clause->Tag = (CELL)NULL; + } + return; + cl = NEXTOP(cl,e); + break; + case _count_a_call: + cl = NEXTOP(cl,e); + break; + case _enter_a_profiling: + cl = NEXTOP(cl,e); + break; + case _pop: + cl = NEXTOP(cl,e); + break; +#ifdef BEAM + case _retry_eam: +#endif + cl = NEXTOP(cl,e); + break; + case _unify_idb_term: + if (regno == 2) { + LogUpdClause *lcl = ClauseCodeToLogUpdClause(cl); + Term t = lcl->ClSource->Entry; + if (IsVarTerm(t)) { + clause->Tag = (CELL)NULL; + } else if (IsApplTerm(t)) { + CELL *pt = RepAppl(t); + + clause->Tag = AbsAppl((CELL *)pt[0]); + clause->u.c_sreg = pt; + } else if (IsPairTerm(t)) { + CELL *pt = RepPair(t); + + clause->Tag = AbsPair(NULL); + clause->u.c_sreg = pt-1; + } else { + clause->Tag = t; + } + } else { + clause->Tag = (CELL)NULL; + } + return; + cl = NEXTOP(cl,e); + break; + case _write_l_list: + cl = NEXTOP(cl,e); + break; + case _write_list: + cl = NEXTOP(cl,e); + break; + case _write_void: + cl = NEXTOP(cl,e); + break; + case _write_struct: + cl = NEXTOP(cl,fa); + break; + case _write_longint: + cl = NEXTOP(cl,i); + break; + case _unify_l_list: + cl = NEXTOP(cl,o); + break; + case _unify_l_list_write: + cl = NEXTOP(cl,o); + break; + case _unify_l_void: + cl = NEXTOP(cl,o); + break; + case _unify_l_void_write: + cl = NEXTOP(cl,o); + break; + case _unify_list: + cl = NEXTOP(cl,o); + break; + case _unify_list_write: + cl = NEXTOP(cl,o); + break; + case _unify_void: + cl = NEXTOP(cl,o); + break; + case _unify_void_write: + cl = NEXTOP(cl,o); + break; + case _unify_atom: + cl = NEXTOP(cl,oc); + break; + case _unify_atom_write: + cl = NEXTOP(cl,oc); + break; + case _unify_bigint: + cl = NEXTOP(cl,oc); + break; + case _unify_dbterm: + cl = NEXTOP(cl,oc); + break; + case _unify_l_atom: + cl = NEXTOP(cl,oc); + break; + case _unify_l_atom_write: + cl = NEXTOP(cl,oc); + break; + case _unify_l_bigint: + cl = NEXTOP(cl,oc); + break; + case _unify_l_dbterm: + cl = NEXTOP(cl,oc); + break; + case _unify_float: + cl = NEXTOP(cl,od); + break; + case _unify_float_write: + cl = NEXTOP(cl,od); + break; + case _unify_l_float: + cl = NEXTOP(cl,od); + break; + case _unify_l_float_write: + cl = NEXTOP(cl,od); + break; + case _unify_struct: + cl = NEXTOP(cl,ofa); + break; + case _unify_struct_write: + cl = NEXTOP(cl,ofa); + break; + case _unify_l_longint: + cl = NEXTOP(cl,oi); + break; + case _unify_l_longint_write: + cl = NEXTOP(cl,oi); + break; + case _unify_longint: + cl = NEXTOP(cl,oi); + break; + case _unify_longint_write: + cl = NEXTOP(cl,oi); + break; +#ifdef BEAM + case _run_eam: +#endif + cl = NEXTOP(cl,os); + break; + case _unify_l_n_voids: + cl = NEXTOP(cl,os); + break; + case _unify_l_n_voids_write: + cl = NEXTOP(cl,os); + break; + case _unify_n_voids: + cl = NEXTOP(cl,os); + break; + case _unify_n_voids_write: + cl = NEXTOP(cl,os); + break; + case _unify_n_atoms: + cl = NEXTOP(cl,osc); + break; + case _unify_n_atoms_write: + cl = NEXTOP(cl,osc); + break; + case _save_appl_x: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.ox.x))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,ox); + break; + case _save_appl_x_write: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.ox.x))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,ox); + break; + case _save_pair_x: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.ox.x))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,ox); + break; + case _save_pair_x_write: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.ox.x))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,ox); + break; + case _unify_l_x_loc: + cl = NEXTOP(cl,ox); + break; + case _unify_l_x_loc_write: + cl = NEXTOP(cl,ox); + break; + case _unify_l_x_val: + cl = NEXTOP(cl,ox); + break; + case _unify_l_x_val_write: + cl = NEXTOP(cl,ox); + break; + case _unify_l_x_var: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.ox.x))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,ox); + break; + case _unify_l_x_var_write: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.ox.x))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,ox); + break; + case _unify_x_loc: + cl = NEXTOP(cl,ox); + break; + case _unify_x_loc_write: + cl = NEXTOP(cl,ox); + break; + case _unify_x_val: + cl = NEXTOP(cl,ox); + break; + case _unify_x_val_write: + cl = NEXTOP(cl,ox); + break; + case _unify_x_var: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.ox.x))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,ox); + break; + case _unify_x_var_write: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.ox.x))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,ox); + break; + case _unify_l_x_var2: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.oxx.xl))) { + clause->Tag = (CELL)NULL; + return; + } + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.oxx.xr))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,oxx); + break; + case _unify_l_x_var2_write: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.oxx.xl))) { + clause->Tag = (CELL)NULL; + return; + } + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.oxx.xr))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,oxx); + break; + case _unify_x_var2: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.oxx.xl))) { + clause->Tag = (CELL)NULL; + return; + } + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.oxx.xr))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,oxx); + break; + case _unify_x_var2_write: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.oxx.xl))) { + clause->Tag = (CELL)NULL; + return; + } + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.oxx.xr))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,oxx); + break; + case _save_appl_y: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.oy.y))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,oy); + break; + case _save_appl_y_write: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.oy.y))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,oy); + break; + case _save_pair_y: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.oy.y))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,oy); + break; + case _save_pair_y_write: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.oy.y))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,oy); + break; + case _unify_l_y_loc: + cl = NEXTOP(cl,oy); + break; + case _unify_l_y_loc_write: + cl = NEXTOP(cl,oy); + break; + case _unify_l_y_val: + cl = NEXTOP(cl,oy); + break; + case _unify_l_y_val_write: + cl = NEXTOP(cl,oy); + break; + case _unify_l_y_var: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.oy.y))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,oy); + break; + case _unify_l_y_var_write: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.oy.y))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,oy); + break; + case _unify_y_loc: + cl = NEXTOP(cl,oy); + break; + case _unify_y_loc_write: + cl = NEXTOP(cl,oy); + break; + case _unify_y_val: + cl = NEXTOP(cl,oy); + break; + case _unify_y_val_write: + cl = NEXTOP(cl,oy); + break; + case _unify_y_var: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.oy.y))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,oy); + break; + case _unify_y_var_write: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.oy.y))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,oy); + break; + case _deallocate: + cl = NEXTOP(cl,p); + break; + case _lock_lu: + cl = NEXTOP(cl,p); + break; + case _call_bfunc_xx: + cl = NEXTOP(cl,plxxs); + break; + case _call_bfunc_xy: + cl = NEXTOP(cl,plxys); + break; + case _call_bfunc_yx: + cl = NEXTOP(cl,plxys); + break; + case _call_bfunc_yy: + cl = NEXTOP(cl,plyys); + break; + case _pop_n: + cl = NEXTOP(cl,s); + break; + case _write_n_voids: + cl = NEXTOP(cl,s); + break; + case _write_n_atoms: + cl = NEXTOP(cl,sc); + break; + case _gtc_float: + cl = NEXTOP(cl,sdll); + break; + case _ltc_float: + cl = NEXTOP(cl,sdll); + break; + case _gtc_int: + cl = NEXTOP(cl,snll); + break; + case _ltc_int: + cl = NEXTOP(cl,snll); + break; + case _add_float_c: + cl = NEXTOP(cl,ssd); + break; + case _fdiv_c1: + cl = NEXTOP(cl,ssd); + break; + case _fdiv_c2: + cl = NEXTOP(cl,ssd); + break; + case _mul_float_c: + cl = NEXTOP(cl,ssd); + break; + case _sub_float_c: + cl = NEXTOP(cl,ssd); + break; + case _a_eq: + cl = NEXTOP(cl,ssll); + break; + case _lt: + cl = NEXTOP(cl,ssll); + break; + case _a_and_c: + cl = NEXTOP(cl,ssn); + break; + case _a_or_c: + cl = NEXTOP(cl,ssn); + break; + case _add_int_c: + cl = NEXTOP(cl,ssn); + break; + case _idiv_c1: + cl = NEXTOP(cl,ssn); + break; + case _idiv_c2: + cl = NEXTOP(cl,ssn); + break; + case _mod_c1: + cl = NEXTOP(cl,ssn); + break; + case _mod_c2: + cl = NEXTOP(cl,ssn); + break; + case _mul_int_c: + cl = NEXTOP(cl,ssn); + break; + case _rem_c1: + cl = NEXTOP(cl,ssn); + break; + case _rem_c2: + cl = NEXTOP(cl,ssn); + break; + case _sl_c1: + cl = NEXTOP(cl,ssn); + break; + case _sl_c2: + cl = NEXTOP(cl,ssn); + break; + case _sr_c1: + cl = NEXTOP(cl,ssn); + break; + case _sr_c2: + cl = NEXTOP(cl,ssn); + break; + case _sub_int_c: + cl = NEXTOP(cl,ssn); + break; + case _a_and: + cl = NEXTOP(cl,sss); + break; + case _a_or: + cl = NEXTOP(cl,sss); + break; + case _add: + cl = NEXTOP(cl,sss); + break; + case _fdiv: + cl = NEXTOP(cl,sss); + break; + case _idiv: + cl = NEXTOP(cl,sss); + break; + case _mod: + cl = NEXTOP(cl,sss); + break; + case _mul: + cl = NEXTOP(cl,sss); + break; + case _rem: + cl = NEXTOP(cl,sss); + break; + case _sl: + cl = NEXTOP(cl,sss); + break; + case _sr: + cl = NEXTOP(cl,sss); + break; + case _sub: + cl = NEXTOP(cl,sss); + break; + case _uminus: + cl = NEXTOP(cl,sss); + break; + case _xor: + cl = NEXTOP(cl,sss); + break; + case _get_f_x: + cl = NEXTOP(cl,sxl); + break; + case _get_fi_x: + cl = NEXTOP(cl,sxl); + break; + case _get_i_x: + cl = NEXTOP(cl,sxl); + break; + case _put_f_var_x: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.sxl.x))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,sxl); + break; + case _put_fi_var_x: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.sxl.x))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,sxl); + break; + case _put_i_var_x: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.sxl.x))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,sxl); + break; + case _put_f_val_x: + cl = NEXTOP(cl,sxll); + break; + case _put_fi_val_x: + cl = NEXTOP(cl,sxll); + break; + case _put_i_val_x: + cl = NEXTOP(cl,sxll); + break; + case _get_f_y: + cl = NEXTOP(cl,syl); + break; + case _get_fi_y: + cl = NEXTOP(cl,syl); + break; + case _get_i_y: + cl = NEXTOP(cl,syl); + break; + case _put_f_var_y: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.syl.y))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,syl); + break; + case _put_fi_var_y: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.syl.y))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,syl); + break; + case _put_i_var_y: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.syl.y))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,syl); + break; + case _put_f_val_y: + cl = NEXTOP(cl,syll); + break; + case _put_fi_val_y: + cl = NEXTOP(cl,syll); + break; + case _put_i_val_y: + cl = NEXTOP(cl,syll); + break; + case _get_list: + if (is_regcopy(myregs, nofregs, cl->u.x.x)) { + clause->Tag = AbsPair(NULL); + clause->u.WorkPC = NEXTOP(cl,x); + return; + } + cl = NEXTOP(cl,x); + break; + if (is_regcopy(myregs, nofregs, cl->u.x.x)) { + clause->Tag = AbsPair(NULL); + clause->u.WorkPC = NEXTOP(cl,x); + return; + } + cl = NEXTOP(cl,x); + break; + case _put_list: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.x.x))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,x); + break; + case _save_b_x: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.x.x))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,x); + break; + case _write_x_loc: + cl = NEXTOP(cl,x); + break; + case _write_x_val: + cl = NEXTOP(cl,x); + break; + case _write_x_var: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.x.x))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,x); + break; + case _get_atom: + if (is_regcopy(myregs, nofregs, cl->u.xc.x)) { + clause->Tag = cl->u.xc.c; + return; + } + cl = NEXTOP(cl,xc); + break; + if (is_regcopy(myregs, nofregs, cl->u.xc.x)) { + clause->Tag = cl->u.xc.c; + return; + } + cl = NEXTOP(cl,xc); + break; + case _get_bigint: + if (is_regcopy(myregs, nofregs, cl->u.xc.x)) { + clause->Tag = AbsAppl((CELL *)FunctorBigInt); + clause->u.t_ptr = (CELL)NULL; + return; + } + cl = NEXTOP(cl,xc); + break; + case _put_atom: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.xc.x))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,xc); + break; + case _get_float: + if (is_regcopy(myregs, nofregs, cl->u.xd.x)) { + clause->Tag = AbsAppl((CELL *)FunctorDouble); + clause->u.t_ptr = AbsAppl(cl->u.xd.d); + return; + } + cl = NEXTOP(cl,xd); + break; + if (is_regcopy(myregs, nofregs, cl->u.xd.x)) { + clause->Tag = AbsAppl((CELL *)FunctorDouble); + clause->u.t_ptr = AbsAppl(cl->u.xd.d); + return; + } + cl = NEXTOP(cl,xd); + break; + case _put_float: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.xd.x))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,xd); + break; + case _get_struct: + if (is_regcopy(myregs, nofregs, cl->u.xfa.x)) { + clause->Tag = AbsAppl((CELL *)cl->u.xfa.f); + clause->u.WorkPC = NEXTOP(cl,xfa); + return; + } + cl = NEXTOP(cl,xfa); + break; + if (is_regcopy(myregs, nofregs, cl->u.xfa.x)) { + clause->Tag = AbsAppl((CELL *)cl->u.xfa.f); + clause->u.WorkPC = NEXTOP(cl,xfa); + return; + } + cl = NEXTOP(cl,xfa); + break; + case _put_struct: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.xfa.x))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,xfa); + break; + case _get_longint: + if (is_regcopy(myregs, nofregs, cl->u.xi.x)) { + clause->Tag = AbsAppl((CELL *)FunctorLongInt); + clause->u.t_ptr = AbsAppl(cl->u.xi.i); + return; + } + cl = NEXTOP(cl,xi); + break; + if (is_regcopy(myregs, nofregs, cl->u.xi.x)) { + clause->Tag = AbsAppl((CELL *)FunctorLongInt); + clause->u.t_ptr = AbsAppl(cl->u.xi.i); + return; + } + cl = NEXTOP(cl,xi); + break; + case _put_longint: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.xi.x))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,xi); + break; + case _p_atom_x: + if (is_regcopy(myregs, nofregs, cl->u.xl.x)) { + clause->Tag = (_atom+1)*sizeof(CELL); + clause->u.t_ptr = (CELL)NULL; + return; + } + if (cl->u.xl.F != FAILCODE) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,xl); + break; + case _p_atomic_x: + if (is_regcopy(myregs, nofregs, cl->u.xl.x)) { + clause->Tag = (_atomic+1)*sizeof(CELL); + clause->u.t_ptr = (CELL)NULL; + return; + } + if (cl->u.xl.F != FAILCODE) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,xl); + break; + case _p_compound_x: + if (is_regcopy(myregs, nofregs, cl->u.xl.x)) { + clause->Tag = (_compound+1)*sizeof(CELL); + clause->u.t_ptr = (CELL)NULL; + return; + } + if (cl->u.xl.F != FAILCODE) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,xl); + break; + case _p_db_ref_x: + if (is_regcopy(myregs, nofregs, cl->u.xl.x)) { + clause->Tag = AbsAppl((CELL *)FunctorDBRef); + clause->u.t_ptr = (CELL)NULL; + return; + } + if (cl->u.xl.F != FAILCODE) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,xl); + break; + case _p_float_x: + if (is_regcopy(myregs, nofregs, cl->u.xl.x)) { + clause->Tag = AbsAppl((CELL *)FunctorDouble); + clause->u.t_ptr = (CELL)NULL; + return; + } + if (cl->u.xl.F != FAILCODE) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,xl); + break; + case _p_integer_x: + if (is_regcopy(myregs, nofregs, cl->u.xl.x)) { + clause->Tag = (_integer+1)*sizeof(CELL); + clause->u.t_ptr = (CELL)NULL; + return; + } + if (cl->u.xl.F != FAILCODE) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,xl); + break; + case _p_nonvar_x: + if (cl->u.xl.F != FAILCODE) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,xl); + break; + case _p_number_x: + if (is_regcopy(myregs, nofregs, cl->u.xl.x)) { + clause->Tag = (_number+1)*sizeof(CELL); + clause->u.t_ptr = (CELL)NULL; + return; + } + if (cl->u.xl.F != FAILCODE) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,xl); + break; + case _p_primitive_x: + if (is_regcopy(myregs, nofregs, cl->u.xl.x)) { + clause->Tag = (_primitive+1)*sizeof(CELL); + clause->u.t_ptr = (CELL)NULL; + return; + } + if (cl->u.xl.F != FAILCODE) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,xl); + break; + case _p_var_x: + if (is_regcopy(myregs, nofregs, cl->u.xl.x)) { + clause->Tag = (_var+1)*sizeof(CELL); + clause->u.t_ptr = (CELL)NULL; + return; + } + if (cl->u.xl.F != FAILCODE) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,xl); + break; + case _get_x_val: + if (!(nofregs = link_regcopies(myregs, nofregs, cl->u.xx.xl, cl->u.xx.xr))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,xx); + break; + case _get_x_var: + if (!(nofregs = add_regcopy(myregs, nofregs, cl->u.xx.xr, cl->u.xx.xl))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,xx); + break; + case _gl_void_valx: + if (is_regcopy(myregs, nofregs, cl->u.xx.xl)) { + clause->Tag = AbsPair(NULL); + clause->u.WorkPC = cl; + return; + } + cl = NEXTOP(cl,xx); + break; + case _gl_void_varx: + if (is_regcopy(myregs, nofregs, cl->u.xx.xl)) { + clause->Tag = AbsPair(NULL); + clause->u.WorkPC = cl; + return; + } + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.xx.xr))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,xx); + break; + case _glist_valx: + if (is_regcopy(myregs, nofregs, cl->u.xx.xl)) { + clause->Tag = AbsPair(NULL); + clause->u.WorkPC = cl; + return; + } + cl = NEXTOP(cl,xx); + break; + case _put_x_val: + if (!(nofregs = add_regcopy(myregs, nofregs, cl->u.xx.xl, cl->u.xx.xr))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,xx); + break; + case _put_x_var: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.xx.xl))) { + clause->Tag = (CELL)NULL; + return; + } + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.xx.xr))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,xx); + break; + case _p_and_vc: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.xxn.x))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,xxn); + break; + case _p_arg_cv: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.xxn.x))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,xxn); + break; + case _p_div_cv: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.xxn.x))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,xxn); + break; + case _p_div_vc: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.xxn.x))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,xxn); + break; + case _p_func2s_cv: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.xxn.x))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,xxn); + break; + case _p_func2s_vc: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.xxn.x))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,xxn); + break; + case _p_or_vc: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.xxn.x))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,xxn); + break; + case _p_plus_vc: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.xxn.x))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,xxn); + break; + case _p_sll_cv: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.xxn.x))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,xxn); + break; + case _p_sll_vc: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.xxn.x))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,xxn); + break; + case _p_slr_cv: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.xxn.x))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,xxn); + break; + case _p_slr_vc: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.xxn.x))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,xxn); + break; + case _p_times_vc: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.xxn.x))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,xxn); + break; + case _p_and_vv: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.xxx.x))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,xxx); + break; + case _p_arg_vv: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.xxx.x))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,xxx); + break; + case _p_div_vv: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.xxx.x))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,xxx); + break; + case _p_func2f_xx: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.xxx.x))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,xxx); + break; + case _p_func2s_vv: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.xxx.x))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,xxx); + break; + case _p_minus_vv: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.xxx.x))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,xxx); + break; + case _p_or_vv: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.xxx.x))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,xxx); + break; + case _p_plus_vv: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.xxx.x))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,xxx); + break; + case _p_sll_vv: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.xxx.x))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,xxx); + break; + case _p_slr_vv: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.xxx.x))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,xxx); + break; + case _p_times_vv: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.xxx.x))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,xxx); + break; + case _put_xx_val: + if (!(nofregs = add_regcopy(myregs, nofregs, cl->u.xxxx.xl1, cl->u.xxxx.xr1))) { + clause->Tag = (CELL)NULL; + return; + } + if (!(nofregs = add_regcopy(myregs, nofregs, cl->u.xxxx.xl2, cl->u.xxxx.xr2))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,xxxx); + break; + case _p_func2f_xy: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.xxy.x))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,xxy); + break; + case _gl_void_valy: + if (is_regcopy(myregs, nofregs, cl->u.xy.y)) { + clause->Tag = AbsPair(NULL); + clause->u.WorkPC = cl; + return; + } + cl = NEXTOP(cl,xy); + break; + case _gl_void_vary: + if (is_regcopy(myregs, nofregs, cl->u.xy.y)) { + clause->Tag = AbsPair(NULL); + clause->u.WorkPC = cl; + return; + } + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.xy.y))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,xy); + break; + case _glist_valy: + if (is_regcopy(myregs, nofregs, cl->u.xy.x)) { + clause->Tag = AbsPair(NULL); + clause->u.WorkPC = cl; + return; + } + cl = NEXTOP(cl,xy); + break; + case _save_b_y: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.y.y))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,y); + break; + case _write_y_loc: + cl = NEXTOP(cl,y); + break; + case _write_y_val: + cl = NEXTOP(cl,y); + break; + case _write_y_var: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.y.y))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,y); + break; + case _p_atom_y: + if (is_regcopy(myregs, nofregs, cl->u.yl.y)) { + clause->Tag = (_atom+1)*sizeof(CELL); + clause->u.t_ptr = (CELL)NULL; + return; + } + if (cl->u.yl.F != FAILCODE) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,yl); + break; + case _p_atomic_y: + if (is_regcopy(myregs, nofregs, cl->u.yl.y)) { + clause->Tag = (_atomic+1)*sizeof(CELL); + clause->u.t_ptr = (CELL)NULL; + return; + } + if (cl->u.yl.F != FAILCODE) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,yl); + break; + case _p_compound_y: + if (is_regcopy(myregs, nofregs, cl->u.yl.y)) { + clause->Tag = (_compound+1)*sizeof(CELL); + clause->u.t_ptr = (CELL)NULL; + return; + } + if (cl->u.yl.F != FAILCODE) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,yl); + break; + case _p_db_ref_y: + if (is_regcopy(myregs, nofregs, cl->u.yl.y)) { + clause->Tag = AbsAppl((CELL *)FunctorDBRef); + clause->u.t_ptr = (CELL)NULL; + return; + } + if (cl->u.yl.F != FAILCODE) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,yl); + break; + case _p_float_y: + if (is_regcopy(myregs, nofregs, cl->u.yl.y)) { + clause->Tag = AbsAppl((CELL *)FunctorDouble); + clause->u.t_ptr = (CELL)NULL; + return; + } + if (cl->u.yl.F != FAILCODE) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,yl); + break; + case _p_integer_y: + if (is_regcopy(myregs, nofregs, cl->u.yl.y)) { + clause->Tag = (_integer+1)*sizeof(CELL); + clause->u.t_ptr = (CELL)NULL; + return; + } + if (cl->u.yl.F != FAILCODE) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,yl); + break; + case _p_nonvar_y: + if (cl->u.yl.F != FAILCODE) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,yl); + break; + case _p_number_y: + if (is_regcopy(myregs, nofregs, cl->u.yl.y)) { + clause->Tag = (_number+1)*sizeof(CELL); + clause->u.t_ptr = (CELL)NULL; + return; + } + if (cl->u.yl.F != FAILCODE) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,yl); + break; + case _p_primitive_y: + if (is_regcopy(myregs, nofregs, cl->u.yl.y)) { + clause->Tag = (_primitive+1)*sizeof(CELL); + clause->u.t_ptr = (CELL)NULL; + return; + } + if (cl->u.yl.F != FAILCODE) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,yl); + break; + case _p_var_y: + if (is_regcopy(myregs, nofregs, cl->u.yl.y)) { + clause->Tag = (_var+1)*sizeof(CELL); + clause->u.t_ptr = (CELL)NULL; + return; + } + if (cl->u.yl.F != FAILCODE) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,yl); + break; + case _get_y_val: + if (!(nofregs = link_regcopies(myregs, nofregs, cl->u.yx.x, cl->u.yx.y))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,yx); + break; + case _get_y_var: + if (!(nofregs = add_regcopy(myregs, nofregs, cl->u.yx.x, cl->u.yx.y))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,yx); + break; + case _put_unsafe: + if (!(nofregs = add_regcopy(myregs, nofregs, cl->u.yx.y, cl->u.yx.x))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,yx); + break; + case _put_y_val: + if (!(nofregs = add_regcopy(myregs, nofregs, cl->u.yx.y, cl->u.yx.x))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,yx); + break; + case _put_y_var: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.yx.x))) { + clause->Tag = (CELL)NULL; + return; + } + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.yx.y))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,yx); + break; + case _p_and_y_vc: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.yxn.y))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,yxn); + break; + case _p_arg_y_cv: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.yxn.y))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,yxn); + break; + case _p_div_y_cv: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.yxn.y))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,yxn); + break; + case _p_div_y_vc: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.yxn.y))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,yxn); + break; + case _p_func2s_y_cv: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.yxn.y))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,yxn); + break; + case _p_func2s_y_vc: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.yxn.y))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,yxn); + break; + case _p_or_y_vc: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.yxn.y))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,yxn); + break; + case _p_plus_y_vc: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.yxn.y))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,yxn); + break; + case _p_sll_y_cv: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.yxn.y))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,yxn); + break; + case _p_sll_y_vc: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.yxn.y))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,yxn); + break; + case _p_slr_y_cv: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.yxn.y))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,yxn); + break; + case _p_slr_y_vc: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.yxn.y))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,yxn); + break; + case _p_times_y_vc: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.yxn.y))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,yxn); + break; + case _p_and_y_vv: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.yxx.y))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,yxx); + break; + case _p_arg_y_vv: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.yxx.y))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,yxx); + break; + case _p_div_y_vv: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.yxx.y))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,yxx); + break; + case _p_func2f_yx: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.yxx.y))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,yxx); + break; + case _p_func2s_y_vv: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.yxx.y))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,yxx); + break; + case _p_minus_y_vv: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.yxx.y))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,yxx); + break; + case _p_or_y_vv: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.yxx.y))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,yxx); + break; + case _p_plus_y_vv: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.yxx.y))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,yxx); + break; + case _p_sll_y_vv: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.yxx.y))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,yxx); + break; + case _p_slr_y_vv: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.yxx.y))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,yxx); + break; + case _p_times_y_vv: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.yxx.y))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,yxx); + break; + case _p_func2f_yy: + if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.yyx.x))) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,yyx); + break; +#ifdef YAPOR +#endif +#ifdef TABLING +#endif +default: + clause->Tag = (CELL)NULL; + return; + } + } diff --git a/H/headclause.h b/H/headclause.h new file mode 100644 index 000000000..a3b3b7a9b --- /dev/null +++ b/H/headclause.h @@ -0,0 +1,1797 @@ + + /* This file was generated automatically by "yap -L misc/buildops" + please do not update */ + + + while (TRUE) { + op_numbers op = Yap_op_from_opcode(cl->opc); + switch (op) { + case _get_2atoms: + if (iarg == Yap_regnotoreg(1)) { + clause->Tag = cl->u.cc.c1; + return; + } + if (iarg == Yap_regnotoreg(2)) { + clause->Tag = cl->u.cc.c2; + return; + } + cl = NEXTOP(cl,cc); + break; + if (iarg == Yap_regnotoreg(2)) { + clause->Tag = cl->u.cc.c2; + return; + } + cl = NEXTOP(cl,cc); + break; + if (iarg == Yap_regnotoreg(1)) { + clause->Tag = cl->u.cc.c1; + return; + } + if (iarg == Yap_regnotoreg(2)) { + clause->Tag = cl->u.cc.c2; + return; + } + cl = NEXTOP(cl,cc); + break; + if (iarg == Yap_regnotoreg(2)) { + 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; + return; + } + if (iarg == Yap_regnotoreg(2)) { + clause->Tag = cl->u.ccc.c2; + return; + } + if (iarg == Yap_regnotoreg(3)) { + clause->Tag = cl->u.ccc.c3; + return; + } + cl = NEXTOP(cl,ccc); + break; + if (iarg == Yap_regnotoreg(3)) { + clause->Tag = cl->u.ccc.c3; + return; + } + cl = NEXTOP(cl,ccc); + break; + if (iarg == Yap_regnotoreg(2)) { + clause->Tag = cl->u.ccc.c2; + return; + } + if (iarg == Yap_regnotoreg(3)) { + clause->Tag = cl->u.ccc.c3; + return; + } + cl = NEXTOP(cl,ccc); + break; + if (iarg == Yap_regnotoreg(3)) { + clause->Tag = cl->u.ccc.c3; + return; + } + cl = NEXTOP(cl,ccc); + break; + if (iarg == Yap_regnotoreg(1)) { + clause->Tag = cl->u.ccc.c1; + return; + } + if (iarg == Yap_regnotoreg(2)) { + clause->Tag = cl->u.ccc.c2; + return; + } + if (iarg == Yap_regnotoreg(3)) { + clause->Tag = cl->u.ccc.c3; + return; + } + cl = NEXTOP(cl,ccc); + break; + if (iarg == Yap_regnotoreg(3)) { + clause->Tag = cl->u.ccc.c3; + return; + } + cl = NEXTOP(cl,ccc); + break; + if (iarg == Yap_regnotoreg(2)) { + clause->Tag = cl->u.ccc.c2; + return; + } + if (iarg == Yap_regnotoreg(3)) { + clause->Tag = cl->u.ccc.c3; + return; + } + cl = NEXTOP(cl,ccc); + break; + if (iarg == Yap_regnotoreg(3)) { + 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; + return; + } + if (iarg == Yap_regnotoreg(2)) { + clause->Tag = cl->u.cccc.c2; + return; + } + if (iarg == Yap_regnotoreg(3)) { + clause->Tag = cl->u.cccc.c3; + return; + } + if (iarg == Yap_regnotoreg(4)) { + clause->Tag = cl->u.cccc.c4; + return; + } + cl = NEXTOP(cl,cccc); + break; + if (iarg == Yap_regnotoreg(4)) { + clause->Tag = cl->u.cccc.c4; + return; + } + cl = NEXTOP(cl,cccc); + break; + if (iarg == Yap_regnotoreg(3)) { + clause->Tag = cl->u.cccc.c3; + return; + } + if (iarg == Yap_regnotoreg(4)) { + clause->Tag = cl->u.cccc.c4; + return; + } + cl = NEXTOP(cl,cccc); + break; + if (iarg == Yap_regnotoreg(4)) { + clause->Tag = cl->u.cccc.c4; + return; + } + cl = NEXTOP(cl,cccc); + break; + if (iarg == Yap_regnotoreg(2)) { + clause->Tag = cl->u.cccc.c2; + return; + } + if (iarg == Yap_regnotoreg(3)) { + clause->Tag = cl->u.cccc.c3; + return; + } + if (iarg == Yap_regnotoreg(4)) { + clause->Tag = cl->u.cccc.c4; + return; + } + cl = NEXTOP(cl,cccc); + break; + if (iarg == Yap_regnotoreg(4)) { + clause->Tag = cl->u.cccc.c4; + return; + } + cl = NEXTOP(cl,cccc); + break; + if (iarg == Yap_regnotoreg(3)) { + clause->Tag = cl->u.cccc.c3; + return; + } + if (iarg == Yap_regnotoreg(4)) { + clause->Tag = cl->u.cccc.c4; + return; + } + cl = NEXTOP(cl,cccc); + break; + if (iarg == Yap_regnotoreg(4)) { + clause->Tag = cl->u.cccc.c4; + return; + } + cl = NEXTOP(cl,cccc); + break; + if (iarg == Yap_regnotoreg(1)) { + clause->Tag = cl->u.cccc.c1; + return; + } + if (iarg == Yap_regnotoreg(2)) { + clause->Tag = cl->u.cccc.c2; + return; + } + if (iarg == Yap_regnotoreg(3)) { + clause->Tag = cl->u.cccc.c3; + return; + } + if (iarg == Yap_regnotoreg(4)) { + clause->Tag = cl->u.cccc.c4; + return; + } + cl = NEXTOP(cl,cccc); + break; + if (iarg == Yap_regnotoreg(4)) { + clause->Tag = cl->u.cccc.c4; + return; + } + cl = NEXTOP(cl,cccc); + break; + if (iarg == Yap_regnotoreg(3)) { + clause->Tag = cl->u.cccc.c3; + return; + } + if (iarg == Yap_regnotoreg(4)) { + clause->Tag = cl->u.cccc.c4; + return; + } + cl = NEXTOP(cl,cccc); + break; + if (iarg == Yap_regnotoreg(4)) { + clause->Tag = cl->u.cccc.c4; + return; + } + cl = NEXTOP(cl,cccc); + break; + if (iarg == Yap_regnotoreg(2)) { + clause->Tag = cl->u.cccc.c2; + return; + } + if (iarg == Yap_regnotoreg(3)) { + clause->Tag = cl->u.cccc.c3; + return; + } + if (iarg == Yap_regnotoreg(4)) { + clause->Tag = cl->u.cccc.c4; + return; + } + cl = NEXTOP(cl,cccc); + break; + if (iarg == Yap_regnotoreg(4)) { + clause->Tag = cl->u.cccc.c4; + return; + } + cl = NEXTOP(cl,cccc); + break; + if (iarg == Yap_regnotoreg(3)) { + clause->Tag = cl->u.cccc.c3; + return; + } + if (iarg == Yap_regnotoreg(4)) { + clause->Tag = cl->u.cccc.c4; + return; + } + cl = NEXTOP(cl,cccc); + break; + if (iarg == Yap_regnotoreg(4)) { + 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; + return; + } + if (iarg == Yap_regnotoreg(2)) { + clause->Tag = cl->u.ccccc.c2; + return; + } + if (iarg == Yap_regnotoreg(3)) { + clause->Tag = cl->u.ccccc.c3; + return; + } + if (iarg == Yap_regnotoreg(4)) { + clause->Tag = cl->u.ccccc.c4; + return; + } + if (iarg == Yap_regnotoreg(5)) { + clause->Tag = cl->u.ccccc.c5; + return; + } + cl = NEXTOP(cl,ccccc); + break; + if (iarg == Yap_regnotoreg(5)) { + clause->Tag = cl->u.ccccc.c5; + return; + } + cl = NEXTOP(cl,ccccc); + break; + if (iarg == Yap_regnotoreg(4)) { + clause->Tag = cl->u.ccccc.c4; + return; + } + if (iarg == Yap_regnotoreg(5)) { + clause->Tag = cl->u.ccccc.c5; + return; + } + cl = NEXTOP(cl,ccccc); + break; + if (iarg == Yap_regnotoreg(5)) { + clause->Tag = cl->u.ccccc.c5; + return; + } + cl = NEXTOP(cl,ccccc); + break; + if (iarg == Yap_regnotoreg(3)) { + clause->Tag = cl->u.ccccc.c3; + return; + } + if (iarg == Yap_regnotoreg(4)) { + clause->Tag = cl->u.ccccc.c4; + return; + } + if (iarg == Yap_regnotoreg(5)) { + clause->Tag = cl->u.ccccc.c5; + return; + } + cl = NEXTOP(cl,ccccc); + break; + if (iarg == Yap_regnotoreg(5)) { + clause->Tag = cl->u.ccccc.c5; + return; + } + cl = NEXTOP(cl,ccccc); + break; + if (iarg == Yap_regnotoreg(4)) { + clause->Tag = cl->u.ccccc.c4; + return; + } + if (iarg == Yap_regnotoreg(5)) { + clause->Tag = cl->u.ccccc.c5; + return; + } + cl = NEXTOP(cl,ccccc); + break; + if (iarg == Yap_regnotoreg(5)) { + clause->Tag = cl->u.ccccc.c5; + return; + } + cl = NEXTOP(cl,ccccc); + break; + if (iarg == Yap_regnotoreg(2)) { + clause->Tag = cl->u.ccccc.c2; + return; + } + if (iarg == Yap_regnotoreg(3)) { + clause->Tag = cl->u.ccccc.c3; + return; + } + if (iarg == Yap_regnotoreg(4)) { + clause->Tag = cl->u.ccccc.c4; + return; + } + if (iarg == Yap_regnotoreg(5)) { + clause->Tag = cl->u.ccccc.c5; + return; + } + cl = NEXTOP(cl,ccccc); + break; + if (iarg == Yap_regnotoreg(5)) { + clause->Tag = cl->u.ccccc.c5; + return; + } + cl = NEXTOP(cl,ccccc); + break; + if (iarg == Yap_regnotoreg(4)) { + clause->Tag = cl->u.ccccc.c4; + return; + } + if (iarg == Yap_regnotoreg(5)) { + clause->Tag = cl->u.ccccc.c5; + return; + } + cl = NEXTOP(cl,ccccc); + break; + if (iarg == Yap_regnotoreg(5)) { + clause->Tag = cl->u.ccccc.c5; + return; + } + cl = NEXTOP(cl,ccccc); + break; + if (iarg == Yap_regnotoreg(3)) { + clause->Tag = cl->u.ccccc.c3; + return; + } + if (iarg == Yap_regnotoreg(4)) { + clause->Tag = cl->u.ccccc.c4; + return; + } + if (iarg == Yap_regnotoreg(5)) { + clause->Tag = cl->u.ccccc.c5; + return; + } + cl = NEXTOP(cl,ccccc); + break; + if (iarg == Yap_regnotoreg(5)) { + clause->Tag = cl->u.ccccc.c5; + return; + } + cl = NEXTOP(cl,ccccc); + break; + if (iarg == Yap_regnotoreg(4)) { + clause->Tag = cl->u.ccccc.c4; + return; + } + if (iarg == Yap_regnotoreg(5)) { + clause->Tag = cl->u.ccccc.c5; + return; + } + cl = NEXTOP(cl,ccccc); + break; + if (iarg == Yap_regnotoreg(5)) { + clause->Tag = cl->u.ccccc.c5; + return; + } + cl = NEXTOP(cl,ccccc); + break; + if (iarg == Yap_regnotoreg(1)) { + clause->Tag = cl->u.ccccc.c1; + return; + } + if (iarg == Yap_regnotoreg(2)) { + clause->Tag = cl->u.ccccc.c2; + return; + } + if (iarg == Yap_regnotoreg(3)) { + clause->Tag = cl->u.ccccc.c3; + return; + } + if (iarg == Yap_regnotoreg(4)) { + clause->Tag = cl->u.ccccc.c4; + return; + } + if (iarg == Yap_regnotoreg(5)) { + clause->Tag = cl->u.ccccc.c5; + return; + } + cl = NEXTOP(cl,ccccc); + break; + if (iarg == Yap_regnotoreg(5)) { + clause->Tag = cl->u.ccccc.c5; + return; + } + cl = NEXTOP(cl,ccccc); + break; + if (iarg == Yap_regnotoreg(4)) { + clause->Tag = cl->u.ccccc.c4; + return; + } + if (iarg == Yap_regnotoreg(5)) { + clause->Tag = cl->u.ccccc.c5; + return; + } + cl = NEXTOP(cl,ccccc); + break; + if (iarg == Yap_regnotoreg(5)) { + clause->Tag = cl->u.ccccc.c5; + return; + } + cl = NEXTOP(cl,ccccc); + break; + if (iarg == Yap_regnotoreg(3)) { + clause->Tag = cl->u.ccccc.c3; + return; + } + if (iarg == Yap_regnotoreg(4)) { + clause->Tag = cl->u.ccccc.c4; + return; + } + if (iarg == Yap_regnotoreg(5)) { + clause->Tag = cl->u.ccccc.c5; + return; + } + cl = NEXTOP(cl,ccccc); + break; + if (iarg == Yap_regnotoreg(5)) { + clause->Tag = cl->u.ccccc.c5; + return; + } + cl = NEXTOP(cl,ccccc); + break; + if (iarg == Yap_regnotoreg(4)) { + clause->Tag = cl->u.ccccc.c4; + return; + } + if (iarg == Yap_regnotoreg(5)) { + clause->Tag = cl->u.ccccc.c5; + return; + } + cl = NEXTOP(cl,ccccc); + break; + if (iarg == Yap_regnotoreg(5)) { + clause->Tag = cl->u.ccccc.c5; + return; + } + cl = NEXTOP(cl,ccccc); + break; + if (iarg == Yap_regnotoreg(2)) { + clause->Tag = cl->u.ccccc.c2; + return; + } + if (iarg == Yap_regnotoreg(3)) { + clause->Tag = cl->u.ccccc.c3; + return; + } + if (iarg == Yap_regnotoreg(4)) { + clause->Tag = cl->u.ccccc.c4; + return; + } + if (iarg == Yap_regnotoreg(5)) { + clause->Tag = cl->u.ccccc.c5; + return; + } + cl = NEXTOP(cl,ccccc); + break; + if (iarg == Yap_regnotoreg(5)) { + clause->Tag = cl->u.ccccc.c5; + return; + } + cl = NEXTOP(cl,ccccc); + break; + if (iarg == Yap_regnotoreg(4)) { + clause->Tag = cl->u.ccccc.c4; + return; + } + if (iarg == Yap_regnotoreg(5)) { + clause->Tag = cl->u.ccccc.c5; + return; + } + cl = NEXTOP(cl,ccccc); + break; + if (iarg == Yap_regnotoreg(5)) { + clause->Tag = cl->u.ccccc.c5; + return; + } + cl = NEXTOP(cl,ccccc); + break; + if (iarg == Yap_regnotoreg(3)) { + clause->Tag = cl->u.ccccc.c3; + return; + } + if (iarg == Yap_regnotoreg(4)) { + clause->Tag = cl->u.ccccc.c4; + return; + } + if (iarg == Yap_regnotoreg(5)) { + clause->Tag = cl->u.ccccc.c5; + return; + } + cl = NEXTOP(cl,ccccc); + break; + if (iarg == Yap_regnotoreg(5)) { + clause->Tag = cl->u.ccccc.c5; + return; + } + cl = NEXTOP(cl,ccccc); + break; + if (iarg == Yap_regnotoreg(4)) { + clause->Tag = cl->u.ccccc.c4; + return; + } + if (iarg == Yap_regnotoreg(5)) { + clause->Tag = cl->u.ccccc.c5; + return; + } + cl = NEXTOP(cl,ccccc); + break; + if (iarg == Yap_regnotoreg(5)) { + 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; + return; + } + if (iarg == Yap_regnotoreg(2)) { + clause->Tag = cl->u.cccccc.c2; + return; + } + if (iarg == Yap_regnotoreg(3)) { + clause->Tag = cl->u.cccccc.c3; + return; + } + if (iarg == Yap_regnotoreg(4)) { + clause->Tag = cl->u.cccccc.c4; + return; + } + if (iarg == Yap_regnotoreg(5)) { + clause->Tag = cl->u.cccccc.c5; + return; + } + if (iarg == Yap_regnotoreg(6)) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (iarg == Yap_regnotoreg(6)) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (iarg == Yap_regnotoreg(5)) { + clause->Tag = cl->u.cccccc.c5; + return; + } + if (iarg == Yap_regnotoreg(6)) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (iarg == Yap_regnotoreg(6)) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (iarg == Yap_regnotoreg(4)) { + clause->Tag = cl->u.cccccc.c4; + return; + } + if (iarg == Yap_regnotoreg(5)) { + clause->Tag = cl->u.cccccc.c5; + return; + } + if (iarg == Yap_regnotoreg(6)) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (iarg == Yap_regnotoreg(6)) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (iarg == Yap_regnotoreg(5)) { + clause->Tag = cl->u.cccccc.c5; + return; + } + if (iarg == Yap_regnotoreg(6)) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (iarg == Yap_regnotoreg(6)) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (iarg == Yap_regnotoreg(3)) { + clause->Tag = cl->u.cccccc.c3; + return; + } + if (iarg == Yap_regnotoreg(4)) { + clause->Tag = cl->u.cccccc.c4; + return; + } + if (iarg == Yap_regnotoreg(5)) { + clause->Tag = cl->u.cccccc.c5; + return; + } + if (iarg == Yap_regnotoreg(6)) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (iarg == Yap_regnotoreg(6)) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (iarg == Yap_regnotoreg(5)) { + clause->Tag = cl->u.cccccc.c5; + return; + } + if (iarg == Yap_regnotoreg(6)) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (iarg == Yap_regnotoreg(6)) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (iarg == Yap_regnotoreg(4)) { + clause->Tag = cl->u.cccccc.c4; + return; + } + if (iarg == Yap_regnotoreg(5)) { + clause->Tag = cl->u.cccccc.c5; + return; + } + if (iarg == Yap_regnotoreg(6)) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (iarg == Yap_regnotoreg(6)) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (iarg == Yap_regnotoreg(5)) { + clause->Tag = cl->u.cccccc.c5; + return; + } + if (iarg == Yap_regnotoreg(6)) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (iarg == Yap_regnotoreg(6)) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (iarg == Yap_regnotoreg(2)) { + clause->Tag = cl->u.cccccc.c2; + return; + } + if (iarg == Yap_regnotoreg(3)) { + clause->Tag = cl->u.cccccc.c3; + return; + } + if (iarg == Yap_regnotoreg(4)) { + clause->Tag = cl->u.cccccc.c4; + return; + } + if (iarg == Yap_regnotoreg(5)) { + clause->Tag = cl->u.cccccc.c5; + return; + } + if (iarg == Yap_regnotoreg(6)) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (iarg == Yap_regnotoreg(6)) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (iarg == Yap_regnotoreg(5)) { + clause->Tag = cl->u.cccccc.c5; + return; + } + if (iarg == Yap_regnotoreg(6)) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (iarg == Yap_regnotoreg(6)) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (iarg == Yap_regnotoreg(4)) { + clause->Tag = cl->u.cccccc.c4; + return; + } + if (iarg == Yap_regnotoreg(5)) { + clause->Tag = cl->u.cccccc.c5; + return; + } + if (iarg == Yap_regnotoreg(6)) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (iarg == Yap_regnotoreg(6)) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (iarg == Yap_regnotoreg(5)) { + clause->Tag = cl->u.cccccc.c5; + return; + } + if (iarg == Yap_regnotoreg(6)) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (iarg == Yap_regnotoreg(6)) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (iarg == Yap_regnotoreg(3)) { + clause->Tag = cl->u.cccccc.c3; + return; + } + if (iarg == Yap_regnotoreg(4)) { + clause->Tag = cl->u.cccccc.c4; + return; + } + if (iarg == Yap_regnotoreg(5)) { + clause->Tag = cl->u.cccccc.c5; + return; + } + if (iarg == Yap_regnotoreg(6)) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (iarg == Yap_regnotoreg(6)) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (iarg == Yap_regnotoreg(5)) { + clause->Tag = cl->u.cccccc.c5; + return; + } + if (iarg == Yap_regnotoreg(6)) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (iarg == Yap_regnotoreg(6)) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (iarg == Yap_regnotoreg(4)) { + clause->Tag = cl->u.cccccc.c4; + return; + } + if (iarg == Yap_regnotoreg(5)) { + clause->Tag = cl->u.cccccc.c5; + return; + } + if (iarg == Yap_regnotoreg(6)) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (iarg == Yap_regnotoreg(6)) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (iarg == Yap_regnotoreg(5)) { + clause->Tag = cl->u.cccccc.c5; + return; + } + if (iarg == Yap_regnotoreg(6)) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (iarg == Yap_regnotoreg(6)) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (iarg == Yap_regnotoreg(1)) { + clause->Tag = cl->u.cccccc.c1; + return; + } + if (iarg == Yap_regnotoreg(2)) { + clause->Tag = cl->u.cccccc.c2; + return; + } + if (iarg == Yap_regnotoreg(3)) { + clause->Tag = cl->u.cccccc.c3; + return; + } + if (iarg == Yap_regnotoreg(4)) { + clause->Tag = cl->u.cccccc.c4; + return; + } + if (iarg == Yap_regnotoreg(5)) { + clause->Tag = cl->u.cccccc.c5; + return; + } + if (iarg == Yap_regnotoreg(6)) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (iarg == Yap_regnotoreg(6)) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (iarg == Yap_regnotoreg(5)) { + clause->Tag = cl->u.cccccc.c5; + return; + } + if (iarg == Yap_regnotoreg(6)) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (iarg == Yap_regnotoreg(6)) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (iarg == Yap_regnotoreg(4)) { + clause->Tag = cl->u.cccccc.c4; + return; + } + if (iarg == Yap_regnotoreg(5)) { + clause->Tag = cl->u.cccccc.c5; + return; + } + if (iarg == Yap_regnotoreg(6)) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (iarg == Yap_regnotoreg(6)) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (iarg == Yap_regnotoreg(5)) { + clause->Tag = cl->u.cccccc.c5; + return; + } + if (iarg == Yap_regnotoreg(6)) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (iarg == Yap_regnotoreg(6)) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (iarg == Yap_regnotoreg(3)) { + clause->Tag = cl->u.cccccc.c3; + return; + } + if (iarg == Yap_regnotoreg(4)) { + clause->Tag = cl->u.cccccc.c4; + return; + } + if (iarg == Yap_regnotoreg(5)) { + clause->Tag = cl->u.cccccc.c5; + return; + } + if (iarg == Yap_regnotoreg(6)) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (iarg == Yap_regnotoreg(6)) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (iarg == Yap_regnotoreg(5)) { + clause->Tag = cl->u.cccccc.c5; + return; + } + if (iarg == Yap_regnotoreg(6)) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (iarg == Yap_regnotoreg(6)) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (iarg == Yap_regnotoreg(4)) { + clause->Tag = cl->u.cccccc.c4; + return; + } + if (iarg == Yap_regnotoreg(5)) { + clause->Tag = cl->u.cccccc.c5; + return; + } + if (iarg == Yap_regnotoreg(6)) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (iarg == Yap_regnotoreg(6)) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (iarg == Yap_regnotoreg(5)) { + clause->Tag = cl->u.cccccc.c5; + return; + } + if (iarg == Yap_regnotoreg(6)) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (iarg == Yap_regnotoreg(6)) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (iarg == Yap_regnotoreg(2)) { + clause->Tag = cl->u.cccccc.c2; + return; + } + if (iarg == Yap_regnotoreg(3)) { + clause->Tag = cl->u.cccccc.c3; + return; + } + if (iarg == Yap_regnotoreg(4)) { + clause->Tag = cl->u.cccccc.c4; + return; + } + if (iarg == Yap_regnotoreg(5)) { + clause->Tag = cl->u.cccccc.c5; + return; + } + if (iarg == Yap_regnotoreg(6)) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (iarg == Yap_regnotoreg(6)) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (iarg == Yap_regnotoreg(5)) { + clause->Tag = cl->u.cccccc.c5; + return; + } + if (iarg == Yap_regnotoreg(6)) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (iarg == Yap_regnotoreg(6)) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (iarg == Yap_regnotoreg(4)) { + clause->Tag = cl->u.cccccc.c4; + return; + } + if (iarg == Yap_regnotoreg(5)) { + clause->Tag = cl->u.cccccc.c5; + return; + } + if (iarg == Yap_regnotoreg(6)) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (iarg == Yap_regnotoreg(6)) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (iarg == Yap_regnotoreg(5)) { + clause->Tag = cl->u.cccccc.c5; + return; + } + if (iarg == Yap_regnotoreg(6)) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (iarg == Yap_regnotoreg(6)) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (iarg == Yap_regnotoreg(3)) { + clause->Tag = cl->u.cccccc.c3; + return; + } + if (iarg == Yap_regnotoreg(4)) { + clause->Tag = cl->u.cccccc.c4; + return; + } + if (iarg == Yap_regnotoreg(5)) { + clause->Tag = cl->u.cccccc.c5; + return; + } + if (iarg == Yap_regnotoreg(6)) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (iarg == Yap_regnotoreg(6)) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (iarg == Yap_regnotoreg(5)) { + clause->Tag = cl->u.cccccc.c5; + return; + } + if (iarg == Yap_regnotoreg(6)) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (iarg == Yap_regnotoreg(6)) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (iarg == Yap_regnotoreg(4)) { + clause->Tag = cl->u.cccccc.c4; + return; + } + if (iarg == Yap_regnotoreg(5)) { + clause->Tag = cl->u.cccccc.c5; + return; + } + if (iarg == Yap_regnotoreg(6)) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (iarg == Yap_regnotoreg(6)) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (iarg == Yap_regnotoreg(5)) { + clause->Tag = cl->u.cccccc.c5; + return; + } + if (iarg == Yap_regnotoreg(6)) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + if (iarg == Yap_regnotoreg(6)) { + clause->Tag = cl->u.cccccc.c6; + return; + } + cl = NEXTOP(cl,cccccc); + break; + case _copy_idb_term: + if (regno != 2) { + clause->Tag = (CELL)NULL; + } else { + LogUpdClause *lcl = ClauseCodeToLogUpdClause(cl); + Term t = lcl->ClSource->Entry; + + if (IsVarTerm(t)) { + clause->Tag = (CELL)NULL; + } else if (IsApplTerm(t)) { + CELL *pt = RepAppl(t); + + clause->Tag = AbsAppl((CELL *)pt[0]); + if (IsExtensionFunctor(FunctorOfTerm(t))) { + clause->u.t_ptr = t; + } else { + clause->u.c_sreg = pt; + } + } else if (IsPairTerm(t)) { + CELL *pt = RepPair(t); + + clause->Tag = AbsPair(NULL); + clause->u.c_sreg = pt-1; + } else { + clause->Tag = t; + } + } + return; + cl = NEXTOP(cl,e); + break; + case _pop: + cl = NEXTOP(cl,e); + break; + case _unify_idb_term: + if (regno != 2) { + clause->Tag = (CELL)NULL; + } else { + LogUpdClause *lcl = ClauseCodeToLogUpdClause(cl); + Term t = lcl->ClSource->Entry; + + if (IsVarTerm(t)) { + clause->Tag = (CELL)NULL; + } else if (IsApplTerm(t)) { + CELL *pt = RepAppl(t); + + clause->Tag = AbsAppl((CELL *)pt[0]); + if (IsExtensionFunctor(FunctorOfTerm(t))) { + clause->u.t_ptr = t; + } else { + clause->u.c_sreg = pt; + } + } else if (IsPairTerm(t)) { + CELL *pt = RepPair(t); + + clause->Tag = AbsPair(NULL); + clause->u.c_sreg = pt-1; + } else { + clause->Tag = t; + } + } + return; + cl = NEXTOP(cl,e); + break; + case _unify_l_list: + cl = NEXTOP(cl,o); + break; + case _unify_l_list_write: + cl = NEXTOP(cl,o); + break; + case _unify_l_void: + cl = NEXTOP(cl,o); + break; + case _unify_l_void_write: + cl = NEXTOP(cl,o); + break; + case _unify_list: + cl = NEXTOP(cl,o); + break; + case _unify_list_write: + cl = NEXTOP(cl,o); + break; + case _unify_void: + cl = NEXTOP(cl,o); + break; + case _unify_void_write: + cl = NEXTOP(cl,o); + break; + case _unify_atom: + cl = NEXTOP(cl,oc); + break; + case _unify_atom_write: + cl = NEXTOP(cl,oc); + break; + case _unify_bigint: + cl = NEXTOP(cl,oc); + break; + case _unify_dbterm: + cl = NEXTOP(cl,oc); + break; + case _unify_l_atom: + cl = NEXTOP(cl,oc); + break; + case _unify_l_atom_write: + cl = NEXTOP(cl,oc); + break; + case _unify_l_bigint: + cl = NEXTOP(cl,oc); + break; + case _unify_l_dbterm: + cl = NEXTOP(cl,oc); + break; + case _unify_float: + cl = NEXTOP(cl,od); + break; + case _unify_float_write: + cl = NEXTOP(cl,od); + break; + case _unify_l_float: + cl = NEXTOP(cl,od); + break; + case _unify_l_float_write: + cl = NEXTOP(cl,od); + break; + case _unify_struct: + cl = NEXTOP(cl,ofa); + break; + case _unify_struct_write: + cl = NEXTOP(cl,ofa); + break; + case _unify_l_longint: + cl = NEXTOP(cl,oi); + break; + case _unify_l_longint_write: + cl = NEXTOP(cl,oi); + break; + case _unify_longint: + cl = NEXTOP(cl,oi); + break; + case _unify_longint_write: + cl = NEXTOP(cl,oi); + break; + case _unify_l_n_voids: + cl = NEXTOP(cl,os); + break; + case _unify_l_n_voids_write: + cl = NEXTOP(cl,os); + break; + case _unify_n_voids: + cl = NEXTOP(cl,os); + break; + case _unify_n_voids_write: + cl = NEXTOP(cl,os); + break; + case _unify_n_atoms: + cl = NEXTOP(cl,osc); + break; + case _unify_n_atoms_write: + cl = NEXTOP(cl,osc); + break; + case _save_appl_x: + if (iarg == cl->u.ox.x) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,ox); + break; + case _save_appl_x_write: + if (iarg == cl->u.ox.x) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,ox); + break; + case _save_pair_x: + if (iarg == cl->u.ox.x) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,ox); + break; + case _save_pair_x_write: + if (iarg == cl->u.ox.x) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,ox); + break; + case _unify_l_x_loc: + cl = NEXTOP(cl,ox); + break; + case _unify_l_x_loc_write: + cl = NEXTOP(cl,ox); + break; + case _unify_l_x_val: + cl = NEXTOP(cl,ox); + break; + case _unify_l_x_val_write: + cl = NEXTOP(cl,ox); + break; + case _unify_l_x_var: + if (iarg == cl->u.ox.x) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,ox); + break; + case _unify_l_x_var_write: + if (iarg == cl->u.ox.x) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,ox); + break; + case _unify_x_loc: + cl = NEXTOP(cl,ox); + break; + case _unify_x_loc_write: + cl = NEXTOP(cl,ox); + break; + case _unify_x_val: + cl = NEXTOP(cl,ox); + break; + case _unify_x_val_write: + cl = NEXTOP(cl,ox); + break; + case _unify_x_var: + if (iarg == cl->u.ox.x) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,ox); + break; + case _unify_x_var_write: + if (iarg == cl->u.ox.x) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,ox); + break; + case _unify_l_x_var2: + if (iarg == cl->u.oxx.xl) { + clause->Tag = (CELL)NULL; + return; + } + if (iarg == cl->u.oxx.xr) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,oxx); + break; + case _unify_l_x_var2_write: + if (iarg == cl->u.oxx.xl) { + clause->Tag = (CELL)NULL; + return; + } + if (iarg == cl->u.oxx.xr) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,oxx); + break; + case _unify_x_var2: + if (iarg == cl->u.oxx.xl) { + clause->Tag = (CELL)NULL; + return; + } + if (iarg == cl->u.oxx.xr) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,oxx); + break; + case _unify_x_var2_write: + if (iarg == cl->u.oxx.xl) { + clause->Tag = (CELL)NULL; + return; + } + if (iarg == cl->u.oxx.xr) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,oxx); + break; + case _save_appl_y: + cl = NEXTOP(cl,oy); + break; + case _save_appl_y_write: + cl = NEXTOP(cl,oy); + break; + case _save_pair_y: + cl = NEXTOP(cl,oy); + break; + case _save_pair_y_write: + cl = NEXTOP(cl,oy); + break; + case _unify_l_y_loc: + cl = NEXTOP(cl,oy); + break; + case _unify_l_y_loc_write: + cl = NEXTOP(cl,oy); + break; + case _unify_l_y_val: + cl = NEXTOP(cl,oy); + break; + case _unify_l_y_val_write: + cl = NEXTOP(cl,oy); + break; + case _unify_l_y_var: + cl = NEXTOP(cl,oy); + break; + case _unify_l_y_var_write: + cl = NEXTOP(cl,oy); + break; + case _unify_y_loc: + cl = NEXTOP(cl,oy); + break; + case _unify_y_loc_write: + cl = NEXTOP(cl,oy); + break; + case _unify_y_val: + cl = NEXTOP(cl,oy); + break; + case _unify_y_val_write: + cl = NEXTOP(cl,oy); + break; + case _unify_y_var: + cl = NEXTOP(cl,oy); + break; + case _unify_y_var_write: + cl = NEXTOP(cl,oy); + break; + case _pop_n: + cl = NEXTOP(cl,s); + break; + case _get_list: + if (iarg == cl->u.x.x) { + clause->Tag = AbsPair(NULL); + clause->u.WorkPC = NEXTOP(cl,x); + return; + } + cl = NEXTOP(cl,x); + break; + if (iarg == cl->u.x.x) { + clause->Tag = AbsPair(NULL); + clause->u.WorkPC = NEXTOP(cl,x); + return; + } + cl = NEXTOP(cl,x); + break; + case _put_list: + if (iarg == cl->u.x.x) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,x); + break; + case _get_atom: + if (iarg == cl->u.xc.x) { + clause->Tag = cl->u.xc.c; + return; + } + cl = NEXTOP(cl,xc); + break; + if (iarg == cl->u.xc.x) { + clause->Tag = cl->u.xc.c; + return; + } + cl = NEXTOP(cl,xc); + break; + case _get_bigint: + if (iarg == cl->u.xc.x) { + clause->Tag = AbsAppl((CELL *)FunctorBigInt); + clause->u.t_ptr = (CELL)NULL; + return; + } + cl = NEXTOP(cl,xc); + break; + case _put_atom: + if (iarg == cl->u.xc.x) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,xc); + break; + case _get_float: + if (iarg == cl->u.xd.x) { + clause->Tag = AbsAppl((CELL *)FunctorDouble); + clause->u.t_ptr = AbsAppl(cl->u.xd.d); + return; + } + cl = NEXTOP(cl,xd); + break; + if (iarg == cl->u.xd.x) { + clause->Tag = AbsAppl((CELL *)FunctorDouble); + clause->u.t_ptr = AbsAppl(cl->u.xd.d); + return; + } + cl = NEXTOP(cl,xd); + break; + case _put_float: + if (iarg == cl->u.xd.x) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,xd); + break; + case _get_struct: + if (iarg == cl->u.xfa.x) { + clause->Tag = AbsAppl((CELL *)cl->u.xfa.f); + clause->u.WorkPC = NEXTOP(cl,xfa); + return; + } + cl = NEXTOP(cl,xfa); + break; + if (iarg == cl->u.xfa.x) { + clause->Tag = AbsAppl((CELL *)cl->u.xfa.f); + clause->u.WorkPC = NEXTOP(cl,xfa); + return; + } + cl = NEXTOP(cl,xfa); + break; + case _put_struct: + if (iarg == cl->u.xfa.x) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,xfa); + break; + case _get_longint: + if (iarg == cl->u.xi.x) { + clause->Tag = AbsAppl((CELL *)FunctorLongInt); + clause->u.t_ptr = AbsAppl(cl->u.xi.i); + return; + } + cl = NEXTOP(cl,xi); + break; + if (iarg == cl->u.xi.x) { + clause->Tag = AbsAppl((CELL *)FunctorLongInt); + clause->u.t_ptr = AbsAppl(cl->u.xi.i); + return; + } + cl = NEXTOP(cl,xi); + break; + case _put_longint: + if (iarg == cl->u.xi.x) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,xi); + break; + case _get_x_val: + if (cl->u.xx.xl == iarg || + cl->u.xx.xr == iarg) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,xx); + break; + case _get_x_var: + if (cl->u.xx.xr == iarg || + cl->u.xx.xl == iarg) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,xx); + break; + case _gl_void_valx: + if (iarg == cl->u.xx.xl) { + clause->Tag = AbsPair(NULL); + clause->u.WorkPC = cl; + return; + } + cl = NEXTOP(cl,xx); + break; + case _gl_void_varx: + if (iarg == cl->u.xx.xl) { + clause->Tag = AbsPair(NULL); + clause->u.WorkPC = cl; + return; + } + if (iarg == cl->u.xx.xr) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,xx); + break; + case _glist_valx: + if (iarg == cl->u.xx.xl) { + clause->Tag = AbsPair(NULL); + clause->u.WorkPC = cl; + return; + } + cl = NEXTOP(cl,xx); + break; + case _put_x_val: + if (cl->u.xx.xl == iarg || + cl->u.xx.xr == iarg) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,xx); + break; + case _put_x_var: + if (iarg == cl->u.xx.xl) { + clause->Tag = (CELL)NULL; + return; + } + if (iarg == cl->u.xx.xr) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,xx); + break; + case _put_xx_val: + if (cl->u.xxxx.xl1 == iarg || + cl->u.xxxx.xr1 == iarg) { + clause->Tag = (CELL)NULL; + return; + } + if (cl->u.xxxx.xl2 == iarg || + cl->u.xxxx.xr2 == iarg) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,xxxx); + break; + case _gl_void_valy: + cl = NEXTOP(cl,xy); + break; + case _gl_void_vary: + cl = NEXTOP(cl,xy); + break; + case _glist_valy: + if (iarg == cl->u.xy.x) { + clause->Tag = AbsPair(NULL); + clause->u.WorkPC = cl; + return; + } + cl = NEXTOP(cl,xy); + break; + case _get_y_val: + if (cl->u.yx.x == iarg) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,yx); + break; + case _get_y_var: + if (cl->u.yx.x == iarg) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,yx); + break; + case _put_unsafe: + if (cl->u.yx.x == iarg) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,yx); + break; + case _put_y_val: + if (cl->u.yx.x == iarg) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,yx); + break; + case _put_y_var: + if (iarg == cl->u.yx.x) { + clause->Tag = (CELL)NULL; + return; + } + cl = NEXTOP(cl,yx); + break; +#ifdef YAPOR +#endif +#ifdef TABLING +#endif +default: + clause->Tag = (CELL)NULL; + return; + } + } diff --git a/H/walkclause.h b/H/walkclause.h index 9b99238b9..15112f3e4 100644 --- a/H/walkclause.h +++ b/H/walkclause.h @@ -80,6 +80,8 @@ case _try_and_mark: case _try_clause: case _try_me: + clause_code = TRUE; + pp = pc->u.Otapl.p; pc = NEXTOP(pc,Otapl); break; /* instructions type c */ @@ -120,7 +122,6 @@ case _copy_idb_term: return found_idb_clause(pc, startp, endp); case _expand_index: - return found_expand_index(pc, startp, endp, codeptr); case _index_pred: return found_owner_op(pc, startp, endp); case _lock_pred: @@ -645,6 +646,8 @@ case _getwork: case _getwork_seq: case _sync: + clause_code = TRUE; + pp = pc->u.Otapl.p; pc = NEXTOP(pc,Otapl); break; /* instructions type e */ @@ -665,6 +668,8 @@ case _table_try_answer: case _table_try_me: case _table_try_single: + clause_code = TRUE; + pp = pc->u.Otapl.p; pc = NEXTOP(pc,Otapl); break; /* instructions type e */ diff --git a/misc/buildops b/misc/buildops index 8185baa38..f2b9d6c09 100644 --- a/misc/buildops +++ b/misc/buildops @@ -6,6 +6,9 @@ :- use_module(library(readutil), [read_line_to_codes/2]). +:- use_module(library(charsio), + [format_to_chars/3]). + :- use_module(library(lists), [member/2]). @@ -26,35 +29,46 @@ main :- open('H/YapOpcodes.h',write,W), open('H/rclause.h',write,C), open('H/walkclause.h',write,L), + open('H/findclause.h',write,F), + open('H/headclause.h',write,H), header(W), header_rclause(C), header_walk_clause(L), - file('C/absmi.c', W, C, L), - start_ifdef("YAPOR", W, C, L), - file('OPTYap/or.insts.i',W, C, L), - end_ifdef(W,C,L), - start_ifdef("TABLING",W,C,L), - file('OPTYap/tab.insts.i',W,C,L), + header_find_clause(F), + header_find_clause(H), + file('C/absmi.c', W, C, L, F, H), + start_ifdef("YAPOR", W, C, L, F, H), + file('OPTYap/or.insts.i',W, C, L, F, H), + end_ifdef(W, C, L, F, H), + start_ifdef("TABLING", W, C, L, F, H), + file('OPTYap/tab.insts.i',W,C,L, F, H), retractall(op(_,_)), - file('OPTYap/tab.tries.insts.i',W,C,L), - end_ifdef(W,C,L), + file('OPTYap/tab.tries.insts.i', W, C, L, F, H), + end_ifdef(W, C, L, F, H), footer(W), footer_rclause(C), footer_walk_clause(L), + footer_find_clause(F), + footer_find_clause(H), + close(F), close(L), close(W), close(C). -start_ifdef(D,W,C,L) :- +start_ifdef(D, W, C, L, F, H) :- retractall(op(_,_)), format(W, '#ifdef ~s~n',[D]), format(C, '#ifdef ~s~n',[D]), - format(L, '#ifdef ~s~n',[D]). + format(L, '#ifdef ~s~n',[D]), + format(F, '#ifdef ~s~n',[D]), + format(H, '#ifdef ~s~n',[D]). -end_ifdef(W,C,L) :- +end_ifdef(W,C,L,F,H) :- format(W, '#endif~n',[]), format(C, '#endif~n',[]), - format(L, '#endif~n',[]). + format(L, '#endif~n',[]), + format(F, '#endif~n',[]), + format(H, '#endif~n',[]). header(W) :- format(W,'~n /* This file was generated automatically by \"yap -L misc/buildops\"~n please do not update */~n~n',[]). @@ -85,12 +99,22 @@ header_walk_clause(W) :- ',[]). -file(I,W,C,L) :- +header_find_clause(W) :- + format(W,'~n /* This file was generated automatically by \"yap -L misc/buildops\"~n please do not update */~n~n + while (TRUE) { + op_numbers op = Yap_op_from_opcode(cl->opc); + switch (op) { +',[]). + + +file(I,W,C,L,F,H) :- open(I,read,R), process(R,grep_opcode(W)), close(R), output_rclause(C), - output_walk_clause(L). + output_walk_clause(L), + output_find_clause(F), + output_head_clause(H). grep_opcode(W, Line) :- split(Line," ,();",[OP,Name,Type]), @@ -199,10 +223,13 @@ get_op(0'y,"Y"). dump_ops(_,[]). dump_ops(C,[Op|Ops]) :- + dump_op(C,Op), + dump_ops(C,Ops). + +dump_op(C,Op) :- special(Op,C), format(C,' case _~s:~n',[Op]), - end_special(Op,C), - dump_ops(C,Ops). + end_special(Op,C). output_walk_clause(L) :- setof(T,O^op(T,O),Types), @@ -358,7 +385,235 @@ add_pp(C,Type,Field) :- walk_to_meta_call(C) :- format(C,' return found_meta_call(startp, endp);~n',[]). - /* or_last requires special handling */ +% +% find region +% tries to find out what an instruction touches in the body +% of a clause +% + +output_find_clause(L) :- + setof(T:Op,op(T,Op),Ops), + member(T:Op, Ops), + output_find_op(Op, T, L), + fail. +output_find_clause(_). + +output_find_op(Op, T, L) :- + opinfo(Op, Actions), + dump_op(L,Op), + dump_actions(Actions, Op, T, L). + +dump_actions([], _, T, L) :- + format(L,' cl = NEXTOP(cl,~s);~n',[T]), + format(L,' break;~n',[]). +dump_actions([A|Actions], Op, T, L) :- + dump_action(A, Op, T, L), + dump_actions(Actions, Op, T, L). + +% conditional jumps can +dump_action(body, _, _, _). +dump_action(ifthenelse, _, T, L) :- + format(L,' if (cl->u.~s.F != FAILCODE) { + clause->Tag = (CELL)NULL; + return; + }~n', [T]). +dump_action(bind(Who,What,Extra), _, T, L) :- + integer(Who), !, + handle_bind_extra(Extra, T, Command), + handle_constant(What, T, Constant), + format(L,' if (is_regcopy(myregs, nofregs, Yap_regnotoreg(~d))) { + clause->Tag = ~s;~s + return; + }~n', [Who,Constant,Command]). +dump_action(bind(Who,What,Extra), _, T, L) :- + handle_bind_extra(Extra, T, Command), + handle_constant(What, T, Constant), + format(L,' if (is_regcopy(myregs, nofregs, cl->u.~s.~s)) { + clause->Tag = ~s;~s + return; + }~n', [T,Who,Constant,Command]). +dump_action(new(Who), _, T, L) :- + format(L,' if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.~s.~s))) { + clause->Tag = (CELL)NULL; + return; + }~n', [T,Who]). +dump_action(dup(Who1,Who2), _, T, L) :- + format(L,' if (!(nofregs = add_regcopy(myregs, nofregs, cl->u.~s.~s, cl->u.~s.~s))) { + clause->Tag = (CELL)NULL; + return; + }~n', [T,Who1,T,Who2]). +dump_action(unify(Who1,Who2), _, T, L) :- + format(L,' if (!(nofregs = link_regcopies(myregs, nofregs, cl->u.~s.~s, cl->u.~s.~s))) { + clause->Tag = (CELL)NULL; + return; + }~n', [T,Who1,T,Who2]). +dump_action(logical, _, _, L) :- + format(L,' if (regno == 2) { + LogUpdClause *lcl = ClauseCodeToLogUpdClause(cl); + Term t = lcl->ClSource->Entry; + if (IsVarTerm(t)) { + clause->Tag = (CELL)NULL; + } else if (IsApplTerm(t)) { + CELL *pt = RepAppl(t); + + clause->Tag = AbsAppl((CELL *)pt[0]); + clause->u.c_sreg = pt; + } else if (IsPairTerm(t)) { + CELL *pt = RepPair(t); + + clause->Tag = AbsPair(NULL); + clause->u.c_sreg = pt-1; + } else { + clause->Tag = t; + } + } else { + clause->Tag = (CELL)NULL; + } + return;~n', []). + +handle_bind_extra([], _, ""). +handle_bind_extra(t_ptr=[], _,S) :- !, + format_to_chars("~n clause->u.t_ptr = (CELL)NULL;",[],S). +handle_bind_extra(t_ptr=F, Type, S) :- + format_to_chars("~n clause->u.t_ptr = AbsAppl(cl->u.~s.~s);",[Type,F],S). +handle_bind_extra(workpc=nextop, T,S) :- + format_to_chars("~n clause->u.WorkPC = NEXTOP(cl,~s);",[T],S). +handle_bind_extra(workpc=currentop, _,S) :- + format_to_chars("~n clause->u.WorkPC = cl;",[],S). + +handle_constant(What, T, Const) :- + What = [C|_], + ( + C == 0'A % 0'Abs + -> + Const = What + ; + C == 0'( % 0'( + -> + Const = What + ; + format_to_chars("cl->u.~s.~s",[T,What],Const) + ). + +% +% find head, works much faster by not looking inside +% tries to find out what an instruction touches in the body +% of a clause +% + +output_head_clause(L) :- + setof(T:Op,op(T,Op),Ops), + member(T:Op, Ops), + output_head_op(Op, T, L), + fail. +output_head_clause(_). + +output_head_op(Op, T, L) :- + opinfo(Op, Actions), + \+ member(body, Actions), + dump_op(L,Op), + dump_head_actions(Actions, Op, T, L). + +dump_head_actions([], _, T, L) :- + format(L,' cl = NEXTOP(cl,~s);~n',[T]), + format(L,' break;~n',[]). +dump_head_actions([A|Actions], Op, T, L) :- + dump_head_action(A, Op, T, L), + dump_head_actions(Actions, Op, T, L). + +% only simple stuff +dump_head_action(bind(Who,_,_), _, _, _) :- Who = [0'y|_], !. % 0'y +dump_head_action(bind(Who,What,Extra), _, T, L) :- + integer(Who), !, + handle_bind_extra(Extra, T, Command), + handle_constant(What, T, Constant), + format(L,' if (iarg == Yap_regnotoreg(~d)) { + clause->Tag = ~s;~s + return; + }~n', [Who,Constant,Command]). +dump_head_action(bind(Who,What,Extra), _, T, L) :- + handle_constant(What, T, Constant), + handle_bind_extra(Extra, T, Command), + format(L,' if (iarg == cl->u.~s.~s) { + clause->Tag = ~s;~s + return; + }~n', [T,Who,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) { + clause->Tag = (CELL)NULL; + return; + }~n', [T,Who]). +dump_head_action(dup(Who1,Who2), _, T, L) :- Who1 = [0'y|_], !, % 0'y done + format(L,' if (cl->u.~s.~s == iarg) { + clause->Tag = (CELL)NULL; + return; + }~n', [T,Who2]). +dump_head_action(dup(Who1,Who2), _, T, L) :- Who2 = [0'y|_], !, % 0'y done + format(L,' if (cl->u.~s.~s == iarg) { + clause->Tag = (CELL)NULL; + return; + }~n', [T,Who1]). +dump_head_action(dup(Who1,Who2), _, T, L) :- + format(L,' if (cl->u.~s.~s == iarg || + cl->u.~s.~s == iarg) { + clause->Tag = (CELL)NULL; + return; + }~n', [T,Who1,T,Who2]). +dump_head_action(unify(Who1,Who2), _, T, L) :- Who1 = [0'y|_], !, % 0'y done + format(L,' if (cl->u.~s.~s == iarg) { + clause->Tag = (CELL)NULL; + return; + }~n', [T,Who2]). +dump_head_action(unify(Who1,Who2), _, T, L) :- Who2 = [0'y|_], !, % 0'y done + format(L,' if (cl->u.~s.~s == iarg) { + clause->Tag = (CELL)NULL; + return; + }~n', [T,Who1]). +dump_head_action(unify(Who1,Who2), _, T, L) :- + format(L,' if (cl->u.~s.~s == iarg || + cl->u.~s.~s == iarg) { + clause->Tag = (CELL)NULL; + return; + }~n', [T,Who1,T,Who2]). +dump_head_action(logical, _, _, L) :- + format(L,' if (regno != 2) { + clause->Tag = (CELL)NULL; + } else { + LogUpdClause *lcl = ClauseCodeToLogUpdClause(cl); + Term t = lcl->ClSource->Entry; + + if (IsVarTerm(t)) { + clause->Tag = (CELL)NULL; + } else if (IsApplTerm(t)) { + CELL *pt = RepAppl(t); + + clause->Tag = AbsAppl((CELL *)pt[0]); + if (IsExtensionFunctor(FunctorOfTerm(t))) { + clause->u.t_ptr = t; + } else { + clause->u.c_sreg = pt; + } + } else if (IsPairTerm(t)) { + CELL *pt = RepPair(t); + + clause->Tag = AbsPair(NULL); + clause->u.c_sreg = pt-1; + } else { + clause->Tag = t; + } + } + return;~n', []). + +handle_bind_extra([], _, ""). +handle_bind_extra(t_ptr=[], _,S) :- !, + format_to_chars("~n clause->u.t_ptr = (CELL)NULL;",[],S). +handle_bind_extra(t_ptr=F, Type, S) :- + format_to_chars("~n clause->u.t_ptr = AbsAppl(cl->u.~s.~s);",[Type,F],S). +handle_bind_extra(workpc=nextop, T,S) :- + format_to_chars("~n clause->u.WorkPC = NEXTOP(cl,~s);",[T],S). + +/* or_last requires special handling */ footer(W) :- format(W,' /* this instruction is hardwired */~n',[]), format(W,'#ifdef YAPOR~n',[]), @@ -393,6 +648,13 @@ footer_walk_clause(W) :- } ',[]). +footer_find_clause(W) :- + format(W,'default: + clause->Tag = (CELL)NULL; + return; + } + }~n',[]). + get_field_names(F) :- open(F, read, A), loop_for_fields(A), @@ -463,3 +725,297 @@ clean_statements(["struct"|Statements0], StatementsF) :- !, clean_statements(["unsigned"|Statements0], StatementsF) :- !, clean_statements(Statements0, StatementsF). clean_statements(Statements, Statements). + +opinfo("p_number_x",[body,bind("x","(_number+1)*sizeof(CELL)",t_ptr=[]),ifthenelse]). +opinfo("p_number_y",[body,bind("y","(_number+1)*sizeof(CELL)",t_ptr=[]),ifthenelse]). +opinfo("p_atomic_x",[body,bind("x","(_atomic+1)*sizeof(CELL)",t_ptr=[]),ifthenelse]). +opinfo("p_atomic_y",[body,bind("y","(_atomic+1)*sizeof(CELL)",t_ptr=[]),ifthenelse]). +opinfo("p_primitive_x",[body,bind("x","(_primitive+1)*sizeof(CELL)",t_ptr=[]),ifthenelse]). +opinfo("p_primitive_y",[body,bind("y","(_primitive+1)*sizeof(CELL)",t_ptr=[]),ifthenelse]). +opinfo("p_compound_x",[body,bind("x","(_compound+1)*sizeof(CELL)",t_ptr=[]),ifthenelse]). +opinfo("p_compound_y",[body,bind("y","(_compound+1)*sizeof(CELL)",t_ptr=[]),ifthenelse]). +opinfo("p_atom_x",[body,bind("x","(_atom+1)*sizeof(CELL)",t_ptr=[]),ifthenelse]). +opinfo("p_atom_y",[body,bind("y","(_atom+1)*sizeof(CELL)",t_ptr=[]),ifthenelse]). +opinfo("p_integer_x",[body,bind("x","(_integer+1)*sizeof(CELL)",t_ptr=[]),ifthenelse]). +opinfo("p_integer_y",[body,bind("y","(_integer+1)*sizeof(CELL)",t_ptr=[]),ifthenelse]). +opinfo("p_float_x",[body,bind("x","AbsAppl((CELL *)FunctorDouble)",t_ptr=[]),ifthenelse]). +opinfo("p_float_y",[body,bind("y","AbsAppl((CELL *)FunctorDouble)",t_ptr=[]),ifthenelse]). +opinfo("p_db_ref_x",[body,bind("x","AbsAppl((CELL *)FunctorDBRef)",t_ptr=[]),ifthenelse]). +opinfo("p_db_ref_y",[body,bind("y","AbsAppl((CELL *)FunctorDBRef)",t_ptr=[]),ifthenelse]). +opinfo("p_var_x",[body,bind("x","(_var+1)*sizeof(CELL)",t_ptr=[]),ifthenelse]). +opinfo("p_var_y",[body,bind("y","(_var+1)*sizeof(CELL)",t_ptr=[]),ifthenelse]). +opinfo("p_nonvar_x",[body,ifthenelse]). +opinfo("p_nonvar_y",[body,ifthenelse]). +opinfo("save_b_x",[body,new("x")]). +opinfo("save_b_y",[body,new("y")]). +opinfo("write_x_val",[body]). +opinfo("write_x_loc",[body]). +opinfo("write_x_var",[body,new("x")]). +opinfo("write_y_var",[body,new("y")]). +opinfo("write_y_val",[body]). +opinfo("write_y_loc",[body]). +opinfo("get_x_var",[dup("xr","xl")]). +opinfo("get_y_var",[dup("x","y")]). +opinfo("put_x_var",[new("xl"),new("xr")]). +opinfo("put_y_var",[new("x"),new("y")]). +opinfo("get_x_val",[unify("xl","xr")]). +opinfo("get_y_val",[unify("x","y")]). +opinfo("put_x_val",[dup("xl","xr")]). +opinfo("put_y_val",[dup("y","x")]). +opinfo("put_unsafe",[dup("y","x")]). +opinfo("put_xx_val",[dup("xl1","xr1"),dup("xl2","xr2")]). +opinfo("glist_valx",[bind("xl","AbsPair(NULL)",workpc=currentop)]). +opinfo("get_atom",[bind("x","c",[])]). +opinfo("get_list",[bind("x","AbsPair(NULL)",workpc=nextop)]). +opinfo("glist_valy",[bind("x","AbsPair(NULL)",workpc=currentop)]). +opinfo("gl_void_valx",[bind("xl","AbsPair(NULL)",workpc=currentop)]). +opinfo("gl_void_valy",[bind("y","AbsPair(NULL)",workpc=currentop)]). +opinfo("gl_void_varx",[bind("xl","AbsPair(NULL)",workpc=currentop),new("xr")]). +opinfo("gl_void_vary",[bind("y","AbsPair(NULL)",workpc=currentop),new("y")]). +opinfo("get_struct",[bind("x","AbsAppl((CELL *)cl->u.xfa.f)",workpc=nextop)]). +opinfo("get_float",[bind("x","AbsAppl((CELL *)FunctorDouble)",t_ptr="d")]). +opinfo("get_longint",[bind("x","AbsAppl((CELL *)FunctorLongInt)",t_ptr="i")]). +opinfo("get_bigint",[bind("x","AbsAppl((CELL *)FunctorBigInt)",t_ptr=[])]). +opinfo("copy_idb_term",[logical]). +opinfo("unify_idb_term",[logical]). +opinfo("put_atom",[new("x")]). +opinfo("put_float",[new("x")]). +opinfo("put_longint",[new("x")]). +opinfo("put_list",[new("x")]). +opinfo("put_struct",[new("x")]). +opinfo("get_2atoms",[bind(1,"c1",[]), + bind(2,"c2",[])]). +opinfo("get_3atoms",[bind(1,"c1",[]), + bind(2,"c2",[]), + bind(3,"c3",[])]). +opinfo("get_4atoms",[bind(1,"c1",[]), + bind(2,"c2",[]), + bind(3,"c3",[]), + bind(4,"c4",[])]). +opinfo("get_5atoms",[bind(1,"c1",[]), + bind(2,"c2",[]), + bind(3,"c3",[]), + bind(4,"c4",[]), + bind(5,"c5",[])]). +opinfo("get_6atoms",[bind(1,"c1",[]), + bind(2,"c2",[]), + bind(3,"c3",[]), + bind(4,"c4",[]), + bind(5,"c5",[]), + bind(6,"c6",[])]). +opinfo("unify_x_var",[new("x")]). +opinfo("unify_x_var_write",[new("x")]). +opinfo("unify_l_x_var",[new("x")]). +opinfo("unify_l_x_var_write",[new("x")]). +opinfo("unify_y_var",[new("y")]). +opinfo("unify_y_var_write",[new("y")]). +opinfo("unify_l_y_var",[new("y")]). +opinfo("unify_l_y_var_write",[new("y")]). +opinfo("save_pair_x_write",[new("x")]). +opinfo("save_pair_x",[new("x")]). +opinfo("save_appl_x_write",[new("x")]). +opinfo("save_appl_x",[new("x")]). +opinfo("save_pair_y_write",[new("y")]). +opinfo("save_pair_y",[new("y")]). +opinfo("save_appl_y_write",[new("y")]). +opinfo("save_appl_y",[new("y")]). +opinfo("unify_x_var2",[new("xl"),new("xr")]). +opinfo("unify_x_var2_write",[new("xl"),new("xr")]). +opinfo("unify_l_x_var2",[new("xl"),new("xr")]). +opinfo("unify_l_x_var2_write",[new("xl"),new("xr")]). +opinfo("p_plus_vv",[body,new("x")]). +opinfo("p_plus_vc",[body,new("x")]). +opinfo("p_minus_vv",[body,new("x")]). +opinfo("p_minus_vc",[body,new("x")]). +opinfo("p_times_vv",[body,new("x")]). +opinfo("p_times_vc",[body,new("x")]). +opinfo("p_div_vv",[body,new("x")]). +opinfo("p_div_vc",[body,new("x")]). +opinfo("p_div_cv",[body,new("x")]). +opinfo("p_and_vv",[body,new("x")]). +opinfo("p_and_vc",[body,new("x")]). +opinfo("p_or_vv",[body,new("x")]). +opinfo("p_or_vc",[body,new("x")]). +opinfo("p_sll_vv",[body,new("x")]). +opinfo("p_sll_vc",[body,new("x")]). +opinfo("p_sll_cv",[body,new("x")]). +opinfo("p_slr_vv",[body,new("x")]). +opinfo("p_slr_vc",[body,new("x")]). +opinfo("p_slr_cv",[body,new("x")]). +opinfo("p_arg_vv",[body,new("x")]). +opinfo("p_arg_cv",[body,new("x")]). +opinfo("p_func2s_vv",[body,new("x")]). +opinfo("p_func2s_vc",[body,new("x")]). +opinfo("p_func2s_cv",[body,new("x")]). +opinfo("p_func2f_vv",[body,new("x")]). +opinfo("p_func2f_xx",[body,new("x")]). +opinfo("p_func2f_xy",[body,new("x")]). +opinfo("p_plus_y_vv",[body,new("y")]). +opinfo("p_plus_y_vc",[body,new("y")]). +opinfo("p_minus_y_vv",[body,new("y")]). +opinfo("p_minus_y_vc",[body,new("y")]). +opinfo("p_times_y_vv",[body,new("y")]). +opinfo("p_times_y_vc",[body,new("y")]). +opinfo("p_div_y_vv",[body,new("y")]). +opinfo("p_div_y_vc",[body,new("y")]). +opinfo("p_div_y_cv",[body,new("y")]). +opinfo("p_and_y_vv",[body,new("y")]). +opinfo("p_and_y_vc",[body,new("y")]). +opinfo("p_or_y_vv",[body,new("y")]). +opinfo("p_or_y_vc",[body,new("y")]). +opinfo("p_sll_y_vv",[body,new("y")]). +opinfo("p_sll_y_vc",[body,new("y")]). +opinfo("p_sll_y_cv",[body,new("y")]). +opinfo("p_slr_y_vv",[body,new("y")]). +opinfo("p_slr_y_vc",[body,new("y")]). +opinfo("p_slr_y_cv",[body,new("y")]). +opinfo("p_arg_y_vv",[body,new("y")]). +opinfo("p_arg_y_cv",[body,new("y")]). +opinfo("p_func2s_y_vv",[body,new("y")]). +opinfo("p_func2s_y_vc",[body,new("y")]). +opinfo("p_func2s_y_cv",[body,new("y")]). +opinfo("p_func2f_yx",[body,new("y")]). +opinfo("p_func2f_yy",[body,new("x")]). +opinfo("put_fi_var_x",[body,new("x")]). +opinfo("put_i_var_x",[body,new("x")]). +opinfo("put_f_var_x",[body,new("x")]). +opinfo("put_fi_var_y",[body,new("y")]). +opinfo("put_i_var_y",[body,new("y")]). +opinfo("put_f_var_y",[body,new("y")]). +opinfo("allocate",[body]). +opinfo("write_void",[body]). +opinfo("write_list",[body]). +opinfo("write_l_list",[body]). +opinfo("enter_a_profiling",[body]). +opinfo("count_a_call",[body]). +opinfo("unify_x_val_write",[]). +opinfo("unify_x_val",[]). +opinfo("unify_l_x_val_write",[]). +opinfo("unify_l_x_val",[]). +opinfo("unify_x_loc_write",[]). +opinfo("unify_x_loc",[]). +opinfo("unify_l_x_loc_write",[]). +opinfo("unify_l_x_loc",[]). +opinfo("unify_y_val_write",[]). +opinfo("unify_y_val",[]). +opinfo("unify_l_y_val_write",[]). +opinfo("unify_l_y_val",[]). +opinfo("unify_y_loc_write",[]). +opinfo("unify_y_loc",[]). +opinfo("unify_l_y_loc_write",[]). +opinfo("unify_l_y_loc",[]). +opinfo("unify_void",[]). +opinfo("unify_void_write",[]). +opinfo("unify_l_void",[]). +opinfo("unify_l_void_write",[]). +opinfo("unify_n_voids",[]). +opinfo("unify_n_voids_write",[]). +opinfo("unify_l_n_voids",[]). +opinfo("unify_l_n_voids_write",[]). +opinfo("write_n_voids",[body]). +opinfo("unify_list",[]). +opinfo("unify_list_write",[]). +opinfo("unify_l_list",[]). +opinfo("unify_l_list_write",[]). +opinfo("unify_atom",[]). +opinfo("unify_atom_write",[]). +opinfo("unify_l_atom",[]). +opinfo("unify_l_atom_write",[]). +opinfo("write_atom",[body]). +opinfo("unify_n_atoms",[]). +opinfo("unify_n_atoms_write",[]). +opinfo("unify_l_n_atoms",[]). +opinfo("unify_l_n_atoms_write",[]). +opinfo("write_n_atoms",[body]). +opinfo("unify_struct",[]). +opinfo("unify_struct_write",[]). +opinfo("unify_l_struct",[]). +opinfo("unify_l_struct_write",[]). +opinfo("write_struct",[body]). +opinfo("unify_float",[]). +opinfo("unify_float_write",[]). +opinfo("unify_l_float",[]). +opinfo("unify_l_float_write",[]). +opinfo("write_float",[body]). +opinfo("unify_longint",[]). +opinfo("unify_longint_write",[]). +opinfo("unify_l_longint",[]). +opinfo("unify_l_longint_write",[]). +opinfo("write_longint",[body]). +opinfo("unify_bigint",[]). +opinfo("unify_bigint_write",[]). +opinfo("unify_l_bigint",[]). +opinfo("unify_l_bigint_write",[]). +opinfo("write_bigint",[body]). +opinfo("unify_dbterm",[]). +opinfo("unify_dbterm_write",[]). +opinfo("unify_l_dbterm",[]). +opinfo("unify_l_dbterm_write",[]). +opinfo("write_dbterm",[body]). +opinfo("pop",[]). +opinfo("pop_n",[]). +opinfo("eqc_float",[body]). +opinfo("ltc_float",[body]). +opinfo("gtc_float",[body]). +opinfo("eqc_int",[body]). +opinfo("ltc_int",[body]). +opinfo("gtc_int",[body]). +opinfo("a_eq",[body]). +opinfo("lt",[body]). +opinfo("add_float_c",[body]). +opinfo("sub_float_c",[body]). +opinfo("mul_float_c",[body]). +opinfo("fdiv_c1",[body]). +opinfo("fdiv_c2",[body]). +opinfo("add_int_c",[body]). +opinfo("sub_int_c",[body]). +opinfo("mul_int_c",[body]). +opinfo("idiv_c1",[body]). +opinfo("idiv_c2",[body]). +opinfo("mod_c1",[body]). +opinfo("mod_c2",[body]). +opinfo("rem_c1",[body]). +opinfo("rem_c2",[body]). +opinfo("a_or_c",[body]). +opinfo("a_and_c",[body]). +opinfo("xopr_c",[body]). +opinfo("sl_c1",[body]). +opinfo("sl_c2",[body]). +opinfo("sr_c1",[body]). +opinfo("sr_c2",[body]). +opinfo("add",[body]). +opinfo("sub",[body]). +opinfo("mul",[body]). +opinfo("fdiv",[body]). +opinfo("idiv",[body]). +opinfo("mod",[body]). +opinfo("rem",[body]). +opinfo("a_or",[body]). +opinfo("a_and",[body]). +opinfo("xor",[body]). +opinfo("uminus",[body]). +opinfo("sl",[body]). +opinfo("sr",[body]). +opinfo("get_fi_x",[body]). +opinfo("get_i_x",[body]). +opinfo("get_f_x",[body]). +opinfo("get_fi_y",[body]). +opinfo("get_i_y",[body]). +opinfo("get_f_y",[body]). +opinfo("put_fi_val_x",[body]). +opinfo("put_f_val_x",[body]). +opinfo("put_i_val_x",[body]). +opinfo("put_fi_val_y",[body]). +opinfo("put_f_val_y",[body]). +opinfo("put_i_val_y",[body]). +opinfo("lock_lu",[body]). +opinfo("call_bfunc_xx",[body]). +opinfo("call_bfunc_yx",[body]). +opinfo("call_bfunc_xy",[body]). +opinfo("call_bfunc_yy",[body]). +opinfo("run_eam",[body]). +opinfo("retry_eam",[body]). +opinfo("alloc_for_logical_pred",[body]). +opinfo("deallocate",[body]). + +