diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ba71bde..de11503 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,7 +8,7 @@ jobs: strategy: fail-fast: false matrix: - julia-version: ['1.0', '1.3', '1.4'] + julia-version: ['1.3', '1.4'] os: [ubuntu-latest] steps: diff --git a/Project.toml b/Project.toml index 57478e4..9668c9b 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "SemanticModels" uuid = "f5ac2a72-33c7-5caf-b863-f02fefdcf428" authors = ["James Fairbanks ", "Micah Halter "] -version = "0.3.0" +version = "0.4.0" [deps] Catlab = "134e5e36-593f-5add-ad60-77f754baafbe" @@ -10,6 +10,10 @@ MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09" Petri = "4259d249-1051-49fa-8328-3f8ab9391c33" [compat] +Catlab = "^0.7.0" +LightGraphs = "^1.3.3" +MacroTools = "^0.5.5" +Petri = "^1.0.0" julia = "1.0" [extras] diff --git a/src/CategoryTheory.jl b/src/CategoryTheory.jl index ff28ccc..1772cb1 100644 --- a/src/CategoryTheory.jl +++ b/src/CategoryTheory.jl @@ -2,7 +2,7 @@ module CategoryTheory using SemanticModels -import Catlab.Doctrines: dom, codom +import Catlab.Theories: dom, codom import Base: append!, push!, deleteat!, delete! export ⊔, AbstractMorph, FinSetMorph, dom, codom, verify, func, Decorated, decorations, undecorate, AbstractSpan, leftob, rightob, apexob, Span, left, right, DoublePushout, AbstractCospan, Cospan, pushout diff --git a/src/OpenPetris.jl b/src/OpenPetris.jl index ddf9f6c..95c09dd 100644 --- a/src/OpenPetris.jl +++ b/src/OpenPetris.jl @@ -5,8 +5,8 @@ import SemanticModels.PetriModels: PetriModel import SemanticModels.OpenModels: OpenModel using ModelingToolkit import ModelingToolkit: Constant -using Catlab.Doctrines -import Catlab.Doctrines: ⊗, compose, otimes +using Catlab.Theories +import Catlab.Theories: ⊗, compose, otimes export OpenPetri, eye, ⊕ diff --git a/src/PetriCospans.jl b/src/PetriCospans.jl index 2a2ba5e..27f21f6 100644 --- a/src/PetriCospans.jl +++ b/src/PetriCospans.jl @@ -1,7 +1,7 @@ module PetriCospans using Catlab -using Catlab.Doctrines +using Catlab.Theories using Catlab.WiringDiagrams # using Catlab.Programs import Base: (==), length, show @@ -10,7 +10,7 @@ using ..PetriModels using ..CategoryTheory import ..CategoryTheory: undecorate, ⊔ -import Catlab.Doctrines: +import Catlab.Theories: Ob, Hom, dom, codom, compose, ⋅, ∘, id, oplus, otimes, ⊗, ⊕, munit, mzero, braid, dagger, dunit, dcounit, mcopy, Δ, delete, ◊, mmerge, ∇, create, □, plus, zero, coplus, cozero, meet, top, join, bottom @@ -25,11 +25,11 @@ export Epidemiology, FreeEpidemiology, spontaneous, exposure, death, death(A)::Hom(A, munit()) ⊣ A::Ob end -spontaneous(A::Ports, B::Ports) = singleton_diagram(Epidemiology.Hom, Box(:→, A, B)) -exposure(A::Ports, B::Ports, C::Ports) = singleton_diagram(Epidemiology.Hom, Box(:exposure, A⊗B, C⊗B)) -death(A::Ports) = singleton_diagram(Epidemiology.Hom, Box(:𝗫, A, Ports([]))) -mcopy(A::Ports{Epidemiology.Hom}, Symbol) = implicit_mcopy(A, 2) -mmerge(A::Ports{Epidemiology.Hom}, Symbol) = implicit_mmerge(A, 2) +spontaneous(A::Ports, B::Ports) = singleton_diagram(Box(:→, A, B)) +exposure(A::Ports, B::Ports, C::Ports) = singleton_diagram(Box(:exposure, A⊗B, C⊗B)) +death(A::Ports) = singleton_diagram(Box(:𝗫, A, Ports([]))) +mcopy(A::Ports{Epidemiology}, Symbol) = implicit_mcopy(A, 2) +mmerge(A::Ports{Epidemiology}, Symbol) = implicit_mmerge(A, 2) @syntax FreeEpidemiology(ObExpr, HomExpr) Epidemiology begin @@ -41,8 +41,8 @@ mmerge(A::Ports{Epidemiology.Hom}, Symbol) = implicit_mmerge(A, 2) copair(f::Hom, g::Hom) = (f ⊗ g) → ∇(codom(f)) proj1(A::Ob, B::Ob) = id(A) ⊗ ◊(B) proj2(A::Ob, B::Ob) = ◊(A) ⊗ id(B) - incl1(A::Ob, B::Ob) = id(A) ⊗ □(B) - incl2(A::Ob, B::Ob) = □(A) ⊗ id(B) + coproj1(A::Ob, B::Ob) = id(A) ⊗ □(B) + coproj2(A::Ob, B::Ob) = □(A) ⊗ id(B) otimes(A::Ob, B::Ob) = associate_unit(new(A,B), munit) otimes(f::Hom, g::Hom) = associate(new(f,g)) end @@ -221,8 +221,8 @@ end proj1(A::FinSet,B::FinSet) = otimes(id(A), delete(B)) proj2(A::FinSet,B::FinSet) = otimes(delete(A), id(B)) - incl1(A::FinSet,B::FinSet) = otimes(id(A), create(B)) - incl2(A::FinSet,B::FinSet) = otimes(create(A), id(B)) + coproj1(A::FinSet,B::FinSet) = otimes(id(A), create(B)) + coproj2(A::FinSet,B::FinSet) = otimes(create(A), id(B)) spontaneous(A::FinSet, B::FinSet) = begin M, N = length(A), length(B) diff --git a/src/RelOlogModels.jl b/src/RelOlogModels.jl index 3a5635b..4fbd2e4 100644 --- a/src/RelOlogModels.jl +++ b/src/RelOlogModels.jl @@ -4,8 +4,8 @@ module RelOlogModels using Catlab using Catlab.Syntax using Catlab.WiringDiagrams -using Catlab.Doctrines -import Catlab.Doctrines.⊗ +using Catlab.Theories +import Catlab.Theories.⊗ using SemanticModels import SemanticModels: model diff --git a/src/WiringDiagrams.jl b/src/WiringDiagrams.jl index 5b21a61..06076c9 100644 --- a/src/WiringDiagrams.jl +++ b/src/WiringDiagrams.jl @@ -3,7 +3,7 @@ module WiringDiagrams using Catlab.WiringDiagrams -using Catlab.Doctrines +using Catlab.Theories using Catlab.Graphics using Catlab.Graphics.Graphviz using MacroTools diff --git a/test/epidemics.jl b/test/epidemics.jl index f8a7b0d..8008ee5 100644 --- a/test/epidemics.jl +++ b/test/epidemics.jl @@ -1,6 +1,6 @@ module TestEpidemics using Catlab -using Catlab.Doctrines +using Catlab.Theories using Catlab.Graphics using Catlab.WiringDiagrams using Catlab.Programs @@ -18,7 +18,7 @@ import SemanticModels.PetriCospans: otimes_ipm, compose_pushout println("Done Importing SemanticModels") -import Catlab.Doctrines: +import Catlab.Theories: Ob, Hom, dom, codom, compose, ⋅, ∘, id, oplus, otimes, ⊗, ⊕, munit, mzero, braid, dagger, dunit, dcounit, mcopy, Δ, delete, ◊, mmerge, ∇, create, □, plus, zero, coplus, cozero, meet, top, join, bottom @@ -199,7 +199,7 @@ Pseird = PetriModel( ([3],[2]), # onset ([2],[4]), # recovery ([2],[5]), # death - ], missing, missing)) + ])) inputs = FinSetMorph(1:5, [1,2,3]) outputs = FinSetMorph(1:5, [1,2,3]) Fcityd = PetriCospan(Cospan(Decorated(inputs, Pseird), diff --git a/test/petricospans.jl b/test/petricospans.jl index eb14237..8919f7c 100644 --- a/test/petricospans.jl +++ b/test/petricospans.jl @@ -1,7 +1,7 @@ module TestPetriCospans using Catlab -using Catlab.Doctrines +using Catlab.Theories using Catlab.WiringDiagrams using Catlab.Programs import Base.Multimedia: display @@ -14,7 +14,7 @@ using SemanticModels.PetriModels using SemanticModels.PetriCospans import SemanticModels.PetriCospans: otimes_ipm, compose_pushout -import Catlab.Doctrines: +import Catlab.Theories: Ob, Hom, dom, codom, compose, ⋅, ∘, id, oplus, otimes, ⊗, ⊕, munit, mzero, braid, dagger, dunit, dcounit, mcopy, Δ, delete, ◊, mmerge, ∇, create, □, plus, zero, coplus, cozero, meet, top, join, bottom @@ -28,7 +28,7 @@ Cospan(f,g), Cospan(f′, g′) pushout(Span(g,f′)) -spon = PetriModel(Petri.Model([1,2], [([1], [2])], missing, missing)) +spon = PetriModel(Petri.Model([1,2], [([1], [2])])) f = Decorated(FinSetMorph(1:2, [2]), [spon]) g = Decorated(FinSetMorph(1:2, [1]), [spon]) s = Span(g,f)