libpetri 2.12.1 → 2.13.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.
@@ -577,15 +577,19 @@ declare class TransitionContext {
577
577
  type TransitionAction = (ctx: TransitionContext) => Promise<void>;
578
578
  /**
579
579
  * Identity action: produces no outputs.
580
+ * For transitions that only consume tokens without producing any.
580
581
  *
581
- * Returns a stable singleton reference (cached on first call). Reference
582
- * stability is relied on by {@link import('./internal/subnet-rewriter.js')
583
- * .composeActions} during channel composition (MOD-021) to short-circuit a
584
- * passthrough-on-both-sides merge to passthrough — saving a microtask hop
585
- * and matching the Java implementation's behaviour where both transitions'
586
- * default actions collapse to the builder's own passthrough default.
582
+ * Returns a stable singleton reference (CORE-051), so {@link isPassthrough}
583
+ * can recognise it.
587
584
  */
588
585
  declare function passthrough(): TransitionAction;
586
+ /**
587
+ * Whether `action` is the built-in {@link passthrough} — i.e. provably produces
588
+ * no output tokens. Identity-based, so a hand-written no-op is not claimed.
589
+ *
590
+ * @param action the action to test; `null` / `undefined` is not passthrough
591
+ */
592
+ declare function isPassthrough(action: TransitionAction | null | undefined): boolean;
589
593
  /**
590
594
  * Transform action: applies function to context, copies result to ALL output places.
591
595
  *
@@ -1539,8 +1543,12 @@ declare class PetriNet {
1539
1543
  bindActions(actionBindings: Map<string, TransitionAction> | Record<string, TransitionAction>): PetriNet;
1540
1544
  /**
1541
1545
  * Creates a new PetriNet with actions bound via a resolver function.
1546
+ *
1547
+ * The resolver is called once per transition with its name. Returning `null`
1548
+ * defers that transition — it keeps whatever action it already carries — which
1549
+ * is what makes staged binding (**MOD-024** AC7) work.
1542
1550
  */
1543
- bindActionsWithResolver(actionResolver: (name: string) => TransitionAction): PetriNet;
1551
+ bindActionsWithResolver(actionResolver: (name: string) => TransitionAction | null): PetriNet;
1544
1552
  static builder(name: string): PetriNetBuilder;
1545
1553
  }
1546
1554
  declare class PetriNetBuilder {
@@ -1774,4 +1782,4 @@ declare class PetriNetBuilder {
1774
1782
  private buildWithFusion;
1775
1783
  }
1776
1784
 
1777
- 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 TokenSupplier 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, readArc as aA, requiredCount as aB, resetArc as aC, timeout as aD, timeoutPlace as aE, tokenAt as aF, tokenOf as aG, transform as aH, transformAsync as aI, transformFrom as aJ, unitToken as aK, window as aL, withTimeout as aM, xor as aN, xorPlaces as aO, MarkingState as aP, type PInvariant as aQ, MarkingStateBuilder as aR, type SmtProperty as aS, type SmtVerificationResult as aT, type BranchPlaceBound as aU, type DeadlockFree as aV, type JoinedOrDeadLettered as aW, type MutualExclusion as aX, type PlaceBound as aY, type Proven as aZ, type SmtStatistics 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, hasGuard as ai, immediate as aj, inhibitorArc as ak, inputArc as al, isUnit as am, keyForPlace as an, latest as ao, matchCorrelates as ap, matchKey as aq, matchSpec as ar, matchesGuard as as, nameId as at, one as au, outPlace as av, outputArc as aw, passthrough as ax, place as ay, produce as az, Transition as b, type Unknown as b0, type Unreachable as b1, type Verdict as b2, type Violated as b3, branchPlaceBound as b4, deadlockFree as b5, isProven as b6, isViolated as b7, joinedOrDeadLettered as b8, mutualExclusion as b9, pInvariant as ba, pInvariantToString as bb, placeBound as bc, propertyDescription as bd, unreachable as be, 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 };
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 SmtStatistics 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, produce as aA, readArc as aB, requiredCount as aC, resetArc as aD, timeout as aE, timeoutPlace as aF, tokenAt as aG, tokenOf as aH, transform as aI, transformAsync as aJ, transformFrom as aK, unitToken as aL, window as aM, withTimeout as aN, xor as aO, xorPlaces as aP, MarkingState as aQ, type PInvariant as aR, MarkingStateBuilder as aS, type SmtProperty as aT, type SmtVerificationResult as aU, type BranchPlaceBound as aV, type DeadlockFree as aW, type JoinedOrDeadLettered as aX, type MutualExclusion as aY, type PlaceBound as aZ, type Proven 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, hasGuard as ai, immediate as aj, inhibitorArc as ak, inputArc as al, isPassthrough as am, isUnit as an, keyForPlace as ao, latest as ap, matchCorrelates as aq, matchKey as ar, matchSpec as as, matchesGuard as at, nameId as au, one as av, outPlace as aw, outputArc as ax, passthrough as ay, place as az, Transition as b, type TokenSupplier as b0, type Unknown as b1, type Unreachable as b2, type Verdict as b3, type Violated as b4, branchPlaceBound as b5, deadlockFree as b6, isProven as b7, isViolated as b8, joinedOrDeadLettered as b9, mutualExclusion as ba, pInvariant as bb, pInvariantToString as bc, placeBound as bd, propertyDescription as be, unreachable as bf, 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, aP as MarkingState, aQ as PInvariant, aR as MarkingStateBuilder, aS as SmtProperty, aT as SmtVerificationResult } from '../petri-net-Byc3gSgJ.js';
2
- export { aU as BranchPlaceBound, aV as DeadlockFree, aW as JoinedOrDeadLettered, aX as MutualExclusion, aY as PlaceBound, aZ as Proven, a_ as SmtStatistics, a$ as TokenSupplier, b0 as Unknown, b1 as Unreachable, b2 as Verdict, $ as VerificationHarness, a0 as VerificationResult, b3 as Violated, b4 as branchPlaceBound, b5 as deadlockFree, b6 as isProven, b7 as isViolated, b8 as joinedOrDeadLettered, b9 as mutualExclusion, ba as pInvariant, bb as pInvariantToString, bc as placeBound, bd as propertyDescription, be as unreachable } from '../petri-net-Byc3gSgJ.js';
1
+ import { b as Transition, a as Place, P as PetriNet, E as EnvironmentPlace, aQ as MarkingState, aR as PInvariant, aS as MarkingStateBuilder, aT as SmtProperty, aU as SmtVerificationResult } from '../petri-net-C3LSY-vm.js';
2
+ export { aV as BranchPlaceBound, aW as DeadlockFree, aX as JoinedOrDeadLettered, aY as MutualExclusion, aZ as PlaceBound, a_ as Proven, a$ as SmtStatistics, b0 as TokenSupplier, b1 as Unknown, b2 as Unreachable, b3 as Verdict, $ as VerificationHarness, a0 as VerificationResult, b4 as Violated, b5 as branchPlaceBound, b6 as deadlockFree, b7 as isProven, b8 as isViolated, b9 as joinedOrDeadLettered, ba as mutualExclusion, bb as pInvariant, bc as pInvariantToString, bd as placeBound, be as propertyDescription, bf as unreachable } from '../petri-net-C3LSY-vm.js';
3
3
  import { Expr, init, Bool, FuncDecl } from 'z3-solver';
4
4
 
5
5
  /**
@@ -426,6 +426,8 @@ declare class SmtVerifier {
426
426
  prioritySemantics(semantics: PrioritySemantics): this;
427
427
  /**
428
428
  * Runs the verification pipeline.
429
+ *
430
+ * @throws Error if the net violates CORE-043 — verification rejects the same nets execution rejects.
429
431
  */
430
432
  verify(): Promise<SmtVerificationResult>;
431
433
  /**
@@ -646,7 +648,11 @@ declare class StateClassGraph {
646
648
  private readonly _predecessors;
647
649
  private readonly _complete;
648
650
  private constructor();
649
- /** Builds the state class graph for a Time Petri Net. */
651
+ /**
652
+ * Builds the state class graph for a Time Petri Net.
653
+ *
654
+ * @throws Error if the net violates CORE-043 — analysis rejects the same nets execution rejects.
655
+ */
650
656
  static build(net: PetriNet, initialMarking: MarkingState, maxClasses: number, environmentPlaces?: Set<EnvironmentPlace<any>>, environmentMode?: EnvironmentAnalysisMode): StateClassGraph;
651
657
  stateClasses(): readonly StateClass[];
652
658
  size(): number;
@@ -35,7 +35,7 @@ import {
35
35
  propertyDescription,
36
36
  structuralCheck,
37
37
  unreachable
38
- } from "../chunk-V3WTQRHC.js";
38
+ } from "../chunk-7VJ5CYUU.js";
39
39
  import "../chunk-ATT7U5H5.js";
40
40
 
41
41
  // src/verification/analysis/scc-analyzer.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "libpetri",
3
- "version": "2.12.1",
3
+ "version": "2.13.0",
4
4
  "description": "Coloured Time Petri Net engine — TypeScript port",
5
5
  "homepage": "https://libpetri.org",
6
6
  "repository": {