rigid#
Implements the free rigid monoidal category.
The objects are given by the free pregroup, the arrows by planar diagrams.
>>> unit, s, n = Ty(), Ty('s'), Ty('n')
>>> t = n.r @ s @ n.l
>>> assert t @ unit == t == unit @ t
>>> assert t.l.r == t == t.r.l
>>> left_snake, right_snake = Id(n.r).transpose(left=True), Id(n.l).transpose()
>>> assert left_snake.normal_form() == Id(n) == right_snake.normal_form()
>>> from discopy import drawing
>>> drawing.equation(
... left_snake, Id(n), right_snake, figsize=(4, 2),
... path='docs/_static/imgs/rigid/snake-equation.png')
|
Implements simple pregroup types: basic types and their iterated adjoints. |
|
Implements pregroup types as lists of simple types. |
|
Objects of the free rigid monoidal category generated by 1. |
|
Implements diagrams in the free rigid monoidal category. |
|
Define an identity arrow in a free rigid category |
|
Implements generators of rigid monoidal diagrams. |
|
Implements swaps of basic types in a rigid category. |
|
Defines cups for simple types. |
|
Defines cups for simple types. |
|
Implements rigid monoidal functors, i.e. preserving cups and caps. |