Re: Translating simple path finding problem from prolog to core.logic

2013-06-30 Thread Craig Ching
Thanks Norman! Not sure how I didn't realize that was happening, but it's working exactly as you describe. Thanks much for your help! Cheers, Craig On Sunday, June 30, 2013 2:40:48 PM UTC-5, Norman Richards wrote: > > Just like the prolog, you are generating an infinite number of solutions. >

Re: Translating simple path finding problem from prolog to core.logic

2013-06-30 Thread Norman Richards
Just like the prolog, you are generating an infinite number of solutions. run* will try and give you all of them. You can use clojure's lazy seq operations (first, take, etc...) or just ask for however many you want: > (run 10 [q] (path2 1 7 q)) ((1 4 3 7) (1 2 4 3 7) (1 4 5 7) (1 2 4

Translating simple path finding problem from prolog to core.logic

2013-06-30 Thread Craig Ching
Hello fellow logicians! I'm trying to translate the following prolog problem to core.logic: >From http://tjeyamy.blogspot.com/2011/02/path-finding-in-prolog.html edge(1,2). edge(1,4). edge(2,4). edge(3,6). edge(3,7). edge(4,3). edge(4,5). edge(5,6). edge(5,7). edge(6,5). edge(7,5). edge(8,6). e