hey, I am extremely-not a logical programming pro, I've been trying to use core.logic to generate test cases with somewhat complex constraints, and it works pretty decently for the most part as far as being a nice way to specify my constraints. the problem I'm facing now is that it tends to get stuck in particular branches of the search tree, when in reality I'd like to do something of a uniform-ish (for some meaning of uniform) sampling of the search tree - is there a way of doing this kind of thing in core.logic or am I using the wrong tool?
what do you mean by stuck?
core.logic uses a sort of streaming interleaving technique to avoid getting stuck in divergent goals
so I guess it's possible that I don't fully understand my problem 🙂 I guess what I'm seeing more concretely is like, the DFS is very observable in the output of my program
perhaps "stuck" was the wrong word - it is finding plenty of solutions, I would like to somehow have a way of generating more varied solutions
it will depend on the structure of your goals, but if you have a recursive goal that never reaches a base case for example, core.logic will still search other branches around that goal
core.logic will generate every possible solution
but you have little to no control of the order in which it generates them
I see, and there's no way I can say. limit the number of solutions that are reported from a particular branch?
no
i see, ok, thanks
you may want to look at test.check or data.generators, or spec for generating test cases
I haven't looked at test.check specifically but none of the quickcheck-likes I investigated seemed to allow me to do the same kind of branching search and goal-specifying that a prolog-like would
I feel like what I really want is some hybrid of those
of course I don't know what you are generating, but I would be surprised you couldn't do it via test.check
ok, I will investigate that, thanks for the assistance