Ty#

class discopy.rigid.Ty(*inside, dom=None, cod=None, _scan=True, **kwargs)[source]#

Bases: discopy.abc.Pregroup, discopy.biclosed.Ty

A rigid type is a biclosed type with rigid objects inside.

Parameters:
  • inside (tuple[Ob, ...]) – The objects inside the type.

  • dom (C0) –

  • cod (C0) –

  • _scan (bool) –

Example

>>> s, n = Ty('s'), Ty('n')
>>> assert n.l.r == n == n.r.l
>>> assert (s @ n).l == n.l @ s.l and (s @ n).r == n.r @ s.r
assert_isadjoint(other)[source]#

Raise AxiomError if two rigid types are not adjoints.

Parameters:

other – The alleged right adjoint.

property l: Ty#

The left adjoint of the type.

property r: Ty#

The right adjoint of the type.

property z: int#

The winding number is only defined for types of length 1.

unwind()[source]#

Rotate an atomic type until its winding number is zero.

The previous normalisation applied .r once, which is only an involution for pivotal types: it sent rigid n.r to n.r.r.

Example

>>> n = Ty('n')
>>> assert n.r.r.unwind() == n.l.unwind() == n
Return type:

Ty

generator_factory#

alias of Ob

factory#

alias of Ty