lambda-sampler-1.0: Boltzmann sampler utilities for lambda calculus.

Copyright(c) Maciej Bendkowski 2016
LicenseBSD3
Maintainermaciej.bendkowski@tcs.uj.edu.pl
Stabilityexperimental
Safe HaskellSafe
LanguageHaskell2010

Data.Lambda.Random.System

Contents

Description

Combinatorial system defining closed h-shallow lambda terms in the de Bruijn notation.

Synopsis

System

data Expr a Source #

An expression defining the branching probabilities in the Boltzmann model for closed h-shallow lambda terms.

Constructors

Expr 

Fields

  • abs :: a

    Abstraction probability.

  • app :: a

    Application probability.

  • idx :: [a]

    Probabilities for de Bruijn indices

Instances

Show a => Show (Expr a) Source # 

Methods

showsPrec :: Int -> Expr a -> ShowS #

show :: Expr a -> String #

showList :: [Expr a] -> ShowS #

type System a = [Expr a] Source #

Combinatorial system specification for closed h-shallow lambda terms.

boltzmannSystem Source #

Arguments

:: (Floating a, Integral b) 
=> Model b

Size notion.

-> b

Shallowness.

-> a

Formal z parameter.

-> System a

The computed Boltzmann system.

Computes the Boltzmann model for closed h-shallow lambda terms evaluated in the given parameter.

Boltzmann samplers

data Sampler a b Source #

Boltzmann sampler specification consisting of a Boltzmann system with a corresponding size notion model.

Constructors

Sampler 

Fields

boltzmannSampler Source #

Arguments

:: (Floating a, Integral b) 
=> Model b

Size notion.

-> b

Shallowness.

-> a

Formal z parameter.

-> Sampler a b

The computed Boltzmann sampler.

Computes the Boltzmann sampler specification for closed h-shallow lambda terms evaluated in the given parameter.

rejectionSampler Source #

Arguments

:: (Floating a, Ord a, Integral b) 
=> Model b

Size notion.

-> b

Shallowness.

-> a

Singularity approximation error.

-> Sampler a b

The computed rejection Boltzmann sampler.

Computes the rejection Boltzmann sampler for closed h-shallow lambda terms evaluated near the dominating singularity.