biclosed#
The free biclosed monoidal category, i.e. with left and right exponentials.
Summary#
A biclosed object is a self-dagger |
|
A biclosed type is a monoidal type that can be exponentiated. |
|
A |
|
An |
|
A |
|
A biclosed diagram is a monoidal diagram with |
|
A biclosed box is a monoidal box in a biclosed diagram. |
|
The evaluation of an exponential type. |
|
The coevaluation of an exponential type, i.e. the dagger of |
|
The currying of a biclosed diagram. |
|
A biclosed sum is a monoidal sum and a biclosed box. |
|
A biclosed functor is a monoidal functor that preserves evaluation and currying. |
|
alias of |
|
A term in the internal language of biclosed categories. |
|
A constant term of defined by a |
|
A variable with a string as name and a |
|
The application either |
|
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)
>>> Equation(f.uncurry(left=True).curry(left=True), f).draw(
... doctest='docs/_static/biclosed/curry-left.svg', margins=(0.1, 0.05))
>>> Equation(h.uncurry(left=False).curry(left=False), h).draw(
... doctest='docs/_static/biclosed/curry-right.svg', margins=(0.1, 0.05))
>>> Equation(
... g.curry(left=True).uncurry(left=True), g,
... g.curry(left=False).uncurry(left=False)).draw(
... doctest='docs/_static/biclosed/uncurry.svg')
Compact currying#
Diagram.to_compact() bends curry bubbles into coevaluation and feedback,
which lands in CMap as a biclosed category has no trace.
>>> g.curry(left=True).uncurry(left=True).to_compact().draw(show=False,
... doctest="docs/_static/cmap/biclosed-curry-left.dot")
>>> g.curry(left=False).uncurry(left=False).to_compact().draw(show=False,
... doctest="docs/_static/cmap/biclosed-curry-right.dot")