Defines | |
#define | IS_TABLE_INSTRUC(instruc) |
#define | CHECK_TABLE_CUT(instruc) |
#define | cut_code(OP1) |
#define | cut_restore_trail_condition_registers(CUTB) restore_trail_condition_registers(CUTB) |
#define | trail_parent(t) ((CPtr *)*(t)) |
#define | trail_value(t) ((CPtr *)*((t)-1)) |
#define | trail_variable(t) ((CPtr *)*((t)-2)) |
#define | good_trail_register(t) (conditional(((CPtr) *((t)-2)))) |
#define | unwind_trail(tbreg, t1, t2) |
|
Value: if (IS_TABLE_INSTRUC(instruc) && !is_completed(tcp_subgoal_ptr(breg))) {\ Psc psc = TIF_PSC(subg_tif_ptr(tcp_subgoal_ptr(breg)));\ Psc call_psc = *(*((Psc **)ereg-1)-1); \ printf("Illegal cut over incomplete tabled predicate: %s/%d, from within a call to %s/%d\n", \ get_name(psc), get_arity(psc), \ get_name(call_psc), get_arity(call_psc)); \ xsb_abort("Illegal cut over a tabled predicate: %s/%d, from within a call to %s/%d\n", \ get_name(psc), get_arity(psc), \ get_name(call_psc), get_arity(call_psc)); \ } |
|
Value: { CPtr cut_breg; \ byte inst_cut_over; \ CPtr xtemp1, xtemp2; \ \ XSB_Deref(OP1); \ cut_breg = (CPtr)(tcpstack.high - oint_val(OP1)); \ cut_restore_trail_condition_registers(cut_breg); \ if (breg != cut_breg) { /* not cutting back to the current CP */\ while (cp_prevbreg(breg) != cut_breg) { \ inst_cut_over = *cp_pcreg(breg); \ CHECK_TABLE_CUT(inst_cut_over) ; \ breg = cp_prevbreg(breg); \ } \ inst_cut_over = *cp_pcreg(breg); \ CHECK_TABLE_CUT(inst_cut_over) ; \ unwind_trail(breg,xtemp1,xtemp2); \ breg = cut_breg; \ } \ /* check_table_cut = TRUE; */ \ XSB_Next_Instr(); \ } |
|
|
|
|
|
Value: (instruc == check_complete || \ instruc == resume_compl_suspension || \ instruc == answer_return || \ instruc == tabletrust || \ instruc == tableretry ) |
|
|
|
|
|
|
|
Value: { \ while (trreg > trfreg && \ !good_trail_register(trreg) && \ trreg > cp_trreg(tbreg)) \ trreg = trail_parent(trreg); \ (t2) = (CPtr) trail_parent((t1) = (CPtr)trreg); \ while ((t2) > (CPtr) cp_trreg(tbreg) && (t2) > (CPtr) trfreg) { \ if (!good_trail_register(t2)) { \ (t2) = (CPtr) trail_parent(t2); \ *(t1) = (Cell) (t2); \ } else { \ (t1) = (t2); \ (t2) = (CPtr) trail_parent(t2); \ } \ } \ } |