0.8.4-SNAPSHOT Arrow_down_16x16

bounded-listo

clojure.core.logic.fd

  • (bounded-listo l n)
Ensure that the list l never grows beyond bound n.
n must have been assigned a domain.

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/core/logic/fd.clj:1112 top

(defne bounded-listo
  "Ensure that the list l never grows beyond bound n.
   n must have been assigned a domain."
  [l n]
  ([() _] (<= 0 n))
  ([[h . t] n]
     (fresh [m]
       (in m (interval 0 Integer/MAX_VALUE))
       (+ m 1 n)
       (bounded-listo t m))))
Vars in clojure.core.logic.fd/bounded-listo:
Used in 0 other vars

Comments top

No comments for bounded-listo. Log in to add a comment.