biclosed

Contents

biclosed#

The free biclosed monoidal category, i.e. with left and right exponentials.

Summary#

Ty

A biclosed type is a monoidal type that can be exponentiated.

Exp

A base type to an exponent type, called with **.

Over

An exponent type over a base type, called with <<.

Under

A base type under an exponent type, called with >>.

Diagram

A biclosed diagram is a monoidal diagram with Curry and Eval boxes.

Box

A biclosed box is a monoidal box in a biclosed diagram.

Eval

The evaluation of an exponential type.

Coeval

The coevaluation of an exponential type, i.e. the dagger of Eval.

Curry

The currying of a biclosed diagram.

Sum

A biclosed sum is a monoidal sum and a biclosed box.

Functor

A biclosed functor is a monoidal functor that preserves evaluation and currying.

CMap

TermBase

A term in the internal language of biclosed categories.

Constant

A constant term of defined by a Diagram with dom=X, cod=Y.

Variable

A variable with a string as name and a Ty.

Application

The application either func(args) of a term func of type Y << X to a term args of type X or args(func, left=True) of a term args of type X fed as input to a term func of type X >> Y.

Abstraction

Axioms#

Diagram.curry() and Diagram.uncurry() are inverses.

>>> x, y, z = map(Ty, "xyz")
>>> f, g, h = Box('f', x, z << y), Box('g', x @ y, z), Box('h', y, x >> z)
>>> from discopy.drawing import Equation
>>> Equation(f.uncurry(left=True).curry(left=True), f).draw(
...     path='docs/_static/biclosed/curry-left.png', margins=(0.1, 0.05))
../_images/curry-left.png
>>> Equation(h.uncurry().curry(), h).draw(
...     path='docs/_static/biclosed/curry-right.png', margins=(0.1, 0.05))
../_images/curry-right.png
>>> Equation(
...     g.curry(left=True).uncurry(left=True), g, g.curry().uncurry()).draw(
...         path='docs/_static/biclosed/uncurry.png')
../_images/uncurry.png