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[Wire, ...]) – 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
generator_factory#

alias of Wire

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]#

The atomic type with winding number zero, see Wire.unwind(). This method is only defined for atomic types.

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

factory#

alias of Ty