POWL 2.0 Choice Graph — Exact Mathematical Realization:
- Definition 1 [BPM25, p. 7]
- Definition 2 & 3 [BPM25, p. 8]
- Definition 3.6, 3.7 & 3.9 [PETRI25, pp. 8–10]
Mathematical Formalism
Let $X$ be a finite set of POWL sub-models (or transitions $T$). A choice graph over $X$ is a tuple: $$ G = (N, E) $$ where:
- $N = X \cup \{▷, □\}$ with $▷, □ \notin X$ (artificial start $▷$ and end $□$ delimiters).
- $E \subseteq N \times N$ is a directed binary relation over $N$.
- $\{▷\} = \{x \in N \mid (N \times \{x\}) \cap E = \emptyset\}$ (unique start node).
- $\{□\} = \{x \in N \mid (\{x\} \times N) \cap E = \emptyset\}$ (unique end node).
- $\forall n \in N, \exists$ a directed path in $E$ from $▷$ to $n$ and from $n$ to $□$.
Language Semantics (Definition 3 [BPM25, p. 8], Definition 3.9 [PETRI25, p. 10])
Let $\vec{G}$ denote the set of all directed paths from $▷$ to $□$ in $G$: $$ \vec{G} = \{\langle x_1, \dots, x_k \rangle \in X^* \mid (▷, x_1), (x_1, x_2), \dots, (x_k, □) \in E\} $$
The language of the choice graph is the union of path concatenations: $$ L(G) = \bigcup_{\langle x_1, \dots, x_k \rangle \in \vec{G}} L(x_1) \cdot L(x_2) \cdots L(x_k) $$
Summary
Functions
Enumerates all paths $\vec{G} = \{\langle x_1, \dots, x_k \rangle \in X^* \mid (▷, x_1), \dots, (x_k, □) \in E\}$.
For cyclic choice graphs, bounds depth by max_depth (default 20) and unrolls by max_unroll (default 2).
Constructs a validated Choice Graph $G = (N, E)$.
Accepts either "▷" / "□" or :start / :end as delimiter identifiers.
Types
Functions
Enumerates all paths $\vec{G} = \{\langle x_1, \dots, x_k \rangle \in X^* \mid (▷, x_1), \dots, (x_k, □) \in E\}$.
For cyclic choice graphs, bounds depth by max_depth (default 20) and unrolls by max_unroll (default 2).
Constructs a validated Choice Graph $G = (N, E)$.
Accepts either "▷" / "□" or :start / :end as delimiter identifiers.
Doctests
iex> a = Ex4pmEngine.POWL.activity("a", "Triage")
iex> b = Ex4pmEngine.POWL.activity("b", "Approve")
iex> {:ok, cg} = Ex4pmEngine.POWL.ChoiceGraph.new([a, b], [{"▷", "a"}, {"a", "b"}, {"b", "□"}])
iex> cg.cyclic?
false
iex> Ex4pmEngine.POWL.ChoiceGraph.enumerate_paths(cg)
[["a", "b"]]