Thanks to Henry's indications, I remembered that conjunctions could refer to 'x' as well as 'y'. Now the syntax is much better (after a little tweaking of 'equivalent'):
callfresh equivalent 5 empty_state That's exactly what I needed! Minikanren is a minimal logic language differing from prolog in that it aims at a terse shallow embedded implementation, and limits its use of extra-logical features much more than prolog. 'call/fresh' updates the logical variable counter and provides a new unused logical variable for use in constraint operators, such as 'equivalent' Thanks! Raoul On Mon, Dec 30, 2019 at 12:15 AM Raul Miller <rauldmil...@gmail.com> wrote: > Can you describe call/fresh in english? > > (What problem does it solve? Do you have a reference to an online manual?) > > When I try searching on the topic, I currently get oblique references and > journal of abnormal psychology pages... > > Thanks, > > -- > Raul > > On Sat, Dec 28, 2019 at 8:51 PM Raoul Schorer <raoul.scho...@gmail.com> > wrote: > > > 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 > > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm