<?xml version="1.0" encoding="UTF-8"?>
<TEI xml:space="preserve" xmlns="http://www.tei-c.org/ns/1.0" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://www.tei-c.org/ns/1.0 https://raw.githubusercontent.com/kermitt2/grobid/master/grobid-home/schemas/xsd/Grobid.xsd"
 xmlns:xlink="http://www.w3.org/1999/xlink">
	<teiHeader xml:lang="en">
		<fileDesc>
			<titleStmt>
				<title level="a" type="main">Some Petri Net Problems with Counterintuitive Solutions</title>
			</titleStmt>
			<publicationStmt>
				<publisher/>
				<availability status="unknown"><licence/></availability>
			</publicationStmt>
			<sourceDesc>
				<biblStruct>
					<analytic>
						<author>
							<persName><forename type="first">Piotr</forename><surname>Chrza ¸stowski-Wachtel</surname></persName>
							<affiliation key="aff0">
								<orgName type="department">Institute of Informatics</orgName>
								<orgName type="institution">University of Warsaw</orgName>
								<address>
									<addrLine>Banacha 2</addrLine>
									<postCode>PL-02-097</postCode>
									<settlement>Warszawa</settlement>
									<country key="PL">Poland</country>
								</address>
							</affiliation>
						</author>
						<author>
							<persName><forename type="first">Piotr</forename><surname>Ulanowski</surname></persName>
							<affiliation key="aff0">
								<orgName type="department">Institute of Informatics</orgName>
								<orgName type="institution">University of Warsaw</orgName>
								<address>
									<addrLine>Banacha 2</addrLine>
									<postCode>PL-02-097</postCode>
									<settlement>Warszawa</settlement>
									<country key="PL">Poland</country>
								</address>
							</affiliation>
						</author>
						<title level="a" type="main">Some Petri Net Problems with Counterintuitive Solutions</title>
					</analytic>
					<monogr>
						<idno type="ISSN">1613-0073</idno>
					</monogr>
					<idno type="MD5">29806CABCFF43BB2009425E950189DFB</idno>
				</biblStruct>
			</sourceDesc>
		</fileDesc>
		<encodingDesc>
			<appInfo>
				<application version="0.7.2" ident="GROBID" when="2025-04-23T18:58+0000">
					<desc>GROBID - A machine learning software for extracting information from scholarly documents</desc>
					<ref target="https://github.com/kermitt2/grobid"/>
				</application>
			</appInfo>
		</encodingDesc>
		<profileDesc>
			<abstract>
<div xmlns="http://www.tei-c.org/ns/1.0"><p>The first author has been giving a one-semester monograph lecture for decades at the Warsaw University. During the lectures he has offered solving Petri net puzzles, as one of the ways to pass the course. Some of them are pretty hard and counterintuitive. Despite the excellency of students at the Warsaw University, some of the puzzles were solved by only a few of them. This paper is a joint paper with one of the current students (the second author), who has solved the hardest puzzles in a convincing way.</p></div>
			</abstract>
		</profileDesc>
	</teiHeader>
	<text xml:lang="en">
		<body>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="1.">Introduction</head><p>Petri nets are a very elegant framework to expose the problems of concurrent systems. They allow to define problems in a comprehensible way and to focus on important issues like liveness or boundedness of a given state. Some of the problems concerning liveness and boundedness are counterintuitive. They offer deep didactic value to look for something that appears impossible at the first glance. Solving such problems gives the students much satisfaction. The questionnaires filled anonymously after each course give no doubt about it. But it also demonstrates good understanding of the subject, so such homework can replace the final exam, if the originality of the solution leaves no doubt about the authorship. We will demonstrate solutions for four problems:</p><p>1. Find a net and two markings: 𝑀 and 𝑀 ′ such that • 𝑀 is live • 𝑀 ′ ≥ 𝑀 • 𝑀 ′ is not live 2. Find a net and two markings: 𝑀 and 𝑀 ′ such that • 𝑀 is live and bounded • 𝑀 ′ ≥ 𝑀 • 𝑀 ′ is live and not bounded 3. Find a net and initial marking M such that • 𝑀 is live and bounded • the reachability graph of 𝑀 has two finals (two maximal strongly connected components).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4.">Find a net and initial marking M such that</head><p>• 𝑀 is live • there exist two places 𝑝 1 , 𝑝 2 , such that they are both unbounded, but not simultaneously.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.">Definitions</head><p>Petri nets are triples ⟨𝑃, 𝑇, 𝐹 ⟩, where 𝑃 and 𝑇 are finite, nonempty and disjoint sets of places and transitions respectively, while 𝐹 : 𝑃 × 𝑇 ∪ 𝑇 × 𝑃 → N is a function definining the structure of a Petri net graph. We assume that if 𝐹 (𝑥, 𝑦) = 0, then there is no edge in the graph between nodes 𝑥 and 𝑦. A positive value means that the edge connecting 𝑥 and 𝑦 exists and denotes the capacity of the edge, so the number of tokens that will be passing along this arc and the direction of token flow. If for all 𝑥, 𝑦 : 𝐹 (𝑥, 𝑦) ≤ 1, we call such a net simple.</p><p>A net is a P-system if the numbers of incoming and outgoing edges of any transition do not exceed one. A net is a T-system if the numbers of incoming and outgoing edges of any place do not exceed one.</p><p>Let's fix a net 𝒩 = ⟨𝑃, 𝑇, 𝐹 ⟩. A marking is a mapping from 𝑃 to N. A transition 𝑡 ∈ 𝑇 is enabled at marking 𝑀 , if for all 𝑝 ∈ 𝑃 : 𝑀 (𝑝) ≥ 𝐹 (𝑝, 𝑡). An enabled transition at a given marking 𝑀 can fire changing 𝑀 into 𝑀 ′ according to the rule: for all 𝑝 ∈ 𝑃 : 𝑀 ′ (𝑝) = 𝑀 (𝑝) − 𝐹 (𝑝, 𝑡) + 𝐹 (𝑡, 𝑝). Firing a transition 𝑡 at 𝑀 changing it to 𝑀 ′ is denoted by 𝑀 [𝑡⟩𝑀 ′ . The reachability set of 𝑀 is the smallest set of markings [𝑀 ] satisfying two conditions:</p><formula xml:id="formula_0">• 𝑀 ∈ [𝑀 ] • if 𝑀 ′ ∈ [𝑀 ] and ∃𝑡 ∈ 𝑇 and 𝑀 ′′ such that 𝑀 ′ [𝑡⟩𝑀 ′′ then 𝑀 ′′ ∈ [𝑀 ].</formula><p>The reachability graph 𝐺(𝑀 ) of a marking M is a graph ⟨𝑉, 𝐸⟩, where 𝑉 = [𝑀 ] and 𝐸 = {(𝑀 ′ , 𝑀 ′′ ) : ∃𝑡 ∈ 𝑇 : 𝑀 ′ [𝑡⟩𝑀 ′′ }; in this case we presume that the edge between 𝑀 ′ and 𝑀 ′′ is labeled by</p><formula xml:id="formula_1">𝑡. A subgraph (𝑉 ′ , 𝐸 ′ ) is called a final of (𝑉, 𝐸) iff 𝑉 ′ ⊆ 𝑉, 𝐸 ′ = 𝐸 ∩ (𝑉 ′ × 𝑉 ′</formula><p>) is a maximal strongly connected component, so any two nodes of 𝑉 ′ are connected by a path in 𝐺(𝑀 ). If the set [𝑀 ] is finite, then finals represent possible ultimate behaviors of a net after making possibly irreversible decisions, during resolving conflicts with transition firings.</p><p>A place 𝑝 at marking 𝑀 is bounded, if there exists 𝑘 ∈ N such that ∀𝑀 ′ ∈ [𝑀 ] : 𝑀 ′ (𝑝) ≤ 𝑘. Otherwise we call such a place unbounded at 𝑀 . A marking 𝑀 is bounded if all places are bounded at 𝑀 (or, equivalently, the set</p><formula xml:id="formula_2">[𝑀 ] is finite). Marking 𝑀 is live if ∀𝑡 ∈ 𝑇 : ∀𝑀 ′ ∈ [𝑀 ] : ∃𝑀 ′′ ∈ [𝑀 ′ ] : 𝑡 is enabled at 𝑀 ′′ . A marking 𝑀 is dead if no transition is enabled at 𝑀 .</formula><p>A net is well formed, if there exists a live and bounded marking in it. A net is structurally bounded if all markings are bounded. When a net is unbounded, we construct coverability graph following the idea of Karp and Miller <ref type="bibr" target="#b5">[KM69]</ref>. Whenever during the construction of the coverability graph a marking bigger than some previously considered node on a path from 𝑀 is created, we replace all the coordinates, which are greater, by a symbol 𝜔 to indicate the possibility of generating arbitrarily many tokens. Additionaly we introduce 𝜔 𝑜 indicating the possibility of generating any odd number of tokens, and 𝜔 𝑒 indicating the possibility of generating any even number of tokens.</p><p>For two markings 𝑀, 𝑀 ′ we say that 𝑀 ≤ 𝑀 ′ iff ∀𝑝 ∈ 𝑃 : 𝑀 (𝑝) ≤ 𝑀 ′ (𝑝). We call a property monotonic, if is is preserved under increasing a marking. Otherwise it is called non-monotonic.</p><p>We present now four problems with (subjectively) increasing difficulty. All of them seem at the first glance to have no solution, but solutions indeed exist.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.">Non-monotonicity of liveness</head><p>Find a net and two markings: 𝑀 and 𝑀 ′ such that</p><formula xml:id="formula_3">• 𝑀 is live • 𝑀 ′ ≥ 𝑀 • 𝑀 ′ is not live</formula><p>This is an old problem, proposed by the first author in the <ref type="bibr" target="#b0">[PNB13]</ref> long ago, solved by many, including <ref type="bibr" target="#b2">[WR85]</ref>. Here we present the most compact solution consisting of a net with just two transitions and one place. The marking of Figure <ref type="figure" target="#fig_0">1</ref> is live: invariantly the number of tokens on place 𝑝 is odd, so one can always increase the number of them by firing 𝑡 1 , but if we increase the number of tokens in the initial marking to 2, the marking is not live: we can fire 𝑡 2 making a marking dead.</p><p>This problem has some important moral: When something goes well, adding some extra goods can destroy wellness. Like it happens in real life, for instance with people who win a fortune on a lottery give up their good jobs, lose friends and end up in disaster. Or in economics, when too much money can trigger unnecessary investments, killing some well working parts of a system. </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4.">Non-monotonicity of boundedness for live nets</head><p>Find a net and two markings: 𝑀 and 𝑀 ′ such that</p><formula xml:id="formula_4">• 𝑀 is live and bounded • 𝑀 ′ ≥ 𝑀 • 𝑀 ′ is live and not bounded</formula><p>This problem is much harder. In fact the first author has been puzzled with this problem by Teruel <ref type="bibr" target="#b3">[ET92]</ref>, while working together on T-systems and P-systems in 1992. The hypothesis of Teruel was that well-formed P-systems are struturally bounded, which would exclude the example satisfying these requirements. Surprisingly, one of the solutions for this problem is a P-system, which makes the hypothesis false.</p><p>The first author proposes this problem to the students, as stated, without a requirement that the net should be a P-system. Maybe this makes the problem even harder. Anyway, the example presented here on Figure <ref type="figure">2</ref> with only two places and four transitions is easily verifiable, as can be seen on the coverability graphs. Notice that every transition can be rollbacked with an opposite transition. To be precise, after firing 𝑡 1 the net will restore its marking by firing 𝑡 4 , and after firing 𝑡 2 , the net will restore its marking by firing 𝑡 3 and vice versa. This means that every marking that can activate 𝑡 1 and 𝑡 2 or 𝑡 3 and 𝑡 4 is live. This is because, after applying transitions in some order from such marking, you can always return to the original marking by applying the corresponding opposite transitions in the reverse order. This way, the net will restore a marking, from which it was possible to activate all the transitions at some point. Notice that marking (0, 5) on Figure <ref type="figure">2</ref> can activate both 𝑡 3 and 𝑡 4 , so the net with unbounded marking is live. Mind that such an example cannot be found for free-choice nets (a consequence of the rank theorem) <ref type="bibr" target="#b1">[DE94]</ref>.</p><p>Let us present another net on Figure <ref type="figure">3</ref> and Figure <ref type="figure">4</ref>, which was discovered by the second author and will serve as a basis of the solution of the next problem.</p><formula xml:id="formula_5">𝑝 1 𝑝 2 𝑡 1 𝑡 2 𝑡 3 𝑡 4 2 3 3 4 4 3 3 2 (2, 1) (0, 4) 𝑡 1 (3, 0) 𝑡 3 𝑡 2 (1, 3) 𝑡 4 𝑡 4 𝑡 1</formula><p>Figure <ref type="figure">2</ref>: A bounded marking of a P-System net solving the "Non-monotonicity of boundedness for live nets" problem, coverability graphs for bounded and unbounded markings</p><formula xml:id="formula_6">𝑝 1 𝑝 2 𝑝 3 𝑝 4 𝑝 5 𝑝 6 𝑝 7 𝑡 1 𝑡 2 𝑡 3 𝑡 4 10|0|10|10 01|1|10|10 𝑡 1 01|0|01|01 𝑡 3 10|1|01|01 𝑡 2 𝑡 4</formula><p>Figure <ref type="figure">3</ref>: A bounded marking of a net solving the "Non-monotonicity of boundedness for live nets" problem, proposed by second author. </p><formula xml:id="formula_7">10|0|20|10 01|1|20|10 𝑡 1 01|0|11|01 𝑡 3 10|1|11|01 𝑡 2 01|𝜔 𝑒 |11|01 𝑡 1 10|𝜔 𝑜 |11|01 𝑡 2 10|𝜔 𝑒 |20|10 𝑡 4 01|𝜔 𝑜 |20|10 𝑡 1 𝑡 4 𝑡 1 𝑡 3 𝑡 3 𝑡 4 𝑡 *</formula></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5.">Two finals</head><p>Find a net and initial marking M such that</p><p>• 𝑀 is live and bounded • the coverability graph of 𝑀 has two finals.</p><p>To find a net, whose coverability graph has two finals is a very easy task. But adding the requirement of liveness can make the problem pretty hard.</p><p>Recently the first author communicated Devillers, who mentioned that the problem was first solved probably by Best and Voss in <ref type="bibr" target="#b4">[BV84]</ref>.</p><p>The solution presented here was proposed by the second author. Mind that the initial marking is live and bounded, and depending on the choice of the first transition to fire, we fall into two different finals, which of course do not share any single marking. The presented reachablility graph leaves no doubt that the problem is solved indeed: after the choice of the first transition to fire, the net falls into disjoint cycles.</p><p>To approach this problem, one can start with a net that is modeling the flow of two processes rivaling for an access to a critical section in a concurrent environment. One can add an additional restriction to ensure liveness and eliminate starvation by enforcing on the processes to enter the critical section in an interleaving sequence -one after the other. This scenario can be represented by the net in Figure <ref type="figure" target="#fig_2">5</ref> without the place 𝑎. Tokens in places 𝑖 1 , 𝑖 2 mean accordingly that the process is idle. Place 𝑚 is representing the binary semaphore. Tokens in 𝑐𝑠 1 and 𝑐𝑠 2 mean, that a specific process is in critical section. Token in 𝑒 means that one of the processes just released the semaphore and wants to become idle.</p><p>With such a net, we can just add an asymmetry to the net with place 𝑎, which solves the given problem. The solution can be seen on Figure <ref type="figure" target="#fig_2">5</ref>. </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="6.">Asynchronous unboundedness</head><p>Find a net and initial marking M such that • 𝑀 is live • there exist two places 𝑝 1 , 𝑝 2 , such that they are both unbounded, but not simultaneously. In other words: for every 𝑘 ∈ N there exists a marking 𝑀 1 ∈ [𝑀 ] with 𝑀 1 (𝑝 1 ) &gt; 𝑘, and there exists a marking 𝑀 2 ∈ [𝑀 ] with 𝑀 2 (𝑝 2 ) &gt; 𝑘, but there exists a constant 𝑚 such that for every</p><formula xml:id="formula_8">𝑀 ′ ∈ [𝑀 ] either 𝑀 ′ (𝑝 1 ) &lt; 𝑚 or 𝑀 ′ (𝑝 2 ) &lt; 𝑚</formula><p>The solution for this problem is presented on Figure <ref type="figure" target="#fig_3">6</ref>. The net is composed of one net that was used for solving the "Two Finals" problem and two nets that were created by the second author for the "Non-monotonicity of boundedness for live nets" problem. By choosing non-deterministicly the first transition 𝑡 1 or 𝑡 2 , the net will put two tokens either on 𝑎 1 or on 𝑎 2 accordingly, but it will be not possible to achieve two tokens on both these places simultaneaously. As we showed earlier the upper nets with their 𝑎 𝑖 being marked with two tokens are unbounded causing the place 𝑝 𝑖 to achieve any number of tokens. All the three nets are live and taking/adding tokens from places 𝑎 𝑖 by other nets won't affect their liveness in a long run. As a result we've received a live net with places 𝑝 1 and 𝑝 2 that fit the requirements of the problem.  </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="7.">Conclusions</head><p>All the presented solutions expose some interesting aspects of net behaviors. Having learned such examples enriches understanding of different non-intuitive properties and interrelations between them. Here the solution of the last example was merely a combination of two previous solutions. Usually students find the last problem being the most difficult.</p><p>It is also nice to see that some standard problems from the concurrency theory, like mutex, give an insight to non-trivial solutions of the presented Petri net problems.</p></div><figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_0"><head>Figure 1 :</head><label>1</label><figDesc>Figure 1: A live marking of a net solving the "Non-monotonicity of liveness" problem.</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_1"><head>4 𝑡 * 3 Figure 4 :</head><label>434</label><figDesc>Figure 4: Coverability graph for not bounded marking * -Transitions with asterisk will fire only when 𝜔 𝑜 = 1</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_2"><head>Figure 5 :</head><label>5</label><figDesc>Figure 5: A marking of a net solving the "Two finals" problem and coverability graph of this net. Values are encoded accordingly 𝑖 1 𝑖 2 |𝑚|𝑐𝑠 1 𝑐𝑠 2 |𝑒|𝑎</figDesc><graphic coords="5,126.31,419.23,198.42,147.75" type="bitmap" /></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_3"><head>Figure 6 :</head><label>6</label><figDesc>Figure 6: A marked net solving the "Asynchronous unboundedness" problem. Places 𝑝 1 and 𝑝 2 can gain any number of tokens, but not at the same time. The marking is live.</figDesc></figure>
		</body>
		<back>
			<div type="references">

				<listBibl>

<biblStruct xml:id="b0">
	<analytic>
		<title level="a" type="main">Puzzle No 3</title>
		<author>
			<persName><forename type="first">Piotr</forename><surname>Chrzastowski-Wachtel</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">Petri Nets and Related Models</title>
		<imprint>
			<biblScope unit="volume">13</biblScope>
			<biblScope unit="page">22</biblScope>
			<date type="published" when="1983">1983</date>
		</imprint>
	</monogr>
	<note>Newsletter No</note>
</biblStruct>

<biblStruct xml:id="b1">
	<monogr>
		<author>
			<persName><forename type="first">J</forename><surname>Desel</surname></persName>
		</author>
		<author>
			<persName><forename type="first">J</forename><surname>Esparza</surname></persName>
		</author>
		<title level="m">Free Choice Petri Nets</title>
				<imprint>
			<publisher>Cambridge University Press</publisher>
			<date type="published" when="1995">1995</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b2">
	<monogr>
		<title level="m" type="main">an Introduction</title>
		<author>
			<persName><forename type="first">Wolgang</forename><surname>Reisig</surname></persName>
		</author>
		<imprint>
			<date type="published" when="1985">1985</date>
			<publisher>Springer Verlag</publisher>
		</imprint>
	</monogr>
	<note>Petri Nets</note>
</biblStruct>

<biblStruct xml:id="b3">
	<monogr>
		<title/>
		<author>
			<persName><forename type="first">E</forename><surname>Teruel</surname></persName>
		</author>
		<imprint>
			<date type="published" when="1992">1992</date>
		</imprint>
	</monogr>
	<note>private communication</note>
</biblStruct>

<biblStruct xml:id="b4">
	<analytic>
		<title level="a" type="main">Free Choice Systems Have Home States</title>
		<author>
			<persName><forename type="first">E</forename><surname>Best</surname></persName>
		</author>
		<author>
			<persName><forename type="first">K</forename><surname>Voss</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">Acta Informatica</title>
		<imprint>
			<biblScope unit="volume">21</biblScope>
			<biblScope unit="page" from="89" to="100" />
			<date type="published" when="1984">1984</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b5">
	<monogr>
		<title level="m" type="main">Parallel program schemata</title>
		<author>
			<persName><forename type="first">R</forename><surname>Karp</surname></persName>
		</author>
		<author>
			<persName><forename type="first">R</forename><surname>Miller</surname></persName>
		</author>
		<imprint>
			<date type="published" when="1969">1969</date>
		</imprint>
		<respStmt>
			<orgName>Computer and System Sciences</orgName>
		</respStmt>
	</monogr>
</biblStruct>

				</listBibl>
			</div>
		</back>
	</text>
</TEI>
