Markings in their two representations.
- A token marking,
%{place_id => [token]}, is what the executor runs on. Tokens are arbitrary terms. - A skeleton marking,
%{place_id => non_neg_integer}, is what analysis runs on: tokens are only counted.
In both, a place absent from the map holds no tokens. Conversion between the two is always explicit.
Summary
Functions
Builds a token marking from counts, using :token for every token.
Counts the tokens of a token marking.
Types
@type skeleton() :: %{required(Petrex.Place.id()) => non_neg_integer()}
@type t() :: %{required(Petrex.Place.id()) => [term()]}
Functions
Builds a token marking from counts, using :token for every token.
iex> Petrex.Marking.from_skeleton(%{a: 2, b: 0})
%{a: [:token, :token], b: []}
Counts the tokens of a token marking.
iex> Petrex.Marking.to_skeleton(%{a: [:token, :token], b: []})
%{a: 2, b: 0}