Skip to content

Commit

Permalink
Merge pull request #847 from AlgebraicJulia/the-glorious-future
Browse files Browse the repository at this point in the history
GATlab integration
  • Loading branch information
epatters authored Oct 17, 2023
2 parents 1874704 + 3b9e304 commit f02b1ee
Show file tree
Hide file tree
Showing 113 changed files with 816 additions and 4,824 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/experiments.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
fail-fast: false
matrix:
experiment: [CompAlgebra, Markov, TensorNetworks]
experiment: [Markov, TensorNetworks]

steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 2 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ version = "0.15.5"

[deps]
ACSets = "227ef7b5-1206-438b-ac65-934d6da304b8"
AlgebraicInterfaces = "23cfdc9f-0504-424a-be1f-4892b28e2f0c"
Colors = "5ae59095-9a9b-59fe-a467-6f913c188581"
CompTime = "0fb5dd42-039a-4ca4-a1d7-89a96eae6d39"
Compose = "a81c6b42-2e10-5240-aca2-a61377ecd94b"
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
GATlab = "f0ffcf3b-d13a-433e-917c-cc44ccf5ead2"
GeneralizedGenerated = "6b9d7cbe-bcb9-11e9-073f-15a7a543e2eb"
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
LightXML = "9c8b4983-aa76-5018-a973-4c85ecc9e179"
Expand Down
2 changes: 1 addition & 1 deletion benchmark/Graphs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Graphs as SimpleGraphs
import MetaGraphs
const LG, MG = SimpleGraphs, MetaGraphs

using Catlab.GATs, Catlab.CategoricalAlgebra, Catlab.Graphs
using GATlab, Catlab.CategoricalAlgebra, Catlab.Graphs
using Catlab.WiringDiagrams: query
using Catlab.Programs: @relation

Expand Down
1 change: 1 addition & 0 deletions benchmark/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
Catlab = "134e5e36-593f-5add-ad60-77f754baafbe"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
GATlab = "f0ffcf3b-d13a-433e-917c-cc44ccf5ead2"
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
MetaGraphs = "626554b9-1ddb-594c-aa3c-2596fe9399a5"
PkgBenchmark = "32113eaa-f34f-5b0d-bd6c-c81e245fc73d"
Expand Down
2 changes: 2 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ Compose = "a81c6b42-2e10-5240-aca2-a61377ecd94b"
Convex = "f65535da-76fb-5f13-bab9-19810c17039a"
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
GATlab = "f0ffcf3b-d13a-433e-917c-cc44ccf5ead2"
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
JSONSchema = "7d188eb4-7ad8-530c-ae41-71a32a6d4692"
LaTeXStrings = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f"
Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306"
PrettyTables = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d"
Expand Down
2 changes: 1 addition & 1 deletion docs/literate/graphs/graphs.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Catlab.GATs, Catlab.Theories
using GATlab, Catlab.Theories
using Catlab.CategoricalAlgebra
using Catlab.Graphs
using Catlab.Graphics
Expand Down
2 changes: 1 addition & 1 deletion docs/literate/graphs/graphs_label.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# # Labeled Graphs
# This example demonstrates how to define new C-Sets from existing C-Sets via the example of adding labels to a graph. We treat labels as members of an arbitrary FinSet of labels rather than a data attribute for pedagogical reasons. When you think of graphs where the labels are numbers, colors, or values of some kind, you would want to make them attributes. The motivation for this example is to be the simplest extension to the theory of graphs that you could possibly make.

using Catlab.GATs, Catlab.Theories
using GATlab, Catlab.Theories
using Catlab.CategoricalAlgebra
using Catlab.Graphs
using Catlab.Graphics
Expand Down
2 changes: 1 addition & 1 deletion docs/literate/sketches/cat_elements.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# # The Category of Elements
# A very useful construction in applied category theory is the Category of Elements, which is also called the Grothendieck construction. This is a very general technique in category theory, but we will look at how you can use it to explain why graphs are so useful in computer science. We have already seen that C-Sets are a model of relational databases that can be used to store data as a collection of interlocking tables. Relational databases are the bread and butter of the computing industry. Every company on earth uses software that is backed by a relational database. Most data that is not stored in a relational DB is often stored in some kind of graph data structure. This sketch will show how these approaches are interchangeable via the category of elements, which associates to every database instance a graph and a graph homomorphism into the schema of the graph.
using Catlab.GATs, Catlab.CategoricalAlgebra, Catlab.Graphs, Catlab.Graphics
using GATlab, Catlab.CategoricalAlgebra, Catlab.Graphs, Catlab.Graphics
using Colors

# Let's tell Catlab how to draw categories of elements.
Expand Down
2 changes: 1 addition & 1 deletion docs/literate/sketches/meets.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
using Core: GeneratedFunctionStub
using Test

using Catlab.GATs, Catlab.Theories, Catlab.CategoricalAlgebra
using GATlab, Catlab.Theories, Catlab.CategoricalAlgebra
using Catlab.Graphics

import Catlab.Theories: compose
Expand Down
2 changes: 1 addition & 1 deletion docs/literate/sketches/partitions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
using Core: GeneratedFunctionStub
using Test

using Catlab.GATs, Catlab.Theories, Catlab.CategoricalAlgebra
using GATlab, Catlab.Theories, Catlab.CategoricalAlgebra
import Catlab.Theories: compose
using DataStructures
using PrettyTables
Expand Down
4 changes: 2 additions & 2 deletions docs/literate/sketches/preorders.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
using Core: GeneratedFunctionStub
using Test

using Catlab.GATs, Catlab.Theories, Catlab.CategoricalAlgebra
using GATlab, Catlab.Theories, Catlab.CategoricalAlgebra
import Catlab.Theories: compose

#=
Expand Down Expand Up @@ -114,7 +114,7 @@ end
# expressions are represented at expression trees
ex = compose(P, [:f, :g])
# the head of an expression is the root of the expression tree
GATs.head(ex)
head(ex)
# the julia type of the expression
typeof(ex)
# the GAT type of the expression
Expand Down
2 changes: 1 addition & 1 deletion docs/literate/sketches/smc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#md # [![](https://img.shields.io/badge/show-nbviewer-579ACA.svg)](@__NBVIEWER_ROOT_URL__/generated/sketches/smc.ipynb)
#
# This vignette supports section 4.4.3 of Seven Sketches in Compositionality, which introduces the definition of symmetric monoidal categories (SMCs). SMCs are a core concept in applied category theory and are a workhorse of Catlab's utility in computing applications. We will discuss the definition as a GAT, see examples of working with formulas, and conversions to wiring diagrams (sometimes called string diagrams). SMCs are useful for modeling mathematical structures like programs or processes where the objects represent data or things and the morphisms represent processes that happen to those things.
using Catlab.GATs, Catlab.Theories
using GATlab, Catlab.Theories
using Catlab.CategoricalAlgebra
using Catlab.WiringDiagrams
using Catlab.Programs
Expand Down
2 changes: 1 addition & 1 deletion docs/literate/wiring_diagrams/wd_cset.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# # Wiring Diagrams as Attributed C-Sets
# Catlab supports many different flavors of diagrammatic syntax. These support the different combinatorial data structures that we use for representing categorical constructions. We will discuss DirectedWiringDiagrams, UndirectedWiringDiagrams, and CPortGraphs in this document.
using Catlab.GATs, Catlab.Theories
using GATlab, Catlab.Theories
using Catlab.CategoricalAlgebra
using Catlab.WiringDiagrams
using Catlab.Programs
Expand Down
2 changes: 1 addition & 1 deletion docs/literate/wiring_diagrams/wiring_diagram_basics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
#md # [![](https://img.shields.io/badge/show-nbviewer-579ACA.svg)](@__NBVIEWER_ROOT_URL__/generated/wiring_diagrams/wiring_diagram_basics.ipynb)
#
# using Catlab.GATs, you can create, manipulate, serialize, and visualize *wiring
# using GATlab, you can create, manipulate, serialize, and visualize *wiring
# diagrams*, also known as [string
# diagrams](https://ncatlab.org/nlab/show/string+diagram). The flexible data
# structure for wiring diagrams allows arbitrary data to be attached to boxes,
Expand Down
1 change: 0 additions & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ makedocs(
],
],
"Modules" => Any[
"apis/gats.md",
"apis/theories.md",
"apis/categorical_algebra.md",
"apis/graphs.md",
Expand Down
2 changes: 1 addition & 1 deletion docs/src/apis/categorical_algebra.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ We can also add equations to this presentation, but we currently do nothing with
We will now give an example of how this all works in practice.

```@example
using Catlab.GATs, Catlab.CategoricalAlgebra
using GATlab, Catlab.CategoricalAlgebra
# Write down the schema for a weighted graph
@present SchWeightedGraph(FreeSchema) begin
Expand Down
Loading

0 comments on commit f02b1ee

Please sign in to comment.