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

Data.Lambda.Model

Contents

Description

Size notion framework of Gittenberger and Gołębiewski for lambda terms in the de Bruijn notation. A size definition constitutes the weights for lambda abstraction, term application, successor and zero.

Synopsis

# Size notions

data Model a Source #

Lambda term size model.

Constructors

 Model FieldszeroW :: aSize of zerosuccW :: aSize of successorabsW :: aSize of the abstractionappW :: aSize of the application

natural :: Integral a => Model a Source #

The natural size notion.

binary :: Integral a => Model a Source #

The binary size notion.

Arguments

 :: Integral a => Model a Size notion -> Bool Whether the size model is valid.

Checks whether the given size model is valid in the framework of Gittenberger and Gołębiewski.

# Helpers

weights :: Model a -> (a, a, a, a) Source #

Given a size notion, returns a tuple (a,b,c,d) where a denotes the size of the de Bruijn zero, b denotes the size of the de Bruijn successor, c denotes the size of the lambda abstraction and finally d denotes the size of the application.