Default Values

Varies by PNTD. Possibilitie include:

  • markings: return zero(Int), zero(Float64), or empty multiset of same sort as adjacent place's sorttype.
  • inscription: return one(Int), one(Float64), or singleton multiset of same sort as adjacent place's sorttype with value of first(elements(sort)).
  • condition: return true, or BooleanConstant(true)

The ISO/IEC 15909-2 standard and the RelaxNG Schemas state 'natural numbers' and 'non-zero natural numbers'. I choose to also allow continuous values to support nonstandard continuous and hybrid valued Petri Nets. Makes generating default values more interesting.

Determine type of Number to parse with number_value by using value_type.

There are many items in the XML that are permitted to be missing and a defaut value is assumed. Examples are place initial marking, arc inscription, transition condition, graphics data.

  • place initial marking is assumed to be empty, i. e. 0.
  • arc inscription is assumed to be 1.
  • transition condition is assumed to be true
  • graphics data, e.g. token position, line width, are TBD

There are multiple kinds of nets supported by PNML.jl differing by (among other properties) the kind on number they use:

  • discrete,
  • continuous,
  • and multi-sorted algebra

See PnmlType - Petri Net Type Definition for the full hierarchy.

This means there are at least 3 sets of default value types. We use the pntd PnmlType as a trait to determine the default types/values.

A consequence is that the default value's type ripples through the type system.

Methods

PNML.Labels.default

# 6 methods for generic function default from PNML.Labels:

Examples

julia> c = default(Condition, PnmlCoreNet(); ctx.ddict)
Condition("", BooleanEx(BooleanConstant(true)))

julia> c()
true

julia> c = default(Condition, PnmlCoreNet(); ctx.ddict)
Condition("", BooleanEx(BooleanConstant(true)))

julia> c = default(Condition, PnmlCoreNet(); ctx.ddict)
Condition("", BooleanEx(BooleanConstant(true)))