Termination in Prolog like systems is a hard problem and core.logic doesn't provide much innovation here yet. I don't have time to look more closely at your specific program. I recommend looking at a good Prolog text as they often discuss issues around termination and possible workarounds.
David On Mon, Feb 3, 2014 at 1:15 AM, Atamert Ölçgen <mu...@muhuk.com> wrote: > This is not a bug, just a result of the evaluation model - order matters. > > > I thought order didn't matter (unless otherwise stated) in core.logic. Is > there a way for me to infer which goals are like this? (by looking at the > code if not from docs) > > I am trying to get this working: > > (defn geto [c k v] > (matche [c] > ([[]] (nilo k)) > ([[f . r]] (fresh [a] (firsto f a) > (conde [(== a k) (resto f v)] > [(geto r k v)]))))) > > > (defn keyso [c k] > (matche [c] > ([[]] (nilo k)) > ([[f . r]] (fresh [a b] (firsto f a) > (keyso r b) > (conso a b k))))) > > > (defn distinctkeyso [c] > (fresh [x] > (keyso c x) > (distincto x))) > > > (run 1 [q] > (fresh [x] > (geto x :tree false) > (== q true) > (geto x :tree q) > (distinctkeyso x))) > > > But it doesn't complete with that distinctkeyso. I tried to use maps but > it didn't work[1], so I decided to give lists a try. geto and keyso seem to > work fine. > > [1] > http://stackoverflow.com/questions/21519290/why-isnt-featurec-create-a-contradiction > > > > On Mon, Feb 3, 2014 at 6:01 AM, Atamert Ölçgen <mu...@muhuk.com> wrote: > >> I can't log in: >> >> com.atlassian.jira.util.dbc.Assertions$NullArgumentException: user should >> not be null! >> >> >> >> >> On Mon, Feb 3, 2014 at 5:58 AM, David Nolen <dnolen.li...@gmail.com>wrote: >> >>> This is not a bug, just a result of the evaluation model - order matters. >>> >>> Bugs can be filed here: http://dev.clojure.org/jira/browse/LOGIC >>> >>> David >>> >>> >>> On Mon, Feb 3, 2014 at 12:51 AM, Atamert Ölçgen < >>> atamert.olc...@gmail.com> wrote: >>> >>>> This succeeds: >>>> >>>> (run 1 [q] >>>> (distincto q) >>>> (== q [1 2 3])) -> ((1 2 3)) >>>> >>>> >>>> >>>> But this runs forever: >>>> >>>> (run 1 [q] >>>> (distincto q) >>>> (== q [1 2 3 1])) >>>> >>>> >>>> >>>> BTW, why is it so difficult to create a bug report for core.logic? >>>> Issue tracker is not enabled in GitHub. I signed up to >>>> http://dev.clojure.org/ but still can't create a ticket. >>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "Clojure" group. >>>> To post to this group, send email to clojure@googlegroups.com >>>> Note that posts from new members are moderated - please be patient with >>>> your first post. >>>> To unsubscribe from this group, send email to >>>> clojure+unsubscr...@googlegroups.com >>>> For more options, visit this group at >>>> http://groups.google.com/group/clojure?hl=en >>>> --- >>>> You received this message because you are subscribed to the Google >>>> Groups "Clojure" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to clojure+unsubscr...@googlegroups.com. >>>> For more options, visit https://groups.google.com/groups/opt_out. >>>> >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Clojure" group. >>> To post to this group, send email to clojure@googlegroups.com >>> Note that posts from new members are moderated - please be patient with >>> your first post. >>> To unsubscribe from this group, send email to >>> clojure+unsubscr...@googlegroups.com >>> For more options, visit this group at >>> http://groups.google.com/group/clojure?hl=en >>> --- >>> You received this message because you are subscribed to the Google >>> Groups "Clojure" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to clojure+unsubscr...@googlegroups.com. >>> For more options, visit https://groups.google.com/groups/opt_out. >>> >> >> >> >> -- >> Kind Regards, >> Atamert Ölçgen >> >> -+- >> --+ >> +++ >> >> www.muhuk.com >> > > > > -- > Kind Regards, > Atamert Ölçgen > > -+- > --+ > +++ > > www.muhuk.com > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > Note that posts from new members are moderated - please be patient with > your first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en > --- > You received this message because you are subscribed to the Google Groups > "Clojure" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to clojure+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.