libpetri 2.13.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +47 -136
- package/dist/{chunk-7VJ5CYUU.js → chunk-5W6SVYPD.js} +67 -19
- package/dist/chunk-5W6SVYPD.js.map +1 -0
- package/dist/{chunk-JVI5HFRX.js → chunk-VCDOKWVU.js} +2 -2
- package/dist/{chunk-E3ZWB645.js → chunk-YVIPJ6KM.js} +1 -1
- package/dist/chunk-YVIPJ6KM.js.map +1 -0
- package/dist/debug/index.d.ts +2 -2
- package/dist/debug/index.js +2 -2
- package/dist/doclet/index.d.ts +1 -1
- package/dist/doclet/index.js +3 -3
- package/dist/dot-exporter-3STXYK74.js +9 -0
- package/dist/{event-store-DKTenPbC.d.ts → event-store-Df_sAVQ_.d.ts} +1 -1
- package/dist/export/index.d.ts +1 -1
- package/dist/export/index.js +2 -2
- package/dist/index.d.ts +91 -38
- package/dist/index.js +368 -294
- package/dist/index.js.map +1 -1
- package/dist/{petri-net-C3LSY-vm.d.ts → petri-net-UQBBkvLl.d.ts} +24 -29
- package/dist/verification/index.d.ts +6 -5
- package/dist/verification/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-7VJ5CYUU.js.map +0 -1
- package/dist/chunk-E3ZWB645.js.map +0 -1
- package/dist/dot-exporter-SHBYMMJ3.js +0 -9
- /package/dist/{chunk-JVI5HFRX.js.map → chunk-VCDOKWVU.js.map} +0 -0
- /package/dist/{dot-exporter-SHBYMMJ3.js.map → dot-exporter-3STXYK74.js.map} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/core/match-spec.ts"],"sourcesContent":["/**\n * ν-net join correlation ([[MatchSpec]]).\n *\n * A {@link MatchSpec} declares that a subset of a transition's **input** places\n * must be correlated by **name equality**: the transition is enabled only when\n * there exists a single {@link NameId} `n` such that every correlated input\n * supplies (at least) its required token count whose projected name equals `n`.\n * On firing, exactly those name-matched tokens are consumed (spec NU-020).\n *\n * This is the single *decidable* predicate — equality of opaque names — and is\n * deliberately NOT a general guard: it correlates the name dimension *across*\n * places (composition-structural, like cardinality) rather than evaluating an\n * arbitrary boolean per token. When both a unary input `guard` and a match are\n * present the guard filters first, then the name correlation runs over the\n * survivors (NU-021).\n */\nimport type { Place } from './place.js';\nimport type { NameId } from './name.js';\n\n/**\n * A name projection: maps a token's value to its {@link NameId}. A projection\n * that yields no name (returns `null`/`undefined` at runtime) is treated as\n * \"no name\" — that token never correlates — mirroring the Java/Rust `KeyFn`\n * contract; the binding selector handles a nullish result defensively.\n */\nexport type KeyFn<T = any> = (value: T) => NameId;\n\n/** One correlated input: the place plus its name projection. */\nexport interface MatchKey<T = any> {\n readonly place: Place<T>;\n readonly key: KeyFn<T>;\n}\n\n/** Correlated fork/join match specification (ν-net join side). */\nexport interface MatchSpec {\n readonly keys: readonly MatchKey[];\n}\n\n/** Builds one correlated input for a {@link MatchSpec}. */\nexport function matchKey<T>(place: Place<T>, key: KeyFn<T>): MatchKey<T> {\n return { place, key };\n}\n\n/**\n * Builds a {@link MatchSpec} from two or more correlated inputs.\n *\n * @example\n * Transition.builder('join')\n * .inputs(one(branchA), one(branchB))\n * .match(matchSpec(\n * matchKey(branchA, (m: Msg) => nameId(m.correlationId)),\n * matchKey(branchB, (m: Msg) => nameId(m.correlationId)),\n * ))\n *\n * @throws if fewer than two inputs are correlated (a match over a single place\n * is just a guard).\n */\nexport function matchSpec(...keys: MatchKey[]): MatchSpec {\n if (keys.length < 2) {\n throw new Error(`MatchSpec must correlate at least 2 input places, got ${keys.length}`);\n }\n return { keys };\n}\n\n/** Returns the name projection for `placeName`, or `undefined` if not correlated. */\nexport function keyForPlace(spec: MatchSpec, placeName: string): KeyFn | undefined {\n for (const k of spec.keys) {\n if (k.place.name === placeName) return k.key;\n }\n return undefined;\n}\n\n/** True when `placeName` is one of the correlated inputs. */\nexport function matchCorrelates(spec: MatchSpec, placeName: string): boolean {\n return spec.keys.some(k => k.place.name === placeName);\n}\n"],"mappings":";AAuCO,SAAS,SAAY,OAAiB,KAA4B;AACvE,SAAO,EAAE,OAAO,IAAI;AACtB;AAgBO,SAAS,aAAa,MAA6B;AACxD,MAAI,KAAK,SAAS,GAAG;AACnB,UAAM,IAAI,MAAM,yDAAyD,KAAK,MAAM,EAAE;AAAA,EACxF;AACA,SAAO,EAAE,KAAK;AAChB;AAGO,SAAS,YAAY,MAAiB,WAAsC;AACjF,aAAW,KAAK,KAAK,MAAM;AACzB,QAAI,EAAE,MAAM,SAAS,UAAW,QAAO,EAAE;AAAA,EAC3C;AACA,SAAO;AACT;AAGO,SAAS,gBAAgB,MAAiB,WAA4B;AAC3E,SAAO,KAAK,KAAK,KAAK,OAAK,EAAE,MAAM,SAAS,SAAS;AACvD;","names":[]}
|
|
File without changes
|
|
File without changes
|