tct-2.0.1: A Complexity Analyser for Term Rewrite Systems

Portabilityunportable
Stabilityunstable
MaintainerMartin Avanzini <martin.avanzini@uibk.ac.at>
Safe HaskellSafe-Infered

Tct.Certificate

Contents

Description

This module defines the Certificate and Complexity datatype, together with accessors.

Synopsis

Complexity

data Complexity

Constructors

Poly (Maybe Int)

Polynomial. If argument is Just k, then k gives the degree of the polynomial

Exp (Maybe Int)

Exponential. If argument is Nothing, then represented bounding function is elementary. If argument is Just k, then bounding function is k-exponential. Hence Exp (Just 1) represents an exponential bounding function.

Supexp

Super exponential.

Primrec

Primitive recursive.

Multrec

Multiple recursive.

Rec

Recursive.

Unknown

Unknown.

The datatype Complexity is TcTs representation of a bounding function, in big-O notation

Constructors

Constructor for constant bounding function.

Constructor for polynomial bounding function, with optional degree.

Constructor for elementary (k-exponential) bounding function.

Constructor for super exponential bounding function.

Constructor for primitive recursive bounding function.

Combinations

Addition of bounds modulo big-O notation, i.e., f `add` g so constructs an element of Complexity that majorises O(f(n)) + O(g(n)).

Multiplication of bounds modulo big-O notation, i.e., f `mult` g so constructs an element of Complexity that majorises O(f(n)) + O(g(n)).

Composition of bounds modulo big-O notation, i.e., f `compose` g so constructs an element of Complexity that majorises O(f(g(n))).

Iteration of bounds modulo big-O notation, i.e., f `iter` g so constructs an element of Complexity that majorises O(f(..f(n)..)) with O(m) occurences of f.

Complexity Certificate

A certificate consists of a lower and an upper bound.

Extract the lower bound from a Certificate.

Extract the upper bound from a Certificate.

The call certificate (l,u) constructs a Certificate with lower bound l and upper bound u.

Constructs a Certificate where both lower and upper bounds are unknown.