diff --git a/dev/.documenter-siteinfo.json b/dev/.documenter-siteinfo.json index 50f7de6c4..e43cec457 100644 --- a/dev/.documenter-siteinfo.json +++ b/dev/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.9.4","generation_timestamp":"2023-12-15T23:35:48","documenter_version":"1.2.1"}} \ No newline at end of file +{"documenter":{"julia_version":"1.9.4","generation_timestamp":"2023-12-16T00:09:09","documenter_version":"1.2.1"}} \ No newline at end of file diff --git a/dev/apis/categorical_algebra/index.html b/dev/apis/categorical_algebra/index.html index ca2cf670c..9bd00a178 100644 --- a/dev/apis/categorical_algebra/index.html +++ b/dev/apis/categorical_algebra/index.html @@ -1,11 +1,11 @@ -Categorical algebra · Catlab.jl

Categorical algebra

Sets and Relations

The following APIs implement FinSet, the category of Finite Sets (actually the skeleton of FinSet). The objects of this category are natural numbers where n represents a set with n elements. The morphisms are functions between such sets. We use the skeleton of FinSet in order to ensure that all sets are finite and morphisms can be stored using lists of integers. Finite relations are built out of FinSet and can be used to do some relational algebra.

Catlab.CategoricalAlgebra.SetsModule

Category of (possibly infinite) sets and functions.

This module defines generic types for the category of sets (SetOb, SetFunction), as well as a few basic concrete types, such as a wrapper type to view Julia types as sets (TypeSet). Extensive support for finite sets is provided by another module, FinSets.

source
Catlab.CategoricalAlgebra.Sets.SetFunctionType

Abstract type for morphism in the category Set.

Every instance of SetFunction{<:SetOb{T},<:SetOb{T′}} is callable with elements of type T, returning an element of type T′.

Note: This type would be better called simply Function but that name is already taken by the base Julia type.

source
Catlab.CategoricalAlgebra.Sets.SetObType

Abstract type for object in the category Set.

The type parameter T is the element type of the set.

Note: This type is more abstract than the built-in Julia types AbstractSet and Set, which are intended for data structures for finite sets. Those are encompassed by the subtype FinSet.

source
AlgebraicInterfaces.ObMethod

Forgetful functor Ob: Cat → Set.

Sends a category to its set of objects and a functor to its object map.

source
Catlab.CategoricalAlgebra.FinSets.FinFunctionType

Function between finite sets.

The function can be defined implicitly by an arbitrary Julia function, in which case it is evaluated lazily, or explictly by a vector of integers. In the vector representation, the function (1↦1, 2↦3, 3↦2, 4↦3), for example, is represented by the vector [1,3,2,3].

FinFunctions can be constructed with or without an explicitly provided codomain. If a codomain is provided, by default the constructor checks it is valid.

This type is mildly generalized by FinDomFunction.

source
Catlab.CategoricalAlgebra.FinSets.FinSetType

Finite set.

A finite set has abstract type FinSet{S,T}. The second type parameter T is the element type of the set and the first parameter S is the collection type, which can be a subtype of AbstractSet or another Julia collection type. In addition, the skeleton of the category FinSet is the important special case S = Int. The set ${1,…,n}$ is represented by the object FinSet(n) of type FinSet{Int,Int}.

source
Catlab.CategoricalAlgebra.FinSets.TabularLimitType

Limit of finite sets viewed as a table.

Any limit of finite sets can be canonically viewed as a table (TabularSet) whose columns are the legs of the limit cone and whose rows correspond to elements of the limit object. To construct this table from an already computed limit, call TabularLimit(::AbstractLimit; ...). The column names of the table are given by the optional argument names.

In this tabular form, applying the universal property of the limit is trivial since it is just tupling. Thus, this representation can be useful when the original limit algorithm does not support efficient application of the universal property. On the other hand, this representation has the disadvantage of generally making the element type of the limit set more complicated.

source
Catlab.CategoricalAlgebra.FinSets.TabularSetType

Finite set whose elements are rows of a table.

The underlying table should be compliant with Tables.jl. For the sake of uniformity, the rows are provided as named tuples, which assumes that the table is not "extremely wide". This should not be a major limitation in practice but see the Tables.jl documentation for further discussion.

source
Catlab.CategoricalAlgebra.FinSets.VarFunctionType

Data type of a map out of a set of attribute variables

Currently, domains are FinSet{Int} and codomains are expected to be FinSet{Int}. This could be generalized to being FinSet{Symbol} to allow for symbolic attributes. (Likewise, AttrVars will have to wrap Any rather than Int)

source
Catlab.CategoricalAlgebra.FinRelations.FinRelationType

Binary relation between finite sets.

A morphism in the category of finite sets and relations. The relation can be represented implicitly by an arbitrary Julia function mapping pairs of elements to booleans or explicitly by a matrix (dense or sparse) taking values in the rig of booleans (BoolRig).

source

Free Diagrams, Limits, and Colimits

The following modules define free diagrams in an arbitrary category and specify limit and colimit cones over said diagrams. Thes constructions enjoy the fullest support for FinSet and are used below to define presheaf categories as C-Sets. The general idea of these functions is that you set up a limit computation by specifying a diagram and asking for a limit or colimit cone, which is returned as a struct containing the apex object and the leg morphisms. This cone structure can be queried using the functions apex and legs. Julia's multiple dispatch feature is heavily used to specialize limit and colimit computations for various diagram shapes like product/coproduct and equalizer/coequalizer. As a consumer of this API, it is highly recommended that you use multiple dispatch to specialize your code on the diagram shape whenever possible.

Catlab.CategoricalAlgebra.FreeDiagramsModule

Free diagrams in a category.

A free diagram in a category is a diagram whose shape is a free category. Examples include the empty diagram, pairs of objects, discrete diagrams, parallel pairs, composable pairs, and spans and cospans. Limits and colimits are most commonly taken over free diagrams.

source
Catlab.CategoricalAlgebra.FreeDiagrams.BipartiteFreeDiagramType

A free diagram with a bipartite structure.

Such diagrams include most of the fixed shapes, such as spans, cospans, and parallel morphisms. They are also the generic shape of diagrams for limits and colimits arising from undirected wiring diagrams. For limits, the boxes correspond to vertices in $V₁$ and the junctions to vertices in $V₂$. Colimits are dual.

source
Catlab.CategoricalAlgebra.FreeDiagrams.BipartiteFreeDiagramMethod

Convert a free diagram to a bipartite free diagram.

Reduce a free diagram to a free bipartite diagram with the same limit (the default, colimit=false) or the same colimit (colimit=true). The reduction is essentially the same in both cases, except for the choice of where to put isolated vertices, where we follow the conventions described at cone_objects and cocone_objects. The resulting object is a bipartite free diagram equipped with maps from the vertices of the bipartite diagram to the vertices of the original diagram.

source
Catlab.CategoricalAlgebra.FreeDiagrams.bundle_legsMethod

Bundle together legs of a multi(co)span.

For example, calling bundle_legs(span, SVector((1,2),(3,4))) on a multispan with four legs gives a span whose left leg bundles legs 1 and 2 and whose right leg bundles legs 3 and 4. Note that in addition to bundling, this function can also permute legs and discard them.

The bundling is performed using the universal property of (co)products, which assumes that these (co)limits exist.

source
Catlab.CategoricalAlgebra.FreeDiagrams.cone_objectsMethod

Objects in diagram that will have explicit legs in limit cone.

In category theory, it is common practice to elide legs of limit cones that can be computed from other legs, especially for diagrams of certain fixed shapes. For example, when it taking a pullback (the limit of a cospan), the limit object is often treated as having two projections, rather than three. This function encodes such conventions by listing the objects in the diagram that will have corresponding legs in the limit object created by Catlab.

See also: cocone_objects.

source
Catlab.CategoricalAlgebra.Limits.SpecializeLimitType

Meta-algorithm that reduces general limits to common special cases.

Reduces limits of free diagrams that happen to be discrete to products. If this fails, fall back to the given algorithm (if any).

TODO: Reduce free diagrams that are (multi)cospans to (wide) pullbacks.

source
Catlab.CategoricalAlgebra.Limits.colimitMethod

Colimit of a diagram.

To define colimits in a category with objects Ob, override the method colimit(::FreeDiagram{Ob}) for general colimits or colimit(::D) with suitable type D <: FixedShapeFreeDiagram{Ob} for colimits of specific shape, such as coproducts or coequalizers.

See also: limit

source
Catlab.CategoricalAlgebra.Limits.epi_monoMethod

The image and coimage are isomorphic. We get this isomorphism using univeral properties.

  CoIm′ ╌╌> I ↠ CoIm
+Categorical algebra · Catlab.jl

Categorical algebra

Sets and Relations

The following APIs implement FinSet, the category of Finite Sets (actually the skeleton of FinSet). The objects of this category are natural numbers where n represents a set with n elements. The morphisms are functions between such sets. We use the skeleton of FinSet in order to ensure that all sets are finite and morphisms can be stored using lists of integers. Finite relations are built out of FinSet and can be used to do some relational algebra.

Catlab.CategoricalAlgebra.SetsModule

Category of (possibly infinite) sets and functions.

This module defines generic types for the category of sets (SetOb, SetFunction), as well as a few basic concrete types, such as a wrapper type to view Julia types as sets (TypeSet). Extensive support for finite sets is provided by another module, FinSets.

source
Catlab.CategoricalAlgebra.Sets.SetFunctionType

Abstract type for morphism in the category Set.

Every instance of SetFunction{<:SetOb{T},<:SetOb{T′}} is callable with elements of type T, returning an element of type T′.

Note: This type would be better called simply Function but that name is already taken by the base Julia type.

source
Catlab.CategoricalAlgebra.Sets.SetObType

Abstract type for object in the category Set.

The type parameter T is the element type of the set.

Note: This type is more abstract than the built-in Julia types AbstractSet and Set, which are intended for data structures for finite sets. Those are encompassed by the subtype FinSet.

source
AlgebraicInterfaces.ObMethod

Forgetful functor Ob: Cat → Set.

Sends a category to its set of objects and a functor to its object map.

source
Catlab.CategoricalAlgebra.FinSets.FinFunctionType

Function between finite sets.

The function can be defined implicitly by an arbitrary Julia function, in which case it is evaluated lazily, or explictly by a vector of integers. In the vector representation, the function (1↦1, 2↦3, 3↦2, 4↦3), for example, is represented by the vector [1,3,2,3].

FinFunctions can be constructed with or without an explicitly provided codomain. If a codomain is provided, by default the constructor checks it is valid.

This type is mildly generalized by FinDomFunction.

source
Catlab.CategoricalAlgebra.FinSets.FinSetType

Finite set.

A finite set has abstract type FinSet{S,T}. The second type parameter T is the element type of the set and the first parameter S is the collection type, which can be a subtype of AbstractSet or another Julia collection type. In addition, the skeleton of the category FinSet is the important special case S = Int. The set ${1,…,n}$ is represented by the object FinSet(n) of type FinSet{Int,Int}.

source
Catlab.CategoricalAlgebra.FinSets.TabularLimitType

Limit of finite sets viewed as a table.

Any limit of finite sets can be canonically viewed as a table (TabularSet) whose columns are the legs of the limit cone and whose rows correspond to elements of the limit object. To construct this table from an already computed limit, call TabularLimit(::AbstractLimit; ...). The column names of the table are given by the optional argument names.

In this tabular form, applying the universal property of the limit is trivial since it is just tupling. Thus, this representation can be useful when the original limit algorithm does not support efficient application of the universal property. On the other hand, this representation has the disadvantage of generally making the element type of the limit set more complicated.

source
Catlab.CategoricalAlgebra.FinSets.TabularSetType

Finite set whose elements are rows of a table.

The underlying table should be compliant with Tables.jl. For the sake of uniformity, the rows are provided as named tuples, which assumes that the table is not "extremely wide". This should not be a major limitation in practice but see the Tables.jl documentation for further discussion.

source
Catlab.CategoricalAlgebra.FinSets.VarFunctionType

Data type of a map out of a set of attribute variables

Currently, domains are FinSet{Int} and codomains are expected to be FinSet{Int}. This could be generalized to being FinSet{Symbol} to allow for symbolic attributes. (Likewise, AttrVars will have to wrap Any rather than Int)

source
Catlab.CategoricalAlgebra.FinRelations.FinRelationType

Binary relation between finite sets.

A morphism in the category of finite sets and relations. The relation can be represented implicitly by an arbitrary Julia function mapping pairs of elements to booleans or explicitly by a matrix (dense or sparse) taking values in the rig of booleans (BoolRig).

source

Free Diagrams, Limits, and Colimits

The following modules define free diagrams in an arbitrary category and specify limit and colimit cones over said diagrams. Thes constructions enjoy the fullest support for FinSet and are used below to define presheaf categories as C-Sets. The general idea of these functions is that you set up a limit computation by specifying a diagram and asking for a limit or colimit cone, which is returned as a struct containing the apex object and the leg morphisms. This cone structure can be queried using the functions apex and legs. Julia's multiple dispatch feature is heavily used to specialize limit and colimit computations for various diagram shapes like product/coproduct and equalizer/coequalizer. As a consumer of this API, it is highly recommended that you use multiple dispatch to specialize your code on the diagram shape whenever possible.

Catlab.CategoricalAlgebra.FreeDiagramsModule

Free diagrams in a category.

A free diagram in a category is a diagram whose shape is a free category. Examples include the empty diagram, pairs of objects, discrete diagrams, parallel pairs, composable pairs, and spans and cospans. Limits and colimits are most commonly taken over free diagrams.

source
Catlab.CategoricalAlgebra.FreeDiagrams.BipartiteFreeDiagramType

A free diagram with a bipartite structure.

Such diagrams include most of the fixed shapes, such as spans, cospans, and parallel morphisms. They are also the generic shape of diagrams for limits and colimits arising from undirected wiring diagrams. For limits, the boxes correspond to vertices in $V₁$ and the junctions to vertices in $V₂$. Colimits are dual.

source
Catlab.CategoricalAlgebra.FreeDiagrams.BipartiteFreeDiagramMethod

Convert a free diagram to a bipartite free diagram.

Reduce a free diagram to a free bipartite diagram with the same limit (the default, colimit=false) or the same colimit (colimit=true). The reduction is essentially the same in both cases, except for the choice of where to put isolated vertices, where we follow the conventions described at cone_objects and cocone_objects. The resulting object is a bipartite free diagram equipped with maps from the vertices of the bipartite diagram to the vertices of the original diagram.

source
Catlab.CategoricalAlgebra.FreeDiagrams.bundle_legsMethod

Bundle together legs of a multi(co)span.

For example, calling bundle_legs(span, SVector((1,2),(3,4))) on a multispan with four legs gives a span whose left leg bundles legs 1 and 2 and whose right leg bundles legs 3 and 4. Note that in addition to bundling, this function can also permute legs and discard them.

The bundling is performed using the universal property of (co)products, which assumes that these (co)limits exist.

source
Catlab.CategoricalAlgebra.FreeDiagrams.cone_objectsMethod

Objects in diagram that will have explicit legs in limit cone.

In category theory, it is common practice to elide legs of limit cones that can be computed from other legs, especially for diagrams of certain fixed shapes. For example, when it taking a pullback (the limit of a cospan), the limit object is often treated as having two projections, rather than three. This function encodes such conventions by listing the objects in the diagram that will have corresponding legs in the limit object created by Catlab.

See also: cocone_objects.

source
Catlab.CategoricalAlgebra.Limits.SpecializeLimitType

Meta-algorithm that reduces general limits to common special cases.

Reduces limits of free diagrams that happen to be discrete to products. If this fails, fall back to the given algorithm (if any).

TODO: Reduce free diagrams that are (multi)cospans to (wide) pullbacks.

source
Catlab.CategoricalAlgebra.Limits.colimitMethod

Colimit of a diagram.

To define colimits in a category with objects Ob, override the method colimit(::FreeDiagram{Ob}) for general colimits or colimit(::D) with suitable type D <: FixedShapeFreeDiagram{Ob} for colimits of specific shape, such as coproducts or coequalizers.

See also: limit

source
Catlab.CategoricalAlgebra.Limits.limitMethod

Limit of a diagram.

To define limits in a category with objects Ob, override the method limit(::FreeDiagram{Ob}) for general limits or limit(::D) with suitable type D <: FixedShapeFreeDiagram{Ob} for limits of specific shape, such as products or equalizers.

See also: colimit

source
Catlab.CategoricalAlgebra.Limits.pullbackMethod

Pullback of a pair of morphisms with common codomain.

To implement for a type T, define the method limit(::Cospan{T}) and/or limit(::Multicospan{T}) or, if you have already implemented products and equalizers, rely on the default implementation.

source
Catlab.CategoricalAlgebra.Limits.pushoutMethod

Pushout of a pair of morphisms with common domain.

To implement for a type T, define the method colimit(::Span{T}) and/or colimit(::Multispan{T}) or, if you have already implemented coproducts and coequalizers, rely on the default implementation.

source
Catlab.Theories.coequalizerMethod

Coequalizer of morphisms with common domain and codomain.

To implement for a type T, define the method colimit(::ParallelPair{T}) or colimit(::ParallelMorphisms{T}).

source
Catlab.Theories.copairMethod

Copairing of morphisms: universal property of coproducts/pushouts.

To implement for coproducts of type T, define the method universal(::BinaryCoproduct{T}, ::Cospan{T}) and/or universal(::Coproduct{T}, ::Multicospan{T}) and similarly for pushouts.

source
Catlab.Theories.coproductMethod

Coproduct of objects.

To implement for a type T, define the method colimit(::ObjectPair{T}) and/or colimit(::DiscreteDiagram{T}).

source
Catlab.Theories.createMethod

Unique morphism out of an initial object.

To implement for a type T, define the method universal(::Initial{T}, ::SMulticospan{0,T}).

source
Catlab.Theories.deleteMethod

Unique morphism into a terminal object.

To implement for a type T, define the method universal(::Terminal{T}, ::SMultispan{0,T}).

source
Catlab.Theories.equalizerMethod

Equalizer of morphisms with common domain and codomain.

To implement for a type T, define the method limit(::ParallelPair{T}) and/or limit(::ParallelMorphisms{T}).

source
Catlab.Theories.factorizeMethod

Factor morphism through (co)equalizer, via the universal property.

To implement for equalizers of type T, define the method universal(::Equalizer{T}, ::SMultispan{1,T}). For coequalizers of type T, define the method universal(::Coequalizer{T}, ::SMulticospan{1,T}).

source
Catlab.Theories.pairMethod

Pairing of morphisms: universal property of products/pullbacks.

To implement for products of type T, define the method universal(::BinaryProduct{T}, ::Span{T}) and/or universal(::Product{T}, ::Multispan{T}) and similarly for pullbacks.

source
Catlab.Theories.productMethod

Product of objects.

To implement for a type T, define the method limit(::ObjectPair{T}) and/or limit(::DiscreteDiagram{T}).

source

Categories

Catlab.CategoricalAlgebra.CategoriesModule

2-category of categories, functors, and natural transformations.

Categories in mathematics appear in the large, often as categories of sets with extra structure, and in the small, as algebraic structures that generalize groups, monoids, preorders, and graphs. This division manifests in Catlab as well. Large categories (in spirit, if not in the technical sense) occur throughout Catlab as @instances of the theory of categories. For computational reasons, small categories are usually presented by generators and relations.

This module provides a minimal interface to accomodate both situations. Category instances are supported through the wrapper type TypeCat. Finitely presented categories are provided by another module, FinCats.

source
Catlab.CategoricalAlgebra.Categories.CategoryType

Abstract base type for a category.

The objects and morphisms in the category have Julia types Ob and Hom, respectively. Note that these types do not necessarily form an @instance of the theory of categories, as they may not meaningfully form a category outside the context of this object. For example, a finite category regarded as a reflexive graph with a composition operation might have type Cat{Int,Int}, where the objects and morphisms are numerical identifiers for vertices and edges in the graph.

The basic operations available in any category are: dom, codom, id, compose.

source
Catlab.CategoricalAlgebra.Categories.FunctorType

Abstract base type for a functor between categories.

A functor has a domain and a codomain (dom and codom), which are categories, and object and morphism maps, which can be evaluated using ob_map and hom_map. The functor object can also be called directly when the objects and morphisms have distinct Julia types. This is sometimes but not always the case (see Category), so when writing generic code one should prefer the ob_map and hom_map functions.

source
Catlab.CategoricalAlgebra.Categories.TransformationType

Abstract base type for a natural transformation between functors.

A natural transformation $α: F ⇒ G$ has a domain $F$ and codomain $G$ (dom and codom), which are functors $F,G: C → D$ having the same domain $C$ and codomain $D$. The transformation consists of a component $αₓ: Fx → Gx$ in $D$ for each object $x ∈ C$, accessible using component or indexing notation (Base.getindex).

source
AlgebraicInterfaces.obFunction

Coerce or look up object in category.

Converts the input to an object in the category, which should be of type Ob in a category of type Cat{Ob,Hom}. How this works depends on the category, but a common case is to look up objects, which might be integers or GAT expressions, by their human-readable name, usually a symbol.

See also: hom.

source
GATlab.Stdlib.StdModels.opMethod

Oppositization 2-functor.

The oppositization endo-2-functor on Cat, sending a category to its opposite, is covariant on objects and morphisms and contravariant on 2-morphisms, i.e., is a 2-functor $op: Catᶜᵒ → Cat$. For more explanation, see the nLab.

source
Catlab.CategoricalAlgebra.FinCatsModule

2-category of finitely presented categories.

This module is for the 2-category Cat what the module FinSets is for the category Set: a finitary, combinatorial setting where explicit calculations can be carried out. We emphasize that the prefix Fin means "finitely presented," not "finite," as finite categories are too restrictive a notion for many purposes. For example, the free category on a graph is finite if and only if the graph is DAG, which is a fairly special condition. This usage of Fin is also consistent with FinSet because for sets, being finite and being finitely presented are equivalent.

source
Catlab.CategoricalAlgebra.FinCats.FinCatGraphEqType

Category presented by a finite graph together with path equations.

The objects of the category are vertices in the graph and the morphisms are paths, quotiented by the congruence relation generated by the path equations. See (Spivak, 2014, Category theory for the sciences, §4.5).

source
Catlab.CategoricalAlgebra.FinCats.FinCatPresentationType

Category defined by a Presentation object.

The presentation type can, of course, be a category (Theories.Category). It can also be a schema (Theories.Schema). In this case, the schema's objects and attribute types are regarded as the category's objects and the schema's morphisms, attributes, and attribute types as the category's morphisms (where the attribute types are identity morphisms). When the schema is formalized as a profunctor whose codomain category is discrete, this amounts to taking the collage of the profunctor.

source
Catlab.CategoricalAlgebra.FinCats.FinTransformationType

A natural transformation whose domain category is finitely generated.

This type is for natural transformations $α: F ⇒ G: C → D$ such that the domain category $C$ is finitely generated. Such a natural transformation is given by a finite amount of data (one morphism in $D$ for each generating object of $C$) and its naturality is verified by finitely many equations (one equation for each generating morphism of $C$).

source
Catlab.CategoricalAlgebra.FinCats.forceFunction

Force evaluation of lazily defined function or functor. The resulting obmap and hommap are guaranteed to have valtype or eltype, as appropriate, equal to Ob and Hom, respectively.

source
Catlab.CategoricalAlgebra.FinCats.hom_generatorFunction

Coerce or look up morphism generator in a finitely presented category.

Since morphism generators often have a different data type than morphisms (e.g., in a free category on a graph, the morphism generators are edges and the morphisms are paths), the return type of this function is generally different than that of hom.

source
Catlab.CategoricalAlgebra.FinCats.is_functorialMethod

Is the purported functor on a presented category functorial?

This function checks that functor preserves domains and codomains. When check_equations is true (the default is false), it also purports to check that the functor preserves all equations in the domain category. No nontrivial checks are currently implemented, so this only functions for identity functors.

See also: `functoriality_failures' and is_natural.

source
Catlab.CategoricalAlgebra.FinCats.is_initialMethod

Dual to a final functor, an initial functor is one for which pulling back diagrams along it does not change the limits of these diagrams.

This amounts to checking, for a functor C->D, that, for every object d in Ob(D), the comma category (F/d) is connected.

source
Catlab.CategoricalAlgebra.FinCats.is_naturalMethod

Is the transformation between FinDomFunctors a natural transformation?

This function uses the fact that to check whether a transformation is natural, it suffices to check the naturality equations on a generating set of morphisms of the domain category. In some cases, checking the equations may be expensive or impossible. When the keyword argument check_equations is false, only the domains and codomains of the components are checked.

See also: is_functorial.

source
Catlab.CategoricalAlgebra.FinCats.make_mapMethod

Maps f over a UnitRange to produce a Vector, or else over anything to produce a Dict. The type paramter functions to ensure the return type is as desired even when the input is empty.

source
Catlab.CategoricalAlgebra.FinCats.ob_generatorFunction

Coerce or look up object generator in a finitely presented category.

Because object generators usually coincide with objects, the default method for ob in finitely presented categories simply calls this function.

source
Catlab.CategoricalAlgebra.FinCats.ob_generatorsFunction

Object generators of finitely presented category.

The object generators of finite presented category are almost always the same as the objects. In principle, however, it is possible to have equations between objects, so that there are fewer objects than object generators.

source

Acsets

Overview and Theory

For an in depth look into the theory behind acsets, we refer the reader to our paper on the subject, which also gives some sense as to how the implementation works. Here, we give a brief tutorial before the the API documentation.

The most essential part of the acset machinery is the schema. The schema parameterizes the acset: each schema corresponds to a different type of acset. Schemas consist of four parts.

  • Objects $X,Y$ ((X,Y,Z)::Ob)
  • Homomorphisms $f \colon X \to Y$ (f :: Hom(X,Y)), which go from objects to objects
  • Attribute types $\mathtt{T}$ (T :: AttrType)
  • Attributes $a \colon X \to \mathtt{T}$ (a :: Attr(X,T)), which go from objects to data types

For those with a categorical background, a schema is a presentation of a category $|S|$ along with a functor $S$ from $|S|$ to the arrow category $0 \to 1$, such that $S^{-1}(1)$ is discrete.

An acset $F$ on a schema consists of...

  • a set $F(X)$ of "primary keys" for each object
  • a function $F(f) \colon F(X) \to F(Y)$ for each morphism
  • a Julia data type $F(\mathtt{T})$ for each data type $\mathtt{T}$
  • a function $F(a) \colon F(X) \to F(\mathtt{T})$ for each attribute $a$.

For those with a categorical background, an acset on a schema $S$ consists of a functor from $S$ to $\mathsf{Set}$, such that objects in $S^{-1}(0)$ map to finite sets, and objects in $S^{-1}(1)$ map to sets that represent types. For any particular functor $K \colon S^{-1}(1) \to \mathsf{Set}$, we can also take the category of acsets that restrict to this map on $S^{-1}$.

We can also add equations to this presentation, but we currently do nothing with those equations in the implementation; they mostly serve as documentation.

We will now give an example of how this all works in practice.

using GATlab, Catlab.CategoricalAlgebra
+    R ╌╌> Im′
source
Catlab.CategoricalAlgebra.Limits.limitMethod

Limit of a diagram.

To define limits in a category with objects Ob, override the method limit(::FreeDiagram{Ob}) for general limits or limit(::D) with suitable type D <: FixedShapeFreeDiagram{Ob} for limits of specific shape, such as products or equalizers.

See also: colimit

source
Catlab.CategoricalAlgebra.Limits.pullbackMethod

Pullback of a pair of morphisms with common codomain.

To implement for a type T, define the method limit(::Cospan{T}) and/or limit(::Multicospan{T}) or, if you have already implemented products and equalizers, rely on the default implementation.

source
Catlab.CategoricalAlgebra.Limits.pushoutMethod

Pushout of a pair of morphisms with common domain.

To implement for a type T, define the method colimit(::Span{T}) and/or colimit(::Multispan{T}) or, if you have already implemented coproducts and coequalizers, rely on the default implementation.

source
Catlab.Theories.coequalizerMethod

Coequalizer of morphisms with common domain and codomain.

To implement for a type T, define the method colimit(::ParallelPair{T}) or colimit(::ParallelMorphisms{T}).

source
Catlab.Theories.copairMethod

Copairing of morphisms: universal property of coproducts/pushouts.

To implement for coproducts of type T, define the method universal(::BinaryCoproduct{T}, ::Cospan{T}) and/or universal(::Coproduct{T}, ::Multicospan{T}) and similarly for pushouts.

source
Catlab.Theories.coproductMethod

Coproduct of objects.

To implement for a type T, define the method colimit(::ObjectPair{T}) and/or colimit(::DiscreteDiagram{T}).

source
Catlab.Theories.createMethod

Unique morphism out of an initial object.

To implement for a type T, define the method universal(::Initial{T}, ::SMulticospan{0,T}).

source
Catlab.Theories.deleteMethod

Unique morphism into a terminal object.

To implement for a type T, define the method universal(::Terminal{T}, ::SMultispan{0,T}).

source
Catlab.Theories.equalizerMethod

Equalizer of morphisms with common domain and codomain.

To implement for a type T, define the method limit(::ParallelPair{T}) and/or limit(::ParallelMorphisms{T}).

source
Catlab.Theories.factorizeMethod

Factor morphism through (co)equalizer, via the universal property.

To implement for equalizers of type T, define the method universal(::Equalizer{T}, ::SMultispan{1,T}). For coequalizers of type T, define the method universal(::Coequalizer{T}, ::SMulticospan{1,T}).

source
Catlab.Theories.pairMethod

Pairing of morphisms: universal property of products/pullbacks.

To implement for products of type T, define the method universal(::BinaryProduct{T}, ::Span{T}) and/or universal(::Product{T}, ::Multispan{T}) and similarly for pullbacks.

source
Catlab.Theories.productMethod

Product of objects.

To implement for a type T, define the method limit(::ObjectPair{T}) and/or limit(::DiscreteDiagram{T}).

source

Categories

Catlab.CategoricalAlgebra.CategoriesModule

2-category of categories, functors, and natural transformations.

Categories in mathematics appear in the large, often as categories of sets with extra structure, and in the small, as algebraic structures that generalize groups, monoids, preorders, and graphs. This division manifests in Catlab as well. Large categories (in spirit, if not in the technical sense) occur throughout Catlab as @instances of the theory of categories. For computational reasons, small categories are usually presented by generators and relations.

This module provides a minimal interface to accomodate both situations. Category instances are supported through the wrapper type TypeCat. Finitely presented categories are provided by another module, FinCats.

source
Catlab.CategoricalAlgebra.Categories.CategoryType

Abstract base type for a category.

The objects and morphisms in the category have Julia types Ob and Hom, respectively. Note that these types do not necessarily form an @instance of the theory of categories, as they may not meaningfully form a category outside the context of this object. For example, a finite category regarded as a reflexive graph with a composition operation might have type Cat{Int,Int}, where the objects and morphisms are numerical identifiers for vertices and edges in the graph.

The basic operations available in any category are: dom, codom, id, compose.

source
Catlab.CategoricalAlgebra.Categories.FunctorType

Abstract base type for a functor between categories.

A functor has a domain and a codomain (dom and codom), which are categories, and object and morphism maps, which can be evaluated using ob_map and hom_map. The functor object can also be called directly when the objects and morphisms have distinct Julia types. This is sometimes but not always the case (see Category), so when writing generic code one should prefer the ob_map and hom_map functions.

source
Catlab.CategoricalAlgebra.Categories.TransformationType

Abstract base type for a natural transformation between functors.

A natural transformation $α: F ⇒ G$ has a domain $F$ and codomain $G$ (dom and codom), which are functors $F,G: C → D$ having the same domain $C$ and codomain $D$. The transformation consists of a component $αₓ: Fx → Gx$ in $D$ for each object $x ∈ C$, accessible using component or indexing notation (Base.getindex).

source
AlgebraicInterfaces.obFunction

Coerce or look up object in category.

Converts the input to an object in the category, which should be of type Ob in a category of type Cat{Ob,Hom}. How this works depends on the category, but a common case is to look up objects, which might be integers or GAT expressions, by their human-readable name, usually a symbol.

See also: hom.

source
GATlab.Stdlib.StdModels.opMethod

Oppositization 2-functor.

The oppositization endo-2-functor on Cat, sending a category to its opposite, is covariant on objects and morphisms and contravariant on 2-morphisms, i.e., is a 2-functor $op: Catᶜᵒ → Cat$. For more explanation, see the nLab.

source
Catlab.CategoricalAlgebra.FinCatsModule

2-category of finitely presented categories.

This module is for the 2-category Cat what the module FinSets is for the category Set: a finitary, combinatorial setting where explicit calculations can be carried out. We emphasize that the prefix Fin means "finitely presented," not "finite," as finite categories are too restrictive a notion for many purposes. For example, the free category on a graph is finite if and only if the graph is DAG, which is a fairly special condition. This usage of Fin is also consistent with FinSet because for sets, being finite and being finitely presented are equivalent.

source
Catlab.CategoricalAlgebra.FinCats.FinCatGraphEqType

Category presented by a finite graph together with path equations.

The objects of the category are vertices in the graph and the morphisms are paths, quotiented by the congruence relation generated by the path equations. See (Spivak, 2014, Category theory for the sciences, §4.5).

source
Catlab.CategoricalAlgebra.FinCats.FinCatPresentationType

Category defined by a Presentation object.

The presentation type can, of course, be a category (Theories.Category). It can also be a schema (Theories.Schema). In this case, the schema's objects and attribute types are regarded as the category's objects and the schema's morphisms, attributes, and attribute types as the category's morphisms (where the attribute types are identity morphisms). When the schema is formalized as a profunctor whose codomain category is discrete, this amounts to taking the collage of the profunctor.

source
Catlab.CategoricalAlgebra.FinCats.FinTransformationType

A natural transformation whose domain category is finitely generated.

This type is for natural transformations $α: F ⇒ G: C → D$ such that the domain category $C$ is finitely generated. Such a natural transformation is given by a finite amount of data (one morphism in $D$ for each generating object of $C$) and its naturality is verified by finitely many equations (one equation for each generating morphism of $C$).

source
Catlab.CategoricalAlgebra.FinCats.forceFunction

Force evaluation of lazily defined function or functor. The resulting obmap and hommap are guaranteed to have valtype or eltype, as appropriate, equal to Ob and Hom, respectively.

source
Catlab.CategoricalAlgebra.FinCats.hom_generatorFunction

Coerce or look up morphism generator in a finitely presented category.

Since morphism generators often have a different data type than morphisms (e.g., in a free category on a graph, the morphism generators are edges and the morphisms are paths), the return type of this function is generally different than that of hom.

source
Catlab.CategoricalAlgebra.FinCats.is_functorialMethod

Is the purported functor on a presented category functorial?

This function checks that functor preserves domains and codomains. When check_equations is true (the default is false), it also purports to check that the functor preserves all equations in the domain category. No nontrivial checks are currently implemented, so this only functions for identity functors.

See also: `functoriality_failures' and is_natural.

source
Catlab.CategoricalAlgebra.FinCats.is_initialMethod

Dual to a final functor, an initial functor is one for which pulling back diagrams along it does not change the limits of these diagrams.

This amounts to checking, for a functor C->D, that, for every object d in Ob(D), the comma category (F/d) is connected.

source
Catlab.CategoricalAlgebra.FinCats.is_naturalMethod

Is the transformation between FinDomFunctors a natural transformation?

This function uses the fact that to check whether a transformation is natural, it suffices to check the naturality equations on a generating set of morphisms of the domain category. In some cases, checking the equations may be expensive or impossible. When the keyword argument check_equations is false, only the domains and codomains of the components are checked.

See also: is_functorial.

source
Catlab.CategoricalAlgebra.FinCats.make_mapMethod

Maps f over a UnitRange to produce a Vector, or else over anything to produce a Dict. The type paramter functions to ensure the return type is as desired even when the input is empty.

source
Catlab.CategoricalAlgebra.FinCats.ob_generatorFunction

Coerce or look up object generator in a finitely presented category.

Because object generators usually coincide with objects, the default method for ob in finitely presented categories simply calls this function.

source
Catlab.CategoricalAlgebra.FinCats.ob_generatorsFunction

Object generators of finitely presented category.

The object generators of finite presented category are almost always the same as the objects. In principle, however, it is possible to have equations between objects, so that there are fewer objects than object generators.

source

Acsets

Overview and Theory

For an in depth look into the theory behind acsets, we refer the reader to our paper on the subject, which also gives some sense as to how the implementation works. Here, we give a brief tutorial before the the API documentation.

The most essential part of the acset machinery is the schema. The schema parameterizes the acset: each schema corresponds to a different type of acset. Schemas consist of four parts.

  • Objects $X,Y$ ((X,Y,Z)::Ob)
  • Homomorphisms $f \colon X \to Y$ (f :: Hom(X,Y)), which go from objects to objects
  • Attribute types $\mathtt{T}$ (T :: AttrType)
  • Attributes $a \colon X \to \mathtt{T}$ (a :: Attr(X,T)), which go from objects to data types

For those with a categorical background, a schema is a presentation of a category $|S|$ along with a functor $S$ from $|S|$ to the arrow category $0 \to 1$, such that $S^{-1}(1)$ is discrete.

An acset $F$ on a schema consists of...

  • a set $F(X)$ of "primary keys" for each object
  • a function $F(f) \colon F(X) \to F(Y)$ for each morphism
  • a Julia data type $F(\mathtt{T})$ for each data type $\mathtt{T}$
  • a function $F(a) \colon F(X) \to F(\mathtt{T})$ for each attribute $a$.

For those with a categorical background, an acset on a schema $S$ consists of a functor from $S$ to $\mathsf{Set}$, such that objects in $S^{-1}(0)$ map to finite sets, and objects in $S^{-1}(1)$ map to sets that represent types. For any particular functor $K \colon S^{-1}(1) \to \mathsf{Set}$, we can also take the category of acsets that restrict to this map on $S^{-1}$.

We can also add equations to this presentation, but we currently do nothing with those equations in the implementation; they mostly serve as documentation.

We will now give an example of how this all works in practice.

using GATlab, Catlab.CategoricalAlgebra
 
 # Write down the schema for a weighted graph
 @present SchWeightedGraph(FreeSchema) begin
@@ -76,8 +76,8 @@
 

API

The mathematical abstraction of an acset can of course be implemented in many different ways. Currently, there are three implementations of acsets in Catlab, which share a great deal of code.

These implementations can be split into two categories.

The first category is static acset types. In this implementation, different schemas correspond to different Julia types. Methods on these Julia types are then custom-generated for the schema, using CompTime.jl.

Under this category, there are two classes of static acset types. The first class is acset types that are generated using the @acset_type macro. These acset types are custom-derived structs. The advantage of this is that the structs have names like Graph or WiringDiagram that are printed out in error messages. The disadvantage is that if you are taking in schemas at runtime, you have to eval code in order to use them.

Here is an example of using @acset_type

@acset_type WeightedGraph(SchWeightedGraph, index=[:src,:tgt])
 g = WeightedGraph()

The second class is AnonACSets. Like acset types derived from @acset_type, these contain the schema in their type. However, they also contain the type of their fields in their types, so the types printed out in error messages are long and ugly. The advantage of these is that they can be used in situations where the schema is passed in at runtime, and they don't require using eval to create a new acset type.

Here is an example of using AnonACSet

const WeightedGraph = AnonACSetType(SchWeightedGraph, index=[:src,:tgt])
-g = WeightedGraph()

The second category is dynamic acset types. Currently, there is just one type that falls under this category: DynamicACSet. This type has a field for the schema, and no code-generation is done for operations on acsets of this type. This means that if the schema is large compared to the data, this type will often be faster than the static acsets.

However, dynamics acsets are a new addition to Catlab, and much of the machinery of limits, colimits, and other high-level acset constructions assumes that the schema of an acset can be derived from the type. Thus, more work will have to be done before dynamic acsets become a drop-in replacement for static acsets.

Here is an example of using a dynamic acset

g = DynamicACSet("WeightedGraph", SchWeightedGraph; index=[:src,:tgt])
Catlab.CategoricalAlgebra.CSets.ACSetTransformationType

Transformation between attributed C-sets.

Homomorphisms of attributed C-sets generalize homomorphisms of C-sets (CSetTransformation), which you should understand before reading this.

A homomorphism of attributed C-sets with schema S: C ↛ A (a profunctor) is a natural transformation between the corresponding functors col(S) → Set, where col(S) is the collage of S. When the components on attribute types, indexed by objects of A, are all identity functions, the morphism is called tight; in general, it is called loose. With this terminology, acsets on a fixed schema are the objects of an ℳ-category (see Catlab.Theories.MCategory). Calling ACSetTransformation will construct a tight or loose morphism as appropriate, depending on which components are specified.

Since every tight morphism can be considered a loose one, the distinction between tight and loose may seem a minor technicality, but it has important consequences because limits and colimits in a category depend as much on the morphisms as on the objects. In particular, limits and colimits of acsets differ greatly depending on whether they are taken in the category of acsets with tight morphisms or with loose morphisms. Tight morphisms suffice for many purposes, including most applications of colimits. However, when computing limits of acsets, loose morphisms are usually preferable. For more information about limits and colimits in these categories, see TightACSetTransformation and LooseACSetTransformation.

source
Catlab.CategoricalAlgebra.CSets.CSetTransformationType

Transformation between C-sets.

Recall that a C-set homomorphism is a natural transformation: a transformation between functors C → Set satisfying the naturality axiom for every morphism, or equivalently every generating morphism, in C.

This data type records the data of a C-set transformation. Naturality is not strictly enforced but is expected to be satisfied. It can be checked using the function is_natural.

If the schema of the dom and codom has attributes, this has the semantics of being a valid C-set transformation on the combinatorial data alone (including attribute variables, if any).

source
Catlab.CategoricalAlgebra.CSets.LooseACSetTransformationType

Loose transformation between attributed C-sets.

Limits and colimits in the category of attributed C-sets and loose homomorphisms are computed pointwise on both objects and attribute types. This implies that (co)limits of Julia types must be computed. Due to limitations in the expressivity of Julia's type system, only certain simple kinds of (co)limits, such as products, are supported.

Alternatively, colimits involving loose acset transformations can be constructed with respect to explicitly given attribute type components for the legs of the cocone, via the keyword argument type_components to colimit and related functions. This uses the universal property of the colimit. To see how this works, notice that a diagram of acsets and loose acset transformations can be expressed as a diagram D: J → C-Set (for the C-sets) along with another diagram A: J → C-Set (for the attribute sets) and a natural transformation α: D ⇒ A (assigning attributes). Given a natural transformation τ: A ⇒ ΔB to a constant functor ΔB, with components given by type_components, the composite transformation α⋅τ: D ⇒ ΔB is a cocone under D, hence factors through the colimit cocone of D. This factoring yields an assigment of attributes to the colimit in C-Set.

For the distinction between tight and loose, see ACSetTranformation.

source
Catlab.CategoricalAlgebra.CSets.TightACSetTransformationType

Tight transformation between attributed C-sets.

The category of attributed C-sets and tight homomorphisms is isomorphic to a slice category of C-Set, as explained in our paper "Categorical Data Structures for Technical Computing". Colimits in this category thus reduce to colimits of C-sets, by a standard result about slice categories. Limits are more complicated and are currently not supported.

For the distinction between tight and loose, see ACSetTranformation.

source
Catlab.CategoricalAlgebra.CSets.naturality_failuresMethod

Returns a dictionary whose keys are contained in the names in arrows(S) and whose value at :f, for an arrow (f,c,d), is a lazy iterator over the elements of X(c) on which α's naturality square for f does not commute. Components should be a NamedTuple or Dictionary with keys contained in the names of S's morphisms and values vectors or dicts defining partial functions from X(c) to Y(c).

only_combinatorial=true means to only look for naturality failures in combinatorial data.

source
Catlab.CategoricalAlgebra.FinCats.is_naturalMethod

Check naturality condition for a purported ACSetTransformation, α: X→Y. For each hom in the schema, e.g. h: m → n, the following square commute must:

     αₘ
+g = WeightedGraph()

The second category is dynamic acset types. Currently, there is just one type that falls under this category: DynamicACSet. This type has a field for the schema, and no code-generation is done for operations on acsets of this type. This means that if the schema is large compared to the data, this type will often be faster than the static acsets.

However, dynamics acsets are a new addition to Catlab, and much of the machinery of limits, colimits, and other high-level acset constructions assumes that the schema of an acset can be derived from the type. Thus, more work will have to be done before dynamic acsets become a drop-in replacement for static acsets.

Here is an example of using a dynamic acset

g = DynamicACSet("WeightedGraph", SchWeightedGraph; index=[:src,:tgt])
Catlab.CategoricalAlgebra.CSets.ACSetTransformationType

Transformation between attributed C-sets.

Homomorphisms of attributed C-sets generalize homomorphisms of C-sets (CSetTransformation), which you should understand before reading this.

A homomorphism of attributed C-sets with schema S: C ↛ A (a profunctor) is a natural transformation between the corresponding functors col(S) → Set, where col(S) is the collage of S. When the components on attribute types, indexed by objects of A, are all identity functions, the morphism is called tight; in general, it is called loose. With this terminology, acsets on a fixed schema are the objects of an ℳ-category (see Catlab.Theories.MCategory). Calling ACSetTransformation will construct a tight or loose morphism as appropriate, depending on which components are specified.

Since every tight morphism can be considered a loose one, the distinction between tight and loose may seem a minor technicality, but it has important consequences because limits and colimits in a category depend as much on the morphisms as on the objects. In particular, limits and colimits of acsets differ greatly depending on whether they are taken in the category of acsets with tight morphisms or with loose morphisms. Tight morphisms suffice for many purposes, including most applications of colimits. However, when computing limits of acsets, loose morphisms are usually preferable. For more information about limits and colimits in these categories, see TightACSetTransformation and LooseACSetTransformation.

source
Catlab.CategoricalAlgebra.CSets.CSetTransformationType

Transformation between C-sets.

Recall that a C-set homomorphism is a natural transformation: a transformation between functors C → Set satisfying the naturality axiom for every morphism, or equivalently every generating morphism, in C.

This data type records the data of a C-set transformation. Naturality is not strictly enforced but is expected to be satisfied. It can be checked using the function is_natural.

If the schema of the dom and codom has attributes, this has the semantics of being a valid C-set transformation on the combinatorial data alone (including attribute variables, if any).

source
Catlab.CategoricalAlgebra.CSets.LooseACSetTransformationType

Loose transformation between attributed C-sets.

Limits and colimits in the category of attributed C-sets and loose homomorphisms are computed pointwise on both objects and attribute types. This implies that (co)limits of Julia types must be computed. Due to limitations in the expressivity of Julia's type system, only certain simple kinds of (co)limits, such as products, are supported.

Alternatively, colimits involving loose acset transformations can be constructed with respect to explicitly given attribute type components for the legs of the cocone, via the keyword argument type_components to colimit and related functions. This uses the universal property of the colimit. To see how this works, notice that a diagram of acsets and loose acset transformations can be expressed as a diagram D: J → C-Set (for the C-sets) along with another diagram A: J → C-Set (for the attribute sets) and a natural transformation α: D ⇒ A (assigning attributes). Given a natural transformation τ: A ⇒ ΔB to a constant functor ΔB, with components given by type_components, the composite transformation α⋅τ: D ⇒ ΔB is a cocone under D, hence factors through the colimit cocone of D. This factoring yields an assigment of attributes to the colimit in C-Set.

For the distinction between tight and loose, see ACSetTranformation.

source
Catlab.CategoricalAlgebra.CSets.TightACSetTransformationType

Tight transformation between attributed C-sets.

The category of attributed C-sets and tight homomorphisms is isomorphic to a slice category of C-Set, as explained in our paper "Categorical Data Structures for Technical Computing". Colimits in this category thus reduce to colimits of C-sets, by a standard result about slice categories. Limits are more complicated and are currently not supported.

For the distinction between tight and loose, see ACSetTranformation.

source
Catlab.CategoricalAlgebra.CSets.naturality_failuresMethod

Returns a dictionary whose keys are contained in the names in arrows(S) and whose value at :f, for an arrow (f,c,d), is a lazy iterator over the elements of X(c) on which α's naturality square for f does not commute. Components should be a NamedTuple or Dictionary with keys contained in the names of S's morphisms and values vectors or dicts defining partial functions from X(c) to Y(c).

only_combinatorial=true means to only look for naturality failures in combinatorial data.

source
Catlab.CategoricalAlgebra.FinCats.is_naturalMethod

Check naturality condition for a purported ACSetTransformation, α: X→Y. For each hom in the schema, e.g. h: m → n, the following square commute must:

     αₘ
   Xₘ --> Yₘ
 Xₕ ↓  ✓  ↓ Yₕ
   Xₙ --> Yₙ
-     αₙ

You're allowed to run this on a named tuple partly specifying an ACSetTransformation, though at this time the domain and codomain must be fully specified ACSets.

only_combinatorial=true means to only test naturality in combinatorial data

source
Catlab.CategoricalAlgebra.FunctorialDataMigrations.internal_homMethod

Objects: Fᴳ(c) = C-Set(C × G, F) where C is the representable c

Given a map f: a->b, we compute that f(Aᵢ) = Bⱼ by constructing the following: Aᵢ A × G → F f*↑ ↑ ↑ ↗ Bⱼ find the hom Bⱼ that makes this commute B × G

where f* is given by yoneda.

source
Catlab.CategoricalAlgebra.FunctorialDataMigrations.representableMethod

Construct a representable C-set.

Recall that a representable C-set is one of form $C(c,-): C → Set$ for some object $c ∈ C$.

This function computes the $c$ representable as the left pushforward data migration of the singleton ${c}$-set along the inclusion functor ${c} ↪ C$, which works because left Kan extensions take representables to representables (Mac Lane 1978, Exercise X.3.2). Besides the intrinsic difficulties with representables (they can be infinite), this function thus inherits any limitations of our implementation of left pushforward data migrations.

source
Catlab.CategoricalAlgebra.FunctorialDataMigrations.subobject_classifierMethod

The subobject classifier Ω in a presheaf topos is the presheaf that sends each object A to the set of sieves on it (equivalently, the set of subobjects of the representable presheaf for A). Counting subobjects gives us the number of A parts; the hom data for f:A->B for subobject Aᵢ is determined via:

Aᵢ ↪ A ↑ ↑ f* PB⌝↪ B (PB picks out a subobject of B, up to isomorphism.)

(where A and B are the representables for objects A and B and f* is the unique map from B into the A which sends the point of B to f applied to the point of A)

Returns the classifier as well as a dictionary of subobjects corresponding to the parts of the classifier.

source
Catlab.CategoricalAlgebra.FunctorialDataMigrations.yonedaMethod

Compute the Yoneda embedding of a category C in the category of C-sets.

Because Catlab privileges copresheaves (C-sets) over presheaves, this is the contravariant Yoneda embedding, i.e., the embedding functor C^op → C-Set.

The first argument cons is a constructor for the ACSet, such as a struct acset type. If representables have already been computed (which can be expensive), they can be supplied via the cache keyword argument.

Returns a FinDomFunctor with domain op(C).

source
Catlab.CategoricalAlgebra.ChaseModule

The chase is an algorithm which subjects a C-Set instance to constraints expressed in the language of regular logic, called embedded dependencies (EDs, or 'triggers').

A morphism S->T, encodes an embedded dependency. If the pattern S is matched (via a homomorphism S->I), we demand there exist a morphism T->I (for some database instance I) that makes the triangle commute in order to satisfy the dependency (if this is not the case, then the trigger is 'active').

Homomorphisms can merge elements and introduce new ones. The former kind are called "equality generating dependencies" (EGDs) and the latter "tuple generating dependencies" (TGDs). Any homomorphism can be factored into EGD and TGD components by, respectively, restricting the codomain to the image or restricting the domain to the coimage.

source
Catlab.CategoricalAlgebra.Chase.chaseMethod
chase(I::ACSet, Σ::AbstractDict, n::Int)

Chase a C-Set or C-Rel instance given a list of embedded dependencies. This may not terminate, so a bound n on the number of iterations is required.

[,]

ΣS ⟶ Iₙ ⊕↓ ⋮ (resulting morphism) ΣT ... Iₙ₊₁

There is a copy of S and T for each active trigger. A trigger is a map from S into the current instance. What makes it 'active' is that there is no morphism from T to I that makes the triangle commute.

Each iteration constructs the above pushout square. The result is a morphism, so that one can keep track of the provenance of elements in the original CSet instance within the chased result.

Whether or not the result is due to success or timeout is returned as a boolean flag.

TODO: this algorithm could be made more efficient by homomorphism caching.

source
Catlab.CategoricalAlgebra.StructuredCospans.StructuredCospanType

Structured cospan.

The first type parameter L encodes a functor L: A → X from the base category A, often FinSet, to a category X with "extra structure." An L-structured cospan is then a cospan in X whose feet are images under L of objects in A. The category X is assumed to have pushouts.

Structured cospans form a double category with no further assumptions on the functor L. To obtain a symmetric monoidal double category, L must preserve finite coproducts. In practice, L usually has a right adjoint R: X → A, which implies that L preserves all finite colimits. It also allows structured cospans to be constructed more conveniently from an object x in X plus a cospan in A with apex R(x).

See also: StructuredMulticospan.

source
Catlab.CategoricalAlgebra.StructuredCospans.OpenACSetTypesMethod

Create types for open attributed C-sets from an attributed C-set type.

The type parameters of the given acset type should not be instantiated with specific Julia types. This function returns a pair of types, one for objects, a subtype of StructuredCospanOb, and one for morphisms, a subtype of StructuredMulticospan. Both types will have the same type parameters for attribute types as the given acset type.

Mathematically speaking, this function sets up structured (multi)cospans with a functor $L: A → X$ between categories of acsets that creates "discrete acsets." Such a "discrete acset functor" is a functor that is left adjoint to a certain kind of forgetful functor between categories of acsets, namely one that is a pullback along an inclusion of schemas such that the image of inclusion has no outgoing arrows. For example, the schema inclusion ${V} ↪ {E ⇉ V}$ has this property but ${E} ↪ {E ⇉ V}$ does not.

See also: OpenCSetTypes.

source
+ αₙ

You're allowed to run this on a named tuple partly specifying an ACSetTransformation, though at this time the domain and codomain must be fully specified ACSets.

only_combinatorial=true means to only test naturality in combinatorial data

source
Catlab.CategoricalAlgebra.FunctorialDataMigrationsModule

Functorial data migration for attributed C-sets.

source
Catlab.CategoricalAlgebra.FunctorialDataMigrations.DataMigrationFunctorType

Data migration functor given contravariantly. Stores a contravariant migration.

source
Catlab.CategoricalAlgebra.FunctorialDataMigrations.internal_homMethod

Objects: Fᴳ(c) = C-Set(C × G, F) where C is the representable c

Given a map f: a->b, we compute that f(Aᵢ) = Bⱼ by constructing the following: Aᵢ A × G → F f*↑ ↑ ↑ ↗ Bⱼ find the hom Bⱼ that makes this commute B × G

where f* is given by yoneda.

source
Catlab.CategoricalAlgebra.FunctorialDataMigrations.migrate!Method

Contravariantly migrate data from the acset Y to the acset X.

This is the mutating variant of migrate!. When the functor on schemas is the identity, this operation is equivalent to copy_parts!.

source
Catlab.CategoricalAlgebra.FunctorialDataMigrations.migrateMethod

Apply a $Δ$ migration by simple precomposition.

source
Catlab.CategoricalAlgebra.FunctorialDataMigrations.migrateMethod

Contravariantly migrate data from the acset Y to a new acset of type T.

The mutating variant of this function is migrate!.

source
Catlab.CategoricalAlgebra.FunctorialDataMigrations.representableMethod

Construct a representable C-set.

Recall that a representable C-set is one of form $C(c,-): C → Set$ for some object $c ∈ C$.

This function computes the $c$ representable as the left pushforward data migration of the singleton ${c}$-set along the inclusion functor ${c} ↪ C$, which works because left Kan extensions take representables to representables (Mac Lane 1978, Exercise X.3.2). Besides the intrinsic difficulties with representables (they can be infinite), this function thus inherits any limitations of our implementation of left pushforward data migrations.

source
Catlab.CategoricalAlgebra.FunctorialDataMigrations.representableMethod

ACSet types do not store info about equations, so this info is lost when we try to recover the presentation from the datatype. Thus, this method for representable should only be used for free schemas

source
Catlab.CategoricalAlgebra.FunctorialDataMigrations.subobject_classifierMethod

The subobject classifier Ω in a presheaf topos is the presheaf that sends each object A to the set of sieves on it (equivalently, the set of subobjects of the representable presheaf for A). Counting subobjects gives us the number of A parts; the hom data for f:A->B for subobject Aᵢ is determined via:

Aᵢ ↪ A ↑ ↑ f* PB⌝↪ B (PB picks out a subobject of B, up to isomorphism.)

(where A and B are the representables for objects A and B and f* is the unique map from B into the A which sends the point of B to f applied to the point of A)

Returns the classifier as well as a dictionary of subobjects corresponding to the parts of the classifier.

source
Catlab.CategoricalAlgebra.FunctorialDataMigrations.yonedaMethod

Compute the Yoneda embedding of a category C in the category of C-sets.

Because Catlab privileges copresheaves (C-sets) over presheaves, this is the contravariant Yoneda embedding, i.e., the embedding functor C^op → C-Set.

The first argument cons is a constructor for the ACSet, such as a struct acset type. If representables have already been computed (which can be expensive), they can be supplied via the cache keyword argument.

Returns a FinDomFunctor with domain op(C).

source
GATlab.Models.SymbolicModels.functorMethod

Gives the underlying schema functor of a data migration seen as a functor of acset categories.

source
Catlab.CategoricalAlgebra.ChaseModule

The chase is an algorithm which subjects a C-Set instance to constraints expressed in the language of regular logic, called embedded dependencies (EDs, or 'triggers').

A morphism S->T, encodes an embedded dependency. If the pattern S is matched (via a homomorphism S->I), we demand there exist a morphism T->I (for some database instance I) that makes the triangle commute in order to satisfy the dependency (if this is not the case, then the trigger is 'active').

Homomorphisms can merge elements and introduce new ones. The former kind are called "equality generating dependencies" (EGDs) and the latter "tuple generating dependencies" (TGDs). Any homomorphism can be factored into EGD and TGD components by, respectively, restricting the codomain to the image or restricting the domain to the coimage.

source
Catlab.CategoricalAlgebra.Chase.chaseMethod
chase(I::ACSet, Σ::AbstractDict, n::Int)

Chase a C-Set or C-Rel instance given a list of embedded dependencies. This may not terminate, so a bound n on the number of iterations is required.

[,]

ΣS ⟶ Iₙ ⊕↓ ⋮ (resulting morphism) ΣT ... Iₙ₊₁

There is a copy of S and T for each active trigger. A trigger is a map from S into the current instance. What makes it 'active' is that there is no morphism from T to I that makes the triangle commute.

Each iteration constructs the above pushout square. The result is a morphism, so that one can keep track of the provenance of elements in the original CSet instance within the chased result.

Whether or not the result is due to success or timeout is returned as a boolean flag.

TODO: this algorithm could be made more efficient by homomorphism caching.

source
Catlab.CategoricalAlgebra.StructuredCospansModule

Structured cospans.

This module provides a generic interface for structured cospans with a concrete implementation for attributed C-sets.

source
Catlab.CategoricalAlgebra.StructuredCospans.OpenACSetLegType

Leg of a structured (multi)cospan of acsets in R-form.

A convenience type that contains the data of an acset transformation, except for the codomain, since that data is already given by the decoration of the R-form structured cospan.

source
Catlab.CategoricalAlgebra.StructuredCospans.StructuredCospanType

Structured cospan.

The first type parameter L encodes a functor L: A → X from the base category A, often FinSet, to a category X with "extra structure." An L-structured cospan is then a cospan in X whose feet are images under L of objects in A. The category X is assumed to have pushouts.

Structured cospans form a double category with no further assumptions on the functor L. To obtain a symmetric monoidal double category, L must preserve finite coproducts. In practice, L usually has a right adjoint R: X → A, which implies that L preserves all finite colimits. It also allows structured cospans to be constructed more conveniently from an object x in X plus a cospan in A with apex R(x).

See also: StructuredMulticospan.

source
Catlab.CategoricalAlgebra.StructuredCospans.StructuredCospanMethod

Construct structured cospan in R-form.

source
Catlab.CategoricalAlgebra.StructuredCospans.StructuredCospanMethod

Construct structured cospan in L-form.

source
Catlab.CategoricalAlgebra.StructuredCospans.StructuredCospanObType

Object in the category of L-structured cospans.

source
Catlab.CategoricalAlgebra.StructuredCospans.StructuredMulticospanType

Structured multicospan.

A structured multicospan is like a structured cospan except that it may have a number of legs different than two.

See also: StructuredCospan.

source
Catlab.CategoricalAlgebra.StructuredCospans.StructuredMulticospanMethod

Construct structured multicospan in R-form.

source
Catlab.CategoricalAlgebra.StructuredCospans.OpenACSetTypesMethod

Create types for open attributed C-sets from an attributed C-set type.

The type parameters of the given acset type should not be instantiated with specific Julia types. This function returns a pair of types, one for objects, a subtype of StructuredCospanOb, and one for morphisms, a subtype of StructuredMulticospan. Both types will have the same type parameters for attribute types as the given acset type.

Mathematically speaking, this function sets up structured (multi)cospans with a functor $L: A → X$ between categories of acsets that creates "discrete acsets." Such a "discrete acset functor" is a functor that is left adjoint to a certain kind of forgetful functor between categories of acsets, namely one that is a pullback along an inclusion of schemas such that the image of inclusion has no outgoing arrows. For example, the schema inclusion ${V} ↪ {E ⇉ V}$ has this property but ${E} ↪ {E ⇉ V}$ does not.

See also: OpenCSetTypes.

source
Catlab.CategoricalAlgebra.StructuredCospans.OpenCSetTypesMethod

Create types for open C-sets from a C-set type.

A special case of OpenACSetTypes. See there for details.

source
diff --git a/dev/apis/graphics/index.html b/dev/apis/graphics/index.html index 5d3272cfb..ecd1cd847 100644 --- a/dev/apis/graphics/index.html +++ b/dev/apis/graphics/index.html @@ -1,2 +1,2 @@ -Graphics · Catlab.jl

Graphics

Catlab.Graphics.GraphvizGraphs.parse_graphvizMethod

Parse Graphviz output in JSON format.

Returns a property graph with graph layout and other metadata. Each node has a position and size.

All units are in points. Note that Graphviz has 72 points per inch.

source
Catlab.Graphics.GraphvizGraphs.to_graphvizMethod

Convert a property graph to a Graphviz graph.

This method is usually more convenient than direct AST manipulation for creating simple Graphviz graphs. For more advanced features, like nested subgraphs, you must use the Graphviz AST.

source
Catlab.Graphics.GraphvizGraphs.to_graphvizMethod

Visualize a bipartite graph using Graphviz.

Works for both directed and undirected bipartite graphs. Both types of vertices in the bipartite graph become nodes in the Graphviz graph.

Arguments

  • prog="dot": Graphviz program to use
  • graph_attrs: Graph-level Graphviz attributes
  • node_attrs: Node-level Graphviz attributes
  • edge_attrs: Edge-level Graphviz attributes
  • node_labels=false: whether to label nodes and if so, which pair of data attributes to use
  • edge_labels=false: whether to label edges and if so, which data attribute (undirected case) or pair of attributes (directed case) to use
  • invis_edge=true: whether to add invisible edges between vertices of same type, which ensures that the order of the nodes is preserved.
source
Catlab.Graphics.GraphvizGraphs.to_graphvizMethod

Convert a graph to a Graphviz graph.

A simple default style is applied. For more control over the visual appearance, first convert the graph to a property graph, define the Graphviz attributes as needed, and finally convert the property graph to a Graphviz graph.

source
Catlab.Graphics.GraphvizGraphs.to_graphvizMethod

Visualize a graph homomorphism using Graphviz.

Visualize a homomorphism (ACSetTransformation) between two graphs (instances of AbstractGraph). By default, the domain and codomain are drawn as subgraphs and the vertex mapping is drawn using dotted edges, whereas the edge map is suppressed. The vertex and edge mapping can also be shown using colors, via the node_colors and edge_colors keyword arguments.

Arguments

  • draw_codom=true: whether to draw the codomain graph
  • draw_mapping=true: whether to draw the vertex mapping using edges
  • prog="dot": Graphviz program to use
  • graph_attrs: Graph-level Graphviz attributes
  • node_attrs: Node-level Graphviz attributes
  • edge_attrs: Edge-level Graphviz attributes
  • node_labels=false: whether to draw node labels and which vertex attribute to use
  • edge_labels=false: whether to draw edge labels and which edge attribute to use
  • node_colors=!draw_codom: whether and how to color nodes based on vertex map
  • edge_colors=!draw_codom: whether and how to color edges based on edge map
source
Catlab.Graphics.GraphvizGraphs.to_graphvizMethod

Draw an undirected wiring diagram using Graphviz.

Creates an undirected, bipartite Graphviz graph, with the boxes and outer ports of the diagram becoming nodes of one kind and the junctions of the diagram becoming nodes of the second kind.

Arguments

  • graph_name="G": name of Graphviz graph
  • prog="neato": Graphviz program, usually "neato" or "fdp"
  • box_labels=false: if boolean, whether to label boxes with their number; if a symbol, name of data attribute for box label
  • port_labels=false: whether to label ports with their number
  • junction_labels=false: if boolean, whether to label junctions with their number; if a symbol, name of data attribute for junction label
  • junction_size="0.075": size of junction nodes, in inches
  • implicit_junctions=false: whether to represent a junction implicity as a wire when it has exactly two incident ports
  • graph_attrs=Dict(): top-level graph attributes
  • node_attrs=Dict(): top-level node attributes
  • edge_attrs=Dict(): top-level edge attributes
source
Catlab.Graphics.GraphvizGraphs.to_graphvizMethod

Draw a circular port graph using Graphviz.

Creates a Graphviz graph. Ports are currently not respected in the image, but the port index for each box can be displayed to provide clarification.

Arguments

  • graph_name="G": name of Graphviz graph
  • prog="neato": Graphviz program, usually "neato" or "fdp"
  • box_labels=false: whether to label boxes with their number
  • port_labels=false: whether to label ports with their number
  • graph_attrs=Dict(): top-level graph attributes
  • node_attrs=Dict(): top-level node attributes
  • edge_attrs=Dict(): top-level edge attributes

TODO: The lack of ports might be able to be resolved by introducing an extra node per port which is connected to its box with an edge of length 0.

source
Catlab.Graphics.GraphvizGraphs.to_graphvizMethod

Draw a wiring diagram using Graphviz.

The input can also be a morphism expression, in which case it is first converted into a wiring diagram. This function requires Graphviz v2.42 or higher.

Arguments

  • graph_name="G": name of Graphviz digraph
  • orientation=TopToBottom: orientation of layout. One of LeftToRight, RightToLeft, TopToBottom, or BottomToTop.
  • node_labels=true: whether to label the nodes
  • labels=false: whether to label the edges
  • label_attr=:label: what kind of edge label to use (if labels is true). One of :label, :xlabel, :headlabel, or :taillabel.
  • port_size="24": minimum size of ports on box, in points
  • junction_size="0.05": size of junction nodes, in inches
  • outer_ports=true: whether to display the outer box's input and output ports. If disabled, no incoming or outgoing wires will be shown either!
  • anchor_outer_ports=true: whether to enforce ordering of the outer box's input and output, i.e., ordering of the incoming and outgoing wires
  • graph_attrs=Dict(): top-level graph attributes
  • node_attrs=Dict(): top-level node attributes
  • edge_attrs=Dict(): top-level edge attributes
  • cell_attrs=Dict(): main cell attributes in node HTML-like label
source
Catlab.Graphics.GraphvizWiringDiagrams.graphviz_layoutMethod

Lay out directed wiring diagram using Graphviz.

Note: At this time, only the positions and sizes of the boxes, and the positions of the outer ports, are used. The positions of the box ports and the splines for the wires are ignored.

source
Catlab.Graphics.WiringDiagramLayoutsModule

Backend-agnostic layout of wiring diagrams via morphism expressions.

This module lays out wiring diagrams for visualization, independent of any specific graphics system. It uses the structure of a morphism expression to determine the layout. Thus, the first step of the algorithm is to convert the wiring diagram to a symbolic expression, using the submodule WiringDiagrams.Expressions. Morphism expressions may also be given directly.

source
Catlab.Graphics.WiringDiagramLayouts.layout_diagramMethod

Lay out a wiring diagram or morphism expression for visualization.

If a wiring diagram is given, it is first to converted to a morphism expression.

The layout is calculated with respect to a cartesian coordinate system with origin at the center of the diagram and the positive y-axis pointing downwards. Box positions are relative to their centers. All positions and sizes are dimensionless (unitless).

source
+Graphics · Catlab.jl

Graphics

Catlab.Graphics.GraphvizGraphs.parse_graphvizMethod

Parse Graphviz output in JSON format.

Returns a property graph with graph layout and other metadata. Each node has a position and size.

All units are in points. Note that Graphviz has 72 points per inch.

source
Catlab.Graphics.GraphvizGraphs.to_graphvizMethod

Convert a property graph to a Graphviz graph.

This method is usually more convenient than direct AST manipulation for creating simple Graphviz graphs. For more advanced features, like nested subgraphs, you must use the Graphviz AST.

source
Catlab.Graphics.GraphvizGraphs.to_graphvizMethod

Visualize a bipartite graph using Graphviz.

Works for both directed and undirected bipartite graphs. Both types of vertices in the bipartite graph become nodes in the Graphviz graph.

Arguments

  • prog="dot": Graphviz program to use
  • graph_attrs: Graph-level Graphviz attributes
  • node_attrs: Node-level Graphviz attributes
  • edge_attrs: Edge-level Graphviz attributes
  • node_labels=false: whether to label nodes and if so, which pair of data attributes to use
  • edge_labels=false: whether to label edges and if so, which data attribute (undirected case) or pair of attributes (directed case) to use
  • invis_edge=true: whether to add invisible edges between vertices of same type, which ensures that the order of the nodes is preserved.
source
Catlab.Graphics.GraphvizGraphs.to_graphvizMethod

Convert a graph to a Graphviz graph.

A simple default style is applied. For more control over the visual appearance, first convert the graph to a property graph, define the Graphviz attributes as needed, and finally convert the property graph to a Graphviz graph.

source
Catlab.Graphics.GraphvizGraphs.to_graphvizMethod

Visualize a graph homomorphism using Graphviz.

Visualize a homomorphism (ACSetTransformation) between two graphs (instances of AbstractGraph). By default, the domain and codomain are drawn as subgraphs and the vertex mapping is drawn using dotted edges, whereas the edge map is suppressed. The vertex and edge mapping can also be shown using colors, via the node_colors and edge_colors keyword arguments.

Arguments

  • draw_codom=true: whether to draw the codomain graph
  • draw_mapping=true: whether to draw the vertex mapping using edges
  • prog="dot": Graphviz program to use
  • graph_attrs: Graph-level Graphviz attributes
  • node_attrs: Node-level Graphviz attributes
  • edge_attrs: Edge-level Graphviz attributes
  • node_labels=false: whether to draw node labels and which vertex attribute to use
  • edge_labels=false: whether to draw edge labels and which edge attribute to use
  • node_colors=!draw_codom: whether and how to color nodes based on vertex map
  • edge_colors=!draw_codom: whether and how to color edges based on edge map
source
Catlab.Graphics.GraphvizGraphs.to_graphvizMethod

Draw an undirected wiring diagram using Graphviz.

Creates an undirected, bipartite Graphviz graph, with the boxes and outer ports of the diagram becoming nodes of one kind and the junctions of the diagram becoming nodes of the second kind.

Arguments

  • graph_name="G": name of Graphviz graph
  • prog="neato": Graphviz program, usually "neato" or "fdp"
  • box_labels=false: if boolean, whether to label boxes with their number; if a symbol, name of data attribute for box label
  • port_labels=false: whether to label ports with their number
  • junction_labels=false: if boolean, whether to label junctions with their number; if a symbol, name of data attribute for junction label
  • junction_size="0.075": size of junction nodes, in inches
  • implicit_junctions=false: whether to represent a junction implicity as a wire when it has exactly two incident ports
  • graph_attrs=Dict(): top-level graph attributes
  • node_attrs=Dict(): top-level node attributes
  • edge_attrs=Dict(): top-level edge attributes
source
Catlab.Graphics.GraphvizGraphs.to_graphvizMethod

Draw a circular port graph using Graphviz.

Creates a Graphviz graph. Ports are currently not respected in the image, but the port index for each box can be displayed to provide clarification.

Arguments

  • graph_name="G": name of Graphviz graph
  • prog="neato": Graphviz program, usually "neato" or "fdp"
  • box_labels=false: whether to label boxes with their number
  • port_labels=false: whether to label ports with their number
  • graph_attrs=Dict(): top-level graph attributes
  • node_attrs=Dict(): top-level node attributes
  • edge_attrs=Dict(): top-level edge attributes

TODO: The lack of ports might be able to be resolved by introducing an extra node per port which is connected to its box with an edge of length 0.

source
Catlab.Graphics.GraphvizGraphs.to_graphvizMethod

Draw a wiring diagram using Graphviz.

The input can also be a morphism expression, in which case it is first converted into a wiring diagram. This function requires Graphviz v2.42 or higher.

Arguments

  • graph_name="G": name of Graphviz digraph
  • orientation=TopToBottom: orientation of layout. One of LeftToRight, RightToLeft, TopToBottom, or BottomToTop.
  • node_labels=true: whether to label the nodes
  • labels=false: whether to label the edges
  • label_attr=:label: what kind of edge label to use (if labels is true). One of :label, :xlabel, :headlabel, or :taillabel.
  • port_size="24": minimum size of ports on box, in points
  • junction_size="0.05": size of junction nodes, in inches
  • outer_ports=true: whether to display the outer box's input and output ports. If disabled, no incoming or outgoing wires will be shown either!
  • anchor_outer_ports=true: whether to enforce ordering of the outer box's input and output, i.e., ordering of the incoming and outgoing wires
  • graph_attrs=Dict(): top-level graph attributes
  • node_attrs=Dict(): top-level node attributes
  • edge_attrs=Dict(): top-level edge attributes
  • cell_attrs=Dict(): main cell attributes in node HTML-like label
source
Catlab.Graphics.GraphvizWiringDiagrams.graphviz_layoutMethod

Lay out directed wiring diagram using Graphviz.

Note: At this time, only the positions and sizes of the boxes, and the positions of the outer ports, are used. The positions of the box ports and the splines for the wires are ignored.

source
Catlab.Graphics.WiringDiagramLayoutsModule

Backend-agnostic layout of wiring diagrams via morphism expressions.

This module lays out wiring diagrams for visualization, independent of any specific graphics system. It uses the structure of a morphism expression to determine the layout. Thus, the first step of the algorithm is to convert the wiring diagram to a symbolic expression, using the submodule WiringDiagrams.Expressions. Morphism expressions may also be given directly.

source
Catlab.Graphics.WiringDiagramLayouts.layout_diagramMethod

Lay out a wiring diagram or morphism expression for visualization.

If a wiring diagram is given, it is first to converted to a morphism expression.

The layout is calculated with respect to a cartesian coordinate system with origin at the center of the diagram and the positive y-axis pointing downwards. Box positions are relative to their centers. All positions and sizes are dimensionless (unitless).

source
diff --git a/dev/apis/graphs/index.html b/dev/apis/graphs/index.html index 91be4e6cf..692a5f75d 100644 --- a/dev/apis/graphs/index.html +++ b/dev/apis/graphs/index.html @@ -1,2 +1,2 @@ -Graphs · Catlab.jl

Graphs

Catlab.Graphs.BasicGraphsModule

Data structures for graphs, based on C-sets.

This module provides the category theorist's four basic kinds of graphs: graphs (aka directed multigraphs), symmetric graphs, reflexive graphs, and symmetric reflexive graphs. It also defines half-edge graphs, which are isomorphic to symmetric graphs, and a few standard kinds of attributed graphs, such as weighted graphs.

The graphs API generally follows that of Graphs.jl, with some departures due to differences between the data structures.

source
Catlab.Graphs.BasicGraphs.HasGraphType

Abstract type for C-sets that contain a graph.

This type encompasses C-sets where the schema for graphs is a subcategory of C. This includes, for example, graphs, symmetric graphs, and reflexive graphs, but not half-edge graphs.

source
Catlab.Graphs.BasicGraphs.HasVerticesType

Abstract type for C-sets that contain vertices.

This type encompasses C-sets where the schema C contains an object V interpreted as vertices. This includes, for example, graphs and half-edge graphs, but not bipartite graphs or wiring diagrams.

source
Catlab.Graphs.BasicGraphs.LabeledGraphType

A labeled graph.

By convention, a "labeled graph" without qualification is a vertex-labeled graph. We do not require that the label be unique, and in this data type, the label attribute is not indexed.

source
Base.invMethod

Involution on half-edge(s) in a half-edge graph.

source
Catlab.Graphs.BasicGraphs.add_dangling_edge!Method

Add a dangling edge to a half-edge graph.

A "dangling edge" is a half-edge that is paired with itself under the half-edge involution. They are usually interpreted differently than "self-loops", i.e., a pair of distinct half-edges incident to the same vertex.

source
Catlab.Graphs.BasicGraphs.neMethod

Number of edges in a graph, or between two vertices in a graph.

In a symmetric graph, this function counts both edges in each edge pair, so that the number of edges in a symmetric graph is twice the number of edges in the corresponding undirected graph (at least when the edge involution has no fixed points).

source
Catlab.Graphs.BasicGraphs.neighborsMethod

Neighbors of vertex in a graph.

In a graph, this function is an alias for outneighbors; in a symmetric graph, a vertex has the same out-neighbors and as in-neighbors, so the distinction is moot.

In the presence of multiple edges, neighboring vertices are given with multiplicity. To get the unique neighbors, call unique(neighbors(g)).

source
Catlab.Graphs.BasicGraphs.rem_vertex!Method

Remove a vertex from a graph.

When keep_edges is false (the default), all edges incident to the vertex are also deleted. When keep_edges is true, incident edges are preserved but their source/target vertices become undefined.

source
Catlab.Graphs.BipartiteGraphsModule

Bipartite graphs, directed and undirected, as C-sets.

A graph theorist might call these "bipartitioned graphs," as in a graph equipped with a bipartition, as opposed to "bipartite graphs," as in a graph that can be bipartitioned. Here we use the former notion, which is more natural from the structuralist perspective, but the latter terminology, which is shorter and more familiar.

source
Catlab.Graphs.BipartiteGraphs.UndirectedBipartiteGraphType

An undirected bipartite graph.

It is a matter of perspective whether to consider such graphs "undirected," in the sense that the edges have no orientation, or "unidirected," in the sense that all edges go from vertices of type 1 to vertices of type 2.

source
Catlab.Graphs.NamedGraphsModule

Extends the basic graph types with vertex and/or edge names.

Naming vertices and edges and looking them up by name is a common requirement. This module provides a simple interface and default graph types for named graphs. Names are understood to be unique within the graph but are not assumed to be strings or symbols.

source
Catlab.Graphs.PropertyGraphs.PropertyGraphType

Graph with properties.

"Property graphs" are graphs with arbitrary named properties on the graph, vertices, and edges. They are intended for applications with a large number of ad-hoc properties. If you have a small number of known properties, it is better and more efficient to create a specialized C-set type using @acset_type.

See also: SymmetricPropertyGraph.

source
Catlab.Graphs.GraphAlgorithms.transitive_reduction!Method

Transitive reduction of a DAG.

The algorithm computes the longest paths in the DAGs and keeps only the edges corresponding to longest paths of length 1. Requires a topological sort, which is computed if it is not supplied.

source
Catlab.Graphs.GraphGenerators.erdos_renyiMethod
erdos_renyi(GraphType, n, p)

Create an Erdős–Rényi random graph with n vertices. Edges are added between pairs of vertices with probability p.

Optional Arguments

  • seed=-1: set the RNG seed.
  • rng: set the RNG directly

References

  • https://github.com/JuliaGraphs/LightGraphs.jl/blob/2a644c2b15b444e7f32f73021ec276aa9fc8ba30/src/SimpleGraphs/generators/randgraphs.jl
source
Catlab.Graphs.GraphGenerators.expected_degree_graphMethod
expected_degree_graph(GraphType, ω)

Given a vector of expected degrees ω indexed by vertex, create a random undirected graph in which vertices i and j are connected with probability ω[i]*ω[j]/sum(ω).

Optional Arguments

  • seed=-1: set the RNG seed.
  • rng: set the RNG directly

Implementation Notes

The algorithm should work well for maximum(ω) << sum(ω). As maximum(ω) approaches sum(ω), some deviations from the expected values are likely.

References

source
Catlab.Graphs.GraphGenerators.watts_strogatzMethod
watts_strogatz(n, k, β)

Return a Watts-Strogatz small world random graph with n vertices, each with expected degree k (or `k

  • 1ifkis odd). Edges are randomized per the model based on probabilityβ`.

The algorithm proceeds as follows. First, a perfect 1-lattice is constructed, where each vertex has exacly div(k, 2) neighbors on each side (i.e., k or k - 1 in total). Then the following steps are repeated for a hop length i of 1 through div(k, 2).

  1. Consider each vertex s in turn, along with the edge to its ith nearest neighbor t, in a clockwise sense.

  2. Generate a uniformly random number r. If r ≥ β, then the edge (s, t) is left unaltered. Otherwise, the edge is deleted and rewired so that s is connected to some vertex d, chosen uniformly at random from the entire graph, excluding s and its neighbors. (Note that t is a valid candidate.)

For β = 0, the graph will remain a 1-lattice, and for β = 1, all edges will be rewired randomly.

Optional Arguments

  • is_directed=false: if true, return a directed graph.
  • seed=-1: set the RNG seed.

References

source
+Graphs · Catlab.jl

Graphs

Catlab.Graphs.BasicGraphsModule

Data structures for graphs, based on C-sets.

This module provides the category theorist's four basic kinds of graphs: graphs (aka directed multigraphs), symmetric graphs, reflexive graphs, and symmetric reflexive graphs. It also defines half-edge graphs, which are isomorphic to symmetric graphs, and a few standard kinds of attributed graphs, such as weighted graphs.

The graphs API generally follows that of Graphs.jl, with some departures due to differences between the data structures.

source
Catlab.Graphs.BasicGraphs.HasGraphType

Abstract type for C-sets that contain a graph.

This type encompasses C-sets where the schema for graphs is a subcategory of C. This includes, for example, graphs, symmetric graphs, and reflexive graphs, but not half-edge graphs.

source
Catlab.Graphs.BasicGraphs.HasVerticesType

Abstract type for C-sets that contain vertices.

This type encompasses C-sets where the schema C contains an object V interpreted as vertices. This includes, for example, graphs and half-edge graphs, but not bipartite graphs or wiring diagrams.

source
Catlab.Graphs.BasicGraphs.LabeledGraphType

A labeled graph.

By convention, a "labeled graph" without qualification is a vertex-labeled graph. We do not require that the label be unique, and in this data type, the label attribute is not indexed.

source
Base.invMethod

Involution on half-edge(s) in a half-edge graph.

source
Catlab.Graphs.BasicGraphs.add_dangling_edge!Method

Add a dangling edge to a half-edge graph.

A "dangling edge" is a half-edge that is paired with itself under the half-edge involution. They are usually interpreted differently than "self-loops", i.e., a pair of distinct half-edges incident to the same vertex.

source
Catlab.Graphs.BasicGraphs.neMethod

Number of edges in a graph, or between two vertices in a graph.

In a symmetric graph, this function counts both edges in each edge pair, so that the number of edges in a symmetric graph is twice the number of edges in the corresponding undirected graph (at least when the edge involution has no fixed points).

source
Catlab.Graphs.BasicGraphs.neighborsMethod

Neighbors of vertex in a graph.

In a graph, this function is an alias for outneighbors; in a symmetric graph, a vertex has the same out-neighbors and as in-neighbors, so the distinction is moot.

In the presence of multiple edges, neighboring vertices are given with multiplicity. To get the unique neighbors, call unique(neighbors(g)).

source
Catlab.Graphs.BasicGraphs.rem_vertex!Method

Remove a vertex from a graph.

When keep_edges is false (the default), all edges incident to the vertex are also deleted. When keep_edges is true, incident edges are preserved but their source/target vertices become undefined.

source
Catlab.Graphs.BipartiteGraphsModule

Bipartite graphs, directed and undirected, as C-sets.

A graph theorist might call these "bipartitioned graphs," as in a graph equipped with a bipartition, as opposed to "bipartite graphs," as in a graph that can be bipartitioned. Here we use the former notion, which is more natural from the structuralist perspective, but the latter terminology, which is shorter and more familiar.

source
Catlab.Graphs.BipartiteGraphs.UndirectedBipartiteGraphType

An undirected bipartite graph.

It is a matter of perspective whether to consider such graphs "undirected," in the sense that the edges have no orientation, or "unidirected," in the sense that all edges go from vertices of type 1 to vertices of type 2.

source
Catlab.Graphs.NamedGraphsModule

Extends the basic graph types with vertex and/or edge names.

Naming vertices and edges and looking them up by name is a common requirement. This module provides a simple interface and default graph types for named graphs. Names are understood to be unique within the graph but are not assumed to be strings or symbols.

source
Catlab.Graphs.PropertyGraphs.PropertyGraphType

Graph with properties.

"Property graphs" are graphs with arbitrary named properties on the graph, vertices, and edges. They are intended for applications with a large number of ad-hoc properties. If you have a small number of known properties, it is better and more efficient to create a specialized C-set type using @acset_type.

See also: SymmetricPropertyGraph.

source
Catlab.Graphs.GraphAlgorithms.transitive_reduction!Method

Transitive reduction of a DAG.

The algorithm computes the longest paths in the DAGs and keeps only the edges corresponding to longest paths of length 1. Requires a topological sort, which is computed if it is not supplied.

source
Catlab.Graphs.GraphGenerators.erdos_renyiMethod
erdos_renyi(GraphType, n, p)

Create an Erdős–Rényi random graph with n vertices. Edges are added between pairs of vertices with probability p.

Optional Arguments

  • seed=-1: set the RNG seed.
  • rng: set the RNG directly

References

  • https://github.com/JuliaGraphs/LightGraphs.jl/blob/2a644c2b15b444e7f32f73021ec276aa9fc8ba30/src/SimpleGraphs/generators/randgraphs.jl
source
Catlab.Graphs.GraphGenerators.expected_degree_graphMethod
expected_degree_graph(GraphType, ω)

Given a vector of expected degrees ω indexed by vertex, create a random undirected graph in which vertices i and j are connected with probability ω[i]*ω[j]/sum(ω).

Optional Arguments

  • seed=-1: set the RNG seed.
  • rng: set the RNG directly

Implementation Notes

The algorithm should work well for maximum(ω) << sum(ω). As maximum(ω) approaches sum(ω), some deviations from the expected values are likely.

References

source
Catlab.Graphs.GraphGenerators.watts_strogatzMethod
watts_strogatz(n, k, β)

Return a Watts-Strogatz small world random graph with n vertices, each with expected degree k (or `k

  • 1ifkis odd). Edges are randomized per the model based on probabilityβ`.

The algorithm proceeds as follows. First, a perfect 1-lattice is constructed, where each vertex has exacly div(k, 2) neighbors on each side (i.e., k or k - 1 in total). Then the following steps are repeated for a hop length i of 1 through div(k, 2).

  1. Consider each vertex s in turn, along with the edge to its ith nearest neighbor t, in a clockwise sense.

  2. Generate a uniformly random number r. If r ≥ β, then the edge (s, t) is left unaltered. Otherwise, the edge is deleted and rewired so that s is connected to some vertex d, chosen uniformly at random from the entire graph, excluding s and its neighbors. (Note that t is a valid candidate.)

For β = 0, the graph will remain a 1-lattice, and for β = 1, all edges will be rewired randomly.

Optional Arguments

  • is_directed=false: if true, return a directed graph.
  • seed=-1: set the RNG seed.

References

source
diff --git a/dev/apis/programs/index.html b/dev/apis/programs/index.html index 0fc1e9d09..be52bb8c3 100644 --- a/dev/apis/programs/index.html +++ b/dev/apis/programs/index.html @@ -1,6 +1,6 @@ -Programs · Catlab.jl

Programs

The module Catlab.Programs provides domain-specific languages (DSLs) for constructing diagrams of various kinds. The DSLs, implemented as Julia macros, are based on the syntax of the Julia language but often interpret that syntax very differently from standard Julia programs. Conversely, this module offers preliminary support for generating Julia code from wiring diagrams.

There are two major macros for constructing wiring diagrams:

  • @program, for directed wiring diagrams (DWDs)
  • @relation, for undirected wiring diagrams (UWDs)

There is a family of related macros for constructing category-theoretic diagrams included in DataMigrations.jl.

API

Catlab.Programs.GenerateJuliaPrograms.evaluateMethod

Evaluate a morphism as a function.

If the morphism will be evaluated only once (possibly with vectorized inputs), then direct evaluation will be much faster than compiling (via compile) and evaluating a standard Julia function.

Compare with functor.

source
Catlab.Programs.ParseJuliaPrograms.@programMacro

Parse a wiring diagram from a Julia program.

For the most part, this is standard Julia code but a few liberties are taken with the syntax. Products are represented as tuples. So if x and y are variables of type $X$ and $Y$, then (x,y) has type $X ⊗ Y$. Also, both () and nothing are interpreted as the monoidal unit $I$.

Unlike standard Julia, the function call expressions f(x,y) and f((x,y)) are equivalent. Consequently, given morphisms $f: W → X ⊗ Y$ and $g: X ⊗ Y → Z$, the code

x, y = f(w)
-g(x,y)

is equivalent to g(f(w)). In standard Julia, at most one of these calls to g would be valid, unless g had multiple signatures.

The diagonals (copying and deleting) of a cartesian category are implicit in the Julia syntax: copying is variable reuse and deleting is variable non-use. For the codiagonals (merging and creating), a special syntax is provided, reinterpreting Julia's vector literals. The merging of x1 and x2 is represented by the vector [x1,x2] and creation by the empty vector []. For example, f([x1,x2]) translates to compose(mmerge(X),f).

This macro is a wrapper around parse_wiring_diagram.

source
Catlab.Programs.RelationalPrograms.@relationMacro

Construct an undirected wiring diagram using relation notation.

Unlike the @program macro for directed wiring diagrams, this macro departs significantly from the usual semantics of the Julia programming language. Function calls with $n$ arguments are now interpreted as assertions that an $n$-ary relation holds at a particular point. For example, the composite of binary relations $R ⊆ X × Y$ and $S ⊆ Y × Z$ can be represented as an undirected wiring diagram by the macro call

@relation (x,z) where (x::X, y::Y, z::Z) begin
+Programs · Catlab.jl

Programs

The module Catlab.Programs provides domain-specific languages (DSLs) for constructing diagrams of various kinds. The DSLs, implemented as Julia macros, are based on the syntax of the Julia language but often interpret that syntax very differently from standard Julia programs. Conversely, this module offers preliminary support for generating Julia code from wiring diagrams.

There are two major macros for constructing wiring diagrams:

  • @program, for directed wiring diagrams (DWDs)
  • @relation, for undirected wiring diagrams (UWDs)

There is a family of related macros for constructing category-theoretic diagrams included in DataMigrations.jl.

API

Catlab.Programs.GenerateJuliaPrograms.evaluateMethod

Evaluate a morphism as a function.

If the morphism will be evaluated only once (possibly with vectorized inputs), then direct evaluation will be much faster than compiling (via compile) and evaluating a standard Julia function.

Compare with functor.

source
Catlab.Programs.ParseJuliaPrograms.@programMacro

Parse a wiring diagram from a Julia program.

For the most part, this is standard Julia code but a few liberties are taken with the syntax. Products are represented as tuples. So if x and y are variables of type $X$ and $Y$, then (x,y) has type $X ⊗ Y$. Also, both () and nothing are interpreted as the monoidal unit $I$.

Unlike standard Julia, the function call expressions f(x,y) and f((x,y)) are equivalent. Consequently, given morphisms $f: W → X ⊗ Y$ and $g: X ⊗ Y → Z$, the code

x, y = f(w)
+g(x,y)

is equivalent to g(f(w)). In standard Julia, at most one of these calls to g would be valid, unless g had multiple signatures.

The diagonals (copying and deleting) of a cartesian category are implicit in the Julia syntax: copying is variable reuse and deleting is variable non-use. For the codiagonals (merging and creating), a special syntax is provided, reinterpreting Julia's vector literals. The merging of x1 and x2 is represented by the vector [x1,x2] and creation by the empty vector []. For example, f([x1,x2]) translates to compose(mmerge(X),f).

This macro is a wrapper around parse_wiring_diagram.

source
Catlab.Programs.RelationalPrograms.@relationMacro

Construct an undirected wiring diagram using relation notation.

Unlike the @program macro for directed wiring diagrams, this macro departs significantly from the usual semantics of the Julia programming language. Function calls with $n$ arguments are now interpreted as assertions that an $n$-ary relation holds at a particular point. For example, the composite of binary relations $R ⊆ X × Y$ and $S ⊆ Y × Z$ can be represented as an undirected wiring diagram by the macro call

@relation (x,z) where (x::X, y::Y, z::Z) begin
   R(x,y)
   S(y,z)
-end

In general, the context in the where clause defines the set of junctions in the diagram and variable sharing defines the wiring of ports to junctions. If the where clause is omitted, the set of junctions is inferred from the variables used in the macro call.

The ports and junctions of the diagram may be typed or untyped, and the ports may be named or unnamed. Thus, four possible types of undirected wiring diagrams may be returned, with the type determined by the form of relation header:

  1. Untyped, unnamed: @relation (x,z) where (x,y,z) ...
  2. Typed, unnamed: @relation (x,z) where (x::X, y::Y, z::Z) ...
  3. Untyped, named: @relation (out1=x, out2=z) where (x,y,z) ...
  4. Typed, named: @relation (out=1, out2=z) where (x::X, y::Y, z::Z) ...

All four types of diagram are subtypes of RelationDiagram.

source
+end

In general, the context in the where clause defines the set of junctions in the diagram and variable sharing defines the wiring of ports to junctions. If the where clause is omitted, the set of junctions is inferred from the variables used in the macro call.

The ports and junctions of the diagram may be typed or untyped, and the ports may be named or unnamed. Thus, four possible types of undirected wiring diagrams may be returned, with the type determined by the form of relation header:

  1. Untyped, unnamed: @relation (x,z) where (x,y,z) ...
  2. Typed, unnamed: @relation (x,z) where (x::X, y::Y, z::Z) ...
  3. Untyped, named: @relation (out1=x, out2=z) where (x,y,z) ...
  4. Typed, named: @relation (out=1, out2=z) where (x::X, y::Y, z::Z) ...

All four types of diagram are subtypes of RelationDiagram.

source
diff --git a/dev/apis/theories/index.html b/dev/apis/theories/index.html index bb93b14ec..32f68ab81 100644 --- a/dev/apis/theories/index.html +++ b/dev/apis/theories/index.html @@ -1,2 +1,2 @@ -Standard library of theories · Catlab.jl

Standard library of theories

Through the module Catlab.Theories, Catlab provides a standard library of generalized algebraic theories for categories, monoidal categories, and other categorical structures. The theories correspond, in most cases, to standard definitions in category theory and they are used throughout Catlab and the AlgebraicJulia ecosystem to structure programs and provide a common interface for applied category theory. The module also provides default syntax systems for many of the theories.

Categorical structures for which theories are provided include:

  • categories
  • monoidal and symmetric monoidal categories
  • cartesian and cocartesian categories
  • semiadditive categories/biproduct categories
  • hypergraph categories
  • bicategories of relations
  • categories with two monoidal products, such as distributive monoidal categories

The contents of this module can be supplemented by the user, and it is even possible to use many parts of Catlab without using this module. The user is free to create new syntax systems for the theories defined here and also to define entirely new theories.

Catlab.TheoriesModule

Catlab's standard library of generalized algebraic theories.

The focus is on categories and monoidal categories, but other related structures are also included.

source
Catlab.Theories.CategoryExprType

Base type for GAT expressions in categories or other categorical structures.

All symbolic expression types exported by Catlab.Theories are subtypes of this abstract type.

source
Base.collectMethod

Collect generators of object in monoidal category as a vector.

source
Base.ndimsMethod

Number of "dimensions" of object in monoidal category.

source
+Standard library of theories · Catlab.jl

Standard library of theories

Through the module Catlab.Theories, Catlab provides a standard library of generalized algebraic theories for categories, monoidal categories, and other categorical structures. The theories correspond, in most cases, to standard definitions in category theory and they are used throughout Catlab and the AlgebraicJulia ecosystem to structure programs and provide a common interface for applied category theory. The module also provides default syntax systems for many of the theories.

Categorical structures for which theories are provided include:

  • categories
  • monoidal and symmetric monoidal categories
  • cartesian and cocartesian categories
  • semiadditive categories/biproduct categories
  • hypergraph categories
  • bicategories of relations
  • categories with two monoidal products, such as distributive monoidal categories

The contents of this module can be supplemented by the user, and it is even possible to use many parts of Catlab without using this module. The user is free to create new syntax systems for the theories defined here and also to define entirely new theories.

Catlab.TheoriesModule

Catlab's standard library of generalized algebraic theories.

The focus is on categories and monoidal categories, but other related structures are also included.

source
Catlab.Theories.CategoryExprType

Base type for GAT expressions in categories or other categorical structures.

All symbolic expression types exported by Catlab.Theories are subtypes of this abstract type.

source
Base.collectMethod

Collect generators of object in monoidal category as a vector.

source
Base.ndimsMethod

Number of "dimensions" of object in monoidal category.

source
diff --git a/dev/apis/wiring_diagrams/index.html b/dev/apis/wiring_diagrams/index.html index b55377a26..c1399a4db 100644 --- a/dev/apis/wiring_diagrams/index.html +++ b/dev/apis/wiring_diagrams/index.html @@ -1,2 +1,2 @@ -Wiring diagrams · Catlab.jl

Wiring diagrams

Catlab.WiringDiagrams.DirectedWiringDiagramsModule

Data structure for (directed) wiring diagrams, aka string diagrams.

A (directed) wiring diagram consists of a collection of boxes with input and output ports connected by wires. A box can be atomic (possessing no internal structure) or can itself be a wiring diagram. Thus, wiring diagrams can be nested recursively. Wiring diagrams are closely related to what the CS literature calls "directed graphs with ports" or more simply "port graphs". The main difference is that a wiring diagram has an "outer box": a wiring diagram has its own ports that can be connected to the ports of its boxes.

This module provides a generic data structure for wiring diagrams. Arbitrary data can be attached to the boxes, ports, and wires of a wiring diagram. The diagrams are "abstract" in the sense that they cannot be directly rendered as raster or vector graphics. However, they form a useful intermediate representation that can be serialized to and from GraphML or translated into Graphviz or other declarative diagram languages.

source
Catlab.CategoricalAlgebra.FinCats.graphMethod

Grapn underlying wiring diagram, including parts for noin-internal wires.

The graph has two special vertices representing the input and output boundaries of the outer box.

source
Catlab.WiringDiagrams.DirectedWiringDiagrams.encapsulated_subdiagramMethod

Create an encapsulating box for a set of boxes in a wiring diagram.

To a first approximation, the union of input ports of the given boxes will become the inputs ports of the encapsulating box and likewise for the output ports. However, when copies or merges occur, as in a cartesian or cocartesian category, a simplification procedure may reduce the number of ports on the encapsulating box.

Specifically:

  1. Each input port of an encapsulated box will have at most one incoming wire

from the encapsulating outer box, and each output port of an encapsulated box will have at most one outgoing wire to the encapsulating outer box.

  1. A set of ports connected to the same outside (non-encapsulated) ports will be

simplified into a single port of the encapsulating box.

See also induced_subdiagram.

source
Catlab.WiringDiagrams.DirectedWiringDiagrams.ocomposeMethod

Operadic composition of wiring diagrams.

This generic function has two different signatures, corresponding to the "full" and "partial" notions of operadic composition (Yau, 2018, Operads of Wiring Diagrams, Definitions 2.3 and 2.10).

This operation is a simple wrapper around substitute.

source
Catlab.WiringDiagrams.DirectedWiringDiagrams.add_wire!Method

Wire together two ports in an undirected wiring diagram.

A convenience method that creates and sets junctions as needed. Ports are only allowed to have one junction, so if both ports already have junctions, then the second port is assigned the junction of the first. The handling of the two arguments is otherwise symmetric.

FIXME: When both ports already have junctions, the two junctions should be merged. To do this, we must implement merge_junctions! and thus also rem_part!.

source
Catlab.WiringDiagrams.MonoidalDirectedWiringDiagramsModule

Wiring diagrams as a symmetric monoidal category.

This module provides a high-level categorical interface to wiring diagrams, building on the low-level imperative interface and the operadic interface. It also defines data types and functions to represent diagonals, codiagonals, duals, caps, cups, daggers, and other gadgets in wiring diagrams.

source
Catlab.WiringDiagrams.WiringDiagramAlgorithms.crossing_minimization_by_sortMethod

Crossing minimization by sorting a univariate statistic.

The boxes in sources and/or targets are fixed and the boxes in vs are permuted. A permutation σ of the latter is returned, such that vs[σ] are the sorted box IDs. Both one-sided and two-sided crossing minimization are supported, depending on whether just one, or both, of sources and targets are given.

In this simple but popular heuristic algorithm, the boxes are permuted by sorting a univariate statistic of the positions of incoming and/or outgoing wires. Typical choices are:

  • mean: the sample mean, yielding the "barycenter method"
  • median: the sample median

In both cases, this algorithm has the property that if there is a permutation with no crossings, it will find it.

source
Catlab.WiringDiagrams.WiringDiagramAlgorithms.normalize_copy!Method

Normalize copies in a wiring diagram.

This function maximizes sharing of intermediate computations in a wiring diagram where copies are natural.

This algorithm is basically the same as the congruence closure algorithm on term graphs, in the special case of the empty relation R = ∅ (Baader & Nipkow, 1998, Term Rewriting and All That, Sec. 4.4). The main difference is the possibility of zero or many function outputs.

source
Catlab.WiringDiagrams.WiringDiagramSerializationModule

Conventions for serialization of wiring diagrams.

Defines a consistent set of names for boxes, ports, and wires to be used when serializing wiring diagrams, as well as conventions for serializing box, port, and wire attributes.

source
Catlab.WiringDiagrams.GraphMLWiringDiagramsModule

Serialize abstract wiring diagrams as GraphML.

Serialization of box, port, and wire values can be overloaded by data type (see convert_to_graphml_data and convert_from_graphml_data).

GraphML is the closest thing to a de jure and de facto standard in the space of graph data formats, supported by a variety of graph applications and libraries. We depart mildly from the GraphML spec by allowing JSON data attributes for GraphML nodes, ports, and edges.

References:

  • GraphML Primer: http://graphml.graphdrawing.org/primer/graphml-primer.html
  • GraphML DTD: http://graphml.graphdrawing.org/specification/dtd.html
source
Catlab.WiringDiagrams.JSONWiringDiagramsModule

Serialize abstract wiring diagrams as JSON.

JSON data formats are convenient when programming for the web. Unfortunately, no standard for JSON graph formats has gained any kind of widespread adoption. We adopt a format compatible with that used by the KEILER project and its successor ELK (Eclipse Layout Kernel). This format is roughly feature compatible with GraphML, supporting nested graphs and ports. It also supports layout information like node position and size.

References:

  • KEILER's JSON graph format: https://rtsys.informatik.uni-kiel.de/confluence/display/KIELER/JSON+Graph+Format
  • ELK's JSON graph format: https://www.eclipse.org/elk/documentation/tooldevelopers/graphdatastructure/jsonformat.html
source
+Wiring diagrams · Catlab.jl

Wiring diagrams

Catlab.WiringDiagrams.DirectedWiringDiagramsModule

Data structure for (directed) wiring diagrams, aka string diagrams.

A (directed) wiring diagram consists of a collection of boxes with input and output ports connected by wires. A box can be atomic (possessing no internal structure) or can itself be a wiring diagram. Thus, wiring diagrams can be nested recursively. Wiring diagrams are closely related to what the CS literature calls "directed graphs with ports" or more simply "port graphs". The main difference is that a wiring diagram has an "outer box": a wiring diagram has its own ports that can be connected to the ports of its boxes.

This module provides a generic data structure for wiring diagrams. Arbitrary data can be attached to the boxes, ports, and wires of a wiring diagram. The diagrams are "abstract" in the sense that they cannot be directly rendered as raster or vector graphics. However, they form a useful intermediate representation that can be serialized to and from GraphML or translated into Graphviz or other declarative diagram languages.

source
Catlab.CategoricalAlgebra.FinCats.graphMethod

Grapn underlying wiring diagram, including parts for noin-internal wires.

The graph has two special vertices representing the input and output boundaries of the outer box.

source
Catlab.WiringDiagrams.DirectedWiringDiagrams.encapsulated_subdiagramMethod

Create an encapsulating box for a set of boxes in a wiring diagram.

To a first approximation, the union of input ports of the given boxes will become the inputs ports of the encapsulating box and likewise for the output ports. However, when copies or merges occur, as in a cartesian or cocartesian category, a simplification procedure may reduce the number of ports on the encapsulating box.

Specifically:

  1. Each input port of an encapsulated box will have at most one incoming wire

from the encapsulating outer box, and each output port of an encapsulated box will have at most one outgoing wire to the encapsulating outer box.

  1. A set of ports connected to the same outside (non-encapsulated) ports will be

simplified into a single port of the encapsulating box.

See also induced_subdiagram.

source
Catlab.WiringDiagrams.DirectedWiringDiagrams.ocomposeMethod

Operadic composition of wiring diagrams.

This generic function has two different signatures, corresponding to the "full" and "partial" notions of operadic composition (Yau, 2018, Operads of Wiring Diagrams, Definitions 2.3 and 2.10).

This operation is a simple wrapper around substitute.

source
Catlab.WiringDiagrams.DirectedWiringDiagrams.add_wire!Method

Wire together two ports in an undirected wiring diagram.

A convenience method that creates and sets junctions as needed. Ports are only allowed to have one junction, so if both ports already have junctions, then the second port is assigned the junction of the first. The handling of the two arguments is otherwise symmetric.

FIXME: When both ports already have junctions, the two junctions should be merged. To do this, we must implement merge_junctions! and thus also rem_part!.

source
Catlab.WiringDiagrams.MonoidalDirectedWiringDiagramsModule

Wiring diagrams as a symmetric monoidal category.

This module provides a high-level categorical interface to wiring diagrams, building on the low-level imperative interface and the operadic interface. It also defines data types and functions to represent diagonals, codiagonals, duals, caps, cups, daggers, and other gadgets in wiring diagrams.

source
Catlab.WiringDiagrams.WiringDiagramAlgorithms.crossing_minimization_by_sortMethod

Crossing minimization by sorting a univariate statistic.

The boxes in sources and/or targets are fixed and the boxes in vs are permuted. A permutation σ of the latter is returned, such that vs[σ] are the sorted box IDs. Both one-sided and two-sided crossing minimization are supported, depending on whether just one, or both, of sources and targets are given.

In this simple but popular heuristic algorithm, the boxes are permuted by sorting a univariate statistic of the positions of incoming and/or outgoing wires. Typical choices are:

  • mean: the sample mean, yielding the "barycenter method"
  • median: the sample median

In both cases, this algorithm has the property that if there is a permutation with no crossings, it will find it.

source
Catlab.WiringDiagrams.WiringDiagramAlgorithms.normalize_copy!Method

Normalize copies in a wiring diagram.

This function maximizes sharing of intermediate computations in a wiring diagram where copies are natural.

This algorithm is basically the same as the congruence closure algorithm on term graphs, in the special case of the empty relation R = ∅ (Baader & Nipkow, 1998, Term Rewriting and All That, Sec. 4.4). The main difference is the possibility of zero or many function outputs.

source
Catlab.WiringDiagrams.WiringDiagramSerializationModule

Conventions for serialization of wiring diagrams.

Defines a consistent set of names for boxes, ports, and wires to be used when serializing wiring diagrams, as well as conventions for serializing box, port, and wire attributes.

source
Catlab.WiringDiagrams.GraphMLWiringDiagramsModule

Serialize abstract wiring diagrams as GraphML.

Serialization of box, port, and wire values can be overloaded by data type (see convert_to_graphml_data and convert_from_graphml_data).

GraphML is the closest thing to a de jure and de facto standard in the space of graph data formats, supported by a variety of graph applications and libraries. We depart mildly from the GraphML spec by allowing JSON data attributes for GraphML nodes, ports, and edges.

References:

  • GraphML Primer: http://graphml.graphdrawing.org/primer/graphml-primer.html
  • GraphML DTD: http://graphml.graphdrawing.org/specification/dtd.html
source
Catlab.WiringDiagrams.JSONWiringDiagramsModule

Serialize abstract wiring diagrams as JSON.

JSON data formats are convenient when programming for the web. Unfortunately, no standard for JSON graph formats has gained any kind of widespread adoption. We adopt a format compatible with that used by the KEILER project and its successor ELK (Eclipse Layout Kernel). This format is roughly feature compatible with GraphML, supporting nested graphs and ports. It also supports layout information like node position and size.

References:

  • KEILER's JSON graph format: https://rtsys.informatik.uni-kiel.de/confluence/display/KIELER/JSON+Graph+Format
  • ELK's JSON graph format: https://www.eclipse.org/elk/documentation/tooldevelopers/graphdatastructure/jsonformat.html
source
diff --git a/dev/devdocs/style/index.html b/dev/devdocs/style/index.html index 3c96a5eec..3236fde42 100644 --- a/dev/devdocs/style/index.html +++ b/dev/devdocs/style/index.html @@ -6,4 +6,4 @@ ######### # Subsection -#-----------

Guidelines for pull requests

Every pull request to Catlab should be reviewed by at least one person. Following are some things to check when making a PR yourself or reviewing someone else's PR. The goal of this list is to ensure that the Catlab codebase is robust and maintainable. When any of these guidelines are violated, it should be documented in a comment on the PR page.

Note: This list only includes the mechanical things. When a reviewing a PR you should always use your own judgment in asking questions and making comments about API and algorithm design. That's the hard part!

Tests and code coverage

Documentation

Version control

Backwards compatibility

Reflecting Catlab's dual status as a research project and a user-facing library, we want to give ourselves space to experiment while also not annoying our users and each other by needlessly breaking things.

+#-----------

Guidelines for pull requests

Every pull request to Catlab should be reviewed by at least one person. Following are some things to check when making a PR yourself or reviewing someone else's PR. The goal of this list is to ensure that the Catlab codebase is robust and maintainable. When any of these guidelines are violated, it should be documented in a comment on the PR page.

Note: This list only includes the mechanical things. When a reviewing a PR you should always use your own judgment in asking questions and making comments about API and algorithm design. That's the hard part!

Tests and code coverage

Documentation

Version control

Backwards compatibility

Reflecting Catlab's dual status as a research project and a user-facing library, we want to give ourselves space to experiment while also not annoying our users and each other by needlessly breaking things.

diff --git a/dev/generated/graphics/composejl_wiring_diagrams.ipynb b/dev/generated/graphics/composejl_wiring_diagrams.ipynb index 18e44aabc..03fc6131b 100644 --- a/dev/generated/graphics/composejl_wiring_diagrams.ipynb +++ b/dev/generated/graphics/composejl_wiring_diagrams.ipynb @@ -77,24 +77,24 @@ " stroke-width=\"0.3\"\n", " font-size=\"3.88\"\n", "\n", - " id=\"img-31819ccd\">\n", + " id=\"img-0a1ecae9\">\n", "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -139,7 +139,7 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " f\n", @@ -310,18 +310,18 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -366,7 +366,7 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " f\n", @@ -404,29 +404,29 @@ " stroke-width=\"0.3\"\n", " font-size=\"3.88\"\n", "\n", - " id=\"img-7efaf76c\">\n", + " id=\"img-15aec99d\">\n", "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -471,15 +471,15 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " g\n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -524,7 +524,7 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " f\n", @@ -695,23 +695,23 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -756,15 +756,15 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " g\n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -809,7 +809,7 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " f\n", @@ -847,34 +847,34 @@ " stroke-width=\"0.3\"\n", " font-size=\"3.88\"\n", "\n", - " id=\"img-693b0cf3\">\n", + " id=\"img-86afd844\">\n", "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -919,15 +919,15 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " g\n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -972,7 +972,7 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " f\n", @@ -1143,28 +1143,28 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -1209,15 +1209,15 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " g\n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -1262,7 +1262,7 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " f\n", @@ -1308,134 +1308,134 @@ " stroke-width=\"0.3\"\n", " font-size=\"3.88\"\n", "\n", - " id=\"img-ba98aec9\">\n", + " id=\"img-b2f6602d\">\n", "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -1480,15 +1480,15 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " g\n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -1533,15 +1533,15 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " f\n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -1586,15 +1586,15 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " k\n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -1639,15 +1639,15 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " h\n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -1692,15 +1692,15 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " m\n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -1745,15 +1745,15 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " n\n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -1798,15 +1798,15 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " l\n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -1851,15 +1851,15 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " n\n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -1904,15 +1904,15 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " m\n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -1957,15 +1957,15 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " k\n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -2010,15 +2010,15 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " h\n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -2063,15 +2063,15 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " g\n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -2116,7 +2116,7 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " f\n", @@ -2287,128 +2287,128 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -2453,15 +2453,15 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " g\n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -2506,15 +2506,15 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " f\n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -2559,15 +2559,15 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " k\n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -2612,15 +2612,15 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " h\n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -2665,15 +2665,15 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " m\n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -2718,15 +2718,15 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " n\n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -2771,15 +2771,15 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " l\n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -2824,15 +2824,15 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " n\n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -2877,15 +2877,15 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " m\n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -2930,15 +2930,15 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " k\n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -2983,15 +2983,15 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " h\n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -3036,15 +3036,15 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " g\n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -3089,7 +3089,7 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " f\n", @@ -3138,13 +3138,13 @@ " stroke-width=\"0.3\"\n", " font-size=\"3.88\"\n", "\n", - " id=\"img-9b99d27d\">\n", + " id=\"img-5e8a27d0\">\n", "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", @@ -3316,7 +3316,7 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", @@ -3355,13 +3355,13 @@ " stroke-width=\"0.3\"\n", " font-size=\"3.88\"\n", "\n", - " id=\"img-ec229661\">\n", + " id=\"img-190d9743\">\n", "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", @@ -3369,7 +3369,7 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", @@ -3541,7 +3541,7 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", @@ -3549,7 +3549,7 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", @@ -3588,13 +3588,13 @@ " stroke-width=\"0.3\"\n", " font-size=\"3.88\"\n", "\n", - " id=\"img-20742bbb\">\n", + " id=\"img-bcb323b0\">\n", "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", @@ -3602,7 +3602,7 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", @@ -3610,7 +3610,7 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", @@ -3618,7 +3618,7 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", @@ -3626,8 +3626,8 @@ " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -3672,15 +3672,15 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " f\n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -3725,7 +3725,7 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " g\n", @@ -3896,7 +3896,7 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", @@ -3904,7 +3904,7 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", @@ -3912,7 +3912,7 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", @@ -3920,7 +3920,7 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", @@ -3928,8 +3928,8 @@ " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -3974,15 +3974,15 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " f\n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -4027,7 +4027,7 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " g\n", @@ -4073,13 +4073,13 @@ " stroke-width=\"0.3\"\n", " font-size=\"3.88\"\n", "\n", - " id=\"img-4ac29743\">\n", + " id=\"img-83eb8e1d\">\n", "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", @@ -4093,7 +4093,7 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", @@ -4107,7 +4107,7 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", @@ -4285,7 +4285,7 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", @@ -4299,7 +4299,7 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", @@ -4313,7 +4313,7 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", @@ -4369,23 +4369,23 @@ " stroke-width=\"0.3\"\n", " font-size=\"3.88\"\n", "\n", - " id=\"img-32c51140\">\n", + " id=\"img-89fd484c\">\n", "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", @@ -4554,17 +4554,17 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", @@ -4607,28 +4607,28 @@ " stroke-width=\"0.3\"\n", " font-size=\"3.88\"\n", "\n", - " id=\"img-491005fc\">\n", + " id=\"img-1bb9eee9\">\n", "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", @@ -4797,22 +4797,22 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", @@ -4851,18 +4851,18 @@ " stroke-width=\"0.3\"\n", " font-size=\"3.88\"\n", "\n", - " id=\"img-e75d2f29\">\n", + " id=\"img-294a95ec\">\n", "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", @@ -5031,12 +5031,12 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", @@ -5072,49 +5072,49 @@ " stroke-width=\"0.3\"\n", " font-size=\"3.88\"\n", "\n", - " id=\"img-3d639276\">\n", + " id=\"img-96fc351f\">\n", "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -5159,15 +5159,15 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " f\n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -5212,14 +5212,14 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " f\n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", @@ -5388,43 +5388,43 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -5469,15 +5469,15 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " f\n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -5522,14 +5522,14 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " f\n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", @@ -5565,48 +5565,48 @@ " stroke-width=\"0.3\"\n", " font-size=\"3.88\"\n", "\n", - " id=\"img-21905dc5\">\n", + " id=\"img-8fbbc86e\">\n", "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", @@ -5775,42 +5775,42 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", @@ -5846,68 +5846,68 @@ " stroke-width=\"0.3\"\n", " font-size=\"3.88\"\n", "\n", - " id=\"img-30f842bd\">\n", + " id=\"img-26a56ff7\">\n", "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", @@ -6076,62 +6076,62 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", @@ -6181,18 +6181,18 @@ " stroke-width=\"0.3\"\n", " font-size=\"3.88\"\n", "\n", - " id=\"img-06bf43da\">\n", + " id=\"img-ce7b32ee\">\n", "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", @@ -6361,12 +6361,12 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", @@ -6404,18 +6404,18 @@ " stroke-width=\"0.3\"\n", " font-size=\"3.88\"\n", "\n", - " id=\"img-da8510ca\">\n", + " id=\"img-ec27efe2\">\n", "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", @@ -6584,12 +6584,12 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", @@ -6634,13 +6634,13 @@ " stroke-width=\"0.3\"\n", " font-size=\"3.88\"\n", "\n", - " id=\"img-116ef5d3\">\n", + " id=\"img-612bd2ba\">\n", "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", @@ -6651,17 +6651,17 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", @@ -6672,8 +6672,8 @@ " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -6718,7 +6718,7 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " f\n", @@ -6889,7 +6889,7 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", @@ -6900,17 +6900,17 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", @@ -6921,8 +6921,8 @@ " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -6967,7 +6967,7 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " f\n", @@ -7025,43 +7025,43 @@ " stroke-width=\"0.3\"\n", " font-size=\"3.88\"\n", "\n", - " id=\"img-1a9afeab\">\n", + " id=\"img-9d8bac03\">\n", "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", @@ -7230,37 +7230,37 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", @@ -7298,33 +7298,33 @@ " stroke-width=\"0.3\"\n", " font-size=\"3.88\"\n", "\n", - " id=\"img-e631ec7b\">\n", + " id=\"img-a030b81b\">\n", "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", @@ -7332,7 +7332,7 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", @@ -7340,32 +7340,32 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", @@ -7534,27 +7534,27 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", @@ -7562,7 +7562,7 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", @@ -7570,32 +7570,32 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", @@ -7646,29 +7646,29 @@ " stroke-width=\"0.3\"\n", " font-size=\"3.88\"\n", "\n", - " id=\"img-6f118e19\">\n", + " id=\"img-301b14c2\">\n", "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -7713,15 +7713,15 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " g\n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -7766,7 +7766,7 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " f\n", @@ -7937,23 +7937,23 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -7998,15 +7998,15 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " g\n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -8051,7 +8051,7 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " f\n", @@ -8096,43 +8096,43 @@ " stroke-width=\"0.3\"\n", " font-size=\"3.88\"\n", "\n", - " id=\"img-6e1779ad\">\n", + " id=\"img-b336c9b1\">\n", "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", @@ -8301,37 +8301,37 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", @@ -8379,34 +8379,34 @@ " stroke-width=\"0.3\"\n", " font-size=\"3.88\"\n", "\n", - " id=\"img-b86f3dd0\">\n", + " id=\"img-76b484ab\">\n", "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -8451,15 +8451,15 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " g\n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -8504,7 +8504,7 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " f\n", @@ -8675,28 +8675,28 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -8741,15 +8741,15 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " g\n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -8794,7 +8794,7 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " f\n", @@ -8842,45 +8842,45 @@ " stroke-width=\"0.3\"\n", " font-size=\"3.88\"\n", "\n", - " id=\"img-ca990e51\">\n", + " id=\"img-31ac6bf2\">\n", "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " g\n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " f\n", @@ -9051,39 +9051,39 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " g\n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " f\n", diff --git a/dev/generated/graphics/composejl_wiring_diagrams/ee64e1b8.svg b/dev/generated/graphics/composejl_wiring_diagrams/f4bffa70.svg similarity index 90% rename from dev/generated/graphics/composejl_wiring_diagrams/ee64e1b8.svg rename to dev/generated/graphics/composejl_wiring_diagrams/f4bffa70.svg index 1459b6c07..05466ff8a 100644 --- a/dev/generated/graphics/composejl_wiring_diagrams/ee64e1b8.svg +++ b/dev/generated/graphics/composejl_wiring_diagrams/f4bffa70.svg @@ -13,128 +13,128 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + @@ -179,15 +179,15 @@ - + g - - + + @@ -232,15 +232,15 @@ - + f - - + + @@ -285,15 +285,15 @@ - + k - - + + @@ -338,15 +338,15 @@ - + h - - + + @@ -391,15 +391,15 @@ - + m - - + + @@ -444,15 +444,15 @@ - + n - - + + @@ -497,15 +497,15 @@ - + l - - + + @@ -550,15 +550,15 @@ - + n - - + + @@ -603,15 +603,15 @@ - + m - - + + @@ -656,15 +656,15 @@ - + k - - + + @@ -709,15 +709,15 @@ - + h - - + + @@ -762,15 +762,15 @@ - + g - - + + @@ -815,7 +815,7 @@ - + f diff --git a/dev/generated/graphics/composejl_wiring_diagrams/index.html b/dev/generated/graphics/composejl_wiring_diagrams/index.html index 614996121..5ed98c0cc 100644 --- a/dev/generated/graphics/composejl_wiring_diagrams/index.html +++ b/dev/generated/graphics/composejl_wiring_diagrams/index.html @@ -19,18 +19,18 @@ - + - + - - + + @@ -75,7 +75,7 @@ - + f @@ -98,23 +98,23 @@ - + - + - + - - + + @@ -159,15 +159,15 @@ - + g - - + + @@ -212,7 +212,7 @@ - + f @@ -235,28 +235,28 @@ - + - + - + - + - - + + @@ -301,15 +301,15 @@ - + g - - + + @@ -354,7 +354,7 @@ - + f @@ -366,7 +366,7 @@ m, n = Hom(:m, B⊗A, A⊗B), Hom(:n, D⊗C, C⊗D) q = Hom(:l, A⊗B⊗C⊗D, D⊗C⊗B⊗A) -to_composejl((f⊗g⊗h⊗k)⋅(m⊗n)⋅q⋅(n⊗m)⋅(h⊗k⊗f⊗g))Example block output

Identities and braidings appear as wires.

to_composejl(id(A))
- + @@ -405,7 +405,7 @@ - + @@ -413,7 +413,7 @@ - + @@ -437,7 +437,7 @@ - + @@ -445,7 +445,7 @@ - + @@ -453,7 +453,7 @@ - + @@ -461,7 +461,7 @@ - + @@ -469,8 +469,8 @@ - - + + @@ -515,15 +515,15 @@ - + f - - + + @@ -568,7 +568,7 @@ - + g @@ -593,7 +593,7 @@ - + @@ -607,7 +607,7 @@ - + @@ -621,7 +621,7 @@ - + @@ -651,17 +651,17 @@ - + - + - + @@ -685,22 +685,22 @@ - + - + - + - + @@ -721,12 +721,12 @@ - + - + @@ -747,43 +747,43 @@ - + - + - + - + - + - + - + - - + + @@ -828,15 +828,15 @@ - + f - - + + @@ -881,14 +881,14 @@ - + f - + @@ -909,42 +909,42 @@ - + - + - + - + - + - + - + - + @@ -965,62 +965,62 @@ - + - + - + - + - + - + - + - + - + - + - + - + @@ -1043,12 +1043,12 @@ - + - + @@ -1069,12 +1069,12 @@ - + - + @@ -1098,7 +1098,7 @@ - + @@ -1109,17 +1109,17 @@ - + - + - + @@ -1130,8 +1130,8 @@ - - + + @@ -1176,7 +1176,7 @@ - + f @@ -1201,37 +1201,37 @@ - + - + - + - + - + - + - + @@ -1252,27 +1252,27 @@ - + - + - + - + - + @@ -1280,7 +1280,7 @@ - + @@ -1288,32 +1288,32 @@ - + - + - + - + - + - + @@ -1341,23 +1341,23 @@ - + - + - + - - + + @@ -1402,15 +1402,15 @@ - + g - - + + @@ -1455,7 +1455,7 @@ - + f @@ -1483,37 +1483,37 @@ - + - + - + - + - + - + - + @@ -1536,28 +1536,28 @@ - + - + - + - + - - + + @@ -1602,15 +1602,15 @@ - + g - - + + @@ -1655,7 +1655,7 @@ - + f @@ -1678,39 +1678,39 @@ - + - + - + - + - + g - + - + f @@ -1751,4 +1751,4 @@ \begin{scope} \draw (12,8) node [text=mycolor000000,rotate around={-0: (0,0)},inner sep=0.0]{\fontsize{12mm}{14.4mm}\selectfont $\text{f}$}; \end{scope} -\end{tikzpicture} +\end{tikzpicture} diff --git a/dev/generated/graphics/graphviz_graphs/index.html b/dev/generated/graphics/graphviz_graphs/index.html index 01ab30b6b..fcd797f26 100644 --- a/dev/generated/graphics/graphviz_graphs/index.html +++ b/dev/generated/graphics/graphviz_graphs/index.html @@ -711,4 +711,4 @@ -'/> +'/> diff --git a/dev/generated/graphics/graphviz_wiring_diagrams/index.html b/dev/generated/graphics/graphviz_wiring_diagrams/index.html index 13774d4c6..89aa2a560 100644 --- a/dev/generated/graphics/graphviz_wiring_diagrams/index.html +++ b/dev/generated/graphics/graphviz_wiring_diagrams/index.html @@ -1539,4 +1539,4 @@ :rankdir => "TB" :_subgraph_cnt => 2 :objects => Object[{… - :edges => Object[{… + :edges => Object[{… diff --git a/dev/generated/graphics/layouts_vs_drawings.ipynb b/dev/generated/graphics/layouts_vs_drawings.ipynb index b84d76d5b..9367495d5 100644 --- a/dev/generated/graphics/layouts_vs_drawings.ipynb +++ b/dev/generated/graphics/layouts_vs_drawings.ipynb @@ -375,59 +375,59 @@ " stroke-width=\"0.3\"\n", " font-size=\"3.88\"\n", "\n", - " id=\"img-3440f609\">\n", + " id=\"img-3eb0f2f0\">\n", "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -472,15 +472,15 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " h\n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -525,15 +525,15 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " g\n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -578,15 +578,15 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " f\n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -631,15 +631,15 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " g\n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -684,15 +684,15 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " f\n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -737,7 +737,7 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " f\n", @@ -908,53 +908,53 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -999,15 +999,15 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " h\n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -1052,15 +1052,15 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " g\n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -1105,15 +1105,15 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " f\n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -1158,15 +1158,15 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " g\n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -1211,15 +1211,15 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " f\n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -1264,7 +1264,7 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " f\n", @@ -1306,68 +1306,68 @@ "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", - "\n", + "\n", " \n", "\n", - "\n", + "\n", " \n", "\n", - "\n", + "\n", " \n", "\n", - "\n", + "\n", " \n", "\n", - "\n", + "\n", " \n", "\n", - "\n", + "\n", " \n", "\n", "\n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", "\n", - " \n", + " \n", "\n", - "\n", + "\n", "\n", "\n", "\n", - " \n", + " \n", "\n", - "\n", + "\n", "\n", "\n", "\n", - " \n", + " \n", "\n", - "\n", + "\n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", "\n", @@ -1375,13 +1375,13 @@ "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", @@ -1435,59 +1435,59 @@ " stroke-width=\"0.3\"\n", " font-size=\"3.88\"\n", "\n", - " id=\"img-dbdd00b2\">\n", + " id=\"img-c54f504d\">\n", "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -1532,15 +1532,15 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " h\n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -1585,15 +1585,15 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " g\n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -1638,15 +1638,15 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " f\n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -1691,15 +1691,15 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " g\n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -1744,15 +1744,15 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " f\n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -1797,7 +1797,7 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " f\n", @@ -1968,53 +1968,53 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -2059,15 +2059,15 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " h\n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -2112,15 +2112,15 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " g\n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -2165,15 +2165,15 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " f\n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -2218,15 +2218,15 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " g\n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -2271,15 +2271,15 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " f\n", " \n", " \n", "\n", - "\n", - " \n", + "\n", + " \n", " \n", " \n", " \n", @@ -2324,7 +2324,7 @@ " \n", " \n", "\n", - "\n", + "\n", " \n", " \n", " f\n", @@ -2358,53 +2358,53 @@ "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", - "\n", + "\n", " \n", "\n", - "\n", + "\n", " \n", "\n", - "\n", + "\n", " \n", "\n", "\n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", "\n", @@ -2412,13 +2412,13 @@ "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", diff --git a/dev/generated/graphics/layouts_vs_drawings/f2b1e721.svg b/dev/generated/graphics/layouts_vs_drawings/213e5d95.svg similarity index 90% rename from dev/generated/graphics/layouts_vs_drawings/f2b1e721.svg rename to dev/generated/graphics/layouts_vs_drawings/213e5d95.svg index 3eff1abfe..b597a0bf7 100644 --- a/dev/generated/graphics/layouts_vs_drawings/f2b1e721.svg +++ b/dev/generated/graphics/layouts_vs_drawings/213e5d95.svg @@ -2,68 +2,68 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -71,13 +71,13 @@ - + - + - + diff --git a/dev/generated/graphics/layouts_vs_drawings/5c2419d5.svg b/dev/generated/graphics/layouts_vs_drawings/947958a0.svg similarity index 91% rename from dev/generated/graphics/layouts_vs_drawings/5c2419d5.svg rename to dev/generated/graphics/layouts_vs_drawings/947958a0.svg index c032fb6dc..7d25ab143 100644 --- a/dev/generated/graphics/layouts_vs_drawings/5c2419d5.svg +++ b/dev/generated/graphics/layouts_vs_drawings/947958a0.svg @@ -13,53 +13,53 @@ - + - + - + - + - + - + - + - + - + - - + + @@ -104,15 +104,15 @@ - + h - - + + @@ -157,15 +157,15 @@ - + g - - + + @@ -210,15 +210,15 @@ - + f - - + + @@ -263,15 +263,15 @@ - + g - - + + @@ -316,15 +316,15 @@ - + f - - + + @@ -369,7 +369,7 @@ - + f diff --git a/dev/generated/graphics/layouts_vs_drawings/632941da.svg b/dev/generated/graphics/layouts_vs_drawings/bc053c85.svg similarity index 92% rename from dev/generated/graphics/layouts_vs_drawings/632941da.svg rename to dev/generated/graphics/layouts_vs_drawings/bc053c85.svg index cf77fbd3b..7fefea9f5 100644 --- a/dev/generated/graphics/layouts_vs_drawings/632941da.svg +++ b/dev/generated/graphics/layouts_vs_drawings/bc053c85.svg @@ -2,53 +2,53 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -56,13 +56,13 @@ - + - + - + diff --git a/dev/generated/graphics/layouts_vs_drawings/b27ecdfc.svg b/dev/generated/graphics/layouts_vs_drawings/fa040111.svg similarity index 92% rename from dev/generated/graphics/layouts_vs_drawings/b27ecdfc.svg rename to dev/generated/graphics/layouts_vs_drawings/fa040111.svg index e8b326a1e..2e8bc36ee 100644 --- a/dev/generated/graphics/layouts_vs_drawings/b27ecdfc.svg +++ b/dev/generated/graphics/layouts_vs_drawings/fa040111.svg @@ -13,53 +13,53 @@ - + - + - + - + - + - + - + - + - + - - + + @@ -104,15 +104,15 @@ - + h - - + + @@ -157,15 +157,15 @@ - + g - - + + @@ -210,15 +210,15 @@ - + f - - + + @@ -263,15 +263,15 @@ - + g - - + + @@ -316,15 +316,15 @@ - + f - - + + @@ -369,7 +369,7 @@ - + f diff --git a/dev/generated/graphics/layouts_vs_drawings/index.html b/dev/generated/graphics/layouts_vs_drawings/index.html index 5f54008de..ff6b13cb3 100644 --- a/dev/generated/graphics/layouts_vs_drawings/index.html +++ b/dev/generated/graphics/layouts_vs_drawings/index.html @@ -249,8 +249,8 @@

'/>

To get just the layout from Graphviz, we call graphviz_layout instead. We can then render this layout using Compose.jl. Note that the Graphviz layout has units in points.

import Compose
 
 layout = graphviz_layout(diagram, orientation=LeftToRight)
-layout_to_composejl(layout, base_unit=Compose.pt)
Example block output

The same layout can be rendered in TikZ:

import TikzPictures
+layout_to_composejl(layout, base_unit=Compose.pt)
Example block output

The same layout can be rendered in TikZ:

import TikzPictures
 
-layout_to_tikz(layout, base_unit="1pt")
Example block output

Series-parallel layout

Catlab has its own layout system based on series-parallel decomposition. In this case, the layout exactly recovers the structure of the morphism expression created at the beginning.

layout = layout_diagram(FreeSymmetricMonoidalCategory, diagram,
+layout_to_tikz(layout, base_unit="1pt")
Example block output

Series-parallel layout

Catlab has its own layout system based on series-parallel decomposition. In this case, the layout exactly recovers the structure of the morphism expression created at the beginning.

layout = layout_diagram(FreeSymmetricMonoidalCategory, diagram,
                         orientation=LeftToRight)
-layout_to_composejl(layout)
Example block output
layout_to_tikz(layout)
Example block output +layout_to_composejl(layout)Example block output
layout_to_tikz(layout)
Example block output diff --git a/dev/generated/graphics/tikz_wiring_diagrams.ipynb b/dev/generated/graphics/tikz_wiring_diagrams.ipynb index a762640b0..9d4dc0b5d 100644 --- a/dev/generated/graphics/tikz_wiring_diagrams.ipynb +++ b/dev/generated/graphics/tikz_wiring_diagrams.ipynb @@ -73,37 +73,37 @@ "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", - "\n", + "\n", " \n", "\n", "\n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", "\n", - " \n", + " \n", "\n", - "\n", + "\n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", "\n", @@ -132,48 +132,48 @@ "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", - "\n", + "\n", " \n", "\n", "\n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", "\n", - " \n", + " \n", "\n", - "\n", + "\n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", "\n", @@ -202,57 +202,57 @@ "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", - "\n", + "\n", " \n", "\n", - "\n", + "\n", " \n", "\n", "\n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", "\n", - " \n", + " \n", "\n", - "\n", + "\n", "\n", "\n", "\n", - " \n", + " \n", "\n", - "\n", + "\n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", "\n", @@ -289,96 +289,96 @@ "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", - "\n", + "\n", " \n", "\n", - "\n", + "\n", " \n", "\n", - "\n", + "\n", " \n", "\n", - "\n", + "\n", " \n", "\n", "\n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", "\n", @@ -400,16 +400,16 @@ "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", @@ -450,23 +450,23 @@ "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", - "\n", + "\n", " \n", "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", "\n", @@ -495,35 +495,35 @@ "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", - "\n", + "\n", " \n", "\n", - "\n", + "\n", " \n", "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", - " \n", + " \n", "\n", - "\n", + "\n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", "\n", @@ -552,32 +552,32 @@ "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", - "\n", + "\n", " \n", "\n", "\n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", @@ -616,97 +616,97 @@ "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", - "\n", + "\n", " \n", "\n", - "\n", + "\n", " \n", "\n", - "\n", + "\n", " \n", "\n", - "\n", + "\n", " \n", "\n", - "\n", + "\n", " \n", "\n", - "\n", + "\n", " \n", "\n", - "\n", + "\n", " \n", "\n", - "\n", + "\n", " \n", "\n", - "\n", + "\n", " \n", "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", @@ -748,97 +748,97 @@ "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", - "\n", + "\n", " \n", "\n", - "\n", + "\n", " \n", "\n", - "\n", + "\n", " \n", "\n", - "\n", + "\n", " \n", "\n", - "\n", + "\n", " \n", "\n", - "\n", + "\n", " \n", "\n", - "\n", + "\n", " \n", "\n", - "\n", + "\n", " \n", "\n", - "\n", + "\n", " \n", "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", @@ -876,17 +876,17 @@ "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", - "\n", + "\n", " \n", "\n", - "\n", + "\n", " \n", "\n", "\n", @@ -894,12 +894,12 @@ "\n", "\n", "\n", - " \n", + " \n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", @@ -932,10 +932,10 @@ "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", @@ -944,7 +944,7 @@ "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", "\n", @@ -973,20 +973,20 @@ "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", - "\n", + "\n", " \n", "\n", "\n", @@ -994,26 +994,26 @@ "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", "\n", @@ -1042,26 +1042,26 @@ "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", - "\n", + "\n", " \n", "\n", - "\n", + "\n", " \n", "\n", - "\n", + "\n", " \n", "\n", - "\n", + "\n", " \n", "\n", "\n", @@ -1070,22 +1070,22 @@ "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", "\n", - " \n", + " \n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", @@ -1115,35 +1115,35 @@ "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", - "\n", + "\n", " \n", "\n", - "\n", + "\n", " \n", "\n", - "\n", + "\n", " \n", "\n", - "\n", + "\n", " \n", "\n", - "\n", + "\n", " \n", "\n", - "\n", + "\n", " \n", "\n", "\n", @@ -1153,32 +1153,32 @@ "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", "\n", - " \n", + " \n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", @@ -1222,41 +1222,41 @@ "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", - "\n", + "\n", " \n", "\n", - "\n", + "\n", " \n", "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", "\n", @@ -1288,10 +1288,10 @@ "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", @@ -1299,20 +1299,20 @@ "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", "\n", @@ -1351,26 +1351,26 @@ "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", - "\n", + "\n", " \n", "\n", "\n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", @@ -1419,10 +1419,10 @@ "\n", "\n", "\n", - "\n", + "\n", " \n", "\n", - "\n", + "\n", " \n", "\n", "\n", @@ -1432,10 +1432,10 @@ "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", @@ -1466,10 +1466,10 @@ "\n", "\n", "\n", - "\n", + "\n", " \n", "\n", - "\n", + "\n", " \n", "\n", "\n", @@ -1484,10 +1484,10 @@ "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", @@ -1532,32 +1532,32 @@ "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", - "\n", + "\n", " \n", "\n", "\n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", @@ -1591,10 +1591,10 @@ "\n", "\n", "\n", - "\n", + "\n", " \n", "\n", - "\n", + "\n", " \n", "\n", "\n", @@ -1604,10 +1604,10 @@ "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", @@ -1651,32 +1651,32 @@ "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", - "\n", + "\n", " \n", "\n", "\n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", @@ -1706,32 +1706,32 @@ "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", - "\n", + "\n", " \n", "\n", "\n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", @@ -1763,32 +1763,32 @@ "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", - "\n", + "\n", " \n", "\n", "\n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", @@ -1820,32 +1820,32 @@ "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", - "\n", + "\n", " \n", "\n", "\n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", diff --git a/dev/generated/graphics/tikz_wiring_diagrams/d1880a21.svg b/dev/generated/graphics/tikz_wiring_diagrams/52009dae.svg similarity index 93% rename from dev/generated/graphics/tikz_wiring_diagrams/d1880a21.svg rename to dev/generated/graphics/tikz_wiring_diagrams/52009dae.svg index 6f949378b..b68f44d2b 100644 --- a/dev/generated/graphics/tikz_wiring_diagrams/d1880a21.svg +++ b/dev/generated/graphics/tikz_wiring_diagrams/52009dae.svg @@ -2,20 +2,20 @@ - + - + - + - + - + @@ -23,26 +23,26 @@ - + - + - + - + - + diff --git a/dev/generated/graphics/tikz_wiring_diagrams/75de7eae.svg b/dev/generated/graphics/tikz_wiring_diagrams/b6c5ad46.svg similarity index 93% rename from dev/generated/graphics/tikz_wiring_diagrams/75de7eae.svg rename to dev/generated/graphics/tikz_wiring_diagrams/b6c5ad46.svg index 2bff4a9a4..4e9297b44 100644 --- a/dev/generated/graphics/tikz_wiring_diagrams/75de7eae.svg +++ b/dev/generated/graphics/tikz_wiring_diagrams/b6c5ad46.svg @@ -2,96 +2,96 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -113,16 +113,16 @@ - + - + - + - + diff --git a/dev/generated/graphics/tikz_wiring_diagrams/f1709624.svg b/dev/generated/graphics/tikz_wiring_diagrams/bbea736c.svg similarity index 84% rename from dev/generated/graphics/tikz_wiring_diagrams/f1709624.svg rename to dev/generated/graphics/tikz_wiring_diagrams/bbea736c.svg index 7d78e38b3..fab4f9a70 100644 --- a/dev/generated/graphics/tikz_wiring_diagrams/f1709624.svg +++ b/dev/generated/graphics/tikz_wiring_diagrams/bbea736c.svg @@ -2,97 +2,97 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/dev/generated/graphics/tikz_wiring_diagrams/f6024845.svg b/dev/generated/graphics/tikz_wiring_diagrams/ceddf541.svg similarity index 89% rename from dev/generated/graphics/tikz_wiring_diagrams/f6024845.svg rename to dev/generated/graphics/tikz_wiring_diagrams/ceddf541.svg index 2a393cb94..2cc88bb92 100644 --- a/dev/generated/graphics/tikz_wiring_diagrams/f6024845.svg +++ b/dev/generated/graphics/tikz_wiring_diagrams/ceddf541.svg @@ -2,35 +2,35 @@ - + - + - + - + - + - + - + - + - + - + @@ -40,32 +40,32 @@ - + - + - + - + - + - + - + - + - + diff --git a/dev/generated/graphics/tikz_wiring_diagrams/12df8309.svg b/dev/generated/graphics/tikz_wiring_diagrams/e1b08a88.svg similarity index 85% rename from dev/generated/graphics/tikz_wiring_diagrams/12df8309.svg rename to dev/generated/graphics/tikz_wiring_diagrams/e1b08a88.svg index d0dc7c2ec..d2f712ee3 100644 --- a/dev/generated/graphics/tikz_wiring_diagrams/12df8309.svg +++ b/dev/generated/graphics/tikz_wiring_diagrams/e1b08a88.svg @@ -2,97 +2,97 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/dev/generated/graphics/tikz_wiring_diagrams/e23151a6.svg b/dev/generated/graphics/tikz_wiring_diagrams/e38dcfba.svg similarity index 91% rename from dev/generated/graphics/tikz_wiring_diagrams/e23151a6.svg rename to dev/generated/graphics/tikz_wiring_diagrams/e38dcfba.svg index 82b672351..40b18c39e 100644 --- a/dev/generated/graphics/tikz_wiring_diagrams/e23151a6.svg +++ b/dev/generated/graphics/tikz_wiring_diagrams/e38dcfba.svg @@ -2,48 +2,48 @@ - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/dev/generated/graphics/tikz_wiring_diagrams/2bc38577.svg b/dev/generated/graphics/tikz_wiring_diagrams/eeb232b1.svg similarity index 89% rename from dev/generated/graphics/tikz_wiring_diagrams/2bc38577.svg rename to dev/generated/graphics/tikz_wiring_diagrams/eeb232b1.svg index 99f65cdb2..026e86002 100644 --- a/dev/generated/graphics/tikz_wiring_diagrams/2bc38577.svg +++ b/dev/generated/graphics/tikz_wiring_diagrams/eeb232b1.svg @@ -2,57 +2,57 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/dev/generated/graphics/tikz_wiring_diagrams/index.html b/dev/generated/graphics/tikz_wiring_diagrams/index.html index a17b2478a..b7b6d081e 100644 --- a/dev/generated/graphics/tikz_wiring_diagrams/index.html +++ b/dev/generated/graphics/tikz_wiring_diagrams/index.html @@ -9,66 +9,66 @@ - + - + - + - + - + - + - + - + - + -'/>
to_tikz(f⋅g, labels=true)
Example block output
to_tikz(f⊗g, labels=true, orientation=TopToBottom)
Example block output

Here is a more complex example, involving generators with compound domains and codomains.

h, k = Hom(:h, C, D),  Hom(:k, D, C)
+'/>
to_tikz(f⋅g, labels=true)
Example block output
to_tikz(f⊗g, labels=true, orientation=TopToBottom)
Example block output

Here is a more complex example, involving generators with compound domains and codomains.

h, k = Hom(:h, C, D),  Hom(:k, D, C)
 m, n = Hom(:m, B⊗A, A⊗B), Hom(:n, D⊗C, C⊗D)
 q = Hom(:l, A⊗B⊗C⊗D, D⊗C⊗B⊗A)
 
-to_tikz((f⊗g⊗h⊗k)⋅(m⊗n)⋅q⋅(n⊗m)⋅(h⊗k⊗f⊗g))
Example block output

Identities and braidings appear as wires.

to_tikz(id(A), labels=true)
- + - + - + - + - + @@ -77,35 +77,35 @@ - + - + - + - + - + - + - + - + - + @@ -114,32 +114,32 @@ - + - + - + - + - + - + - + @@ -149,25 +149,25 @@ '/>

The isomorphism $A \otimes B \otimes C \to C \otimes B \otimes A$ induced by the permutation $(3\ 2\ 1)$ is a composite of braidings and identities.

σ = (braid(A,B) ⊗ id(C)) ⋅ (id(B) ⊗ braid(A,C) ⋅ (braid(B,C) ⊗ id(A)))
 
 to_tikz(σ, arrowtip="Stealth", arrowtip_pos="-0.1pt",
-        labels=true, labels_pos="0.1pt")
Example block output

By default, anchor points are added along identity and braiding wires to reproduce the expression structure in the layout. The anchors can be disabled to get a more "unbiased" layout.

to_tikz(σ, anchor_wires=false, arrowtip="Stealth", arrowtip_pos="-0.1pt",
-        labels=true, labels_pos="0.1pt")
Example block output

Biproduct category

A, B, C = Ob(FreeBiproductCategory, :A, :B, :C)
+        labels=true, labels_pos="0.1pt")
Example block output

By default, anchor points are added along identity and braiding wires to reproduce the expression structure in the layout. The anchors can be disabled to get a more "unbiased" layout.

to_tikz(σ, anchor_wires=false, arrowtip="Stealth", arrowtip_pos="-0.1pt",
+        labels=true, labels_pos="0.1pt")
Example block output

Biproduct category

A, B, C = Ob(FreeBiproductCategory, :A, :B, :C)
 f = Hom(:f, A, B)
 
 to_tikz(mcopy(A), labels=true)
to_tikz(mcopy(A)⋅(f⊗f)⋅mmerge(B), labels=true)
Example block output
to_tikz(mcopy(A⊗B), orientation=TopToBottom, labels=true)
to_tikz(mcopy(A)⋅(f⊗f)⋅mmerge(B), labels=true)
Example block output
to_tikz(mcopy(A⊗B), orientation=TopToBottom, labels=true)
to_tikz(mcopy(A⊗B⊗C), orientation=TopToBottom, labels=true)
Example block output

Compact closed category

The unit and co-unit of a compact closed category appear as caps and cups.

A, B = Ob(FreeCompactClosedCategory, :A, :B)
+'/>
to_tikz(mcopy(A⊗B⊗C), orientation=TopToBottom, labels=true)
Example block output

Compact closed category

The unit and co-unit of a compact closed category appear as caps and cups.

A, B = Ob(FreeCompactClosedCategory, :A, :B)
 
 to_tikz(dunit(A), arrowtip="Stealth", labels=true)
- + - + @@ -390,10 +390,10 @@ - + - + @@ -402,10 +402,10 @@ '/>
to_tikz((mcopy(X)⊕mcopy(X)) ⋅ (id(X)⊕swap(X,X)⊕id(X)) ⋅ (plus(X)⊕plus(X)))
- + - + @@ -490,10 +490,10 @@ - + - + @@ -503,32 +503,32 @@ - + - + - + - + - + - + - + @@ -540,32 +540,32 @@ - + - + - + - + - + - + - + @@ -577,32 +577,32 @@ - + - + - + - + - + - + - + @@ -614,32 +614,32 @@ - + - + - + - + - + - + - + @@ -658,4 +658,4 @@ \path[wire] (root.west) to[out=0,in=-180] (n1.west); \path[wire] (n1.east) to[out=0,in=-180] (n2.west); \path[wire] (n2.east) to[out=0,in=180] (root.east); -\end{tikzpicture}
+\end{tikzpicture}
diff --git a/dev/generated/graphs/graphs/index.html b/dev/generated/graphs/graphs/index.html index e6012de8c..3fbfe644f 100644 --- a/dev/generated/graphs/graphs/index.html +++ b/dev/generated/graphs/graphs/index.html @@ -1122,4 +1122,4 @@
-'/> +'/> diff --git a/dev/generated/graphs/graphs_label/index.html b/dev/generated/graphs/graphs_label/index.html index f76381902..c7ca7b481 100644 --- a/dev/generated/graphs/graphs_label/index.html +++ b/dev/generated/graphs/graphs_label/index.html @@ -1139,4 +1139,4 @@
-'/> +'/> diff --git a/dev/generated/graphs/subgraphs/index.html b/dev/generated/graphs/subgraphs/index.html index e34d65018..14c94b734 100644 --- a/dev/generated/graphs/subgraphs/index.html +++ b/dev/generated/graphs/subgraphs/index.html @@ -1158,4 +1158,4 @@
-'/> +'/> diff --git a/dev/generated/sketches/cat_elements/index.html b/dev/generated/sketches/cat_elements/index.html index cc32a1e99..f83b22936 100644 --- a/dev/generated/sketches/cat_elements/index.html +++ b/dev/generated/sketches/cat_elements/index.html @@ -737,4 +737,4 @@
-'/>

As a very advanced exercise, you could try to implement one or both directions of the isomorphism above.

+'/>

As a very advanced exercise, you could try to implement one or both directions of the isomorphism above.

diff --git a/dev/generated/sketches/meets.ipynb b/dev/generated/sketches/meets.ipynb index 5b2db5150..732f5c476 100644 --- a/dev/generated/sketches/meets.ipynb +++ b/dev/generated/sketches/meets.ipynb @@ -565,7 +565,7 @@ "output_type": "stream", "text": [ "Test Summary: | Pass Total Time\n", - "Upsets | 4 4 0.3s\n", + "Upsets | 4 4 0.2s\n", "Test Summary: | Pass Total Time\n", "Downsets | 4 4 0.1s\n", "Test Summary: | Pass Total Time\n", @@ -575,7 +575,7 @@ { "output_type": "execute_result", "data": { - "text/plain": "Test.DefaultTestSet(\"Meets\", Any[], 6, false, false, true, 1.702683251729401e9, 1.702683251836908e9, false)" + "text/plain": "Test.DefaultTestSet(\"Meets\", Any[], 6, false, false, true, 1.702685257942362e9, 1.702685258042921e9, false)" }, "metadata": {}, "execution_count": 13 @@ -868,7 +868,7 @@ { "output_type": "execute_result", "data": { - "text/plain": "Test.DefaultTestSet(\"meets2\", Any[], 8, false, false, true, 1.702683252016268e9, 1.702683252016433e9, false)" + "text/plain": "Test.DefaultTestSet(\"meets2\", Any[], 8, false, false, true, 1.702685258208311e9, 1.702685258208459e9, false)" }, "metadata": {}, "execution_count": 17 diff --git a/dev/generated/sketches/meets/index.html b/dev/generated/sketches/meets/index.html index c52c4e1a6..6f13e8cf7 100644 --- a/dev/generated/sketches/meets/index.html +++ b/dev/generated/sketches/meets/index.html @@ -226,7 +226,7 @@ @test meet(g, 1, 4) == 1 @test meet(g, 1, 1) == 1 @test meet(g, 2, 2) == 2 -end
Test.DefaultTestSet("Meets", Any[], 6, false, false, true, 1.702683331124019e9, 1.702683331173518e9, false)

Another Example:

@present P(FreeSchema) begin
+end
Test.DefaultTestSet("Meets", Any[], 6, false, false, true, 1.702685332607426e9, 1.702685332656885e9, false)

Another Example:

@present P(FreeSchema) begin
   (a₁,a₂,a₃,a₄, a₅)::Ob
   f::Hom(a₁, a₂)
   g::Hom(a₁, a₃)
@@ -395,4 +395,4 @@ 

Test suite @test meet(g, 2, 2) == 2 @test meet(g, 3, 5) == nothing @test meet(g, 2, 5) == 5 -end

Test.DefaultTestSet("meets2", Any[], 8, false, false, true, 1.702683331240386e9, 1.702683331240533e9, false)

Exercise 3

Make bigger preorders to test corner cases in the above code. If you find an example that breaks these implementations, please report it.

Exercise 4

Implement the dual constructions for joins.

+end
Test.DefaultTestSet("meets2", Any[], 8, false, false, true, 1.702685332723496e9, 1.702685332723647e9, false)

Exercise 3

Make bigger preorders to test corner cases in the above code. If you find an example that breaks these implementations, please report it.

Exercise 4

Implement the dual constructions for joins.

diff --git a/dev/generated/sketches/partitions.ipynb b/dev/generated/sketches/partitions.ipynb index 8156d2741..a7b5a1d97 100644 --- a/dev/generated/sketches/partitions.ipynb +++ b/dev/generated/sketches/partitions.ipynb @@ -225,59 +225,59 @@ "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", - " \n", + " \n", "\n", "\n", - " \n", + " \n", "\n", "\n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", "\n", @@ -417,129 +417,129 @@ "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", - "\n", + "\n", "\n", "\n", "\n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", - " \n", + " \n", "\n", "\n", - " \n", + " \n", "\n", "\n", - " \n", + " \n", "\n", "\n", - " \n", + " \n", "\n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", - " \n", + " \n", "\n", "\n", "\n", "\n", "\n", - " \n", + " \n", "\n", "\n", - " \n", + " \n", "\n", "\n", - " \n", + " \n", "\n", "\n", - " \n", + " \n", "\n", "\n", - " \n", + " \n", "\n", "\n", - " \n", + " \n", "\n", "\n", - " \n", + " \n", "\n", "\n", - " \n", + " \n", "\n", "\n", - " \n", + " \n", "\n", "\n", - " \n", + " \n", "\n", "\n", - " \n", + " \n", "\n", "\n", "\n", diff --git a/dev/generated/sketches/partitions/d704f48b.svg b/dev/generated/sketches/partitions/5b8de2cd.svg similarity index 92% rename from dev/generated/sketches/partitions/d704f48b.svg rename to dev/generated/sketches/partitions/5b8de2cd.svg index b11b301ba..141b2ed46 100644 --- a/dev/generated/sketches/partitions/d704f48b.svg +++ b/dev/generated/sketches/partitions/5b8de2cd.svg @@ -2,59 +2,59 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/dev/generated/sketches/partitions/8e7839d3.svg b/dev/generated/sketches/partitions/6426b229.svg similarity index 87% rename from dev/generated/sketches/partitions/8e7839d3.svg rename to dev/generated/sketches/partitions/6426b229.svg index 6ff6d9edc..bddd5fc3d 100644 --- a/dev/generated/sketches/partitions/8e7839d3.svg +++ b/dev/generated/sketches/partitions/6426b229.svg @@ -2,129 +2,129 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/dev/generated/sketches/partitions/index.html b/dev/generated/sketches/partitions/index.html index 15fc63d36..9b0ee08d1 100644 --- a/dev/generated/sketches/partitions/index.html +++ b/dev/generated/sketches/partitions/index.html @@ -34,7 +34,7 @@ \arrow["g"', two heads, from=1-1, to=3-4] """; -TikzCD(triangle, preamble=TikzCDs.Styles.Quiver)Example block output

Let's take a look at an example:

A = FinSet(4)
+TikzCD(triangle, preamble=TikzCDs.Styles.Quiver)
Example block output

Let's take a look at an example:

A = FinSet(4)
 Q = FinSet(3)
 P = FinSet(2)
 
@@ -69,4 +69,4 @@
 \arrow["{f\cdot h\cdot h^\prime = g\cdot h^\prime}"', two heads, from=1-1, to=5-4]
 """;
 
-TikzCD(refinement, preamble=TikzCDs.Styles.Quiver)
Example block output +TikzCD(refinement, preamble=TikzCDs.Styles.Quiver)Example block output diff --git a/dev/generated/sketches/preorders/index.html b/dev/generated/sketches/preorders/index.html index 0b1c81806..d99118cff 100644 --- a/dev/generated/sketches/preorders/index.html +++ b/dev/generated/sketches/preorders/index.html @@ -136,4 +136,4 @@ Fₒ = Dict(:X=>:a, :Y=>:b, :Z=>:c) Fₕ = Dict(:f=>:ab, :g=>[:bc, :cd]) F = FinFunctor(Fₒ, Fₕ, P, Q) -@test !is_functorial(F)
Test Passed

Monotone maps are functors for thin categories. One of the benefits of category theory is that we find abstractions that work in multiple domains. The abstraction of preserving the domains and codomains of morphisms is a key abstraction that we can use to define many notions in mathematics.

+@test !is_functorial(F)
Test Passed

Monotone maps are functors for thin categories. One of the benefits of category theory is that we find abstractions that work in multiple domains. The abstraction of preserving the domains and codomains of morphisms is a key abstraction that we can use to define many notions in mathematics.

diff --git a/dev/generated/sketches/smc/index.html b/dev/generated/sketches/smc/index.html index 15246ee19..be90b31d9 100644 --- a/dev/generated/sketches/smc/index.html +++ b/dev/generated/sketches/smc/index.html @@ -395,4 +395,4 @@
-'/>

You can visualize the copy and delete morphisms explicitly with the add_junctions function. The dots with one wire input and multiple outputs are copying values and dots with no wires out are deletions (discarding values). Not all instances of a SymmetricMonoidalCategory support copy and delete, for example, in manufacturing you can't duplicate a resource, and in chemistry you can't discard species. Catlab would enforce that when you tried to interpret the wiring diagram in a specific SMC.

draw(add_junctions(recipe))
Example block output

For more details about working with wiring diagrams in Catlab, you should look at the vignettes under wiring_diagrams which explain how wiring diagrams interact with SMC expressions and the basics of constructing and manipulation wiring diagrams.

+'/>

You can visualize the copy and delete morphisms explicitly with the add_junctions function. The dots with one wire input and multiple outputs are copying values and dots with no wires out are deletions (discarding values). Not all instances of a SymmetricMonoidalCategory support copy and delete, for example, in manufacturing you can't duplicate a resource, and in chemistry you can't discard species. Catlab would enforce that when you tried to interpret the wiring diagram in a specific SMC.

draw(add_junctions(recipe))
Example block output

For more details about working with wiring diagrams in Catlab, you should look at the vignettes under wiring_diagrams which explain how wiring diagrams interact with SMC expressions and the basics of constructing and manipulation wiring diagrams.

diff --git a/dev/generated/wiring_diagrams/diagrams_and_expressions/index.html b/dev/generated/wiring_diagrams/diagrams_and_expressions/index.html index e9412f39e..9cd86a2eb 100644 --- a/dev/generated/wiring_diagrams/diagrams_and_expressions/index.html +++ b/dev/generated/wiring_diagrams/diagrams_and_expressions/index.html @@ -241,4 +241,4 @@
-'/>
roundtrip_expr(expr)

\[\left(\Delta_{A} \otimes \Delta_{B}\right) \cdot \left(\mathrm{id}_{A} \otimes \sigma_{A,B} \otimes \mathrm{id}_{B}\right) : A \otimes B \to A \otimes B \otimes A \otimes B\]

The equation just witnessed,

\[\Delta_{A \otimes B} = (\Delta_A \otimes \Delta_B) \cdot (1_A \otimes \sigma_{A,B} \otimes 1_B),\]

is one of the coherence laws for cartesian products (arXiv:0908.3347, Table 7). Another coherence law for products is

\[\lozenge_{A \otimes B} = \lozenge_A \otimes \lozenge_B.\]

expr = delete(A ⊗ B)

\[\lozenge_{A \otimes B} : A \otimes B \to I\]

roundtrip_expr(expr)

\[\lozenge_{A} \otimes \lozenge_{B} : A \otimes B \to I\]

+'/>
roundtrip_expr(expr)

\[\left(\Delta_{A} \otimes \Delta_{B}\right) \cdot \left(\mathrm{id}_{A} \otimes \sigma_{A,B} \otimes \mathrm{id}_{B}\right) : A \otimes B \to A \otimes B \otimes A \otimes B\]

The equation just witnessed,

\[\Delta_{A \otimes B} = (\Delta_A \otimes \Delta_B) \cdot (1_A \otimes \sigma_{A,B} \otimes 1_B),\]

is one of the coherence laws for cartesian products (arXiv:0908.3347, Table 7). Another coherence law for products is

\[\lozenge_{A \otimes B} = \lozenge_A \otimes \lozenge_B.\]

expr = delete(A ⊗ B)

\[\lozenge_{A \otimes B} : A \otimes B \to I\]

roundtrip_expr(expr)

\[\lozenge_{A} \otimes \lozenge_{B} : A \otimes B \to I\]

diff --git a/dev/generated/wiring_diagrams/wd_cset/index.html b/dev/generated/wiring_diagrams/wd_cset/index.html index 8aa36a05e..22028e4ea 100644 --- a/dev/generated/wiring_diagrams/wd_cset/index.html +++ b/dev/generated/wiring_diagrams/wd_cset/index.html @@ -1637,4 +1637,4 @@

« Wiring diagrams and syntactic expressionsDrawing graphs in Graphviz »
+'/>

Almost every application of graphs in computer science could be better served by using one of these extensions to the basic graph data structure.

diff --git a/dev/generated/wiring_diagrams/wiring_diagram_basics/index.html b/dev/generated/wiring_diagrams/wiring_diagram_basics/index.html index 85db7166e..3eeef6298 100644 --- a/dev/generated/wiring_diagrams/wiring_diagram_basics/index.html +++ b/dev/generated/wiring_diagrams/wiring_diagram_basics/index.html @@ -506,4 +506,4 @@ -'/> +'/> diff --git a/dev/index.html b/dev/index.html index f2e9fe26e..099e74e11 100644 --- a/dev/index.html +++ b/dev/index.html @@ -20,4 +20,4 @@ x2::Int end

That is, we assume that all subtypes of a certain abstract types have the same field names, and are organized in roughly the same way. There is no way of enforcing this within Julia, so instead we leave a comment on the abstract type to document that we are working this way.

Note that this is contrary to the standard wisdom in Julia that one should as much as possible access structs through methods, not field accesses. The reason why we do not do this here is twofold. First of all, sometimes it can be annoying to write out the trivial field-access methods in addition to defining the struct. For instance, we have 12 different structs in src/acsets/ColumnImplementations.jl that all are subtypes of an Abstract Field Convention abstract type. It would be 24 lines of boilerplate to write out the field accessors for these types with little appreciable benefit. The second reason is that the Abstract Field Convention is a stronger guarantee than an interface: we are claiming that any subtype has precisely these fields in this order, and no others! This is essential for defining methods like copy, which might be defined as follows.

function copy(p::T) where {T<:Pair}
   T(p.x1, p.x2)
-end

So the Abstract Field Convention is stronger than a normal interface. It's not really about encapsulating data, it's more about cutting down on long names in debug messages.

Table of Contents

+end

So the Abstract Field Convention is stronger than a normal interface. It's not really about encapsulating data, it's more about cutting down on long names in debug messages.

Table of Contents