(1 0 0 1) and (0 1 0 1) are wrong for me. The idea is that, say, (f 8 [2 3]) should give me all ways of putting two sequences of ones (with sizes 2 and 3, in this order), separated by some zeros, in an 8-length row.
It is like solving a one-row nonogram. Then I just use it for all rows and columns to make a full nonogram solver: http://github.com/maurolopes/nonogramsolver As I said, my program seems to be working now. I'm only giving you context so it is easier to understand my code and debug core.logic. On Thu, Mar 6, 2014 at 2:00 PM, David Nolen <[email protected]> wrote: > Which results are making it through that you don't think should? > > Just trying to figure out what the main part of your program is doing. > sumo and dropo appear to be just fine by themselves. > > David > > > On Thu, Mar 6, 2014 at 11:56 AM, Mauro Lopes <[email protected]> wrote: > >> Actually what I desire to get as a result is only the first three >> solutions: >> >> #{(0 1 1 0) (1 1 0 0) (0 0 1 1)} >> >> I noticed that, in order to get this solution, I can just replace >> >> ([[] vars]) >> >> with >> >> ([[] vars] >> (l/everyg #(l/== % 0) vars)) >> >> and it seems to work fine for my program, and I agree that this change is >> necessary for it to work as intended. >> >> Anyway, without this change, what I really think it should return is: >> >> #{(0 1 1 0) (1 1 0 0) (0 0 1 1) (1 1 1 0) (1 1 0 1) (1 1 1 1) (0 1 1 1)} >> >> So, in my opinion, both of the solutions (4 or 5 results) are incorrect, >> core.logic is adding a few extra results and missing others. >> >> >> On Thu, Mar 6, 2014 at 11:34 AM, David Nolen <[email protected]>wrote: >> >>> Thanks I can confirm. I'm assuming the case where you get 5 results in >>> the set is simply not correct? >>> >>> David >>> >>> >>> On Wed, Mar 5, 2014 at 10:33 PM, Mauro Lopes <[email protected]>wrote: >>> >>>> Sure. I have added fd/in for all vars involved in fd operations and the >>>> problem persists. I uploaded the new code to JIRA. See if it helps. >>>> Thanks. >>>> >>>> Regards, >>>> >>>> Mauro >>>> >>>> >>>> On Wednesday, March 5, 2014 12:18:23 PM UTC-3, David Nolen wrote: >>>> >>>>> So I took a closer look at this and noticed that you're not using >>>>> fd/in in all the locations where you create fresh vars and then apply >>>>> finite domain operation on them. This is not correct. >>>>> >>>>> Can you fix your code and then let us know if the problem continues to >>>>> persist? >>>>> >>>>> Thanks, >>>>> David >>>>> >>>>> >>>>> On Sat, Feb 22, 2014 at 7:48 PM, Mauro Lopes <[email protected]>wrote: >>>>> >>>>>> Done. Ticket is at http://dev.clojure.org/jira/browse/LOGIC-156 >>>>>> Thanks, David. >>>>>> >>>>>> On Saturday, February 22, 2014 9:01:54 PM UTC-3, David Nolen wrote: >>>>>> >>>>>>> Sounds like a bug, please file a bug in JIRA with this code and I >>>>>>> will take a look. Thanks! >>>>>>> >>>>>>> David >>>>>>> >>>>>>> >>>>>>> On Sat, Feb 22, 2014 at 5:53 PM, Mauro Lopes <[email protected]>wrote: >>>>>>> >>>>>>>> Hello everyone, >>>>>>>> >>>>>>>> I am new to core.logic but have been using it for the past few days >>>>>>>> (version 0.8.7). >>>>>>>> I have found a behavior that seems strange to me. I have written a >>>>>>>> search (run*) that does not always return the same set of results if I >>>>>>>> run >>>>>>>> it a few times with the same input. Not even the number of results is >>>>>>>> the >>>>>>>> same. Can that somehow be the right thing to expect? Maybe I have >>>>>>>> misunderstood some basic concept, so please clarify what is going on. >>>>>>>> >>>>>>>> I have simplified my program to the minimum version I could find >>>>>>>> that still shows this behavior. Here is the gist: >>>>>>>> gist.github.com/maurolopes/9163407 >>>>>>>> >>>>>>>> Thanks! >>>>>>>> >>>>>>>> -- >>>>>>>> You received this message because you are subscribed to the Google >>>>>>>> Groups "minikanren" group. >>>>>>>> To unsubscribe from this group and stop receiving emails from it, >>>>>>>> send an email to [email protected]. >>>>>>>> To post to this group, send email to [email protected]. >>>>>>>> >>>>>>>> Visit this group at http://groups.google.com/group/minikanren. >>>>>>>> For more options, visit https://groups.google.com/groups/opt_out. >>>>>>>> >>>>>>> >>>>>>> -- >>>>>> You received this message because you are subscribed to the Google >>>>>> Groups "minikanren" group. >>>>>> To unsubscribe from this group and stop receiving emails from it, >>>>>> send an email to [email protected]. >>>>>> To post to this group, send email to [email protected]. >>>>>> Visit this group at http://groups.google.com/group/minikanren. >>>>>> For more options, visit https://groups.google.com/groups/opt_out. >>>>>> >>>>> >>>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "minikanren" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to [email protected]. >>>> >>>> To post to this group, send email to [email protected]. >>>> Visit this group at http://groups.google.com/group/minikanren. >>>> For more options, visit https://groups.google.com/groups/opt_out. >>>> >>> >>> -- >>> You received this message because you are subscribed to a topic in the >>> Google Groups "minikanren" group. >>> To unsubscribe from this topic, visit >>> https://groups.google.com/d/topic/minikanren/fjL-vGpwK6g/unsubscribe. >>> To unsubscribe from this group and all its topics, send an email to >>> [email protected]. >>> >>> To post to this group, send email to [email protected]. >>> Visit this group at http://groups.google.com/group/minikanren. >>> For more options, visit https://groups.google.com/groups/opt_out. >>> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "minikanren" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To post to this group, send email to [email protected]. >> Visit this group at http://groups.google.com/group/minikanren. >> For more options, visit https://groups.google.com/groups/opt_out. >> > > -- > You received this message because you are subscribed to a topic in the > Google Groups "minikanren" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/minikanren/fjL-vGpwK6g/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/minikanren. > For more options, visit https://groups.google.com/groups/opt_out. > -- You received this message because you are subscribed to the Google Groups "minikanren" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/minikanren. For more options, visit https://groups.google.com/groups/opt_out.
