PNML

PNML.PNMLModule

Petri Net Markup Language, is an XML-based format. PNML.jl reads a pnml model and emits an intermediate representation (IR).

The intermediate representation (IR) represents the XML tree via julia data structures: dictionaries, NamedTuples, LabelledArrays, strings, numbers, objects, vectors. The exact mixture changes as the project continues.

The tags of the XML are used as keys and names as much as possible.

What is accepted as values is ~~often~~ a superset of what a given pntd schema specifies. This can be thought of as duck-typing. Conforming to the pntd is not the role of the IR.

The pnml standard has layers. This package has layers: PnmlNet, AbstractPetriNet

The core layer is useful and extendable. The standard defines extensions of the core, called meta-models, for

  • place-transition petri nets (integers) and
  • high-level petri net graphs (many-sorted algebra).

This package family adds non-standard continuous net (float64) support. Note that there is not yet any RelaxNG schema for our extensions.

On top of the concrete PnmlNet of the IR are net adaptions and interpertations. This is the level that Petri Net conformance can be imposed. It is also where other Net constructs can be defined over PnmlNets. Perhaps as new meta-models.

source
PNML.XDVTType

XMLDict.xml_dict XMLDict Value Type is value or Vector of values from .

source
PNML.AbstractLabelType
abstract type AbstractLabel

Labels are attached to the Petri Net Graph objects. See AbstractPnmlObject.

Expected interface is for every concrete label to have fields: - text - graphics - toolspecinfos - declarationdicts

source
PNML.AbstractOperatorType
abstract type AbstractOperator <: PNML.AbstractTerm

Operators are part of the high-level pnml many-sorted algebra.

...can be a built-in constant or a built-in operator, a multiset operator which among others can construct a multiset from an enumeration of its elements, or a tuple operator. Each operator has a sequence of sorts as its input sorts, and exactly one output sort, which defines its signature.

See NamedOperator and ArbitraryOperator.

source
PNML.AbstractPnmlObjectType
abstract type AbstractPnmlObject

Objects of a Petri Net Graph are pages, arcs, nodes.

Expected interface is for every concrete object to have fields: - id - namelabel - graphics - labels - toolspecinfos

source
PNML.AbstractTermType
abstract type AbstractTerm

Terms are part of the multi-sorted algebra that is part of a High-Level Petri Net.

Concrete terms are Variable and Operator found within the <structure> element of a label. They are parsed into PnmlExpr as TermInterface expressions thar are evaluated during the enabling and firing rule.

Notably, a Term is not a PnmlLabel (or a PNML Label).

References

See also Declaration, Labels.SortType, AbstractDeclaration.

Term_(logic):

A first-order term is recursively constructed from constant symbols, variables and function symbols.

Besides in logic, terms play important roles in universal algebra, and rewriting systems.

more convenient to think of a term as a tree.

A term that doesn't contain any variables is called a ground term

When the domain of discourse contains elements of basically different kinds, it is useful to split the set of all terms accordingly. To this end, a sort (sometimes also called type) is assigned to each variable and each constant symbol, and a declaration...of domain sorts and range sort to each function symbol....

Type_theory

term in logic is recursively defined as a constant symbol, variable, or a function application, where a term is applied to another term

if t is a term of type σ → τ, and s is a term of type σ, then the application of t to s, often written (t s), has type τ.

Lambda terms:

The term redex, short for reducible expression, refers to subterms that can be reduced by one of the reduction rules.

See Metatheory and SymbolicUtils

source
PNML.AbstractVariableType
abstract type AbstractVariable <: PNML.AbstractTerm

Variables are part of the high-level pnml many-sorted algebra.

source
PNML.AnnotationType
abstract type Annotation <: PNML.AbstractLabel

Label that may be displayed. Differs from an Attribute Label by possibly having a Graphics field. We do not implement a separate Attribute type since graphics is optional.

source
PNML.AnyElementType
struct AnyElement
  • tag::Union{SubString{String}, String, Symbol}

  • elements::Union{SubString{String}, String, OrderedCollections.LittleDict{Union{String, Symbol}, Any, KS, VS} where {KS<:Union{Tuple{Vararg{Union{String, Symbol}}}, AbstractVector{Union{String, Symbol}}}, VS<:Union{Tuple, AbstractVector{Any}}}}

Hold well-formed XML. See also ToolInfo and PnmlLabel.

Creates a tree where the root is tag, leaf node values are Union{String, SubString{String}}, and interior nodes values are Union{DictType, Vector{DictType}}

See DictType.

source
PNML.ArcType

Edge of a Petri Net Markup Language graph that connects place and transition.

mutable struct Arc <: PNML.AbstractPnmlObject
  • id::Symbol

  • source::Base.RefValue{Symbol}

  • target::Base.RefValue{Symbol}

  • inscription::PNML.Labels.Inscription

  • namelabel::Union{Nothing, PNML.Labels.Name}

  • graphics::Union{Nothing, PNML.Labels.PnmlGraphics.Graphics}

  • toolspecinfos::Union{Nothing, Vector{PNML.Labels.ToolInfo}}

  • extralabels::Union{Nothing, Vector{PNML.Labels.PnmlLabel}}

  • declarationdicts::PNML.DeclDict

source
PNML.BooleanConstantType
BooleanConstant("true"|"false", decldict) is a built-in operator (constants are 0-ary operators).
c = BooleanConstant(true, decldict); c() == true
source
PNML.CoordinateType
struct Coordinate
  • x_::Float32

  • y_::Float32

Cartesian Coordinate are positive decimals. Ranges from 0 to 999.9.

source
PNML.DeclDictType
struct DeclDict
  • namedsorts::Dict{Symbol, Any}

  • arbitrarysorts::Dict{Symbol, Any}

  • partitionsorts::Dict{Symbol, Any}

  • multisetsorts::Dict{Symbol, Any}

  • productsorts::Dict{Symbol, Any}

  • namedoperators::Dict{Symbol, Any}

  • arbitraryoperators::Dict{Symbol, Any}

  • partitionops::Dict{Symbol, Any}

  • feconstants::Dict{Symbol, Any}

  • usersorts::Dict{Symbol, Any}

  • useroperators::Dict{Symbol, Any}

Collection of dictionaries holding various kinds of PNML declarations. Each keyed by REFID symbols.

source
PNML.DictTypeType

Dictionary passed to XMLDict.xml_dict as dict_type. See unparsed_tag.

source
PNML.FEConstantType
FEConstant

Finite enumeration constant.

these FEConstants are part of the declaration of the FiniteEnumeration sort. On the other hand, each of

these FEConstants defines a 0-ary operation, i. e. is a declaration of a constant.

Usage

fec = FEConstant(:anID, "somevalue", decldict)
fec() == :anID
fec.name = "somevalue"
source
PNML.FiniteIntRangeConstantType
struct FiniteIntRangeConstant{T<:Integer} <: PNML.AbstractOperator

Must refer to a value between the start and end of the respective FiniteIntRangeSort.

source
PNML.HLAnnotationType
abstract type HLAnnotation <: PNML.AbstractLabel

Annotation label that adds <structure>.

source
PNML.LabelParserType
struct LabelParser
  • tag::Symbol

  • func::Union{Function, Type}

Maps a Symbol to a parser callable for a <labeltag> tag's well-formed contents. The parser will be called as func(node, pntd) and return

source
PNML.MissingIDExceptionType
struct MissingIDException <: PNML.PnmlException
  • msg::String

Use exception to allow dispatch and additional data presentation to user.

source
PNML.NumberConstantType
NumberConstant{T<:Number, S}

Builtin operator that has arity=0 means the same result every time, a constant. Restricted to NumberSorts, those Sorts whose eltype isa Number.

source
PNML.OperatorType

PNML Operator as Functor

tag maps to func, a functor/function Callable. Its arity is same as length of inexprs and insorts

source
PNML.PageType
mutable struct Page{PNTD<:PNML.PnmlTypes.PnmlType} <: PNML.AbstractPnmlObject
  • net::Base.RefValue{<:PNML.AbstractPnmlNet}

  • pntd::PNML.PnmlTypes.PnmlType

  • id::Symbol

  • namelabel::Union{Nothing, PNML.Labels.Name}

  • graphics::Union{Nothing, PNML.Labels.PnmlGraphics.Graphics}

  • toolspecinfos::Union{Nothing, Vector{PNML.Labels.ToolInfo}}

  • extralabels::Union{Nothing, Vector{PNML.Labels.PnmlLabel}}

  • netsets::PNML.PnmlNetKeys

Contain all places, transitions & arcs. Pages are for visual presentation. There must be at least 1 Page for a valid pnml model.

PNTD binds the other type parameters together to express a specific PNG. See PnmlNet

source
PNML.ParseContextType
ParseContext
  • idregistry::PNML.PnmlIDRegistrys.PnmlIDRegistry

  • ddict::PNML.DeclDict

  • labelparser::Vector{PNML.LabelParser}

  • toolparser::Vector{PNML.ToolParser}

source
PNML.PlaceType
mutable struct Place <: PNML.AbstractPnmlNode
  • id::Symbol

  • initialMarking::PNML.Labels.Marking

  • sorttype::PNML.Labels.SortType

  • namelabel::Union{Nothing, PNML.Labels.Name}

  • graphics::Union{Nothing, PNML.Labels.PnmlGraphics.Graphics}

  • toolspecinfos::Union{Nothing, Vector{PNML.Labels.ToolInfo}}

  • extralabels::Union{Nothing, Vector{PNML.Labels.PnmlLabel}}

  • declarationdicts::PNML.DeclDict

Place node of a Petri Net Markup Language graph.

Each place has an initial marking that has a basis matching sorttype. M is a "multiset sort denoting a collection of tokens". A "multiset sort over a basis sort is interpreted as "the set of multisets over the type associated with the basis sort".

source
PNML.PnmlConfigType

Configuration with default values that can be overidden by a LocalPreferences.toml.

Options

  • indent_width::Int: Indention of nested lines.
  • text_element_optional::Bool: There are pnml files that break the rules & do not have <text> elements.
  • warn_on_fixup::Bool: When an missing value is replaced by a default value, issue a warning.
  • warn_on_namespace::Bool: There are pnml files that break the rules & do not have an xml namespace.
  • warn_on_unclaimed::Bool: Issue warning when PNML label does not have a parser defined. While allowed, there will be code required to do anything useful with the label.
  • warn_on_unimplemented::Bool: Issue warning to highlight something unimplemented. Expect high volume of messages.
  • verbose::Bool: Print information as runs.
source
PNML.PnmlModelType
mutable struct PnmlModel
  • nets::Tuple{Vararg{PnmlNet}}

  • namespace::String

One or more Petri Nets.

source
PNML.PnmlMultisetType
pnmlmultiset(basis::SortRef, x::T, multi::Int=1) -> PnmlMultiset{T}

Construct as a multiset with one element, x, with default multiplicity of 1.

PnmlMultiset wraps a Multisets.Multiset{T} where T is the sort element type.

Some Operatorsand [Variables`](@ref) create/use a multiset. Thre are constants (and 0-arity operators) defined that must be multisets since HL markings are multisets.

See Bag for expression that returns this data structure.

"multix" is text representation of the<numberof>operator that produces a multiset. As does<all>` operator.

source
PNML.PnmlNetType
mutable struct PnmlNet{PNTD<:PNML.PnmlTypes.PnmlType} <: PNML.AbstractPnmlNet
  • type::PNML.PnmlTypes.PnmlType

  • id::Symbol

  • pagedict::OrderedCollections.OrderedDict{Symbol, Page{PNTD}} where PNTD<:PNML.PnmlTypes.PnmlType

  • netdata::PNML.PnmlNetData

  • page_set::OrderedCollections.OrderedSet{Symbol}

  • declaration::PNML.Labels.Declaration

  • namelabel::Union{Nothing, PNML.Labels.Name}

  • toolspecinfos::Union{Nothing, Vector{PNML.Labels.ToolInfo}}

  • extralabels::Vector{PNML.Labels.PnmlLabel}

  • idregistry::PNML.PnmlIDRegistrys.PnmlIDRegistry

One Petri Net of a PNML model.

source
PNML.PnmlNetDataType
struct PnmlNetData
  • place_dict::OrderedCollections.OrderedDict{Symbol, Any}

  • transition_dict::OrderedCollections.OrderedDict{Symbol, Any}

  • arc_dict::OrderedCollections.OrderedDict{Symbol, Any}

  • refplace_dict::OrderedCollections.OrderedDict{Symbol, Any}

  • reftransition_dict::OrderedCollections.OrderedDict{Symbol, Any}

Collect each of the PnmlNodess & Arcs of a Petri Net Graph into one collection. Accessed via pnml ID key or iterate over values of an OrderedDict.

In the 'pnml' standard there is a Page structure that can be removed by flatten_pages!, removing some display-related information, leaving a functional Petri Net Graph as described in this structure. It is intended to be a per-PnmlNet database that is mutated as each page is parsed.

See PnmlNetKeys for page-level pnml ID of "owners" net data.

source
PNML.PnmlNetKeysType
struct PnmlNetKeys
  • page_set::OrderedCollections.OrderedSet{Symbol}

  • place_set::OrderedCollections.OrderedSet{Symbol}

  • transition_set::OrderedCollections.OrderedSet{Symbol}

  • arc_set::OrderedCollections.OrderedSet{Symbol}

  • reftransition_set::OrderedCollections.OrderedSet{Symbol}

  • refplace_set::OrderedCollections.OrderedSet{Symbol}

Per-page structure of OrderedSets of pnml IDs for each "owned" Page and other AbstractPnmlObject.

source
PNML.PnmlTupleType

ISO 15909 Standard considers Tuple to be an Operator.

The <tuple> operator is used to wrap an ordered collection of AbstractTerm instances. When evaluated each term will have the same sort as corresponding element of a ProductSort.

PnmlTupleEx is the PnmlExpr that produces an expression calling pnmltuple to create a Julia Tuple after evaluating all arguments.

source
PNML.REFIDType

Alias for Symbol that refers to something with an ID Symbol.

source
PNML.RefPlaceType

Reference Place node of a Petri Net Markup Language graph. For connections between pages.

struct RefPlace <: PNML.ReferenceNode
  • id::Symbol

  • ref::Symbol

  • namelabel::Union{Nothing, PNML.Labels.Name}

  • graphics::Union{Nothing, PNML.Labels.PnmlGraphics.Graphics}

  • toolspecinfos::Union{Nothing, Vector{PNML.Labels.ToolInfo}}

  • extralabels::Union{Nothing, Vector{PNML.Labels.PnmlLabel}}

  • declarationdicts::PNML.DeclDict

source
PNML.RefTransitionType

Refrence Transition node of a Petri Net Markup Language graph. For connections between pages.

struct RefTransition <: PNML.ReferenceNode
  • id::Symbol

  • ref::Symbol

  • namelabel::Union{Nothing, PNML.Labels.Name}

  • graphics::Union{Nothing, PNML.Labels.PnmlGraphics.Graphics}

  • toolspecinfos::Union{Nothing, Vector{PNML.Labels.ToolInfo}}

  • extralabels::Union{Nothing, Vector{PNML.Labels.PnmlLabel}}

  • declarationdicts::PNML.DeclDict

source
PNML.SortRefType
SortRef

Reference concrete sort (<:AbstractSort (or following that informal interface)) using a REFID Symbol that indexes one of the dictionaries in the network's declaration dictionary (DeclDict).

The REFID will be in the network's PnmlIDRegistry.

Note the similarity to UserSort and <usersort declaration="id" />

We use the UserSort -> NamedSort -> ConcreteSort to add a name and REFID to built-in sorts, thus making them accessable. This extends this decoupling (symbols instead of sorts) to anonymous sorts that are inlined.

source
PNML.ToolParserType
struct ToolParser
  • toolname::String

  • version::String

  • func::Union{Function, Type}

Holds a parser callable for a <toolspecific> tag's well-formed contents.

Will be in an iteratable collection that maps tool name & version to a parser callable. See toolspecific_content_fallback(node, pntd).

source
PNML.TransitionType

Transition node of a Petri Net Markup Language graph.

mutable struct Transition <: PNML.AbstractPnmlNode
  • id::Symbol

  • condition::PNML.Labels.Condition

  • namelabel::Union{Nothing, PNML.Labels.Name}

  • graphics::Union{Nothing, PNML.Labels.PnmlGraphics.Graphics}

  • toolspecinfos::Union{Nothing, Vector{PNML.Labels.ToolInfo}}

  • extralabels::Union{Nothing, Vector{PNML.Labels.PnmlLabel}}

  • vars::Set{Symbol}

  • varsubs::Vector{NamedTuple}: Cache of variable substutions for this transition

  • declarationdicts::PNML.DeclDict

source
PNML.VariableType
struct Variable <: PNML.AbstractVariable
  • refvariable::Symbol

  • declarationdicts::PNML.DeclDict

Variable refers to a VariableDeclaration. Example input: <variable refvariable="varx"/>.

#TODO examples of use, modifying and accessing

source
Base.:*Method

n*B for PnmlMultisets is the scalar multiset product.

source
Base.:*Method

A*B for PnmlMultisets is forwarded to Multiset.

source
Base.:+Method

A+B for PnmlMultisets is the disjoint union of enclosed multiset.

source
Base.:-Method

A-B for PnmlMultisets is the disjoint union of enclosed multiset.

source
Base.:<Method

A<B for PnmlMultisets is forwarded Multiset.

source
Base.:<=Method

A<=B for PnmlMultisets is forwarded Multiset.

source
Base.:>Method

A>B for PnmlMultisets is forwarded Multiset.

source
Base.:>=Method

A>=B for PnmlMultisets is forwarded Multiset.

source
PNML._opsMethod

Return iterator over operator dictionaries of Declaration Dictionaries.

source
PNML._sortsMethod

Return iterator over sort dictionaries of Declaration Dictionaries.

source
PNML.accum_varsets!Method
accum_varsets!(bvs, arc_bvs) -> Bool

Collect variable bindings, intersecting among arcs. Return enabled status of false if any variable does not have a substitution.

source
PNML.adjacent_placeFunction
adjacent_place(net::PnmlNet, arc::Arc) -> Place
adjacent_place(netdata::PnmlNetData, source,::Symbol target::Symbol) -> Place

Adjacent place of an arc is either the source or target.

source
PNML.allpagesMethod
allpages(net::PnmlNet|dict::OrderedDict) -> Iterator

Return iterator over all pages in the net. Maintains insertion order.

source
PNML.append_page!Method

Append selected fields of r to fields of l. Some, like Names and xml, are omitted because they are scalar values, not collections.

pagedict & netdata (holding the arc and pnml nodes) are per-net data that is not modified here. netsets hold pnml IDs "owned"

source
PNML.arcFunction

Return arc with id if found, otherwise nothing.

source
PNML.arcMethod

Return Arc from 's' to 't' or nothing. Useful for graphs where arcs are represented by a tuple(source,target).

source
PNML.arcsFunction
arcs(n::PnmlNet) -> iterator
arcs(p::AbstractPetriNet) -> iterator

Return iterator over arc ids.

source
PNML.basisFunction
basis(x, ddict) -> SortRef

Return SortRef referencing a NamedSort, ArbitrarySort or PartitionSort declaration. MultisetSort, Multiset, List have a basis. Default basis is sortof Place marking & sorttype, arc inscriptions have a basis.

source
PNML.basisMethod
basis(ms::PnmlMultiset) -> AbstractSort

Multiset basis sort is accessed through a SortRef that holds an REFID index into decldict, can be used to (B type parameter) is a REFID to a UserSort that references a NamedSort. Which gives a name and id to a built-in Sorts, ProductSorts, or other UserSorts. MultisetSorts not allowed here. Nor loops in sort references.

source
PNML.binding_value_setsMethod
binding_value_sets(net::PnmlNet, marking) -> Vector{Dict{REFID,Any}}

Return dictionary with transaction ID is key and value is binding set for variables of that transition. Each variable of an enabled transition will have a non-empty binding.

source
PNML.conditionsFunction
conditions(net::PnmlNet) -> Iterator

Iterate over REFID => condition(transaction) pairs of net. This is the same order as transactions.

source
PNML.declarationsMethod
declarations(dd::DeclDict) -> Iterator

Return an iterator over all the declaration dictionaries' values.

source
PNML.decldictFunction
decldict(x) -> DeclDict

PnmlNet,Page and Declaration labels have bindings to the net-level DeclDict.

source
PNML.deref!Method
deref!(net::PnmlNet; trim, verbose)

Remove reference nodes from arcs.

Operates on the PnmlNetData at the net level. Expects that the PnmlNetKeys of the firstpage will have to be cleaned as part of flatten_pages!,

Axioms

  1. All ids in a network are unique in that they only have one instance in the XML.
  2. A chain of reference Places (or Transitions) always ends at a Place (or Transition).
  3. All ids are valid.
  4. No cycles.
source
PNML.deref_placeMethod
deref_place(net, id[], trim::Bool] ) -> Symbol

Return id of referenced place. If trim is true (default) the reference is removed.

source
PNML.deref_transitionMethod
deref_transition(net, id[, trim::Bool] ) -> Symbol

Return id of referenced transition. If trim is true (default) the reference is removed.

source
PNML.dict_showFunction
dict_show(io::IO, x)

Internal helper for things that contain DictType.

source
PNML.enabledFunction
enabled(::PnmlNet, marking) -> Vector{Bool}

Return vector of booleans where true means the matching transition is enabled at current marking. Has the same order as the transitions dictionary. Used in the firing rule. Update tr.vars Set and tr.varsubs NamedTuple.

source
PNML.fill_nonhl!Method
fill_nonhl!(ctx::ParseContext; idreg::PnmlIDRegistry) -> DeclDict

Fill a DeclDict with built-ins and defaults (that may be redefined).

source
PNML.fill_sort_tag!Method
fill_sort_tag!(ctx::ParseContext, tag::Symbol, sort) -> fill_sort_tag!(ctx, tag, sort, dict)
fill_sort_tag!(ctx::ParseContext, tag::Symbol, sort, dict) -> SortRef

If not already in the declarations dictionary dict, add sort with key of tag.

dict defaults to namedsorts a callable returning a dictionary in the DeclDict.

Register the tag and create and return a SortRef holding tag.

source
PNML.find_netMethod
find_net(model, id::Symbol) -> Union{Nothing, PnmlNet}

Return PnmlNet having id or nothing`.

source
PNML.find_netsFunction

Return nets matching pntd type given as symbol or pnmltype singleton.

source
PNML.fireMethod
fire(incidence, enabled, marking) -> LVector

Return the marking vector after firing transition: marking + incidence * enabled

marking values added to product of incidence' matrix and firing vector enabled.

source
PNML.flatten_pages!Function
flatten_pages!(net::PnmlNet[; options])

Merge page content into the 1st page of the net.

Options

  • trim::Bool Remove refrence nodes (default true). See deref!.
  • verbose::Bool Print breadcrumbs See CONFIG.
source
PNML.get_arc_bvs!Method
get_arc_bvs!(arc_bvs, arc_vars, placesort, mark, ddict) -> Bool

Fill arc_bvs with an entry for each key in arc_vars. Return true if no variables are present or all variables have at least 1 substution.

source
PNML.get_labelFunction
get_label(x, tag::Symbol) -> PnmlLabel

Return first label of x with a matching tagvalue.

source
PNML.has_keyMethod
has_key(dd::DeclDict, dict, key::Symbol) -> Bool

Where dict is the access method for a dictionary in DeclDict.

source
PNML.has_labelFunction
has_label(x, tag::Union{Symbol, String, SubString{String}) -> Bool

Does x have any label with a matching tag.

source
PNML.has_nameFunction
has_name(x) -> Bool

Return true if there is a name. Some declarations (inside a label) have a name. Nodes (nets, pages, places, transitions, arcs) may optionally have a name (as a label).

source
PNML.incidence_matrixFunction
incidence_matrix(petrinet) -> LArray

When token identity is collective, marking and inscription values are Numbers and matrix C[arc(transition,place)] = inscription(arc(transition,place)) - inscription(arc(place,transition)) is called the incidence_matrix.

High-level nets have tokens with individual identity, perhaps tuples of them, usually multisets of finite enumerations, can be other sorts including numbers, strings, lists. Symmetric nets are restricted, and thus easier to deal with and reason about.

source
PNML.input_matrixFunction
input_matrix(petrinet::AbstractPetriNet) -> Matrix{value_type(Inscription, typeof(net))}
input_matrix(petrinet::PnmlNet) -> Matrix{value_type(Inscription, typeof(net))}

Create and return a matrix ntransitions x nplaces.

source
PNML.inscription_valueFunction

inscription_value(::Type{T}, a::Arc, def, varsub) -> T

If a is nothing return def else evaluate inscription expression with varsub, where def is a default value of same sort as adjacent place. and varsub is a possibly empty variable substitution.

source
PNML.inscriptionsFunction
inscriptions(net::PnmlNet) -> Iterator

Iterate over REFID => inscription(arc) pairs of net. This is the same order as arcs.

source
PNML.isoperatorMethod
isoperator(tag::Symbol) -> Bool

Predicate to identify operators in the high-level pntd's many-sorted algebra abstract syntaxt tree.

Note: It is not the same as Meta.isoperator. Both work on Symbols. Not expecting any conflict.

  • integer
  • multiset
  • boolean
  • tuple
  • builtin constant
  • useroperator
source
PNML.ispidMethod
ispid(x::Symbol)

Return function to be used like: any(ispid(:asym), iterablewithpid).

source
PNML.labelofMethod
labelof(x, tag) -> Maybe{PnmlLabel}

x is anyting that supports haslabel/getlabel, tag is the tag of the xml label element.

source
PNML.labelsFunction
labels(x) -> Iterateable
labels(x, tag::Union{Symbol, String, SubString{String}) -> Iterateable

Return iterator of labels attached to x.

source
PNML.logfileMethod

Return file path string after creating intermediate directories.

source
PNML.multiplicityMethod
multiplicity(ms::PnmlMultiset, x) -> Integer
multiplicity(ms::Number, x) -> Number
source
PNML.nameFunction
name(x) -> String

Return name String. Default to empty string.

source
PNML.netdataFunction
netdata(x) -> PnmlNetData

Access PnmlNet-level data structure.

source
PNML.netsMethod
nets(model::PnmlModel) -> Tuple{Vararg{PnmlNet}}

Return all nets of model.

source
PNML.operatorMethod
operator(dd::DeclDict, id::Symbol) -> AbstractOperator

Return operator TermInterface expression for id. toexpr(::OpExpr, varsub, ddict) = :(useroperator(ddict, REFID)(varsub))

Operator Declarations include: :namedoperator, :feconstant, :partitionelement, :arbitraryoperator with types NamedOperator, FEConstant, PartitionElement, ArbitraryOperator. These define operators of different types that are placed into separate dictionaries.

#! CORRECT AbstractOperator type hierarchy that has Operator as concrete type.

#! AbstractDeclarations and AbstractTerms are "parallel" hierarchies in the UML, #! with AbstractTerms divided into AbstractOperators and AbstractVariables.

useroperator(REFID) is used to locate the operator definition, when it is found in feconstants(), is a callable returning a FEConstant literal.

`toexpr(::FEConstantEx, varsub, ddict) = :(useroperator(ddict, REFID)(varsub))`

The FEConstant operators defined by the declaration do not have a distinct type name in the standard. Note that a FEConstant's value in the standard is its identity. We could use objectid(::FEConstant), REFID or name for output value. Output sort of op is FEConstant.

Other OperatorDeclaration dictionarys also hold TermInterface expressions accessed by

`toexpr(::PnmlExpr, varsub, ddict) = :(useroperator(ddict, REFID)(varsub))`

where PnmlExpr is the TermInterface to match OperatorDeclaration. With output sort to match OperatorDeclaration .

#TODO named operator input variables and thier sorts

#TODO partition element

#TODO arbitrary opearator

#TODO built-in operators

source
PNML.operatorsMethod
operators(dd::DeclDict)-> Iterator

Iterate over each operator in the operator subset of declaration dictionaries .

source
PNML.output_matrixFunction
output_matrix(petrinet::AbstractPetriNet) -> Matrix{value_type(Inscription, typeof(net))}
output_matrix(petrinet::PnmlNet) -> Matrix{value_type(Inscription, typeof(net))}

Create and return a matrix ntransitions x nplaces.

source
PNML.pagesFunction
pages(net::PnmlLabel|page::Page) -> iterator

Return iterator of pages directly owned by that object.

See allpages for an iterator over all pages in the PNML network model. When there is only one page in the net, or all pages are owned by the 'net' itself, 'allpages' and 'pages` behave the same.

Maintains order (insertion order).

source
PNML.pidFunction
pid(x) -> Symbol

Return pnml id symbol of x. An id's value is unique in the XML model of PNML. REFID is used for refrences to pnml ids.

source
PNML.pnml_hl_operatorMethod
pnml_hl_operator(tag::Symbol) -> Callable(::Vector{AbstractTerm})

Return callable with a single argument, a vector of inputs.

source
PNML.pnml_hl_outsortMethod
pnml_hl_outsort(tag::Symbol; insorts::Vector{UserSortRef}) -> SortRef

Return sort that operator tag returns.

source
PNML.pnmlmultisetFunction
pnmlmultiset(basis::SortRef, x, multi::Int=1; ddict) -> PnmlMultiset
pnmlmultiset(basis::SortRef, x::Multisets.Multiset; ddict) -> PnmlMultiset
pnmlmultiset(basis::SortRef; ddict) -> PnmlMultiset

Constructs a PnmlMultiset containing a multiset and a sort from either

  • a sortref, one element and a multiplicity, default = 1, denoted "1'x",
  • a sortref and Multiset
  • or just a sortref (not a multisetsort), uses all sortelements, each with multiplicity 1.

Are mapping to Multisets.jl implementation: Create empty Multiset{T}() then fill. If we have an element we can use typeof(x) to deduce T. If we have a basis sort definition we use eltype(basis) to deduce T.

Usages

  • ⟨all⟩ wants all sortelements
  • default marking, inscription want one element or zero elements (elements can be PnmlTuples)

we always find a sort to use, And use dummy elements for their typeof for empty multisets.

Expect to be called from a @matchable Terminterface, thusly:

  • eval(toexpr(Bag(basis, x, multi, ddict), variable_substitutions))
  • eval(toexpr(Bag(basis), ddict), variable_substitutions))
source
PNML.refidFunction
refid(x) -> REFID

Return reference id symbol. Multiple objects may hold the same refid value.

source
PNML.refplace_idsetFunction
refplace_idset(x) -> OrderedSet{Symbol} #TODO iterator?

Return reference place pnml ids.

source
PNML.save_config!Method
save_config!(config::PnmlConfig=CONFIG[])

Save a configuration to your LocalPreferences.toml file using Preferences.jl. The saved preferences will be automatically loaded next time you do using PNML

Examples

julia> using PNML

julia> PNML.CONFIG[].verbose = true;

julia> PNML.CONFIG[].warn_on_unclaimed = true;     # Customize some defaults

julia> PNML.save_config!(PNML.CONFIG[]); # Will be automatically read next time you `using PNML`
source
PNML.sortdefinitionFunction
sortdefinition(::SortDeclaration) -> Sort

Return concrete sort attached to a sort declaration object.

Dictionaries in a network-level DeclDict hold, among other things, NamedSort, ArbitrarySort and PartitionSort declarations. These declarations add an ID and name to a concrete sort, with the ID symbol used as the dictionary key.

Examples

sortdefinition(namedsort(decldict, refid))
sortdefinition(partitionsort(decldict, refid))
source
PNML.sortelementsMethod
sortelements(ms::PnmlMultiset) -> iterator

Iterates over elements of the basis sort. May not be finite sort!

source
PNML.sortofFunction
sortof(x) -> AbstractSort

Return the sort of an object or type. Any type that supports the PNML sort interface is expected to define has_sort to be true and a sortof method that returns a sort instance.

Often implemented as sortdefinition(namedsort(ddict, sortref(x))) or other call of sortdefinition. Default implementation is identity.

We provide a sort for some Julia types: Integer, Int64, Float64. Used for PTNet.

source
PNML.sortofMethod

Special case to IntegerSort(), it is part of the name, innit.

source
PNML.sortrefFunction
sortref(x) -> SortRef

Return a REFID wrapped in a SortRef.

Things that have a sortref include: Place, Arc, Inscription, Marking, MultisetSort, SortType, NumberConstant, Int64, Integer, Float64, FEConstant, FiniteIntRangeConstant, DotConstant, BooleanConstant, PnmlMultiset, Operator, Variable,

source
PNML.sourceMethod
source(arc) -> Symbol

Return identity symbol of source of arc.

source
PNML.tagFunction
tag(x) -> Symbol

Return tag symbol. Multiple objects may hold the same tag value. Often used to refer to an XML tag.

source
PNML.targetMethod
target(arc) -> Symbol

Return identity symbol of target of arc.

source
PNML.unwrap_pmsetMethod
unwrap_pmset(mark) -> Multiset

If marking wraps a PnmlMultiset, extract a singleton.

source
PNML.valueFunction
value(x)

Return value of x. Can be a wrapped value or a derived value. May return an Expr that returns the value when eval'ed.

source
PNML.value_typeFunction
value_type(::Type{<AbstractLabel}, ::Type{<:PnmlType}) -> Type

Return the Type of a label's value.

source
PNML.varsubsFunction
varsubs(transition) -> Vector{NamedTuple}

Access the variable substitutions of a transition.

Variable substitutions depend on the current marking. Cache value in transition field as part of enabling rule phase of a Petri net lifecycle.

source
PNML.verifyMethod

Error if any diagnostic messages are collected. Especially intended to detect semantc error.

source
PNML.versionFunction

"Version of tool for this tool specific information element and its parser."

source
PNML.vertex_data!Method

Fill dictionary where keys are pnml ids, values are tuples of vertex code, place or transition.

source
PNML.zero_markingMethod

Return zero-valued object with same basis and eltype as place's marking.

Used in enabling and firing rules to deduce type of Arc's adjacent_place.

source

PNML.PnmlTypes

PNML.PnmlTypesModule

Petri Net Type Definition (pntd) URI mapped to PnmlType subtype singleton.

source
PNML.PnmlTypes.pntd_mapConstant

Map from Petri Net Type Definition (pntd) URI to Symbol. Allows multiple strings to map to the same pntd.

There is a companion map pnmltype_map that takes the symbol to a type object.

The URI is a string and may be the full URL of a pntd schema, just the schema file name, or a placeholder for a future schema.

For readability, the 'pntd symbol' should match the name used in the URI with inconvinient characters removed or replaced. For example, '-' is replaced by '_'.

source
PNML.PnmlTypes.HLCoreNetType
struct HLCoreNet <: PNML.PnmlTypes.AbstractHLCore

HLCoreNet can be used for generic high-level nets. We try to implement and test all function at `PnmlCoreNet level, but expect to find use for a concrete type at this level for testing high-level extensions.

source
PNML.PnmlTypes.HLPNGType
struct HLPNG <: PNML.PnmlTypes.AbstractHLCore

High-Level Petri Net Graphs (HLPNGs) are the most intricate High-Level Petri Net schema. It extends SymmetricNet, including with

  • declarations for sorts and functions (ArbitraryDeclarations)
  • sorts for Integer, String, and List
source
PNML.PnmlTypes.PTNetType
struct PTNet <: PNML.PnmlTypes.AbstractPnmlCore

Place-Transition Petri Nets add small extensions to core PNML. Integer-valued initialMarking and inscription.

The grammer file is ptnet.pnml so we name it PTNet. Note that 'PT' is often the prefix for XML tags specialized for this net type.

source
PNML.PnmlTypes.PnmlCoreNetType
struct PnmlCoreNet <: PNML.PnmlTypes.AbstractPnmlCore

The most minimal concrete Petri Net.

Used to implement and test the core PNML support. Covers the complete graph infrastructure including labels attached to nodes and arcs.

source
PNML.PnmlTypes.PnmlTypeType
abstract type PnmlType

Abstract root of a dispatch type based on Petri Net Type Definitions (pntd).

Each Petri Net Markup Language (PNML) network element will have a single pntd URI as a required 'type' XML attribute. That URI should refer to a RelaxNG schema defining the syntax and semantics of the XML model.

Selected abbreviations, URIs that do not resolve to a valid schema file, are also allowed.

Refer to pntd_symbol and pnmltype for how to get from the URI to a singleton.

source
PNML.PnmlTypes.SymmetricNetType
struct SymmetricNet <: PNML.PnmlTypes.AbstractHLCore

Symmetric Petri Net is the best-worked use case in the primer and ISO 15909 standard part 2.

source
PNML.PnmlTypes.pnmltypeFunction
pnmltype(pntd::PnmlType) -> pnml
pnmltype(uri::AbstractString) -> PnmlType
pnmltype(s::Symbol; pnmltype_map=pnmltype_map) -> PnmlType

Map either a text string or a symbol to a dispatch type object.

While that string may be a URI for a pntd, we treat it as a simple string without parsing. The PnmlTypes.pnmltype_map and PnmlTypes.pntd_map are both assumed to be correct here.

Unknown or empty uri will map to symbol :pnmlcore. Unknown symbol throws a DomainError exception.

Examples

jldoctest; setup=:(using PNML; using PNML: pnmltype, pntd_symbol)
julia> pnmltype(PnmlCoreNet())
PnmlCoreNet()

julia> pnmltype("nonstandard")
PnmlCoreNet()

julia> pnmltype(:symmetric)
SymmetricNet()
source
PNML.PnmlTypes.pntd_symbolMethod
pntd_symbol(s::AbstractString) -> Symbol

Map string s to a pntd symbol using pntd_map. Any unknown s is mapped to :pnmlcore. Returned symbol is suitable for pnmltype to use to index into pnmltype_map.

Examples

julia> PNML.PnmlTypes.pntd_symbol("foo")
:pnmlcore
source

PNML.PnmlIDRegistrys

PNML.PnmlIDRegistrys.reset_reg!Method
reset_reg!(
    registry::PNML.PnmlIDRegistrys.PnmlIDRegistry
) -> PNML.PnmlIDRegistrys.PnmlIDRegistry

Empty the set of id symbols. Use case is unit tests.

source

PNML.Sorts

PNML.Sorts.BoolSortType

Built-in sort whose eltype is Bool

Operators: and, or, not, imply

Functions: equality, inequality

source
PNML.Sorts.CyclicEnumerationSortType
struct CyclicEnumerationSort{M} <: PNML.Sorts.EnumerationSort{M}

Wraps tuple of REFIDs into feconstant(decldict).

Operations differ between EnumerationSorts. All wrap a tuple of symbols and metadata, allowing attachment of Partition/PartitionElement.

See ISO/IEC 15909-2:2011/Cor.1:2013(E) defect 11 power or nth successor/predecessor

MCC2023/SharedMemory-COL-100000 has cyclic enumeration with 100000 <feconstant> elements.

source
PNML.Sorts.DotSortType
DotSort

Built-in sort whose eltype is Bool, the smallest Integer subtype that can represent one.

source
PNML.Sorts.FiniteIntRangeSortType
struct FiniteIntRangeSort{T<:Integer, M} <: PNML.AbstractSort
FiniteIntRangeSort(start::T, stop::T; meta) where {T<:Integer} -> Range
source
PNML.Sorts.ProductSortType
struct ProductSort{N} <: PNML.AbstractSort

An ordered collection of sorts. The elements of the sort are tuples of elements of each sort.

ISO 15909-1:2019 Concept 14 (color domain) finite cartesian product of color classes. Where sorts are the syntax for color classes and ProduceSort is the color domain.

source
PNML.Sorts.builtin_sortsMethod

Tuple of sort IDs that are considered builtin. There will be a version defined for each in the DeclDict. Users may (re)define these.

source
PNML.Sorts.equalsMethod
equals(a::PNML.AbstractSort, b::PNML.AbstractSort) -> Any

For sorts to be the same, first they must have the same type. Then any contents of the sorts are compared semantically.

source
PNML.Sorts.make_sortrefMethod
make_sortref(parse_context, dict, sort, seed, id, name) ->  SortRef`
  • dict is a method/callable that returns an AbstractDict (in a DeclDict).
  • sort ia a concrete sort that is to be in dict.
  • seed is passed to gensym if id in nothing and no sort is already in dict.
  • id is a Symbol and the string name are nothing and "" unless there is a wrapper providing such information,

Uses fill_sort_tag!.

Return concrete SortRef matching dict, wrapping id.

source
PNML.Sorts.refsMethod
refs(sort::EnumerationSort) -> Vector{REFID}

Return Vector of FEConstant REFIDs.

source
PNML.Sorts.sortsMethod
sorts(ps::ProductSort) -> NTuple

Return iterator over tuples of elements of sorts in the product.

source
PNML.sortelementsMethod
sortelements(sort::EnumerationSort) -> Iterator

Return iterator into feconstant(decldict) for this sort's FEConstants. Maintains order of this sort.

source

PNML.Declarations

PNML.Declarations.AbstractDeclarationType
abstract type AbstractDeclaration

Declarations define objects/names that are used for high-level terms in conditions, inscriptions, markings. The definitions are attached to PNML nets and/or pages using a PNML Label defined in a <declarations> tag.

  • id
  • name
source
PNML.Declarations.ArbitraryOperatorType
struct ArbitraryOperator <: PNML.Declarations.OperatorDeclaration
  • id::Symbol

  • name::Union{SubString{String}, String}

  • declaration::Symbol

  • declarationdicts::PNML.DeclDict

...arbitrary sorts and operators do not come with a definition of the sort or operation; they just introduce a new symbol.

Like ArbitrarySort, does not have an associated algebra, not usable by SymmetricNet.

source
PNML.Declarations.ArbitrarySortType
struct ArbitrarySort <: PNML.Declarations.SortDeclaration
  • id::Symbol

  • name::Union{SubString{String}, String}

  • body::Symbol

  • declarationdicts::PNML.DeclDict

Arbitrary sorts that can be used for constructing terms are reserved for/supported by HLPNG in the pnml standard.

...arbitrary sorts and operators do not come with a definition of the sort or operation; they just introduce a new symbol.

Like ArbitraryOperator, does not have an associated algebra, not usable by SymmetricNet.

source
PNML.Declarations.NamedOperatorType
struct NamedOperator{T} <: PNML.Declarations.OperatorDeclaration
  • id::Symbol

  • name::Union{SubString{String}, String}

  • parameter::Vector{PNML.Declarations.VariableDeclaration}

  • def::Any

  • declarationdicts::PNML.DeclDict

See UserOperator.

Vector of VariableDeclaration for parameters (ordered), and duck-typed AbstractTerm for its body.

source
PNML.Declarations.NamedSortType
struct NamedSort{S<:PNML.AbstractSort} <: PNML.Declarations.SortDeclaration
  • id::Symbol

  • name::Union{SubString{String}, String}

  • def::PNML.AbstractSort

  • declarationdicts::PNML.DeclDict

Declaration of a NamedSort. Wraps a concrete instance of an AbstractSort. See MultisetSort, ProductSort, UserSort.

source
PNML.Declarations.PartitionElementType
PartitionElement(id::Symbol, name, Vector{IDREF}, REFID)
  • id::Symbol

  • name::Union{SubString{String}, String}

  • terms::Vector{Symbol}

  • partition::Symbol

  • declarationdicts::PNML.DeclDict

Establishes an equivalence class over a Declarations.PartitionSort's emumeration. See also FiniteEnumerationSort. Gives a name to an element of a partition. The element is an equivalence class.

PartitionElement is different from FiniteEnumeration, CyclicEnumeration, FiniteIntRangeSort in that it holds UserOperators, not FEConstants. The UserOperator refers to the FEConstants of the sort over which the partition is defined. NB: FEConstants are 0-arity operators. UserOperator is how operation declarations are accessed.

NB: The "PartitionElementOf" operator maps each element of the FiniteEnumeration (referenced by the partition) to the PartitionElement (of the partition) to which it belongs.

PartitionElementOf(partition, feconstant) -> PartitionElement partitionelementof(partition, feconstant) -> PartitionElement

PartitionElementOf is passed a REFID of the partition whose PartitionElement membership is being queried.

Each PartitionElement contains a collection of REFIDs to UserOperators which refer to a finite sort's (FiniteEnumeration, CyclicEnumeration, FiniteIntRangeSort) FEConstant by REFID.

Test for membership by iterating over each partition element, and over each term.

source
PNML.Declarations.PartitionSortType
struct PartitionSort <: PNML.Declarations.SortDeclaration
  • id::Symbol

  • name::Union{SubString{String}, String}

  • def::Symbol

  • elements::Vector{PNML.Declarations.PartitionElement}

  • declarationdicts::PNML.DeclDict

Partition sort declaration is a finite enumeration that is partitioned into sub-ranges of enumerations. Is the sort at the partition or the element level (1 sort or many sorts?)

Like NamedSort, will add an id and name to a sort, and is accessed by UserSort.

source
PNML.Declarations.UnknownDeclarationType
struct UnknownDeclaration <: PNML.Declarations.AbstractDeclaration
  • id::Symbol

  • name::Union{SubString{String}, String}

  • nodename::Union{SubString{String}, String}

  • content::Vector{PNML.AnyElement}

  • declarationdicts::PNML.DeclDict

source
PNML.Declarations.VariableDeclarationType
struct VariableDeclaration{S<:SortRef} <: PNML.Declarations.AbstractDeclaration
  • id::Symbol

  • name::Union{SubString{String}, String}

  • sort::SortRef

  • declarationdicts::PNML.DeclDict

Variable declaration <variabledecl> adds a name string and sort to the id shared with <variable> terms in non-ground terms.

EXAMPLE

PNML.DeclDict

PNML.variabledecls[id] = VariableDeclaration(id, "human name", sort)

source

PNML.PnmlGraphics

PNML.Labels.PnmlGraphics.FontType

Font attributes as strings.

struct Font
  • family::String

  • style::String

  • weight::String

  • size::String

  • align::String

  • rotation::String

  • decoration::String

source
PNML.Labels.PnmlGraphics.GraphicsType

PNML Graphics can be attached to many parts of PNML models.

struct Graphics{T<:Float32}
  • dimension::PNML.Coordinate

  • fill::PNML.Labels.PnmlGraphics.Fill

  • font::PNML.Labels.PnmlGraphics.Font

  • line::PNML.Labels.PnmlGraphics.Line

  • offset::PNML.Coordinate

  • positions::Vector{PNML.Coordinate}

source

PNML.Labels

PNML.Labels.ConditionType
(c::Condition)(args) -> Bool

Use args, a dictionary of variable substitutions into the expression to return a Bool.

source
PNML.Labels.ConditionType
struct Condition{T<:PNML.Expressions.PnmlExpr} <: PNML.HLAnnotation
  • text::Union{Nothing, String}

  • term::PNML.Expressions.PnmlExpr

  • graphics::Union{Nothing, PNML.Labels.PnmlGraphics.Graphics}

  • toolspecinfos::Union{Nothing, Vector{PNML.Labels.ToolInfo}}

  • vars::Vector{Symbol}

  • declarationdicts::PNML.DeclDict

Label a Transition with an boolean expression used to determine when/if the transition fires.

There may be other things evaluating to boolean used to determine transition firing filters, including: priority labels, inhibitor arc, place capacity labels, time/delay labels.

Examples

Vector

julia> c = Labels.Condition(false, ctx.ddict)
Condition("", BooleanEx(BooleanConstant(false)))

julia> c()
false

julia> c = Labels.Condition("xx", BooleanEx(BooleanConstant(true, ctx.ddict)), ctx.ddict)
Condition("xx", BooleanEx(BooleanConstant(true)))

julia> c()
true
source
PNML.Labels.DeclarationType
struct Declaration <: PNML.Annotation
  • text::Union{Nothing, String}

  • ddict::PNML.DeclDict

  • graphics::Union{Nothing, PNML.Labels.PnmlGraphics.Graphics}

  • toolspecinfos::Union{Nothing, Vector{PNML.Labels.ToolInfo}}

Label of a <net> or <page> that holds zero or more declarations. The declarations are used to define parts of the many-sorted algebra used by High-Level Petri Nets.

All the declarations in the <structure> are placed into a single per-net dictionary ddict. The text, graphics, and toolspecinfos fields are expected to be nothing, but are present because, being labels, it is allowed.

source
PNML.Labels.HLLabelType
struct HLLabel{PNTD} <: PNML.HLAnnotation
  • text::Union{Nothing, String}

  • structure::Union{Nothing, PNML.AnyElement}

  • graphics::Union{Nothing, PNML.Labels.PnmlGraphics.Graphics}

  • toolspecinfos::Union{Nothing, Vector{PNML.Labels.ToolInfo}}

  • declarationdicts::PNML.DeclDict

High-level pnml labels are expected to have <text> and <structure> elements. This concrete type is for "unclaimed" labels in a high-level petri net.

source
PNML.Labels.InscriptionType
struct Inscription{T<:PNML.Expressions.PnmlExpr} <: PNML.HLAnnotation
  • text::Union{Nothing, String}

  • term::PNML.Expressions.PnmlExpr

  • graphics::Union{Nothing, PNML.Labels.PnmlGraphics.Graphics}

  • toolspecinfos::Union{Nothing, Vector{PNML.Labels.ToolInfo}}

  • vars::Vector{Symbol}

  • declarationdicts::PNML.DeclDict

Labels an Arc with a expression term .

Inscription(t::PnmlExpr)() is a functor evaluating the expression and returns a value of the eltype of sort of inscription.

source
PNML.Labels.MarkingType
struct Marking{T<:PNML.Expressions.PnmlExpr} <: PNML.Annotation
  • term::PNML.Expressions.PnmlExpr

  • text::Union{Nothing, String}

  • graphics::Union{Nothing, PNML.Labels.PnmlGraphics.Graphics}

  • toolspecinfos::Union{Nothing, Vector{PNML.Labels.ToolInfo}}

  • declarationdicts::PNML.DeclDict

Number-valued label of Place.

Is a functor that returns the value. ```

source
PNML.Labels.MarkingMethod

Evaluate Marking instance by evaluating term expression.

Place/Transition Nets (PNet, ContinuousNet) use collective token identity (map to Number). High-level Nets (SymmetricNet, HLPNG) use individual token identity (colored petri nets).

There is a multi-sorted algebra definition mechanism defined for HL Nets. HL Net Marking values are a ground terms of this multi-sorted algebra.

These are used to give the initialize a marking vector that will then be updated by firing a transition.

source
PNML.Labels.NameType
struct Name <: PNML.Annotation
  • text::String

  • graphics::Union{Nothing, PNML.Labels.PnmlGraphics.Graphics}

  • toolspecinfos::Union{Nothing, Vector{PNML.Labels.ToolInfo}}

Name is for display, possibly in a tool specific way.

source
PNML.Labels.PnmlLabelType
struct PnmlLabel <: PNML.Annotation
  • tag::Union{SubString{String}, String, Symbol}

  • elements::Union{SubString{String}, String, OrderedCollections.LittleDict{Union{String, Symbol}, Any, KS, VS} where {KS<:Union{Tuple{Vararg{Union{String, Symbol}}}, AbstractVector{Union{String, Symbol}}}, VS<:Union{Tuple, AbstractVector{Any}}}}

  • declarationdicts::PNML.DeclDict

Wrap a PNML Label as parsed by XMLDict. Use the XML tag as identifier.

Used for "unclaimed" labels that do not have, or we choose not to use, a dedicated parse method. Claimed labels will have a type/parser defined to make use of the structure defined by the pntd schema.

See also AnyElement which allows any well-formed XML, while PnmlLabel is restricted to PNML Labels.

source
PNML.Labels.RateType
struct Rate{T<:Number} <: PNML.Annotation
  • value::Number

  • graphics::Union{Nothing, PNML.Labels.PnmlGraphics.Graphics}

  • toolspecinfos::Union{Nothing, Vector{PNML.Labels.ToolInfo}}

  • declarationdicts::PNML.DeclDict

Real valued label. An expected use is as a transition rate.

source
PNML.Labels.SortTypeType
struct SortType <: PNML.Annotation
  • text::Union{Nothing, String}

  • sort_::SortRef

  • graphics::Union{Nothing, PNML.Labels.PnmlGraphics.Graphics}

  • toolspecinfos::Union{Nothing, Vector{PNML.Labels.ToolInfo}}

  • declarationdicts::PNML.DeclDict

A places's <type> label wraps a UserSortRef that holds a REFID to the sort of a place, hence use of sorttype. It is the type (or set) concept of the many-sorted algebra.

For high-level nets there will be a declaration section with a rich language of sorts using UserSort & PNML.Declarations.NamedSort defined in the xml input.

For other PnmlNet's they are used internally to allow common implementations.

defines the type by referring to some sort; by the fixed interpretation of built-in sorts,

this sort defines the type of the place.

By the fixed interpretation of sorts, this implicitly refers to a set, which is the type of that place.

"refers to set" excludes multiset (as stated elsewhere in standard)

this is a sort, not a term, so no variables or operators.

The initial marking function M0 is defined by the label Marking of the places. ... this is a ground term of the corresponding multiset sort.

Ground terms have no variables and can be evaluated outside of a transition firing rule.

source
PNML.Labels.StructureType
struct Structure
  • tag::Symbol

  • el::Any

High-level Annotation Labels place meaning in <structure> that is consumed by "claimed" labels. Is is expected to contain an abstract syntax tree (ast) for the many-sorted algebra expressed in XML. We implement this to allow use of <structure> tags by other PnmlTypes.

Extra

There are various defined structure ast variants in pnml:

  • Sort Type of a Place [builtin, multi, product, user]
  • Place Marking [variable, operator]
  • Transition Condition [variable, operator]
  • Arc Inscription [variable, operator]
  • Declarations [sort, variable, operator]

These should all have dedicated parsers and objects as claimed labels. Here we provide a fallback for unclaimed tags.

source
PNML.Labels.TokenGraphicsType
struct TokenGraphics
  • positions::Vector{PNML.Coordinate}

TokenGraphics is <toolspecific> content. Combines the <tokengraphics> and <tokenposition> elements.

source
PNML.Labels.ToolInfoType
struct ToolInfo{T}
  • toolname::String

  • version::String

  • infos::Vector

  • declarationdicts::PNML.DeclDict

Holds a <toolspecific> tag.

It wraps a iteratable collection (currently vector) of well formed elements parsed into AnyElements for use by anything that understands toolname, version tool specifics.

source
PNML.Labels._matchFunction
_match(tx, namerex::Regex, versionrex::Regex) -> Bool

Return true if both toolname and version match. Default is any version. Applies to ToolInfo, ToolParser, and other objects with a name and version method.

source
PNML.Labels.def_sort_elementMethod
def_sort_element(x)

Return an arbitrary element of sort x. All sorts are expected to be iteratable and non-empty, so we return first. Uses include default inscription value and default initial marking value sorts.

x can be anything with a sortelements(x) method that returns an iterator with length. See AbstractSort, SortType.

source
PNML.Labels.defaultFunction
default(::Type{T<:AbstractLabel}, pntd::PnmlType; ddict::DeclDict) -> T

Return a default label T for pntd.

source
PNML.Labels.defaultMethod
default(
    ::Type{<:PNML.Labels.Marking},
    pntd::PNML.PnmlTypes.PnmlType,
    placetype::PNML.Labels.SortType;
    ddict
)

Return default marking value based on PnmlType. Has meaning of empty, as in zero. For high-level nets, the marking is an empty multiset whose basis matches placetype. Others have a marking that is a Number.

source
PNML.Labels.delay_valueMethod
delay_value(
    t;
    tag,
    valtype,
    content_parser,
    default_value
) -> Tuple{AbstractString, Float64, Union{Bool, Float64}}

Return delay label value as interval tuple: ("closure-string", left, right) Missing delay labels default to ("closed", 0.0, 0.0) a.k.a. zero.

All net types may have a delay value type. Expected label XML: see MathML. Only non-negative.

Supports

  • ("closed-open", 0.0, ∞) -> [0.0, ∞)
  • ("open-closed", 2.0, 6.0 -> (2.0, 6.0]
  • ("open", 2.0, 6.0) -> (2.0, 6.0)
  • ("closed", 2.0, 6.0) -> [2.0, 6.0]
source
PNML.Labels.get_toolinfoFunction
get_toolinfo(infos, toolname[, version]) -> Maybe{ToolInfo}

Return first toolinfo in iteratable collection infos having a matching toolname and version. See has_toolinfo.

source
PNML.Labels.get_toolinfosFunction
get_toolinfos(infos, toolname::Regex, version::Regex) -> Iterator

infos may be a collection of ToolInfo or ToolParser. Return iterator over infos matching toolname and version regular expressions. Default version regex matches anything, returning all infos for a tool or all parsers for a tool.

source
PNML.Labels.has_toolinfoFunction

has_toolinfo(infos, toolname[, version]) -> Bool

Does any toolinfo in iteratable collection infos have a matching toolname, and a matching version (if it is provided). toolname and version will be turned into Regexs to match against each item in the infos collection.

source
PNML.Labels.hastagMethod
hastag(x, tagvalue::Union{Symbol, String, SubString{String}}) -> Bool

Test anything with a tag accessor for equality with tagvalue.

Usage: Iterators.filter(Fix2(hastag, :asymbol), iteratable)

source
PNML.Labels.rate_valueMethod
rate_value(t; <options>) -> Real

Return value of a Rate label. Missing rate labels are defaulted to zero.

Expected label XML: <rate> <text>0.3</text> </rate>

Arguments

`t` is anything that supports `labelof(t, tag)`.
`tag::String` is the XML element tag, default `"rate"`.
`value_type::Type{<:Number}` is concrete `Type` used to parse value.
`content_parser`::Base.Callable with arguments of `labelof(t, tag)` and `value_type`.
`default_value` = zero(value_type) is returned when `labelof(t, tag)` returns `nothing`.
source
PNML.Labels.textMethod

Return text field. All labels are expected to have one that may be nothing or an empty string.

source
PNML.Labels.validate_toolinfosMethod
validate_toolinfos(infos, dd) -> Bool

Validate each ToolInfo in the iterable infos collection.

Note that each info may contain any well-formed XML. That XML for other toolinfos must be ignored. Any info for this tool will have deeper validation implemented.

source
PNML.nameMethod

Name of tool to for this tool specific information element.

source

PNML.Parser

PNML.Parser.ParseInscriptionTermType
ParseInscriptionTerm(placetype) -> Functor

Holds parameters for parsing inscription. The sort of the inscription must match the place sorttype. Input arcs (source is a transition) and output arcs (source is a place) called as (pit::ParseInscriptionTerm)(::XMLNode, ::PnmlType)

source
PNML.Parser.add_labelMethod
add_label(infos::Maybe{collection}, node::XMLNode, pntd, parse_context) -> collection

Allocate storage for collection on first use. Then parse and add a label.

source
PNML.Parser.add_toolinfo!Method
add_toolinfo!(collection, node, pntd, parse_contex) -> collection

Parse and add ToolInfo to infos collection, return infos.

The UML from the pnml primer (and schemas) use <toolspecific> as the tag name for instances of the type ToolInfo.

source
PNML.Parser.add_toolinfoMethod
add_toolinfo(infos::Maybe{collection}, node::XMLNode, pntd, parse_contex) -> collection

Allocate storage for infos on first use. Then add to infos.

source
PNML.Parser.allchildrenFunction
allchildren(node::XMLNode, tag::AbstractString) -> Vector{XMLNode}

Return vector of el's immediate children with tag.

source
PNML.Parser.alldecendentsFunction
alldecendents(node::XMLNode, tag::AbstractString) -> Vector{XMLNode}

Return vector of node's immediate children and decendents with tag.

source
PNML.Parser.attributeFunction
attribute(node::EzXML.Node, key::AbstractString) -> String
attribute(
    node::EzXML.Node,
    key::AbstractString,
    msg::String
) -> String

Return XML attribute value.

source
PNML.Parser.fill_decl_dict!Method
fill_decl_dict!(ctx::ParseContext, node::XMLNode, pntd::PnmlType) -> ParseContext

Add <declaration> <declarations> to ParseContext. <declaration> may be attached to <net> and <page> elements. Each will have contents in a <structure> element. Are net-level values.

source
PNML.Parser.firstchildFunction
firstchild(
    node::EzXML.Node,
    tag::AbstractString
) -> Union{Nothing, EzXML.Node}
firstchild(
    node::EzXML.Node,
    tag::AbstractString,
    namespace::AbstractString
) -> Union{Nothing, EzXML.Node}

Return up to 1 immediate child of el that is a tag. ns is the default namespace. Invent a prefix to create an iterator of namespace prefix and URI pairs

source
PNML.Parser.parse_arcMethod
parse_arc(node::XMLNode, pntd::PnmlType) -> Arc

Construct an Arc with labels specialized for the PnmlType.

source
PNML.Parser.parse_conditionMethod
parse_condition(::XMLNode, ::PnmlType; decldict) -> Condition

Label of transition node. Used in the enabling function.

Details

ISO/IEC 15909-1:2019(E) Concept 15 (symmetric net) introduces Φ(transition), a guard or filter function, that is and'ed into the enabling function. 15909-2 maps this to <condition> expressions.

Later concepts add filter functions that are also and'ed into the enabling function.

  • Concept 28 (prioritized Petri net enabling rule)
  • Concept 31 (time Petri net enabling rule)

We support PTNets having <condition> with same syntax as High-level nets. Condition has <text> and <structure> elements, with all meaning in the <structure> that holds an expression evaluating to a boolean value.

One field of a Condition holds a boolean expression, BoolExpr. Another field holds information on variables in the expression.

source
PNML.Parser.parse_declaration!Function

Fill dd::[DeclDict](@ref) from one or more <declaration> labels.

Expected format: <declaration> <structure> <declarations> <namedsort/> <namedsort/> ...

Assume behavior with the meaning in a <structure> for all nets.

Note the use of both declaration and declarations. We allow repeated declaration (without the s) here. All fill the same DeclDict. See fill_decl_dict!

source
PNML.Parser.parse_feconstantsMethod
parse_feconstants(::XMLNode, ::PnmlType, ::REFID; ddict) -> Tuple{<:SortRef}

Place the constants into feconstants(). Return tuple of finite enumeration constant REFIDs.

Access as 0-ary operator indexed by REFID

source
PNML.Parser.parse_graphicsMethod
parse_graphics(
    node,
    pntd
) -> PNML.Labels.PnmlGraphics.Graphics{Float32}

Arcs, Annotations and Nodes have different graphics semantics. Return a Graphics holding the union of possibilities.

source
PNML.Parser.parse_hlinitialMarkingMethod
parse_hlinitialMarking(
    node::EzXML.Node,
    placetype::PNML.Labels.SortType,
    pntd::PNML.PnmlTypes.AbstractHLCore;
    parse_context
)

High-level initial marking labels are expected to have a <structure> child containing a ground term. Sort of marking term must be the same as placetype, the places SortType. Will be a UserSort that holds the ID of a sort declaration.

NB: Used by PTNets that assume placetype is DotSort().

source
PNML.Parser.parse_hlinscriptionMethod
parse_hlinscription(
    node::EzXML.Node,
    source::Symbol,
    target::Symbol,
    pntd::PNML.PnmlTypes.AbstractHLCore;
    netdata,
    parse_context
)

hlinscriptions are expressions.

source
PNML.Parser.parse_initialMarkingMethod
parse_initialMarking(
    node::EzXML.Node,
    placetype::PNML.Labels.SortType,
    pntd::PNML.PnmlTypes.PnmlType;
    parse_context
)

Non-high-level PnmlType initial marking parser. Most things are assumed to be Numbers.

source
PNML.Parser.parse_inscriptionMethod
parse_inscription(
    node::EzXML.Node,
    source::Symbol,
    target::Symbol,
    pntd::PNML.PnmlTypes.PnmlType;
    parse_context
)

Ignore the source & target IDREF symbols.

source
PNML.Parser.parse_label_contentMethod
parse_label_content(node::XMLNode, termparser, pntd; decldict) -> NamedTuple

Parse top-level label node using a termparser callable applied to any <structure> element. Also parses <text>, <toolinfo>, graphics and sort of term.

Top-level labels are attached to nodes, such as: marking, inscription, condition. Each having a termparser.

Returns vars, a tuple of PNML variable REFIDs. Used in the muti-sorted algebra of High-level nets.

source
PNML.Parser.parse_nameMethod
parse_name(
    node::EzXML.Node,
    pntd::PNML.PnmlTypes.PnmlType;
    parse_context
)

Return Name label holding <text> value. With optional <toolspecific> & <graphics> information.

source
PNML.Parser.parse_namedoperatorMethod
parse_namedoperator(
    node::EzXML.Node,
    pntd::PNML.PnmlTypes.PnmlType;
    parse_context
)

Declaration of an operator expression in many-sorted algebra.

An operator of arity 0 is a constant (ground-term, literal). When arity > 0, the parameters are variables, using a NamedTuple for values.

source
PNML.Parser.parse_namedsortMethod
parse_namedsort(
    node::EzXML.Node,
    pntd::PNML.PnmlTypes.PnmlType;
    parse_context
)

Declaration that wraps a Sort, adding an ID and name.

source
PNML.Parser.parse_netMethod
parse_net(node::XMLNode[; options...]) -> PnmlNet

PnmlNet created from an <net> XMLNode.

Arguments

  • pntd_override::Maybe{PnmlType}
  • parse_context::ParseContext
source
PNML.Parser.parse_net_1!Method

Parse PNML <net> with a defined PnmlType used to set the expected behavior of labels attached to the nodes of a petri net graph, including: marking, inscription, condition and sorttype.

Page IDs are appended as the XML tree is descended, followed by node IDs.

source
PNML.Parser.parse_page!Method
parse_page!(net,netsets, node, pntd; context) -> Nothing

Call _parse_page! to create a page with its own netsets. Add created page to parent's page_idset(netsets) and pagedict(net).

source
PNML.Parser.parse_partitionelement!Method
parse_partitionelement!(elements::Vector{PartitionElement}, node::XMLNode; ddict)

Parse <partitionelement>, add FEConstant refids to the element and append element to the vector.

source
PNML.Parser.parse_sorttypeMethod
parse_sorttype(
    node::EzXML.Node,
    pntd::PNML.PnmlTypes.PnmlType;
    parse_context
)

Annotation Label that defines the "sort" of tokens held by the place and semantics of the marking. NB: The "type" of a place from many-sorted algebra is different from the Petri Net "type" of a net or "pntd". Neither is directly a julia type. Nor a pnml sort.

We allow all pntd's places to have a <type> label. Non-high-level net places are expecting a numeric sort: eltype(sort) <: Number.

source
PNML.Parser.parse_sorttype_termMethod
parse_sorttype_term(::XMLNode, ::PnmlType; decldict) -> PnmlExpr, SortRef, Tuple

The PNML <type> of a <place> is a "sort" of the high-level many-sorted algebra. Because we are sharing the HL implementation with the other meta-models, we support it in all nets.

The term here is a concrete sort, usually UserSortRef. It is possible to have an inlined concrete sort that is anonymous. We place all these concrete sorts in the parse_context.ddict and pass around a SortRef.

See parse_sorttype for the rest of the AnnotationLabel structure.

source
PNML.Parser.parse_structureMethod
parse_structure(
    node::EzXML.Node,
    pntd::PNML.PnmlTypes.PnmlType;
    parse_context
)

Return PNML.Labels.Structure holding an XML <structure>. Should be inside of an PNML label. A "claimed" label usually elids the <structure> level (does not call this method).

source
PNML.Parser.parse_termMethod
parse_term(node::XMLNode, ::PnmlType; ddict) -> (PnmlExpr, sort, vars)
parse_term(::Val{:tag}, node::XMLNode, ::PnmlType; ddict) -> (PnmlExpr, sort, vars)

node is a child of a <structure>, <subterm> or <def> element with a nodename of tag.

All terms have a sort, #TODO ... document this XXX

Will be using TermInterface.jl to build an expression tree (AST) that can contain: operators, constants (as 0-arity operators), and variables.

AST expressions are evaluated for: - place initial marking vector, - enabling rule and - firing rule where condition and inscription expressions may contain non-ground terms (using variables).

source
PNML.Parser.parse_termMethod
parse_partitionelementof(elements::Vector{PartitionElement}, node::XMLNode)

Parse <partitionelement refpartition="id">, add FEConstant refids to the element and append element to the vector.

source
PNML.Parser.parse_textMethod
parse_text(
    node::EzXML.Node,
    _::PNML.PnmlTypes.PnmlType
) -> String

Return the stripped string of <text> node's content.

source
PNML.Parser.parse_variabledeclMethod
parse_variabledecl(node::XMLNode, pntd::PnmlType; parse_context::ParseContext) -> VariableDeclaration

Variables are used during firing a transition to identify tokens removed from input place markings, added to output place markings.

Variables are used in evaluating an <namedoperator.>

Variabledecls provide a name and sort.

Variabledecls may appear in the definition of an operator as well as directly in a declaration.

source
PNML.Parser.pnml_namespaceMethod
pnml_namespace(
    node::EzXML.Node;
    missing_ns_fatal,
    default_ns
) -> String

Return namespace. When node does not have a namespace return default value pnml_ns and warn or throw an error.

source
PNML.Parser.subtermsMethod
subterms(node, pntd; vars) -> Vector{PnmlExpr}

Unwrap each <subterm> and parse into a PnmlExpr term. Collect expressions in a Vector and variable REFIDs in a Tuple.

source
PNML.Parser.to_sortFunction
to_sort(sortref::SortRef; ddict::DeclDict) -> AbstractSort

Return concrete sort from ddict using the REFID in sortref,

source
PNML.Parser.unparsed_tagMethod
unparsed_tag(node::XMLNode) -> (tag, Union{DictType, String, SubString{String}})

Return tuple holding a well formed XML tree as parsed by XMLDict.xml_dict. Symbols for attribute key, strings for element/child keys and strings for value/leaf.

tag is the name of the XML element that is "unparsed". It is the root of the tree.

See: anyelement, AnyElement,PnmlLabel, Labels.Structure.

source

PNML.PNet

PNML.PNet.AbstractPetriNetType
abstract type AbstractPetriNet{PNTD<:PNML.PnmlTypes.PnmlType}

Top-level of a single network in a pnml model that is some flavor of Petri Net. Note that pnml can represent nets that are not Petri Nets.

Here is where specialization and restriction are applied to achive Proper Petri Behavior.

See PnmlModel, PnmlType.

Extended

Additional constrants can be imposed. We want to run under the motto: "syntax is not semantics, quack".

Since a PNML.Document model can contain multiple networks it is possible that a higher-level will create multiple AbstractPetriNet instances, each a different type.

Multiple Pages can (are permitted to) be merged into one page by PNML.flatten_pages! without losing any Petri Net semantics.

source
PNML.PNet.HLPetriNetType

Wrap a single pnml net. Presumes that the net does not need to be flattened as all content is in first page.

struct HLPetriNet{PNTD} <: PNML.PNet.AbstractPetriNet{PNTD}
  • ctx::PNML.Context

  • net::PnmlNet{PNTD} where PNTD

Details

source
PNML.PNet.SimpleNetType
struct SimpleNet{PNTD} <: PNML.PNet.AbstractPetriNet{PNTD}
  • id::Symbol

  • net::PnmlNet{PNTD} where PNTD

  • metadata::Any

TODO: Rename SimpleNet to TBD

SimpleNet is a concrete AbstractPetriNet wrapping a single PnmlNet.

Uses a flattened net to avoid the page level of the pnml hierarchy.

Note: A multi-page petri net can always be flattened by removing referenceTransitions & referencePlaces, and merging pages into the first page.

source
PNML.PNet.TransitionMatricesType
TransitionMatrices

This data structure stores the transition matrix of an Petri net object. This is primarily used for constructing the vectorfield representation of the Petri net.

These are matrices of inscription value_type

source
PNML.PNet.civMethod
civ(net, arcid) -> _cvt_inscription_value(pntd, arcdict[srcid], z, NamedTuple())
source
PNML.PNet.counted_transitionsFunction
counted_transitions(net) -> Pair(pid(tr)=>(in_counts=>out_counts))

Iterates over transitions producing a pair for each tansition := of a pair of tuples of inscription values for preset, postset arcs. Useful for petri net meta-models that need special handling to expand when inscription > 1.

source
PNML.PNet.in_inscriptionsMethod
in_inscriptions(net, transitionid) -> Iterator

Iterate over preset of transition, returning source place id => inscription value pairs.

source
PNML.PNet.in_outFunction

Return tuple of input, output labelled vectors with key of place ids and value of arc inscription's value for use as a transition function. #TODO When do these get called "pre" and "post"?

source
PNML.PNet.initial_markingsFunction
initial_markings(petrinet) -> Tuple{Pair{id(place),value_type(marking(place))}

Tuple of Pair(placeid, initialmarking value).

High-level P/T Nets use cardinality of its multiset place marking value. Really, the implementation should be the same as for PTNet.

Other HL Nets use multisets.

source
PNML.PNet.insMethod
ins(net, transition_id) -> LVector

Inscription values labeled with source place id for arcs with transition_id as the target id.

source
PNML.PNet.labeled_transitionsFunction
labeled_transitions((net::PnmlNet)) -> `(t_name=>t_rate)=>((input_states)=>(output_states))`

Iterates over transitions producing a pair for each tansition := Pair{Pair{Symbol,Number}, Pair{Tuple,Tuple}} where the Symbol is the transition ID, Number is the rate value and the Tuples are place IDs.

source
PNML.PNet.out_inscriptionsMethod
out_inscriptions(net, transitionid) -> Iterator

Iterate over postset of transition, returning target place id => inscription value pairs.

source
PNML.PNet.outsMethod
outs(net, transition_id) -> LVector

Inscription values labeled with target place id for arcs with transition_id as the source id.

source
PNML.PNet.ratesFunction
rates(petrinet::AbstractPetriNet) -> [id(transition) => rate_value(transition)]

Return a vector of transitionid=>ratevalue.

We allow all PNML nets to be stochastic Petri nets. See rate_value.

source
PNML.PNet.transition_functionFunction

transition_function(petrinet::AbstractPetriNet) -> LVector{Symbol, Tuple{LVector,LVector}

Transition function of a Petri Net. Each transition has an input vector and an output vector. Each labelled vector is indexed by the place on the other end of the arc. Values are inscriptions of the arc.

keys are transition ids

values are tuple of input, output labeled vectors,

label is source or target place id - inscription (integer?)

source
PNML.metagraphMethod
metagraph(::AbstractPetriNet) -> MetaGraph
metagraph(::PnmlNet) -> MetaGraph

Return MetaGraph instance based on a SimpleDiGraph with PNML nodes attached to vertices and edges.

source

PNML.Expressions

PNML.Expressions.PnmlTupleExType
PnmlTupleEx(args::Vector)

PnmlTupleEx TermInterface expression object wraps an ordered collection of PnmlExpr objects. There is a related ProductSort: an ordered collection of sorts. Each tuple element will have the same sort as the corresponding product sort.

NB: ISO 15909 Standard considers Tuple to be an Operator.

source
PNML.Expressions.substituteMethod
substitute(expr, dict)

Recursivly substitute a VariableEx with its the value from dict. The values in dict will be ground terms of a place's sorttype. These values are from the current marking vector. ```

source
PNML.Expressions.toexprFunction
toexpr(ex::PnmlExpr, varsubs::NamedTuple, ddict) -> Expr

Return Expr. Recursivly call toexpr on any contained terms. varsubs used to replace variables with values in expressions.

source

Index