Pm4ExUnit.Conformance (pm4exunit v26.11.12)

Copy Markdown

Formal Token-Based Replay and FSM Conformance Engine for Elixir / ExUnit. Validates traces against allowed finite state machine transitions and execution paths. Calculates token replay fitness: fitness = 0.5 (1 - missing / consumed) + 0.5 (1 - remaining / produced)

Replay semantics are a faithful port of pm4vitest's standard TBR engine (servengine-frontend/packages/pm4vitest/src/conformance.ts): each valid path becomes a parallel branch in a block-structured Petri net (shared source place, per-activity transitions, shared sink place); a trace is replayed with bounded backtracking choosing the firing sequence minimizing (missing, remaining) lexicographically.

Summary

Functions

Evaluates a sequence of events/activities against a set of valid paths or allowed transitions.

Types

conformance_result()

@type conformance_result() :: %{
  success: boolean(),
  fitness: float(),
  violations: [String.t()],
  diagnostics: map()
}

Functions

evaluate(events, valid_paths, opts \\ [])

Evaluates a sequence of events/activities against a set of valid paths or allowed transitions.