Skip to content

Engine IntList newgs not used #5

@akbooer

Description

@akbooer

final int[] gs = pushBody(b, head, C0);
final IntList newgs = IntList.tail(IntList.app(gs, IntList.tail(G.gs)));
G.k = k + 1;
if (!IntList.isEmpty(newgs))
return new Spine(gs, base, IntList.tail(G.gs), ttop, 0, cls);
else
return answer(ttop);

This looks like a very expensive way of computing

(gs.length > 1) || (G.gs.length > 1)

as IntList newgs is otherwise unused?

Just seeking to understand why this is written this way, as I am in the process of converting the engine into the Lua language (what else to do in lockdown?) Preliminary speed tests are very encouraging. This whole implementation (plus the "Hitchhiker" paper, and the YouTube tutorial) is otherwise wonderfully clear and straight-forward.

Thanks for your work, I had been looking for a compact Prolog implementation for quite a while!

Tony

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions