Compound

Compound#

class discopy.closed.Compound(dom, cod)[source]#

Bases: TermBase

A term built from other terms, its parts: a Tuple, a Projection or a Let. Two compound terms are equal when their parts are, and the name is printed from the parts when first read rather than when the term is built, so that building a term is linear in its size where printing every subterm made it quadratic.

Parameters:
  • dom (Ty) – The domain of the term, i.e. the types of its free variables.

  • cod (Ty) – The codomain of the term.

property parts: tuple#

The terms and other data the compound term is built from.