LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
spn_properties.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2012-2026, QORE Lab, Imperial College London
3 * All rights reserved.
4 */
5#ifndef LINE_API_SPN_SPN_PROPERTIES_H
6#define LINE_API_SPN_SPN_PROPERTIES_H
7
8/**
9 * @file
10 * @ingroup api_spn
11 * Aggregate Petri-net property analysis: P- and T-invariants, minimal
12 * siphons and traps with Commoner's condition, the LP structural checks and
13 * net classes, and the reachability-graph verdicts, all at one initial
14 * marking. Two structural verdicts are derived when the net is monotone
15 * (`ignored` empty; inhibitor arcs, priorities and mixed timed/immediate
16 * events void the structural theorems):
17 * structdeadlockfree = 1 when the net is ordinary and Commoner holds
18 * (a deadlock empties a siphon; Murata 1989, Thm. 26-27), else -1;
19 * structlive = 1 for an asymmetric-choice net with Commoner, 0 for an
20 * extended free-choice net without it (Commoner/Hack), else -1.
21 * MATLAB twin: matlab/src/api/spn/spn_properties.m.
22 */
23
24#include <cstddef>
25#include <string>
26#include <vector>
27
34
35namespace line {
36namespace spn {
37
39 std::vector<long long> m0;
40 std::vector<std::string> ignored;
45 SpnStructProps structp; ///< MATLAB/Java/Python field "struct"
47 bool commoner = true;
49 int structlive = -1;
50};
51
52template <class T>
54 const std::vector<double>& init = std::vector<double>(),
55 std::size_t maxstates = 0) {
56 const detail::SpnNet net = detail::spn_build_net(sn, "spn_properties");
58 pr.m0 = detail::spn_initmarking(sn, net, init, "spn_properties");
59 const std::vector<double> m0d(pr.m0.begin(), pr.m0.end());
60 pr.ignored = net.ignored;
61 pr.sinv = spn_sinvariants(sn, m0d);
63 pr.siphons = spn_siphons(sn, m0d);
64 pr.traps = spn_traps(sn, m0d);
66 pr.reach = spn_reachprops(sn, m0d, maxstates);
68 if (net.ignored.empty()) {
69 if (pr.structp.ordinary && pr.commoner) pr.structdeadlockfree = 1;
70 if (pr.structp.asymmetric && pr.commoner) pr.structlive = 1;
71 else if (pr.structp.efc && !pr.commoner) pr.structlive = 0;
72 }
73 return pr;
74}
75
76} // namespace spn
77} // namespace line
78
79#endif // LINE_API_SPN_SPN_PROPERTIES_H
A network plus its refreshed NetworkStruct.
SpnReachProps spn_reachprops(const qn::NetworkStruct< T > &sn, const std::vector< double > &init=std::vector< double >(), std::size_t maxstates=0)
SpnTraps spn_traps(const qn::NetworkStruct< T > &sn, const std::vector< double > &init=std::vector< double >())
Definition spn_traps.h:36
SpnStructProps spn_structprops(const qn::NetworkStruct< T > &sn)
SpnInvariants spn_sinvariants(const qn::NetworkStruct< T > &sn, const std::vector< double > &init=std::vector< double >())
Minimal-support S-invariants and the load vector of a net.
SpnSiphons spn_siphons(const qn::NetworkStruct< T > &sn, const std::vector< double > &init=std::vector< double >())
Definition spn_siphons.h:46
SpnTInvariants spn_tinvariants(const qn::NetworkStruct< T > &sn)
SpnProperties spn_properties(const qn::NetworkStruct< T > &sn, const std::vector< double > &init=std::vector< double >(), std::size_t maxstates=0)
Conservation laws of a layered queueing network, enumerated from its structure.
Definition aoi_dist2ph.h:52
Behavioural properties of a stochastic Petri net from its reachability graph (Murata 1989,...
Minimal-support S-invariants (P-invariants) of a stochastic Petri net, and the load vector V = S m0.
All minimal siphons of a stochastic Petri net and Commoner's condition (Murata 1989,...
Structural properties of a stochastic Petri net, from its incidence matrix C alone (Murata 1989,...
Minimal-support T-invariants of a stochastic Petri net (Murata 1989, sec.
All minimal traps of a stochastic Petri net (Murata 1989, sec.
The invariant basis of a net, in PLACE-LEVEL coordinates: one level per (place, class) pair,...
std::vector< long long > m0
std::vector< std::string > ignored
SpnStructProps structp
MATLAB/Java/Python field "struct".
bool commoner
every minimal siphon holds a marked trap
Definition spn_siphons.h:41