3 ms·
What happens if you input a puzzle that's unsolvable? Does the program run forever trying to seek a solution, or can it realize the puzzle is unsolvable?
by blakesmith 14y ago
What happens if you input a puzzle that's unsolvable? Does the program run forever trying to seek a solution, or can it realize the puzzle is unsolvable?
- riffraff 14y agoI think you get the core.logic equivalent of prolog's "no" result. I know nothing of clojure and core.logic, but a quick test: *sum=> (run* [q] (fresh [a b] (== a 1) (== b 2) (== a b) (== q [a b]))) () *sum=> (run* [q] (fresh [a b] (== a 1) (== b 1) (== a b) (== q [a b]))) ([1 1]) the first has no solutions, while the latter returns one of them.