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
|
@@ -72,7 +72,6 @@ type Arc = ArcInput | ArcOutput | ArcInhibitor | ArcRead | ArcReset;
|
|
|
72
72
|
interface ArcInput<T = any> {
|
|
73
73
|
readonly type: 'input';
|
|
74
74
|
readonly place: Place<T>;
|
|
75
|
-
readonly guard?: (value: T) => boolean;
|
|
76
75
|
}
|
|
77
76
|
interface ArcOutput<T = any> {
|
|
78
77
|
readonly type: 'output';
|
|
@@ -91,7 +90,7 @@ interface ArcReset<T = any> {
|
|
|
91
90
|
readonly place: Place<T>;
|
|
92
91
|
}
|
|
93
92
|
/** Input arc: consumes token from place when transition fires. */
|
|
94
|
-
declare function inputArc<T>(place: Place<T
|
|
93
|
+
declare function inputArc<T>(place: Place<T>): ArcInput<T>;
|
|
95
94
|
/** Output arc: produces token to place when transition fires. */
|
|
96
95
|
declare function outputArc<T>(place: Place<T>): ArcOutput<T>;
|
|
97
96
|
/** Inhibitor arc: blocks transition if place has tokens. */
|
|
@@ -102,15 +101,14 @@ declare function readArc<T>(place: Place<T>): ArcRead<T>;
|
|
|
102
101
|
declare function resetArc<T>(place: Place<T>): ArcReset<T>;
|
|
103
102
|
/** Returns the place this arc connects to. */
|
|
104
103
|
declare function arcPlace(arc: Arc): Place<any>;
|
|
105
|
-
/** Checks if an input arc has a guard predicate. */
|
|
106
|
-
declare function hasGuard(arc: ArcInput): boolean;
|
|
107
|
-
/** Checks if a token value matches an input arc's guard. */
|
|
108
|
-
declare function matchesGuard<T>(arc: ArcInput<T>, value: T): boolean;
|
|
109
104
|
|
|
110
105
|
/**
|
|
111
|
-
* Input specification with cardinality
|
|
112
|
-
*
|
|
113
|
-
*
|
|
106
|
+
* Input specification with cardinality. Purely structural (IO-006): cardinality
|
|
107
|
+
* determines how many tokens to consume; there is no per-token predicate.
|
|
108
|
+
*
|
|
109
|
+
* Conditional token selection is modeled with multiple conflicting transitions
|
|
110
|
+
* and XOR-on-input semantics rather than a predicate coupled to the enablement
|
|
111
|
+
* check.
|
|
114
112
|
*
|
|
115
113
|
* Inputs are always AND-joined (all must be satisfied to enable transition).
|
|
116
114
|
* XOR on inputs is modeled via multiple transitions (conflict).
|
|
@@ -119,33 +117,29 @@ type In = InOne | InExactly | InAll | InAtLeast;
|
|
|
119
117
|
interface InOne<T = any> {
|
|
120
118
|
readonly type: 'one';
|
|
121
119
|
readonly place: Place<T>;
|
|
122
|
-
readonly guard?: (value: T) => boolean;
|
|
123
120
|
}
|
|
124
121
|
interface InExactly<T = any> {
|
|
125
122
|
readonly type: 'exactly';
|
|
126
123
|
readonly place: Place<T>;
|
|
127
124
|
readonly count: number;
|
|
128
|
-
readonly guard?: (value: T) => boolean;
|
|
129
125
|
}
|
|
130
126
|
interface InAll<T = any> {
|
|
131
127
|
readonly type: 'all';
|
|
132
128
|
readonly place: Place<T>;
|
|
133
|
-
readonly guard?: (value: T) => boolean;
|
|
134
129
|
}
|
|
135
130
|
interface InAtLeast<T = any> {
|
|
136
131
|
readonly type: 'at-least';
|
|
137
132
|
readonly place: Place<T>;
|
|
138
133
|
readonly minimum: number;
|
|
139
|
-
readonly guard?: (value: T) => boolean;
|
|
140
134
|
}
|
|
141
|
-
/** Consume exactly 1 token (standard CPN semantics).
|
|
142
|
-
declare function one<T>(place: Place<T
|
|
143
|
-
/** Consume exactly N tokens (batching).
|
|
144
|
-
declare function exactly<T>(count: number, place: Place<T
|
|
145
|
-
/** Consume all available tokens (must be 1+).
|
|
146
|
-
declare function all<T>(place: Place<T
|
|
147
|
-
/** Wait for N+ tokens, consume all when enabled.
|
|
148
|
-
declare function atLeast<T>(minimum: number, place: Place<T
|
|
135
|
+
/** Consume exactly 1 token (standard CPN semantics). */
|
|
136
|
+
declare function one<T>(place: Place<T>): InOne<T>;
|
|
137
|
+
/** Consume exactly N tokens (batching). */
|
|
138
|
+
declare function exactly<T>(count: number, place: Place<T>): InExactly<T>;
|
|
139
|
+
/** Consume all available tokens (must be 1+). */
|
|
140
|
+
declare function all<T>(place: Place<T>): InAll<T>;
|
|
141
|
+
/** Wait for N+ tokens, consume all when enabled. */
|
|
142
|
+
declare function atLeast<T>(minimum: number, place: Place<T>): InAtLeast<T>;
|
|
149
143
|
/** Returns the minimum number of tokens required to enable. */
|
|
150
144
|
declare function requiredCount(spec: In): number;
|
|
151
145
|
/**
|
|
@@ -191,11 +185,11 @@ declare function nameId(value: string): NameId;
|
|
|
191
185
|
* On firing, exactly those name-matched tokens are consumed (spec NU-020).
|
|
192
186
|
*
|
|
193
187
|
* This is the single *decidable* predicate — equality of opaque names — and is
|
|
194
|
-
* deliberately NOT a general
|
|
195
|
-
* places (composition-structural, like cardinality) rather than
|
|
196
|
-
* arbitrary boolean per token.
|
|
197
|
-
*
|
|
198
|
-
*
|
|
188
|
+
* deliberately NOT a general input predicate: it correlates the name dimension
|
|
189
|
+
* *across* places (composition-structural, like cardinality) rather than
|
|
190
|
+
* evaluating an arbitrary boolean per token. Input specifications themselves
|
|
191
|
+
* remain purely structural (IO-006); name correlation is the only per-token
|
|
192
|
+
* filter the enablement check ever applies (NU-021).
|
|
199
193
|
*/
|
|
200
194
|
|
|
201
195
|
/**
|
|
@@ -228,7 +222,7 @@ declare function matchKey<T>(place: Place<T>, key: KeyFn<T>): MatchKey<T>;
|
|
|
228
222
|
* ))
|
|
229
223
|
*
|
|
230
224
|
* @throws if fewer than two inputs are correlated (a match over a single place
|
|
231
|
-
*
|
|
225
|
+
* correlates nothing).
|
|
232
226
|
*/
|
|
233
227
|
declare function matchSpec(...keys: MatchKey[]): MatchSpec;
|
|
234
228
|
/** Returns the name projection for `placeName`, or `undefined` if not correlated. */
|
|
@@ -1746,7 +1740,8 @@ declare class PetriNetBuilder {
|
|
|
1746
1740
|
* Map<string, Place<unknown>> convention — TypeScript Place identity is
|
|
1747
1741
|
* name-based per `runtime/compiled-net.ts`).
|
|
1748
1742
|
* 3. Walk every transition through {@link applyFusion} to rewrite arc place
|
|
1749
|
-
* references
|
|
1743
|
+
* references; input arcs colliding on a canonical place merge per
|
|
1744
|
+
* [MOD-021] (additive where summable, rejected otherwise).
|
|
1750
1745
|
* 4. Re-derive the place set from the rewritten transitions plus any
|
|
1751
1746
|
* caller-declared standalone places, dropping non-canonical members.
|
|
1752
1747
|
* Caller-declared standalone places that happen to be non-canonical
|
|
@@ -1782,4 +1777,4 @@ declare class PetriNetBuilder {
|
|
|
1782
1777
|
private buildWithFusion;
|
|
1783
1778
|
}
|
|
1784
1779
|
|
|
1785
|
-
export { type VerificationHarness as $, type Arc as A, type Port as B, type Channel as C, type PortDirection as D, type EnvironmentPlace as E, FusionSet as F, SubnetDefBuilder as G, type SubnetInstance as H, type In as I, type Timing as J, type KeyFn as K, type LogFn as L, MAX_DURATION_MS as M, type NameId as N, type Out as O, PetriNet as P, type TimingDeadline as Q, type TimingDelayed as R, SubnetDef as S, type Token as T, type TimingExact as U, type TimingImmediate as V, type TimingWindow as W, TokenInput as X, TokenOutput as Y, type TransitionAction as Z, TransitionBuilder as _, type Place as a, type
|
|
1780
|
+
export { type VerificationHarness as $, type Arc as A, type Port as B, type Channel as C, type PortDirection as D, type EnvironmentPlace as E, FusionSet as F, SubnetDefBuilder as G, type SubnetInstance as H, type In as I, type Timing as J, type KeyFn as K, type LogFn as L, MAX_DURATION_MS as M, type NameId as N, type Out as O, PetriNet as P, type TimingDeadline as Q, type TimingDelayed as R, SubnetDef as S, type Token as T, type TimingExact as U, type TimingImmediate as V, type TimingWindow as W, TokenInput as X, TokenOutput as Y, type TransitionAction as Z, TransitionBuilder as _, type Place as a, type Unknown as a$, type VerificationResult as a0, all as a1, allPlaces as a2, and as a3, andPlaces as a4, arcPlace as a5, atLeast as a6, consumptionCount as a7, deadline as a8, delayed as a9, requiredCount as aA, resetArc as aB, timeout as aC, timeoutPlace as aD, tokenAt as aE, tokenOf as aF, transform as aG, transformAsync as aH, transformFrom as aI, unitToken as aJ, window as aK, withTimeout as aL, xor as aM, xorPlaces as aN, MarkingState as aO, type PInvariant as aP, MarkingStateBuilder as aQ, type SmtProperty as aR, type SmtVerificationResult as aS, type BranchPlaceBound as aT, type DeadlockFree as aU, type JoinedOrDeadLettered as aV, type MutualExclusion as aW, type PlaceBound as aX, type Proven as aY, type SmtStatistics as aZ, type TokenSupplier as a_, earliest as aa, enumerateBranches as ab, environmentPlace as ac, exact as ad, exactly as ae, fork as af, forwardInput as ag, hasDeadline as ah, immediate as ai, inhibitorArc as aj, inputArc as ak, isPassthrough as al, isUnit as am, keyForPlace as an, latest as ao, matchCorrelates as ap, matchKey as aq, matchSpec as ar, nameId as as, one as at, outPlace as au, outputArc as av, passthrough as aw, place as ax, produce as ay, readArc as az, Transition as b, type Unreachable as b0, type Verdict as b1, type Violated as b2, branchPlaceBound as b3, deadlockFree as b4, isProven as b5, isViolated as b6, joinedOrDeadLettered as b7, mutualExclusion as b8, pInvariant as b9, pInvariantToString as ba, placeBound as bb, propertyDescription as bc, unreachable as bd, TransitionContext as c, type ArcInhibitor as d, type ArcInput as e, type ArcOutput as f, type ArcRead as g, type ArcReset as h, ComposeBindings as i, FusionSetBuilder as j, type InAll as k, type InAtLeast as l, type InExactly as m, type InOne as n, Instance as o, Interface as p, InterfaceBuilder as q, type MatchKey as r, type MatchSpec as s, type OutAnd as t, type OutForwardInput as u, type OutPlace as v, type OutTimeout as w, type OutXor as x, type OutputEntry as y, PetriNetBuilder as z };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { b as Transition, a as Place, P as PetriNet, E as EnvironmentPlace,
|
|
2
|
-
export {
|
|
1
|
+
import { b as Transition, a as Place, P as PetriNet, E as EnvironmentPlace, aO as MarkingState, aP as PInvariant, aQ as MarkingStateBuilder, aR as SmtProperty, aS as SmtVerificationResult } from '../petri-net-UQBBkvLl.js';
|
|
2
|
+
export { aT as BranchPlaceBound, aU as DeadlockFree, aV as JoinedOrDeadLettered, aW as MutualExclusion, aX as PlaceBound, aY as Proven, aZ as SmtStatistics, a_ as TokenSupplier, a$ as Unknown, b0 as Unreachable, b1 as Verdict, $ as VerificationHarness, a0 as VerificationResult, b2 as Violated, b3 as branchPlaceBound, b4 as deadlockFree, b5 as isProven, b6 as isViolated, b7 as joinedOrDeadLettered, b8 as mutualExclusion, b9 as pInvariant, ba as pInvariantToString, bb as placeBound, bc as propertyDescription, bd as unreachable } from '../petri-net-UQBBkvLl.js';
|
|
3
3
|
import { Expr, init, Bool, FuncDecl } from 'z3-solver';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -341,9 +341,10 @@ type PrioritySemantics = 'none' | 'conflict';
|
|
|
341
341
|
* - Operates on the marking projection (integer vectors) — no timing
|
|
342
342
|
* - An untimed deadlock-freedom proof is stronger than needed
|
|
343
343
|
* (timing can only restrict behavior)
|
|
344
|
-
* -
|
|
345
|
-
*
|
|
346
|
-
*
|
|
344
|
+
* - Input specifications are purely structural (IO-006) — there is no per-arc
|
|
345
|
+
* predicate for the encoder to be blind to
|
|
346
|
+
* - If a counterexample is found, it may be spurious in timed semantics —
|
|
347
|
+
* the report notes this
|
|
347
348
|
*
|
|
348
349
|
* Verification Pipeline:
|
|
349
350
|
* 1. Flatten — expand XOR, index places, build pre/post vectors
|