Fork me on GitHub
#core-logic
<
2022-06-01
>
Martynas Maciulevičius09:06:38

IMO you don't ever control how the logic will progress. So you probably can't. But even then what would a person expect... what if the solver will decide to run your expression 1M times? I don't know if it makes more sense than reacting to the results themselves. Also one more problem with shimming the code is that it would force the solver to solve from the "side" that would input into your code.

Martynas Maciulevičius14:06:14

I'm not a pro by any means. But when I was reading the start of the intro about prolog it was the first thing that they wrote about. And then I dropped reading it 😄 The expressions that you specify by conso and other operators work both ways. For instance look how they define addition and subtraction using the same addition operator. You can do this in math but most of the time your functions in Clojure are one-way only. So if you will use this kind of one-way function... you will force the computation of the solver to be evaluated in a particular way. And if you will have a way to cheaply compute something in the computation then it may get repeated if you will force the solver to think in a specific way.