This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-02-10
Channels
- # beginners (140)
- # boot (18)
- # cider (4)
- # cljs-dev (28)
- # clojure (191)
- # clojure-greece (51)
- # clojure-russia (1)
- # clojure-spec (13)
- # clojure-uk (2)
- # clojurescript (38)
- # community-development (26)
- # core-logic (16)
- # cursive (6)
- # datomic (3)
- # defnpodcast (9)
- # editors (1)
- # emacs (1)
- # fulcro (10)
- # immutant (3)
- # jobs-discuss (2)
- # leiningen (17)
- # lumo (24)
- # off-topic (30)
- # quil (12)
- # re-frame (11)
- # reagent (103)
- # remote-jobs (2)
- # shadow-cljs (157)
- # spacemacs (4)
- # unrepl (18)
- # yada (2)
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?
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
I see, and there's no way I can say. limit the number of solutions that are reported from a particular branch?
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