cd /news/machine-learning/pluck-probabilistic-programming-with… · home topics machine-learning article
[ARTICLE · art-28083] src=pluck-lang.github.io ↗ pub= topic=machine-learning verified=true sentiment=· neutral

Pluck: Probabilistic Programming With Lazy Inference

Researchers released Pluck, a probabilistic programming language that uses lazy knowledge compilation for efficient exact inference. It supports higher-order functions, recursion, and can compute exact probability distributions and posterior samples for discrete random programs.

read2 min publishedJun 15, 2026

Pluck is a probabilistic programming language with efficient inference based on lazy knowledge compilation. It supports higher-order functions, many recursive programs, and recursive types.

Quick Start #

Install Pluck and run your first program:

git clone --recurse-submodules https://github.com/mlb2251/Pluck.jl.git
cd Pluck.jl

cd src/RSDD/rsdd
cargo build --release --features ffi
cd ../../..

using Pkg
Pkg.activate(".")
Pkg.instantiate()
using Pluck
load_pluck_file("programs/simple_example.pluck");

Expressive, Lazy, Functional Programs

Pluck programs are expressive functional programs, that can also make (discrete) random choices. It supports lazy algebraic data types, higher-order functions, and recursion.

(define-type tree (Leaf) (Node nat tree tree))

(define (random-tree)
  (if (flip 0.6)
    (Leaf)
    (let ((left  (random-tree))
          (right (random-tree)))
      (Node (geom 0.5) left right))))
Node 2 (Leaf) (Node 0 (Leaf) (Leaf))
Leaf
Node 1 (Leaf) (Leaf)

Exact Inference

Pluck can compute the exact probability distributions of many expressions.

;; What is the probability that a random tree has fewer than 4 nodes?
(query tree-size-small
  (Marginal (< (length (nodes (random-tree))) 4)))
tree-size-small:
  true   0.855
  false  0.145

Bayesian Conditioning

Pluck can also compute the exact conditional (i.e., posterior) distribution of an expression, given some Boolean condition.

(query bst-given-size8-bounded
  (let ((t (random-tree)))
    (Posterior
      (isBST t)
      (and (== (size t) 8) (all-nodes-between t 0 10)))))
bst-given-size8-bounded:
  false   0.9999999999998865
  true    1.1346479311669095e-13

Posterior Sampling

Pluck can draw exact samples from posterior distributions, even in infinite spaces.

(query tree-samples-given-size8-bst-bounded
  (let ((t (random-tree)))
    (PosteriorSamples
      t
      (and (== (size t) 8)
           (all-nodes-between t 0 10)
           (isBST t))
      5)))
(Node 9 (Node 7 (Node 6 (Node 4 (Node 3 (Node 2 (Node 1 (Leaf) (Leaf)) (Leaf)) (Leaf)) (Node 5 (Leaf) (Leaf))) (Leaf)) (Leaf)) (Leaf))
(Node 8 (Node 5 (Node 4 (Node 2 (Node 1 (Leaf) (Leaf)) (Node 3 (Leaf) (Leaf))) (Leaf)) (Node 6 (Leaf) (Leaf))) (Node 9 (Leaf) (Leaf)))
(Node 8 (Node 7 (Node 5 (Node 1 (Leaf) (Node 4 (Node 2 (Leaf) (Node 3 (Leaf) (Leaf))) (Leaf))) (Node 6 (Leaf) (Leaf))) (Leaf)) (Leaf))
(Node 8 (Node 6 (Node 3 (Node 1 (Leaf) (Node 2 (Leaf) (Leaf))) (Node 4 (Leaf) (Node 5 (Leaf) (Leaf)))) (Node 7 (Leaf) (Leaf))) (Leaf))
(Node 8 (Node 7 (Node 6 (Node 1 (Leaf) (Node 3 (Node 2 (Leaf) (Leaf)) (Node 5 (Node 4 (Leaf) (Leaf)) (Leaf)))) (Leaf)) (Leaf)) (Leaf))
── more in #machine-learning 4 stories · sorted by recency
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/pluck-probabilistic-…] indexed:0 read:2min 2026-06-15 ·