Encoding Petri Nets in Answer Set Programming for Simulation Based Reasoning

by   Saadat Anwar, et al.

One of our long term research goals is to develop systems to answer realistic questions (e.g., some mentioned in textbooks) about biological pathways that a biologist may ask. To answer such questions we need formalisms that can model pathways, simulate their execution, model intervention to those pathways, and compare simulations under different circumstances. We found Petri Nets to be the starting point of a suitable formalism for the modeling and simulation needs. However, we need to make extensions to the Petri Net model and also reason with multiple simulation runs and parallel state evolutions. Towards that end Answer Set Programming (ASP) implementation of Petri Nets would allow us to do both. In this paper we show how ASP can be used to encode basic Petri Nets in an intuitive manner. We then show how we can modify this encoding to model several Petri Net extensions by making small changes. We then highlight some of the reasoning capabilities that we will use to accomplish our ultimate research goal.



There are no comments yet.


page 1

page 2

page 3

page 4


Encoding Higher Level Extensions of Petri Nets in Answer Set Programming

Answering realistic questions about biological systems and pathways simi...

Logic Programming Petri Nets

With the purpose of modeling, specifying and reasoning in an integrated ...

Representing, reasoning and answering questions about biological pathways - various applications

Biological organisms are composed of numerous interconnected biochemical...

Automata Techniques for Temporal Answer Set Programming

Temporal and dynamic extensions of Answer Set Programming (ASP) have pla...

Modeling Stable Matching Problems with Answer Set Programming

The Stable Marriage Problem (SMP) is a well-known matching problem first...

Clingo goes Linear Constraints over Reals and Integers

The recent series 5 of the ASP system clingo provides generic means to e...
This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

1 Introduction

The main motivation behind this paper is to model biological pathways and answer questions of the kind that a biologist would ask. Examples of such questions include ones used in biology text books to test the understanding of students. We found Petri Nets [1] to be the most suitable starting point for our needs as its graphical representation and semantics closely matches biological pathway diagrams.111In addition to modeling of biological systems, Petri Nets are also used over a wide range of domains, such as, workflows, embedded systems and industrial control [2, 3, 4, 5, 6, 7]. However, answering those type of questions requires certain extensions to the Petri Net model and reasoning with multiple simulations and parallel evolutions. Although numerous Petri Net modeling, simulation and analysis systems exist [8, 9, 10, 11, 12, 13], we did not find these systems to be a good match for all our needs. Some had limited adaptability outside their primary application domain, while others, though quite capable, did not offer easy extensibility. Most systems did not explore all possible state evolutions nor allowed different firing semantics.

To address the twin needs of easy extensibility and reasoning over multiple evolutions we propose encoding Petri Nets using Answer Set Programming (ASP), which is a declarative programming language with competitive solvers 222See [14, 15, 16] and has been used in modeling domains such as spacecrafts [17], work flows [18]

, natural language processing 

[19, 20] and biological systems modeling [21, 22]. In our quest we found ASP to be preferable to process algebra, temporal logics, and mathematical equations applied to Petri Nets. Some of these techniques, like -calculus is cumbersome even for small Nets [23], while others, like mathematical equations, impose restrictions on the classes of Petri Nets they can model [24].

Petri Net translation to ASP has been studied before [25, 26]. However, these implementations are limited to specific classes of Petri Nets and have a different focus. For example,  [25] used ASP for the analysis of properties of 1-safe Petri Nets such as reachability and deadlock detection. 1-safe Petri Nets are very basic in nature as they can accommodate at most one token in a place and they don’t allow source/sink transitions or inhibition arcs. As a result their ASP translation does not require handling of token aggregation, leading to simpler conflict resolution and weight-constraints than the general case. In [26], a new class of Petri Nets called Simple Logic Petri Nets (SLPNs) is presented and translated to ASP code. This class of Petri Nets uses simple logic expressions for arc weights and positive ground literals as tokens at places. Their implementation does not carry the notion of conflicting transitions, i.e., a token from a source place can be used in multiple transitions in a single firing step. It also does not follow the standard notion of token aggregation, i.e., if the same token arrives at a place from two different transitions, it looses its individual identity and only gets counted as one. Both of these implementations focus on analyzing properties of specific classes of Petri Nets. We design our implementation to simulate general Petri Nets. To our knowledge this has not been attempted in ASP before. However, some of our encoding scheme is similar to their work. Our current focus in this work is less on performance and more on the ease of encoding, extensibility, and exploring all possible state evolutions.

Thus the main contributions of this paper are: In Section 3 we show how ASP allows intuitive declarative encoding of basic Petri Nets resulting in a low specification–implementation gap. We then show, how Petri Net extensions can be incorporated in our encoding by making small changes. In particular, we explore change of firing semantics (Section 4), and allowing reset arcs (Section 5), inhibitor arcs (Section 6) and read arcs (Section 7). We show how our ASP encoding allows exploring all possible state evolutions in a Petri Net simulation and how to reason with those simulation results. We also show how Petri Nets fit into our ultimate goal of answering questions with respect to biological pathways. While the goal of this paper is not to analyze Petri Net properties of reachability, liveness, and boundedness etc., we briefly mention how these can be analyzed using our encoding. We now start with a brief background on ASP and Petri Nets.

2 Background on ASP and Petri Nets

Answer Set Programming (ASP)

is a declarative logic programming language based on the Stable Model Semantics 

[27]. Please refer to the Clingo manual [14] for details of the ASP syntax used in this paper.

A Petri Net is a graph of a finite set of nodes and directed arcs, where nodes are split between places and transitions, and each arc either connects a place to a transition or a transition to a place. Each place has a number of tokens (called the its marking). Collective marking of all places in a Petri Net is called its marking (or state). Arc labels represent arc weights. When missing, arc-weight is assumed as one, and place marking is assumed as zero.

Figure 1: Petri Net graph (of sub-section of glycolysis pathway) showing places as circles, transitions as boxes and arcs as directed arrows. Places have token count (or marking) written above them, assumed 0 when missing. Arcs labels represent arc-weights, assumed 1 when missing.

The set of place nodes on incoming and outgoing arcs of a transition are called its pre-set (input place set or input-set) and post-set (output place set or output-set), respectively. A transition is enabled when each of its pre-set place has at least the number of tokens equal to the arc-weight from to . An enabled transition may fire, consuming tokens equal to arc-weight from to from each pre-set place , producing tokens equal to arc-weight from to to each post-set place .

Multiple transitions may fire as long as they consume no more than the available tokens, with the assumption that tokens cannot be shared. Fig. 1 shows a portion of the glycolysis pathway [28], in which places represent reactants and products, transitions represent reactions, and arc weights represent reactant quantity consumed or the product quantity produced by the reaction.

Definition 1 (Petri Net).

A Petri Net is a tuple , where, is a finite set of places; is a finite set of transitions, ; is a set of arcs from transitions to places; is a set of arcs from places to transitions; ; and is the arc-weight function

Definition 2 (Marking).

A marking is the token assignment of each place node , where . Initial token assignment is called the initial marking. Marking at step is written as .

Definition 3 (Pre-set & post-set of a transition).

Pre-set / input-set of a transition is , while the post-set / output-set is

Definition 4 (Enabled Transition).

A transition is enabled with respect to marking , , if . An enabled transition may fire.

Definition 5 (Execution).

An execution is the simulation of change of marking from to due to firing of transition . is computed as follows:

Definition 6 (Conflicting Transitions).

A set of enabled transitions conflict if their simultaneous firing will consume more tokens than are available at an input place:

Definition 7 (Firing Set).

A set of simultaneously firing, non-conflicting, enabled transitions is called a firing set. Its execution w.r.t. marking produces new marking as follows:

Definition 8 (Execution Sequence).

An execution sequence is the simulation of a firing sequence . It is the transitive closure of executions, where subsequent markings become the initial marking for the next firing set. Thus, in the execution sequence , the firing of with respect to marking produces the marking which becomes the initial marking for .

3 Translating Basic Petri Net Into ASP

In this section we present ASP encoding of simple Petri Nets. We describe, how a given Petri Net , and an initial marking are encoded into ASP for a simulation length . Following sections will show how Petri Net extensions can be easily added to it. We represent a Petri Net with the following facts:


Facts place(). where is a place.


Facts trans(). where is a transition.


Facts ptarc(). where with weight .


Facts tparc(). where with weight .

Petri Net execution simulation proceeds in discrete time-steps, these time steps are encoded by the following facts:


Facts time() where .

initial marking (or initial state) of the Petri Net is represented by the following facts:


Facts holds() for every place with initial marking .

ASP requires all variables in rule bodies be domain restricted. Thus, we add the following facts to capture token quantities produced during the simulation 333Note that can be arbitrarily chosen to be larger than the maximum expected token quantity produced during the simulation.:


Facts num()., where

A transition is enabled if each of its input places has at least arc-weight tokens. Conversely, is not enabled if , and is only enabled when no such place exists. These are captured in and respectively:


notenabled(T,TS):-ptarc(P,T,N),holds(P,Q,TS),Q<N, place(P),
trans(T), time(TS),num(N),num(Q).


enabled(T,TS) :- trans(T), time(TS), not notenabled(T, TS).

The rule encodes notenabled(T,TS) which captures the existence of an input place of transition that violates the minimum token requirement at time-step . Where, the predicate holds(P,Q,TS) encodes the marking of place at . Rule encodes enabled(T,TS) which captures that transition is enabled at since there is no input place of transition that violates the minimum input token requirement at . In biological context, captures the conditions when a reaction (represented by ) is ready to proceed. A subset of enabled transitions may fire simultaneously at a given time-step. This is encoded as:


{fires(T,TS)} :- enabled(T,TS), trans(T), time(TS).

Rule encodes fires(T,TS), which captures the firing of transition at . The rule is encoded with a count atom as its head, which makes it a choice rule. This rule either picks the enabled transition for firing at or not, effectively enumerating a subset of enabled transitions to fire. Whether this set can fire or not in an answer set is subject to conflict checking, which is done by rules shown later. In biological context, the selected transition-set models simultaneously occurring reactions and the conflict models limited reactant supply that cannot be shared. Such a conflict can lead to multiple choices in parallel reaction evolutions and different outcomes. The next set of rules captures the consumption and production of tokens due to the firing of transitions in a firing-set as well as their aggregate effect, which computes the marking for the next time step:


add(P,Q,T,TS) :- fires(T,TS), tparc(T,P,Q), time(TS).


del(P,Q,T,TS) :- fires(T,TS), ptarc(P,T,Q), time(TS).


tot_incr(P,QQ,TS) :- QQ=#sum[add(P,Q,T,TS)=Q:num(Q):trans(T)],
time(TS), num(QQ), place(P).


tot_decr(P,QQ,TS) :- QQ=#sum[del(P,Q,T,TS)=Q:num(Q):trans(T)], time(TS), num(QQ), place(P).


holds(P,Q,TS+1) :-holds(P,Q1,TS),tot_incr(P,Q2,TS),time(TS+1),

Rule encodes add(P,Q,T,TS) and captures the addition of tokens to place due to firing of transition at time-step . Rule encodes del(P,Q,T,TS) and captures the deletion of tokens from place due to firing of transition at . Rules and aggregate all add’s and del’s for place due to and at time-step , respectively, by using the QQ=#sum[] construct to sum the values into . Rule which encodes holds(P,Q,TS+1) uses these aggregate adds and removes and updates ’s marking for the next time-step . In biological context, these rules capture the effect of a reaction on reactant and product quantities available in the next simulation step. To prevent overconsumption at a place following rules are added:


consumesmore(P,TS) :- holds(P,Q,TS), tot_decr(P,Q1,TS), Q1 > Q.


consumesmore :- consumesmore(P,TS).


:- consumesmore.

Rule encodes consumesmore(P,TS) which captures overconsumption of tokens at input place at time due to the firing set selected by . Overconsumption (and hence conflict) occurs when tokens consumed by the firing set are greater than the tokens available at . Rule generalizes this notion of overconsumption and constraint eliminates answers where overconsumption is possible.

Definition 9.

Given a Petri Net and its encoding . We say that there is a 1-1 correspondence between the answer sets of and the execution sequences of iff for each answer set of , there is a corresponding execution sequence of such that

Proposition 1.

There is a 1-1 correspondence between the answer sets of and the execution sequences of .

3.1 An example execution

Next we look at an example execution of the Petri Net shown in Figure 1. The Petri Net and its initial marking are encoded as follows444{holds(p1,0,0),…,holds(pN,0,0)}, {num(0),…,num(60)}, {time(0),…,time(5)} have been written as holds(p1;…;pN,0,0), num(0..60), time(0..5), respectively, to save space.:


we get thousands of answer-sets, for example555{fires(t1,ts1),…,fires(tN,ts1)} have been written as fires(t1;…;tN;ts1) to save space.:

holds(bpg13,0,0) holds(dhap,0,0) holds(f16bp,0,0) holds(g3p,0,0)
holds(bpg13,0,1) holds(dhap,0,1) holds(f16bp,1,1) holds(g3p,0,1)
holds(bpg13,0,2) holds(dhap,1,2) holds(f16bp,1,2) holds(g3p,1,2)
holds(bpg13,0,3) holds(dhap,2,3) holds(f16bp,1,3) holds(g3p,2,3)
holds(bpg13,2,4) holds(dhap,3,4) holds(f16bp,1,4) holds(g3p,2,4)
holds(bpg13,4,5) holds(dhap,4,5) holds(f16bp,1,5) holds(g3p,2,5)
fires(t3,0) fires(t3;t4,1) fires(t3;t4;t5a;t5b,2)
fires(t3;t4;t5a;t5b;t6,3) fires(t3;t4;t5a;t5b;t6,4)

4 Changing Firing Semantics

The ASP code above implements the set firing semantics. It can produce a large number of answer-sets, since any subset of a firing set will also be fired as a firing set. For our biological system modeling, it is often beneficial to simulate only the maximum activity at any given time-step. We accomplish this by defining the maximal firing set semantics, which requires that a maximal subset of non-conflicting transitions fires at a single time step666Such a semantics reduces the reachable markings. See [29] for the analysis of its computational power.. Our semantics is different from the firing multiplier approach used by [30], in which a transition can fire as many times as allowed by the tokens available in its source places. Their approach requires an exponential time firing algorithm in the number of transitions. Our maximal firing set semantics is implemented by adding the following rules to the encoding in Section 3:


could_not_have(T,TS) :- enabled(T,TS), not fires(T,TS),
ptarc(S,T,Q), holds(S,QQ,TS), tot_decr(S,QQQ,TS), Q > QQ - QQQ.


:-not could_not_have(T,TS), enabled(T,TS), not fires(T,TS),
trans(T), time(TS).

Rule encodes could_not_have(T,TS) which means that an enabled transition that did not fire at time , could not have fired because its firing would have resulted in overconsumption. Rule eliminates any answer-sets in which an enabled transition did not fire, that could not have caused overconsumption. Intuitively, these two rules guarantee that the only reason for an enabled transition to not fire is conflict avoidance (due to overconsumption). With this firing semantics, the number of answer-sets produced for Petri Net in Figure 1 reduces to 2.

Proposition 2.

There is 1-1 correspondence between the answer sets of and the execution sequences of .

Other firing semantics can be encoded with similar ease777For example, if interleaved firing semantics is desired, replace rules with the following: a5’: more_than_one_fires :- fires(T1,TS), fires(T2, TS), T1 != T2, time(TS). a6’: :- more_than_one_fires. . We now look at Petri Net extensions and show how they can be easily encoded in ASP.

5 Extension - Reset Arcs

Definition 10 (Reset Arc).

A Reset Arc in a Petri Net is an arc from place to transition that consumes all tokens from its input place on firing of . A Reset Petri Net is a tuple where, are the same as for PN; and defines reset arcs

Figure 2: Petri Net of Fig 1 extended with a reset arc from to shown with double arrowhead.

Figure 2 shows an extended version of the Petri Net in Figure 1 with a reset arc from to (shown with double arrowhead). In biological context it models the removal of all quantity of compound . Petri Net execution semantics with reset arcs is modified for conflict detection and execution as follows:

Definition 11 (Conflicting Transitions in ).

A set of enabled transitions conflict in w.r.t. if firing them simultaneously will consume more tokens than are available at any one of their common input-places. conflict if:

Definition 12 (Execution in ).

Execution of a transition set in has the following effect:

where and represents the places emptied by due to reset arcs.

Since a reset arc from to , consumes current marking dependent tokens, we extend ptarc to include time and replace with , respectively in the Section 4 encoding and add rule for each reset arc:


Rules ptarc():-time(). for each non-reset arc


Rules tparc():-time(). for each non-reset arc


notenabled(T,TS) :- ptarc(P,T,N,TS), holds(P,Q,TS), Q < N,
place(P), trans(T), time(TS), num(N), num(Q).


add(P,Q,T,TS) :- fires(T,TS), tparc(T,P,Q,TS), time(TS).


del(P,Q,T,TS) :- fires(T,TS), ptarc(P,T,Q,TS), time(TS).


Rules ptarc() :- holds(), num(), . for each reset arc between and using as arc-weight at time step .

Rule encodes place-transition arc with marking dependent weight to capture the notion of a reset arc. The execution semantics of our definition are slightly different from the standard definition in  [31], even though both capture similar operations. Our implementation considers token consumption by reset arc in contention with other token consuming arcs from the same place, while the standard definition considers token consumption as a side effect, not in contention with other arcs.

Figure 3: Petri Net showing feedback inhibition arc from to with a bullet arrowhead. Inhibitor arc weight is assumed when not specified.

We chose our definition to allow modeling of biological process that removes all available quantity of a substance in a maximal firing set. Consider Figure 2, if has or more tokens, our semantics would only permit either or to fire in a single time-step, while the standard semantics can allow both and to fire simultaneously, such that the reset arc removes left over tokens after consumes one token.

We could have, instead, extended our encoding to include self-modifying nets [32], but our definition provides a simpler solution. Standard semantics, however, can be easily encoded888 Standard reset arc can be added to Section 4 encoding by splitting into and adding as follows: f8’: rptarc(,). - fact capturing a reset arc a7’: reset(P,TS) :- rptarc(P,T), place(P), trans(T), fires(T,TS), time(TS). - rule to capture if will be reset at time due to firing of transition that has a reset arc on it from to . r5a’: holds(P,Q,TS+1) :- holds(P,Q1,TS), tot_incr(P,Q2,TS), tot_decr(P,Q3,TS), Q=Q1+Q2-Q3, place(P), num(Q;Q1;Q2;Q3), time(TS), time(TS+1), not reset(P,TS). - rule to compute marking at when is not being reset. r5b’: holds(P,Q,TS+1) :- tot_incr(P,Q,TS), place(P), num(Q), time(TS), time(TS+1), reset(P,TS). - rule to compute marking at when is being reset. .

Proposition 3.

There is 1-1 correspondence between the answer sets of and the execution sequences of .

6 Extension - Inhibitor Arcs

Definition 13 (Inhibitor Arc).

An inhibitor arc [33] is a place–transition arc that inhibits its transition from firing as long as the place has any tokens in it. An inhibitor arc does not consume any tokens from its input place. A Petri Net with reset and inhibitor arcs is a tuple , where, are the same as for ; and defines inhibitor arcs.

Figure 4: Petri Net with read arc from to shown with arrowhead on both ends. The transition will not fire unless there are at least tokens in , but when it executes, it only consumes tokens.

Figure 3 shows a Petri Net with inhibition arc from to with a bulleted arrowhead. It models biological feedback regulation in simplistic terms, where excess downstream causes the upstream production by glycolysis to be inhibited until the excess quantity is consumed [28]. Petri Net execution semantics with inhibit arcs is modified for determining enabled transitions as follows:

Definition 14 (Enabled Transition in ).

A transition is enabled with respect to marking , , if all its input places have at least the number of tokens as the arc-weight and all have zero tokens, i.e.

We add inhibitor arcs to our encoding in Section 5 as follows:


Rules iptarc():-time(). for each inhibitor arc between and .


notenabled(T,TS) :- iptarc(P,T,N,TS), holds(P,Q,TS), place(P),
trans(T), time(TS), num(N), num(Q), Q >= N.

The new rule encodes another reason for a transition to be disabled (or not enabled). An inhibitor arc from to with arc weight will cause its target transition to not enable when the number of tokens at its source place is greater than or equal to , where is always per rule .

Proposition 4.

There is 1-1 correspondence between the answer sets of and the execution sequences of .

7 Extension - Read Arcs

Definition 15 (Read Arc).

A read arc (a test arc or a query arc) [34] is an arc from place to transition, which enables its transition only when its source place has at least the number of tokens as its arc weight. It does not consume any tokens from its input place. A Petri Net with reset, inhibitor and read arcs is a tuple , where, are the same as for ; defines read arcs; and defines read arc weight.

Figure 4 shows a Petri Net with read arc from to shown with arrowhead on both ends. It models the ATP synthase activation requiring a higher concentration of ions in the intermembrane space 999This is an oversimplified model of (ATP synthase) activation, since the actual model requires an concentration differential across membrane.. The reaction itself consumes a lower quantity of ions represented by the regular place-transition arc [28, 35]. Petri Net execution semantics with read arcs is modified for determining enabled transitions as follows:

Definition 16 (Enabled Transition in ).

A transition is enabled with respect to marking , , if all its input places have at least the number of tokens as the arc-weight , all have zero tokens and all have at least the number of tokens as the arc-weight , i.e.

We add read arcs to our encoding of Section 6 as follows:


Rules tptarc():-time(). for each read arc .


place(P),trans(T), time(TS), num(N), num(Q), Q < N.

The new rule encodes another reason for a transition to not be enabled. A read arc from to with arc weight will cause its target transition to not enable when the number of tokens at its source place is less than the arc weight .

Proposition 5.

There is a 1-1 correspondence between the answer sets of and the execution sequences of .

8 Example Use Case of Our Encoding and Additional Reasoning Abilities

We illustrate the usefulness of our encoding by applying it to the following simulation based reasoning question from [28]101010As it appeared in https://sites.google.com/site/2nddeepkrchallenge/:

Question 1.

“At one point in the process of glycolysis, both dihydroxyacetone phosphate (DHAP) and glyceraldehyde 3-phosphate (G3P) are produced. Isomerase catalyzes the reversible conversion between these two isomers. The conversion of DHAP to G3P never reaches equilibrium and G3P is used in the next step of glycolysis. What would happen to the rate of glycolysis if DHAP were removed from the process of glycolysis as quickly as it was produced?”

In order to answer this question, we create a Petri Net model of sub-portion of the normal glycolysis pathway relevant to the question (Figure 1) and encode it in ASP using the encoding in Section 3. We then extend this pathway by adding a reset arc to it for modeling the immediate removal of (Figure 2) and encode it in ASP using the encoding in Section 5. We simulate both models for the same number of time steps using the maximal firing set semantics from Section 4, since we are interested in the maximum change (in production) between the two scenarios. Figure 5 shows the average quantity of produced by the normal and the extended Petri Net models for a -step simulation and Figure 6 shows the spread of unique quantities produced during these simulations. We compute the rate of glycolysis as the ratio “” at the end of the simulation. We post process these results to determine the average rates as well as the spread among the answer-sets. Our results show a lower rate of production and hence glycolysis in the extended pathway, with a spread of

quantity ranging from zero to the same amount as the normal pathway. Although we are using average rates to answer this question, the ASP encoding produces all possible state evolutions, which may be further analyzed by assigning different probabilities to these state evolutions.

Figure 5: Average quantity of produced by the normal and extended Petri Net models in Fig. 1 and Fig. 2 for a simulation length of .

ASP allows us to perform additional reasoning not directly supported by various Petri Net formalisms examined by us 111111We examined a significant number of Petri Net formalisms. For example, if we are given partial state information, we can use it in ASP as way-points to guide the simulation. Consider that we want to determine the cause of a substance ’s quantity recovery after it is depleted. Using ASP, we can enumerate only those answer-sets where a substance exhausts completely and then recovers by adding constraints. The answer sets produced can then be passed on to an additional ASP reasoning step that determines the general cause leading to the recovery of after its depletion. This type of analysis is possible, since the answer-sets enumerate the entire simulation evolution and all possible state evolutions.

Figure 6: Spread of the quantity of produced by the normal and extended Petri Net models in Fig. 1 and Fig. 2 for a simulation length of .

Although not a focus of this work, various Petri Net properties can be easily analyzed using our ASP encoding. For example dynamic properties can be analyzed as follows: one can test reachability of a state (or marking) by adding a constraint that removes all answer-sets that do not contain ; boundedness by adding a constraint on token count; basic liveness by extending the Petri Net model with source transitions connected to all places, switching to the interleaved firing semantics, and removing answers where the subject transition to be tested is not fired. Intuitively, structural properties can be analyzed as follows: T-invariants can be extracted by enumerating transitions whenever marking using an interleaved firing semantics. P-invariants can be extracted by using interleaved firing semantics to visit all possible state (or marking) evolutions, selecting a subset of places , and eliminating all answer-sets where .

9 Related Work and Conclusion

Here we will elaborate a bit on some of the existing Petri Net systems121212The Petri Net Tools Database web-site summarizes a large slice of existing tools http://www.informatik.uni-hamburg.de/TGI/PetriNets/tools/quick.html, (especially ones used in biological modeling) and put them in context of our research. We follow that with some ways existing Petri Net tools are used for biological analysis and put them in the context of our research.

CPN Tools [8] is a graphical tool for simulating Colored Petri Nets with discrete tokens. It supports guards, timed transitions, and hierarchical transitions but currently does not have direct support for inhibit or reset arcs. It pursues one simulation evolution, breaking transition choice ties randomly. Cell Illustrator [36] is a closed source Java based graphical tool for simulating biological systems using Hybrid Functional Petri Nets (HPFNe). HPFNs combine features from Continuous as well as Discrete Petri Nets. Cell Illustrator only supports uncolored tokens and pursues one simulation evolution, breaking transition choice ties randomly. Snoopy [9] is a graphical tool written in C++ for analyzing biological models. It supports simulating Colored, Stochastic, Hybrid, and Continuous Petri Nets with read, reset, and inhibit arcs under a few firing semantics, including maximal firing. However, it does not explore all possible evolutions and it is unclear if simulation results can be exported for further reasoning. Renew [13] is an open source simulation tool written in Java. It supports Colored tokens, (reference semantics of) Object tokens, guard conditions, inhibit arcs, reset arcs, timed tokens, arc delays, and token reservation. Token nets can be created on the fly. Its use requires some knowledge of Java. Some features like arc pre-delays when combined with transition delays can lead to complicated semantics. It is unclear how ties are broken to resolve transition conflicts and whether all possible state evolutions are explored.

[3, 37, 38] have previously used Petri Nets to analyze biological pathways, but their analysis is mostly limited to dynamic and structural properties. [39] surveyed various Petri Net implementations to study the properties and dynamics of biological systems. They defined a series of question that can be answered by Petri Nets using simulation. Contrary to their approach, we picked our questions from college level text books to capture real world questions. Our approach is also different in that we model the questions as Petri Net extensions and we can perform further reasoning on simulation runs.

Conclusion: In this paper we discussed the appropriateness of Petri Nets–especially ASP implementation of Petri Nets, for modeling biological pathways and answering realistic questions (the ones found in biology textbooks) with respect to such pathways. We presented how simple Petri Nets can be encoded in ASP and showed that ASP provides an elaboration tolerant way to easily realize various Petri Net extensions and firing semantics. The extensions include changing of the firing semantics, and allowing reset arcs, inhibitor arcs and read arcs. Our encoding has a low specification-implementation gap. It allows enumeration of all possible evolutions of a Petri Net simulation as well as the ability to carry out additional reasoning about these simulations. We also presented an example use case of our encoding scheme. Finally, we briefly discussed other Petri Net systems and their use in biological modeling and analysis and compared them with our work. Our focus in this paper has been less on performance and more on ease of encoding, extensibility, exploring all possible state evolutions, and strong reasoning abilities not supported by other Petri Net implementations examined. In a follow on enhanced version of this paper, we will carry out detailed performance analysis. In a sequel of this paper, we will present extension of this work to other Petri Net extensions, such as colored tokens, priority transitions, and durative transitions.


  • [1] Carl Adam Petri. Kommunikation mit automaten. Technical report, Technical Report 2 (Schriften des IIM), Institut für Instrumentelle Mathematik, Bonn, Germany, 1962.
  • [2] W.M.P. van der Aalst, KM Van Hee, and GJ Houben. Modelling and analysing workflow using a petri-net based approach. In Proceedings of the second Workshop on Computer-Supported Cooperative Work, Petri nets and related formalisms, pages 31–50. of, 1994.
  • [3] A Sackmann, M Heiner, and I Koch. Application of petri net based analysis techniques to signal transduction pathways. BMC Bioinformatics, 2(7):482, November 2006.
  • [4] L.A. Cortés, P. Eles, and Z. Peng. A petri net based model for heterogeneous embedded systems. In Proc. NORCHIP Conference, pages 248–255. Citeseer, 1999.
  • [5] R. Zurawski and MengChu Zhou. Petri nets and industrial applications: A tutorial. Industrial Electronics, IEEE Transactions on, 41(6):567 –583, dec 1994.
  • [6] W.M.P. Van Der Aalst. The application of petri nets to workflow management. Journal of Circuits, Systems and Computers, 08(01):21–66, 1998.
  • [7] V.N. Reddy, M.L. Mavrovouniotis, M.N. Liebman, et al. Petri net representations in metabolic pathways. In Proc Int Conf Intell Syst Mol Biol, volume 1, page 96038982, 1993.
  • [8] K. Jensen, L.M. Kristensen, and L. Wells. Coloured Petri Nets and CPN Tools for modelling and validation of concurrent systems. International Journal on Software Tools for Technology Transfer (STTT), 9(3):213–254, 2007.
  • [9] Monika Heiner, Mostafa Herajy, Fei Liu, Christian Rohr, and Martin Schwarick. Snoopy - a unifying petri net tool. In Application and Theory of Petri Nets, volume 7347 of Lecture Notes in Computer Science, pages 398–407, 2012.
  • [10] S. Kounev, C. Dutz, and A. Buchmann. QPME-queueing petri net modeling environment. In Quantitative Evaluation of Systems, 2006. QEST 2006. Third International Conference on, pages 115–116. IEEE, 2006.
  • [11] B. Berthomieu, P.O. Ribet, and F. Vernadat. The tool TINA–construction of abstract state spaces for petri nets and time petri nets. International Journal of Production Research, 42(14):2741–2756, 2004.
  • [12] M. Nagasaki, A. Saito, E. Jeong, C. Li, K. Kojima, E. Ikeda, and S. Miyano. Cell illustrator 4.0: A computational platform for systems biology. In Silico Biology, 10(1):5–26, 2010.
  • [13] O. Kummer, F. Wienberg, and M. Duvigneau. Renew–the reference net workshop. Petri Net Newsletter, 56:12–16, 1999.
  • [14] M. Gebser, R. Kaminski, B. Kaufmann, M. Ostrowski, T. Schaub, and M. Schneider. Potassco: The Potsdam answer set solving collection. aicom, 24(2):105–124, 2011.
  • [15] F. Lin and Y. Zhao. Assat: Computing answer sets of a logic program by sat solvers. Artificial Intelligence, 157(1):115–137, 2004.
  • [16] Martin Gebser, Lengning Liu, Gayathri Namasivayam, André Neumann, Torsten Schaub, and Mirosław Truszczyński. The first answer set programming system competition. In Logic Programming and Nonmonotonic Reasoning, pages 3–17. Springer Berlin Heidelberg, 2007.
  • [17] M. Nogueira, M. Balduccini, M. Gelfond, R. Watson, and M. Barry. An a-prolog decision support system for the space shuttle. Practical Aspects of Declarative Languages, pages 169–183, 2001.
  • [18] M. Balduccini. Job schedule generation, March 3 2009. US Patent App. 12/396,640.
  • [19] C. Baral, M. Gelfond, and R. Scherl. Using answer set programming to answer complex queries. In Workshop on Pragmatics of Question Answering at HLT-NAAC2004, 2004.
  • [20] E. Erdem and R. Yeniterzi. Transforming controlled natural language biomedical queries into answer set programs. In Proceedings of the Workshop on Current Trends in Biomedical Natural Language Processing, pages 117–124. Association for Computational Linguistics, 2009.
  • [21] S. Dworschak, S. Grell, V.J. Nikiforova, T. Schaub, and J. Selbig. Modeling biological networks by action languages via answer set programming. Constraints, 13(1):21–65, 2008.
  • [22] M. Gebser, A. König, T. Schaub, S. Thiele, and P. Veber. The BioASP library: ASP solutions for systems biology. In 22nd IEEE International Conference on Tools with Artificial Intelligence (ICTAI’10), volume 1, pages 383–389, 2010.
  • [23] W.M.P. van der Aalst. Pi calculus versus petri nets: Let us eat “humble pie” rather than further inflate the “pi hype”. BPTrends, 3(5):1–11, 2005.
  • [24] T. Murata. Petri nets: Properties, analysis and applications. Proceedings of the IEEE, 77(4):541–580, 1989.
  • [25] Keijo Heljanko and Ilkka Niemelä. Petri net analysis and nonmonotomic reasoning. Leksa Notes in Computer Science, pages 7–19, 2000.
  • [26] Tristan M. Behrens and Jürgen Dix. Model checking with logic based petri nets. Technical report ifi-07-02, Insitut für Informatik, Technische Universität Clausthal Julius-Albert Str. 4, 38678 Clausthal-Zellerfeld, Germany, Clausthal University of Technology, Dept of Computer Science, May 2007.
  • [27] Michael Gelfond and Vladimir Lifschitz. The stable model semantics for logic programming. Logic Programming: Proceedings of the Fifth International Conference and Symposium, pages 1070–1080, 1988.
  • [28] J.B. Reece, M.L. Cain, L.A. Urry, P.V. Minorsky, and S.A. Wasserman. Campbell Biology. Pearson Benjamin Cummings, 2010.
  • [29] Hans-Dieter Burkhard. Ordered firing in petri nets. Journal of Information Processing and Cybernetics, (17):71–86, 1980.
  • [30] Elzbieta Krepska, Nicola Bonzanni, Anton Feenstra, Wan Fokkink, Thilo Kielmann, Henri Bal, and Jaap Heringa. Design issues for qualitative modelling of biological cells with petri nets. Formal Methods in Systems Biology, pages 48–62, 2008.
  • [31] Toshiro Araki and Tadao Kasami. Some decision problems related to the reachability problem for petri nets. Theoretical Computer Science, 3(1):85–104, 1976.
  • [32] Rüdiger Valk. Self-modifying nets, a natural extension of petri nets. In Automata, Languages and Programming, volume 62 of Lecture Notes in Computer Science, pages 464–476. Springer, 1978.
  • [33] James L. Peterson. Petri nets. Computing Surveys, 9(3):223–252, September 1977.
  • [34] Søren Christensen and Niels Damgaard Hansen. Coloured Petri nets extended with place capacities, test arcs and inhibitor arcs. Springer, 1993.
  • [35] Jeremy M Berg, John L Tymoczko, and Lubert Stryer. A proton gradient powers the synthesis of atp. 2002.
  • [36] Masao Nagasaki, Ayumu Saito, Atsushi Doi, Hiroshi Matsuno, and Satoru Miyano. Foundations of Systems Biology: Using Cell Illustrator and Pathway Databases. Computational Biology. Springer, 2009.
  • [37] R. Hofestädt and S. Thelen. Qualitative modeling of biochemical networks. In Silico Biology, 1:39–53, 1998.
  • [38] Chen Li, Shunichi Suzuki, Qi-Wei Ge, Mitsuru Nakata, Hiroshi Matsuno, and Satoru Miyano. Structural modeling and analysis of signaling pathways based on petri nets. Journal of bioinformatics and computational biology, 4(05):1119–1140, 2006.
  • [39] Mor Peleg, Daniel Rubin, and Russ B Altman. Using petri net tools to study properties and dynamics of biological systems. Journal of the American Medical Informatics Association, 12(2):181–199, 2005.