core-logic

kneiva 2017-03-03T07:57:12.000525Z

Having a list of integers how would I find the biggest square area that can fit in the columns? With clojure.logic or preferrably with https://github.com/aengelberg/loco. I couldn’t find an example or a tutorial that help me with this kind of problem. Examples:

1234321     321     423

   0                0
  ***       0       0 0
 0***0      **      **0
00***00     **0     **0
= 3         = 2     = 2

2017-03-03T08:02:43.000527Z

it seems like the kind of think you might be able to find a formula for

2017-03-03T08:06:14.000528Z

I think with logic programming or some kind of sat solver you are going to have trouble, because both of those tend to be good answering "does a solution to this exist" and less so at solving "find me the solution with property x"

2017-03-03T08:17:55.000529Z

actually, I think you can put that in terms of does X exist: "Does X exist where X is a number that fits in row 0, and row 0 + X, and X+1 doesn't fit in row 0 + X + 1"

2017-03-03T08:23:54.000531Z

the biggest result or smallest result, is a constraint relative to all the other answers, which means you have to compute all the other possible answers

kneiva 2017-03-03T08:26:33.000532Z

Ok, I think that helps. I’ll ponder on it. Thanks!