Menu

Commit [r8598]  Maximize  Restore  History

Fixed a deep-seated memory bug in build_delay_list (used by get_residual). Keeping track of the varibles used in

a given delay element requires passing over 3 tries: the subgoal (de when called), answer (de after answer unif),
and delay tries (used to keep variables in delay elements straight). This is complicated by the fact that a delay
list contains several delay elements so their variable bindings need to be shared in a binding accumulator. This
accumulator must be refreshed for each delay_list for a given answer.

All this leads to considerable complications, where an array of bindings is maintained for a given delay element,
while these bindings are maintained in an accumulator. The original code juggled these arrays in a manner that
caused memory errors, so to get around this I wrote code to perform explicit copies, and made the bindings from the
delay trie load directly into the accumulator.

All this required a bit of code refactoring, and I also renamed some variables, as it the old names made things much
harder to follow than it would have been otherwise.

tswift 2016-01-25

changed /trunk/XSB/emu/bineg_xsb_i.h
changed /trunk/XSB/emu/context.h
changed /trunk/XSB/emu/residual.c
changed /trunk/XSB/emu/residual.h
changed /trunk/XSB/emu/tries.c
changed /trunk/XSB/emu/tries.h
/trunk/XSB/emu/bineg_xsb_i.h Diff Switch to side-by-side view
Loading...
/trunk/XSB/emu/context.h Diff Switch to side-by-side view
Loading...
/trunk/XSB/emu/residual.c Diff Switch to side-by-side view
Loading...
/trunk/XSB/emu/residual.h Diff Switch to side-by-side view
Loading...
/trunk/XSB/emu/tries.c Diff Switch to side-by-side view
Loading...
/trunk/XSB/emu/tries.h Diff Switch to side-by-side view
Loading...
MongoDB Logo MongoDB