semagrams.acsets

In this package, we define nested ACSets.

In a nested acset, each element of an acset has an associated acset, which we call a subacset. The schema for a nested acset has an acset schema associated with each object, which defines the schema for the acsets associated to the parts assigned to that object.

A nested part of a nested acset is a list of (ob, id) pairs, which at each step tell you how to get to the next nested acset. The type of such a nested part is just the list of obs.

Morphisms in a nested acset schema go from nested part types to nested part types. The acset schema that contains the morphism is the "highest point" that the morphism can go, i.e. the only way to get from a nested part to another nested part via a morphism is to go all the way up to where the morphism is defined, and then go back down to the target of the morphism.

Nested acsets are still not fully understood mathematically.

Attributes

Todo:

We have a confusion of terminology in that we use "part" to refer to both an element of the category of elements of a single acset, and also an element of the category of elements of the entire nested acset. We should fix this.

Members list

Concise view

Type members

Classlikes

case class ACSet(schema: Schema, props: PropMap, partsMap: Map[Ob, PartSet])

A nested acset.

A nested acset.

Attributes

partsMap

the PartSet object for each Ob in the schema. This is where the subacsets are stored.

props

the top-level properties. The values of morphisms, attributes, and generic Propertys are stored here. We don't need what in Catlab we call "subparts"; it's folded into this. For instance, if this is the subacset for an edge, then the source and target are stored here.

schema

the schema that the acset conforms to

Companion:
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
object ACSet

This object contains the constructor method for ACSets and also a collection of wrappers around ACSet methods in the State monad that allow for a quasi-imperative API for modifying ACSets purely.

This object contains the constructor method for ACSets and also a collection of wrappers around ACSet methods in the State monad that allow for a quasi-imperative API for modifying ACSets purely.

Attributes

Companion:
class
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
ACSet.type
trait Attr extends Property

A trait marking attributes in a Schema

A trait marking attributes in a Schema

Unlike in Julia ACSets, we do not have AttrTypes. Rather, attributes have their associated scala type given by Property.Value.

Attributes

Graph
Supertypes
trait Property
class Object
trait Matchable
class Any
Known subtypes
object SName.type
object TName.type
object Program.type
trait Hom extends Property

A trait marking morphisms in a Schema

A trait marking morphisms in a Schema

Unlike in typical categories, morphisms can have multiple domains and multiple codomains. This is shorthand for a morphism for each pair of domain and codomain.

Additionally, domains/codomains for morphisms are sequences of objects, representing paths through the schema, so a morphism goes between multiple levels of the schema.

Attributes

Graph
Supertypes
trait Property
class Object
trait Matchable
class Any
Known subtypes
object IS.type
object IT.type
object OS.type
object OT.type
object Src.type
object Tgt.type
case class Id(id: Int)

An opaque wrapper around an integer

An opaque wrapper around an integer

Attributes

Companion:
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
object Id

Attributes

Companion:
class
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Id.type
trait Ob

A trait marking objects in a Schema

A trait marking objects in a Schema

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object I.type
object O.type
object S.type
object T.type
object Box.type
object InPort.type
object OutPort.type
object PrimBox.type
object Wire.type
case class Part(path: Seq[(Ob, Id)]) extends Entity

A part is a path through a nested acset. If you visualize a nested acset as a tree, where each node is an acset and its children are all of its subacsets, then a part tells at each level which subacset to choose.

A part is a path through a nested acset. If you visualize a nested acset as a tree, where each node is an acset and its children are all of its subacsets, then a part tells at each level which subacset to choose.

The empty path refers to the root acset.

Attributes

Todo:

We should have "relative" parts and "absolute" parts, just like in a filesystem there are relative and absolute paths. I think that currently Part is used for both notions, which is very confusing.

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait Entity
class Object
trait Matchable
class Any
case class PartSet(nextId: Int, ids: Seq[Id], acsets: Map[Id, ACSet])

Storage class for the parts corresponding to an Ob in a schema.

Storage class for the parts corresponding to an Ob in a schema.

This is immutable; methods that logically mutate simply return new objects.

Attributes

acsets

The subacset corresponding to each id

ids

The ids of all the parts added so far. This is a Seq because we care about the ordering; when the ACSet is displayed this ordering is used when two sprites overlap.

nextId

The id to assign to the next part added

Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
case class PartType(path: Seq[Ob]) extends EntityType

The type of a part in a nested acset is a sequence of objects, going down through the nested schemas.

The type of a part in a nested acset is a sequence of objects, going down through the nested schemas.

So PartType(Seq()) is the type of the root acset part, and PartType(Seq(Box,InPort)) refers to the type of input ports on boxes.

Attributes

Companion:
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
object PartType

Attributes

Companion:
class
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
object Petris

Implementation of the schema for Petri nets

Implementation of the schema for Petri nets

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Petris.type
case object SchEmpty extends Schema

The empty schema.

The empty schema.

Attributes

Graph
Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait Schema
class Object
trait Matchable
class Any
Self type
trait Schema

The schema for a nested acset.

The schema for a nested acset.

The nested part comes in because anything that implements Ob has another schema attached to it.

Attributes

Todo:

What does this correspond to categorically?

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object SchPetri.type
object SchEmpty.type
object SchPrimBox.type
object SchWiringDiagram.type

Implementation of a schema for wiring diagrams

Implementation of a schema for wiring diagrams

Uses nested acsets so that ports are parts of the subacsets corresponding to boxes.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
object catlab

A catlab-compatible implementation of Schema.

A catlab-compatible implementation of Schema.

Used for apps like category of elements display, where we have to accept an arbitrary acset from Catlab.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
catlab.type

Value members

Concrete fields

val ROOT: Part

The part corresponding to the top-level acset itself.

The part corresponding to the top-level acset itself.

Attributes