Clone wiki

Lea / Lea_s_World

Lea's Philosophy

This page presents the leading design ideas of Lea.

  • Any Lea instance represents a discrete probability distribution.
  • Such distribution is immutable.
  • Most operations on Lea instances produces new Lea instances.
  • The operations are performed in a lazy way.
  • Probabilities are defined and stored as natural numbers, representing rational numbers having a common denominator.
  • Operations made on Lea instances are propagated to their values.
  • Operations involving more than one Lea instance use the cartesian product.
  • The same instance occurring several times in the same expression is treated consistently, through a value binding mechanism.
  • Any non-Lea object mixed in an operation with a Lea instance is automatically coerced into a Lea instance representing a "certain" value.
  • Lea is an abstract class.
  • Each Lea's concrete subclasses defines a specific method to produce the values-probability pairs.
  • The Alea subclass defines actual "atomic" value-probability pairs.