Overview of some type hierarchies.

PnmlType - Petri Net Type Definition (PNTD)

See PnmlTypes module page.

There are levels: Core (Place-Transition), Continuous and High-Level PNG (HLPNG).

PnmlCoreNet is a concrete subtype of PnmlType. PnmlCoreNet is used by some AbstractPetriNet concrete types (PNet.SimpleNet).

ContinuousNet is a concrete type of AbstractContinuousNet. ContinuousNet uses floating point marking and inscriptions. It is a nonstandard extension to the ISO standard.

HLCoreNet is a concrete subtype of AbstractHLCore. HLCoreNet is used by some AbstractPetriNet concrete types (PNet.HLPetriNet). Think of it as a testable implementation of AbstractHLCore.

Tries to represent the model (all models) at a structural level. Tries to avoid imposing semantics. It is a toolkit with a wide range of behavior. Those semantics should be part of AbstractPetriNet. Yes, the PnmlType in use selects some semantics and affects the toolkit.

PnmlType
├─ AbstractContinuousNet
│  └─ ContinuousNet
├─ AbstractHLCore
│  ├─ HLCoreNet
│  ├─ HLPNG
│  ├─ PT_HLPNG
│  └─ SymmetricNet
└─ AbstractPnmlCore
   ├─ PTNet
   └─ PnmlCoreNet
PnmlTypeDescription
PnmlCoreNetCore structure. Only defined label is <name>.
PTNetUsing <initialMarking>, <inscription> labels that have a <text> containing a number.
HLCoreNetHL Petri Net Graphs structure. Using <hlinitialMarking>, <hlinscription> labels with <structure>. Multisorted algebra.
PT-HLPNGRestrict sort to dot, condition always true.
SymmetricNetRestrict sorts to finite, annotations have <structure>.
HLNetUnrestricted, Arbitrary Sorts, Operators, Lists, Strings.
StochasticExtended PNML. Use <rate> label
TimedExtended PNML.
OpenExtended PNML .

Todo: Continuous Petri Net

AbstractPetriNet

AbstractPetriNet uses the Intermediate Representation's PnmlNet and PnmlType to implement a Petri Net Graph (PNG).

AbstractPetriNet
├─ HLPetriNet{PNTD} where PNTD<:PnmlType
└─ SimpleNet{PNTD} where PNTD<:PnmlType

AbstractPnmlObject

Page, Arc, Place, Transition define the graph of a PnmlNet.

AbstractPnmlObject
├─ Arc
├─ AbstractPnmlNode
│  ├─ Place
│  └─ Transition
├─ ReferenceNode
│  ├─ RefPlace
│  └─ RefTransition
└─ Page

Structure

Fields expected of every subtype of AbstractPnmlObject:

NameDescription
idSymbol, see 'REFID
pntd<: PnmlType identifies the meta-model of a net.
nameOptional Name label.
labelsOptional PnmlLabel collection of unclaimed labels.
toolspecinfosOptional ToolInfo collection of tool specific content.

Note that subtypes may have additional fields. For example, Page has a subpages field.

ADT

using Moshi.Data: @data

@data NetNode{PNTD,} begin
    Arc
    Place
    Transition
    RefPlace
    RefTransition
    Page
end

AbstractLabel

AbstractLabels are attached to AbstractPnmlObjects. Kinds of label include: marking, inscription, condition and declarations, sort, and ad-hoc. Ad-hoc is where we assume any undefined element attached to a AbstractPnmlObject instance is a label and add it to a collection of 'other labels'. Some 'other labels' can be accessed using: rate_value, delay_value.

Some Labels of Interest

Full NameNodeLabel Description
MarkingPlaceValue is a number or ground term.
InscriptionArcValue is a number or ground term.
ConditionTransitionValue is a boolean term.
RateTransitionValue is a floating point number.
PriorityTransitionFiring order of enabled transitions.
WeightTransitionFiring tiebreaker.

Note that Rate, Priority and Weight are not part of base standard. See Unclaimed Labels

AbstractLabel
├─ Annotation
│  ├─ Declaration
│  ├─ Marking
│  ├─ Name
│  ├─ PnmlLabel
│  ├─ Rate
│  └─ SortType
└─ HLAnnotation
   ├─ Condition
   ├─ HLLabel
   └─ Inscription
Difference between Object and Label
  • Objects have ids and Names.
  • Labels are attached to Objects.
  • Some Labels (attributes) do not have Graphics.
  • Labels are extendable.
  • Labels are named by the xml tag. Any "unknown" tag of an Object is presumed to be a label.

PnmlException

PnmlException
├─ MalformedException
└─ MissingIDException

Many-sorted Algebra Concepts

The PNML Standard builds the High-level Petri Net Graph as a layer using a Core layer (PnmlCore). The main feature of the HL layer (HLCore) is to require all annotation labels to have <text> and <structure> elements. All meaning is required to reside in a single child of <structure>. With the <text> for human/documentation use.

Implemented so that it is mostly part of the PnmlCore implementation. At which level, both <text> and <structure> are optional.

The <type> label of a Place is meant to be a sort of a many-sorted algebra. We call it sorttype to reduce the confusion.

PNML.jl allows/requires all net type's places to have sorttype objects. Only high-level PNML input is expected to contain a <type> tag. For other nets we interpret the SortType to be IntegerSort or RealSort based on PNTD. And Marking values of non-high-level nets are interpreted as multisets with airity of 1. This allows more common implementation in the core layer.

For high-level nets the sorttype object is an SortType HLAnnotation subtype containing an AbstractSort.

AbstractDeclaration

Labels attached to PnmlNet and/or Page. The Declarations contained in a <declarations> apply to the whole net even when attached to a Page.

AbstractDeclaration
├─ OperatorDeclaration
│  ├─ ArbitraryOperator
│  ├─ NamedOperator
│  └─ PartitionElement
├─ SortDeclaration
│  ├─ ArbitrarySort
│  ├─ NamedSort
│  └─ PartitionSort
├─ UnknownDeclaration
└─ VariableDeclaration

AbstractSort

Each Place has a sorttype containing an AbstractSort.

AbstractSort
├─ BoolSort
├─ DotSort
├─ EnumerationSort
│  ├─ CyclicEnumerationSort
│  └─ FiniteEnumerationSort
├─ FiniteIntRangeSort
├─ ListSort
├─ MultisetSort
├─ NumberSort
│  ├─ IntegerSort
│  ├─ NaturalSort
│  ├─ NullSort
│  ├─ PositiveSort
│  └─ RealSort
├─ ProductSort
├─ StringSort
└─ UserSort

AbstractTerm

Part of the many-sorted algebra of a High-level net. See AbstractOperator. Variable

AbstractTerm
├─ AbstractOperator
│  ├─ BooleanConstant
│  ├─ DotConstant
│  ├─ FEConstant
│  ├─ FiniteIntRangeConstant
│  ├─ NumberConstant
│  ├─ Operator
│  └─ UserOperator
└─ AbstractVariable
   └─ Variable

PnmlExpr

Expressions of the many-sorted algebra are part of a petri net's dynamic behavior. PnmlExpr are TermInterface compatible. Used to do variable substitution before evaluation of mutisorted algebra expressions in enabling and firing rules. Ground terms contain no variables and therefore do not depend on the current marking of the net.

PnmlExpr
├─ Add
├─ Addition
├─ Append
├─ Bag
├─ BoolExpr
│  ├─ And
│  ├─ BooleanEx
│  ├─ Equality
│  ├─ GreaterThan
│  ├─ GreaterThanOrEqual
│  ├─ Imply
│  ├─ Inequality
│  ├─ LessThan
│  ├─ LessThanOrEqual
│  ├─ Not
│  ├─ Or
│  ├─ PartitionGreaterThan
│  ├─ PartitionLessThan
│  ├─ StringGreaterThan
│  ├─ StringGreaterThanOrEqual
│  ├─ StringLessThan
│  └─ StringLessThanOrEqual
├─ Cardinality
├─ CardinalityOf
├─ Concatenation
├─ Contains
├─ Division
├─ DotConstantEx
├─ ListAppend
├─ ListConcatenation
├─ ListLength
├─ MemberAtIndex
├─ Modulo
├─ Multiplication
├─ NumberEx
├─ OpExpr
│  ├─ NamedOperatorEx
│  ├─ PartitionElementOp
│  └─ UserOperatorEx
├─ PartitionElementOf
├─ PnmlTupleEx
├─ Predecessor
├─ ScalarProduct
├─ StringLength
├─ Sublist
├─ SubstringEx
├─ Subtract
├─ Subtraction
├─ Successor
└─ VariableEx

AbstractPetriNet

Note AbstractPetriNet is a facade for PnmlNet. There may be other facades. For example stock flow nets.

AbstractPetriNet
├─ HLPetriNet{PNTD} where PNTD<:PnmlType
└─ SimpleNet{PNTD} where PNTD<:PnmlType