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

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

Data.Lambda.Random.PlainSystem

Contents

Description

Combinatorial specification defining plain lambda terms in the de Bruijn notation.

Synopsis

System

data PlainSystem a Source #

An expression defining the branching probabilities in the Boltzmann model for plain lambda terms.

Constructors

PlainSystem 

Fields

  • abs :: a

    Abstraction probability.

  • app :: a

    Application probability.

  • zero :: a

    Zero constructor probability.

Instances

boltzmannSystem Source #

Arguments

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

Size notion.

-> a

Formal z parameter.

-> PlainSystem a

The computed Boltzmann system.

Computes the Boltzmann model for plain lambda terms evaluated in the given parameter.

Boltzmann samplers

data PlainSampler a b Source #

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

Constructors

PlainSampler 

Fields

boltzmannSampler Source #

Arguments

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

Size notion.

-> a

Formal z parameter.

-> PlainSampler a b

The computed Boltzmann sampler.

Computes the Boltzmann sampler specification for plain lambda terms evaluated in the given parameter.

rejectionSampler Source #

Arguments

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

Size notion.

-> a

Singularity approximation error.

-> PlainSampler a b

The computed rejection Boltzmann sampler.

Computes the rejection Boltzmann sampler for plain lambda terms evaluated near the dominating singularity.

Evaluation

eval :: (Floating a, Integral b) => Model b -> a -> a Source #

Evaluates the generating function for plain lambda terms assuming the given size model and parameter value.