  We present here a new probabilistic inference algorithm that gives exact
results in the domain of discrete probability distributions. This algorithm,
named the Statues algorithm, calculates the marginal probability distribution
on probabilistic models defined as direct acyclic graphs. These models are made
up of well-defined primitives that allow to express, in particular, joint
probability distributions, Bayesian networks, discrete Markov chains,
conditioning and probabilistic arithmetic. The Statues algorithm relies on a
variable binding mechanism based on the generator construct, a special form of
coroutine; being related to the enumeration algorithm, this new algorithm
brings important improvements in terms of efficiency, which makes it valuable
in regard to other exact marginalization algorithms. After introduction of
several definitions, primitives and compositional rules, we present in details
the Statues algorithm. Then, we briefly discuss the interest of this algorithm
compared to others and we present possible extensions. Finally, we introduce
Lea and MicroLea, two Python libraries implementing the Statues algorithm,
along with several use cases. A proof of the correctness of the algorithm is
provided in appendix.
