Welcome! Please see the About page for a little more info on how this works.

0 votes
in core.logic by

This goal should enumerate any fd vars found in a fresh/ground var bound to a sequence. This would avoid some unintuitive behavior that came up on the mailing list:

`
(defne weighted-listo [l w]
([() _] (fd/== w 0))
([[h . t] _]

(fresh [n]
  (fd/in n (fd/interval 0 java.lang.Integer/MAX_VALUE))
  (fd/in h (fd/interval 1 java.lang.Integer/MAX_VALUE))
  (fd/+ h n w)
  (weighted-listo t n))))

`

2 Answers

0 votes
by

Comment made by: austinhaas

Here is a link to the discussion on the mailing list: https://groups.google.com/forum/#!topic/minikanren/MgcvtkA6_EI

0 votes
by
Reference: https://clojure.atlassian.net/browse/LOGIC-133 (reported by dnolen)
...