Library Reference

SemanticModels.SemanticModelsModule

SemanticModels

provides the AbstractModel type and constructors for building metamodeling tooling for categorical model representations

source
SemanticModels.modelMethod

model(::AbstractModel, x) dig into the expression that describes a model and break it down into components. This allows you to construct a structured representation of the modeling problem at the expression level. Just like how julia modeling frameworks build structured representations of the problems in data structures. This version builds them at the expression level. The first argument is the type you want to construct, the second argument is the model structure that you want to analyze. For example

model(PetriModel, x::Petri.Model)::PetriModel
source

Category Theory

The following Category Theory operations ship with SemanticModels, you can use them as templates for defining your own model classes.

SemanticModels.CategoryTheory.AbstractCospanType
AbstractCospan

an abstract type for representing cospans. The essential API for subtypes of AbstractCospan are

  1. left(c)::M
  2. right(c)::M
  3. pullback(c)::S

where M is the type of morphisms in the cospan, and S is the type of span that solves the pullback defined by c. See Cospan for an example.

source
SemanticModels.CategoryTheory.AbstractMorphType
AbstractMorph

an abstract type for representing morphisms. The essential API for subtypes of AbstractMorph are

  1. dom(m)::T
  2. codom(m)::T
  3. func(m)::Function

where T is the type of the objects in the category. See FinSetMorph for an example.

source
SemanticModels.CategoryTheory.AbstractSpanType
AbstractSpan

an abstract type for representing spans. The essential API for subtypes of AbstractSpan are

  1. left(s)::M
  2. right(s)::M
  3. pushout(s)::C

where M is the type of morphisms in the span, and C is the type of cospan that solves a pushout of span s. See Span for an example.

source
SemanticModels.CategoryTheory.FinSetMorphType
FinSetMorph{T,F}

morphisms in the category of Finite Sets. The objects are of type UnitRange{Int}. func(m::FinSetMorph) is a function that takes Int -> Int. FinSetMorphs can be constructed from a list of numbers. For example, FinSetMorph([1,3,2,3]) is the morphism that takes 1->1, 2->3, 3->2, 4->3 on domain 1:4 with codomain 1:3. When you define a morphism from a list of integers, the codomain is inferred from the largest element of the list. The domain must always be the 1:l where l is the length of the input list.

(f::FinSetMorph)(g::G) where G <: AbstractGraph

lift a finite set morphism (list of integers) to a graph homomorphism by its action on the vertex set. The graph h = f(g) is defined by taking the edges of g and relabeling their src and dst according to the function of f.

This method computes a valid graph homomorphism by definition.

source
SemanticModels.CategoryTheory.pushoutMethod
pushout(s::Span{T, T}) where T <: Decorated

treat f,g as a decorated span and compute the pushout that is, the cospan of f=(f⊔g) and g=(a⊔b), with the decoration of (f⊔g)(d)

source

Model Classes

The following model class ship with SemanticModels, you can use them as templates for defining your own model classes.

Modules = [
           SemanticModels.WiringDiagrams,
           SemanticModels.PetriModels,
           SemanticModels.RelOlogModels,
           SemanticModels.OpenModels,
           SemanticModels.OpenPetris,
           SemanticModels.PetriCospans
          ]

Index