Hi,

I am trying to implement minikanren <http://www.minikanren.org> in J. I
have it almost working, but I am stuck in the last part of the core
implementation
<https://github.com/jasonhemann/microKanren/blob/master/microKanren.scm>. I
do not understand how to write "call/fresh" from the scheme code:

In J, where "empty_state" is a list of 2 boxes emulating "s/c":
(call empty_state) (equivalent 5) (fresh empty_state)
which as a first step evaluates to:
(1$0) (equivalent 5) ('',.@;1)

In the above working code, "empty_state" is repeated, and that is what I
want to avoid. "equivalent" is a conjunction, and "call" and "fresh" are
both monadic verbs applied to the noun "empty_state". In the scheme version
"call" and "fresh" are united in "call/fresh", but this would require me to
pass the "equivalent" conjunction as argument to "call/fresh".

Can you help me write the scheme "call/fresh" equivalent, please?
my code is at https://github.com/Rscho314/new_kanren

Thanks,
Raoul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to