ANN: Dogelog Runtime, Prolog to the Moon (2021)
Mostowski Collapse
janburse at fastmail.fm
Mon Sep 20 02:44:27 EDT 2021
This strategy works if you use failure driven loops.
It doesn't work you program recursive loops that go
on forever. Like Erlang processes.
foo(X) :-
bar(X,Y), foo(Y).
Typically Y is a fresh variable. A good Prolog system
with good Garbage Collection can run such a process
for days and months.
If you don't clean up the trail, you exhaust the
memory after a few minutes or seconds.
Greg Ewing schrieb:
>> On Mon, Sep 20, 2021 at 3:19 AM Mostowski Collapse
>> <janburse at fastmail.fm> wrote:
>>>
>>> On the other hand if I would use the trigger
>>> from Python, I possibly would need a double linked
>>> list, to remove an element.
>
> Here's another idea: Put weak references in the trail, but
> don't bother with the scanning -- just skip over dead ones
> during backtracking.
>
> Seems to me you would be doing about the same amount of
> work either way, just doing it at different times.
>
More information about the Python-list
mailing list