Trap spaces of Boolean networks are conflict-free siphons of their Petri net encoding

Boolean network modeling of gene regulation but also of post-trans-criptomic systems has proven over the years that it can bring powerful analyses and corresponding insight to the many cases where precise biological data is not sufficiently available to build a detailed quantitative model. Besides simulation, the analysis of such models is mostly based on attractor computation, since those correspond roughly to observable biological phenotypes . The recent use of trap spaces made a real breakthrough in that field allowing to consider medium-sized models that used to be out of reach. However, with the continuing increase in model size and complexity of Boolean update functions, the state-of-the-art computation of minimal trap spaces based on prime implicants shows its limits due to the difficulty of the prime-implicant computation. In this article we explore and prove for the first time a connection be-tween trap spaces of a general Boolean network and siphons of its Petri net encoding. Besides important theoretical applications in studying properties of trap spaces, the connection enables us to propose an alternative approach to compute minimal trap spaces, and hence complex attractors, of a general Boolean network. It replaces the need for prime implicants by a completely different technique, namely the enumeration of maximal siphons in the Petri net encoding of the original model. We then demonstrate its efficiency and compare it to the state-of-the-art methods on a large collection of real-world

Boolean network modeling of gene regulation but also of post-transcriptomic systems has proven over the years that it can bring powerful analyses and corresponding insight to the many cases where precise biological data is not sufficiently available to build a detailed quantitative model.Besides simulation, the analysis of such models is mostly based on attractor computation, since those correspond roughly to observable biological phenotypes.The recent use of trap spaces made a real breakthrough in that field allowing to consider medium-sized models that used to be out of reach.However, with the continuing increase in model size and complexity of Boolean update functions, the state-of-the-art computation of minimal trap spaces based on prime implicants shows its limits due to the difficulty of the prime-implicant computation.
In this article we explore and prove for the first time a connection between trap spaces of a general Boolean network and siphons of its Petri net encoding.Besides important theoretical applications in studying properties of trap spaces, the connection enables us to propose an alternative approach to compute minimal trap spaces, and hence complex attractors, of a general Boolean network.It replaces the need for prime implicants by a completely different technique, namely the enumeration of maximal siphons in the Petri net encoding of the original model.We then demonstrate its efficiency and compare it to the state-of-the-art methods on a large collection of real-world

Introduction
From the observation that the transcriptional regulation behaved in a sigmoid step-like way, came the original idea to represent models of gene regulation as discrete event systems.Those gene regulation networks use thresholds or equivalently logical functions to represent the different regulations [1,2,3,4].
Boolean modeling made available some powerful analyses and corresponding insight for gene regulation models.Then, over the years, its use increased even for modelling post-transcriptional mechanisms, supported by the many cases where precise biological data was not sufficiently available to build a detailed quantitative model [5].This lack of data is more frequent for large and very large models, which led to a steady increase in the size of logical models à la Thomas [6].The main analysis tool for such models is the computation of its fixed and periodic attractors, since those correspond roughly to observable biological phenotypes.The recent use of trap spaces [7] made a real breakthrough in that field allowing to consider medium-sized models that used to be out of reach and for which only simulation was available.However, with the most recent models both being quite large and using rather complex update functions, the state-of-the-art computation of minimal trap spaces based on prime implicants shows its limits.More specifically, the number of prime implicants of a Boolean function is in general exponential in the number of input nodes of this function [7].Moreover, the computation of prime implicants is a demanding task, especially for complex Boolean functions.
It is worth noting that the recent method presented in [8] for computing minimal trap spaces avoids the prime-implicant computation by relying on the most-permissive semantics of Boolean networks.This method has been implemented in the tool mpbn1 demonstrated in [9] for handling medium-sized models from the literature and very large synthetic models (up to 100,000 nodes).However, this method is only applicable for locallymonotonic Boolean networks, whereas the prime implicants based method [7] is applicable for general Boolean networks (i.e., including both locally-monotonic and non-locally-monotonic ones).In addition, the bioLQM platform also provides another method using Binary Decision Diagrams (BDDs) in http://colomoto.org/biolqm/doc/tools-trapspace.html.This method avoids the prime-implicant computation as it characterizes the set of generic trap spaces of a Boolean network by a BDD, then filters this set to get the set of all minimal trap spaces.By this approach, it requires the computation of all solutions, whereas the methods [7,9] based on Answer Set Programming (ASP) can start enumerating them as they are found.Moreover, the main issue with this BDD-based method is that the number of generic trap spaces of a Boolean network may be extremely larger than its number of minimal trap spaces.This issue limits the efficiency of the current BDDbased method.The study [10] highlights the need for non-locally-monotonic Boolean networks in both biological and theoretical aspects.Hence, it is still necessary to develop efficient methods for computing minimal trap spaces of large-scale general Boolean networks.
Petri nets were introduced in the 60s as simple formalism for describing and analyzing information-processing systems that are characterized as being concurrent, asynchronous, non-deterministic and possibly distributed [11,12].The use of Petri nets for representing biochemical reaction systems, by mapping molecular species to places and reactions to transitions, hinted at already in [11,12] was used more thoroughly quite late in [13], together with some Petri net concepts and tools for the analysis of metabolic networks.
Siphons are such a concept, but they have not been used a lot for the study of biochemical systems [14,15] even if the practical cost of computing their minimal/maximal elements appear much more manageable than the theoretical complexity would indicate [16,17].
In this article we explore and prove for the first time a connection between trap spaces of a general Boolean network and siphons of its Petri net encoding.Not only having important theoretical applications in studying properties of trap spaces in Boolean networks, the connection has important practical applications in the trap space computation.Specifically, based on the connection, we propose an alternative approach to compute minimal trap spaces, and hence complex attractors, of a general Boolean network.It replaces the need for prime implicants by a completely different technique, namely the enumeration of maximal siphons in the Petri net encoding of the original model.We then demonstrate its efficiency and compare it to the state-of-the-art methods for computing minimal trap spaces of Boolean networks on many real-world models from various sources in the literature and on randomly generated models.
Herein we revise and extend our previous work in [18] as follows.First, more formal definitions are given and the existing proofs are made more detailed.In particular, an updated proof provides another way to prove the independence of trap spaces of a Boolean network with respect to its update scheme, which was originally proved in [7].Second, we showcase a theoretical application of the connection between trap spaces in Boolean networks and conflict-free siphons in Petri nets.Third, beyond the proposed ASP method implementing the alternative approach [18], we propose several other possible methods for computing minimal trap spaces using Maximum Satisfiability (MaxSAT), Constraint Programming (CP), and Integer Linear Programming (ILP).Fourth, we discuss in detail how to compute several special types of trap spaces in a Boolean network.Besides minimal trap spaces, these special types also play crucial roles in analyzing and controlling Boolean networks [19].Fifth, regarding the implementation, we have developed a new converter that directly reads a .bnetfile and builds the Petri net encoding, instead of using the PNML conversion of bioLQM [18].Finally, we conduct a more extensive benchmark on more real-world models from various sources and randomly generated models to evaluate all the proposed methods (the benchmark conducted in [18] considers only a few dozens of representative real-world models), therefore obtaining more comprehensive insights.
The rest of this paper is organized as follows: Section 2 recalls the basic concepts including Boolean networks, attractors, trap spaces, Petri nets, and siphons.Section 3 presents the main finding, the connection between trap spaces in Boolean networks and siphons in Petri nets.Section 4 presents the alternative approach for computing minimal trap spaces and the four possible methods implementing it.Section 5 shows an important biological case study showing the applicability of the new approach.Section 6 reports the experimental results for evaluating the efficiency of the proposed methods.
Finally, Section 7 concludes the paper and draws future work.

Preliminaries
We shall briefly recall here some preliminaries on Boolean networks related to trap spaces and Petri nets.

Boolean networks
Definition 2.1.A Boolean Network (BN) is a pair N = (V, F ) where: • V = {v 1 , . . ., v n } is the set of nodes.We use v i to denote both the node v i and its associated Boolean variable.
A Boolean function is locally-monotonic if it can be represented by a formula in disjunctive normal form in which all occurrences of any given literal are either negated or non-negated [9].A Boolean network is said to be locally-monotonic if all its Boolean functions are locally-monotonic.
Otherwise, this model is said to be non-locally-monotonic.
A state s ∈ B n is as a mapping s : V → B that assigns either 0 (inactive) or 1 (active) to each node.We denote the set of all possible states of a Boolean network N by S N = B n .At each time step t, node v i can update its state by where s (resp.s ′ ) is the state of N at time t (resp.t + 1).Note that for simplicity, we write f i (s) even if IN (v i ) ⊊ V (i.e., IN (v i ) does not contain some nodes of V ).An update scheme of a Boolean network specifies the way that the nodes update their states through time evolution [20].There are many different update schemes, but the two main types [20] are: synchronous, where all the nodes are updated simultaneously, and fully asynchronous, where only one node is selected non-deterministically to be updated.Following the update scheme, the Boolean network transits from a state to another state (possibly identical).This transition is called the state transition and denoted by →⊆ S N × S N .For example, under the synchronous update scheme, we have x → y if and only if y(v i ) = f i (x), ∀v i ∈ V , whereas under the fully asynchronous update scheme, we have x → y if and only if there Then the dynamics of N is captured by the directed graph (S N , →) called the State Transition Graph (STG).

Traps spaces
We recall here some definitions from [7] for the introduction of trap spaces.
Minimal trap spaces prove to be a very good approximation of the attractors of a Boolean network under asynchronous update schemes and have become the de facto standard way to analyze models of a few tens of genes [21,22].
A non-empty set T ⊆ S N is a trap set with respect to → if for every x ∈ T and y ∈ S N with x → y it holds that y ∈ T [7].An attractor of N with respect to → can be defined as an inclusion-wise minimal trap set of (S N , →).An attractor can be also seen as a terminal strongly connected component of (S N , →) [23].An attractor of size 1 is called a fixed point, otherwise it is called a cyclic or complex attractor [7].
means that the value of v i is free in m and v i is called a free variable.We denote D m the set of all fixed variables of m.A subspace m is equivalent to a set of states: A trap space is defined as a subspace that is also a trap set.It is noted that trap spaces of a Boolean network are independent of the update scheme of this model [7], we provide in Corollary 3.1 another proof of this.Then, we define a partial order < on S ⋆ N as: Consequently, a trap space m is minimal if and only if there is no trap space m ′ ∈ S ⋆ N such that m ′ < m.
For example, let us consider the Boolean network shown in Example 2.1.Example 2.1.We give a Boolean network N = (V, F ), where V = (x 1 , x 2 ) Herein, ∧, ∨, and ¬ denote the logical conjunction, disjunction, and negation operators, respectively.A marking for a Petri net is a mapping M : P → N that assigns a number of tokens to each place.A place p is marked by a marking M if and only if M (p) > 0. We shall write pred(x) (resp.succ(x)) to represent the set of vertices that have a (non-zero weighted) arc leading to (resp.coming from)

Petri net encoding of Boolean networks
x.In this work, we consider a class of Petri nets called 1-safe Petri nets where every place has at most 1 token and all arcs are of weight 1.Note that in such nets we have M : P → {0, 1}, we might therefore represent a marking by the equivalent set of places containing a token and will use this notation for simplicity.In this case, weights are implicitly omitted in the arcs of a Petri net.Then, a transition t ∈ T is enabled at a marking M if and only if pred(t) ⊆ M .A marking M is called a deadlock if there are no enabled transitions at M .The firing of t leads to a new marking M ′ specified by M ′ = (M \ pred(t)) ∪ succ(t).Note that when multiple transitions are enabled, we need to embed one firing scheme (similar to the update scheme of a Boolean network) to the Petri net.The classical firing scheme is that only one of the enabled transition is non-deterministically chosen to fire [12].
The link between Boolean networks à la Thomas and Petri nets was originally established in [24] in order to make available formal methods like model-checking for the analysis of such systems.The basic encoding into 1safe (i.e., never more than one token in each place) nets only holds for purely Boolean networks but was later extended to multivalued logical models in two ways, either in [25] with non 1-safe Petri nets or more recently in [23] with 1-safe nets but many more places.
Since our study is focused on Boolean networks, we briefly recall the original encoding here.Its basis is that every node (gene) v of the original model N = (V, F ) is represented by two separate places (p v and p v ), corresponding to its two states, active, and inactive, respectively.Each conjunct of the logical function that activates the gene will lead to a transition t, consuming the inactive place (i.e., a directional arc from p v to t), producing the active place (i.e., a directional arc from t to p v ), and with all other literals both consumed and produced (i.e., a bidirectional arc).Conversely a transition is added from the active place to the inactive place for each conjunct of the negation of that function.Let s be a state of the Boolean network and M s be its corresponding marking in the encoded Petri net.It holds that ∀v ∈ V , Note also that at any marking M of the Petri net encoding a Boolean network, it always holds that The main property of this encoding is that it is completely faithful with respect to the update scheme of the original Boolean network.For each node v of N , only transitions corresponding to v can change the current marking of p v or p v .In addition, at any marking at most one of such transitions is enabled because M (p v )+M (p v ) = 1 holds.Hence, for any update scheme in N , we have a corresponding firing scheme in P, which preserves the equivalence between the dynamics of N and P [26].
For illustration, let us reconsider the Boolean network shown in Example 2.1.Figure 1(c) shows the Petri net encoding of this Boolean network.
Place p x 1 (resp.p x 1 ) in P represents the activation (resp.the inactivation) of node x 1 in N .Marking {p x 1 , p x 2 } in P represents state 10 in N .Transitions t 1 x 1 and t2 x 1 represent the update of node x 1 .Of course, in any marking t 1 x 1 and t 2 x 1 cannot be both enabled.Then, the fully asynchronous update scheme in N corresponds to the classical firing scheme in P where only one of the enabled transitions for a given marking will be fired [12].
Note that given a Boolean network in the standard SBML-Qual format [27], i.e., the package of SBML v3 [28] for such models, one can easily obtain its Petri net encoding in the Petri Net Markup Language (PNML) 2 standard using the bioLQM3 library.This piece of software extracted from GINsim [29] and part of the CoLoMoTo4 [30] software suite allows for easy conversion between standard formats.It also accepts many other common formats for Boolean networks, notably the .bnetfiles of the BoolNet [31,21] tools.The conversion is executed as follows: java -jar GINsim.jar-lqm <input.{sbml,bnet,...}> <output.pnml> Note that transforming a Boolean network defined by its functions into its Petri net encoding roughly relies on obtaining conditions for the activation and inactivation of the states.In [24] this took the form of the whole truth table of the Boolean functions, but as shown in Appendix 1 of [23] computing Disjunctive Normal Forms (DNF) of each Boolean function is enough.
Though this might appear quite computationally intensive it is important to remark first that contrary to the prime implicants case, there is no need to find minimal DNFs.One way to look at this is to consider that this amounts to a similar approach as that used in [8] but with the encoding of both activation and inhibition functions as DNFs in order to take into account possible non-local-monotonicity.This does not change the worst-case-complexity (obtaining a single DNF being exponential) but might matter a lot in practice.
As such, we will explore how this transformation, here using BDDs in bioLQM or directly in our tool using the pyeda5 library, and the one based on the most-permissive semantics compare with each other in Section 6.

Siphons
Siphons are a static and classical property of Petri nets [11].Note however that the use of siphons for the analysis of biological models, though it is not new, has been mostly relevant to the ODE-based continuous semantics of chemical reaction networks [32,33,34].We recall here the basic definition establishing that to produce something in a siphon you must consume something from the siphon.This corresponds to the idea that a siphon is a set of places that once unmarked remains unmarked.
Note that ∅ is trivially a siphon.
Proposition 2.1.A set S of places is a siphon of a Petri net (P, T, W ) if and only if pred(S) ⊆ succ(S).

Trap spaces as conflict-free siphons
First let us associate subspaces and sets of places in the Petri net encoding.
Definition 3.1.Let m be a subspace of Boolean network N = (V, F ).A mirror of m is a set of places S in the Petri net encoding P of N such that: and Now, we add a definition related to any set of places of a Petri net encoding a Boolean network, and notably a siphon of such a net.

Definition 3.2. A set of places of Petri net P encoding Boolean network
N is conflict-free if it does not contain any two places corresponding to the active and inactive states of the same node of N .Then, a conflict-free siphon S is said to be maximal if and only if there is no other conflict-free siphon Intuitively, a siphon is a set of places that once unmarked remains so.If it is conflict-free it is possible to associate a subspace to it, more precisely it is the mirror of a subspace.Since it is a siphon, the fixed values will remain so whatever update happens, as the unmarked places remain unmarked.The subspace corresponding to that conflict-free siphon is therefore a trap space, and the maximality of the siphon is equivalent to the minimality of the trap space (as many fixed values as possible).For example, the Boolean network given in Example 2.1 has two trap spaces, m 1 = 11 and m 2 = ⋆⋆.The Petri net encoding of this Boolean network has five generic siphons, S 1 = ∅, However, only S 1 and S 4 are conflict-free siphons and correspond to m 2 and m 1 , respectively.Since S 1 ⊂ S 4 , S 4 is a maximal siphon corresponding to the minimal trap space m 1 .Hereafter, we formally prove that a (maximal) conflict-free siphon is equivalent to a (minimal) trap space.
Theorem 3.1.Let N = (V, F ) be a Boolean network and P be its Petri net encoding.A subspace m is a trap space of N if and only if its mirror S is a conflict-free siphon of P.
Proof.First, we show that if m is a trap space of N , then S is a conflict-free siphon of P (*).
If D m = ∅, then S = ∅ is trivially a conflict-free siphon of P. Thus, we consider the case that D m ̸ = ∅ (resp.S ̸ = ∅).Assume that S is not a siphon of P.Then, there is a transition t ∈ T such that S ∩ succ(t) ̸ = ∅ but S ∩ pred(t) = ∅.This implies that there is a place p ∈ S such that p ∈ succ(t) but p ̸ ∈ pred(t).Let v be the node in N corresponding to p.By the characteristics of the encoding [24], there is a directional arc from t to p and a directional arc from the complementary place of p to t.Without loss of generality, we assume that p = p v , then there is a directional arc from t to p v and a directional arc from p v to t.
We follow the following procedure to find a state s ∈ S N [m] such that where M s is the corresponding marking in P of s.
For every place p ′ ∈ pred(t), let p ′′ be the complementary place of p ′ and v ′ be the corresponding node in N of p ′ and p ′′ .
If p ′′ ̸ ∈ S, then v ′ ̸ ∈ D m and we can always set the Boolean value to For the remaining nodes of N , we can always set Boolean values to these nodes to preserve that s ∈ S N [m] by applying the same procedure.We also have M s (p v ) = 0 by the characteristics of the encoding [24] (and Definition 3.1).Now, t is enabled at marking M s .Its firing leads to a new marking For any firing scheme of P, the firing of t always happens.Since a firing scheme of P is equivalent to an update scheme of N , s can escape from the trap space m for any update scheme of N , which contradicts to the property of a trap space.Hence, S is a siphon of P. By the definition of a mirror, S is also a conflict-free one.
Second, we show that if S is a conflict-free siphon of P, then m is a trap space of N (**).
By the definition of a mirror, m is a subspace of N .Let s be an arbitrary state in S N [m] and M s be its corresponding marking in P. Assume that there is a place by the characteristics of the encoding [24].By the which is a contradiction.
It is symmetric for the case that p = p v .Hence, M s (p) = 0, ∀p ∈ S. In any marking M ′ s reachable from M s regardless of the firing scheme of P, we have M ′ s (p) = 0, ∀p ∈ S by the dynamical property on markings of a siphon [35].
we have all two cases as follows.Case 1: . By the definition of a trap space and the arbitrariness of s, m is a trap space of N .
Note that this proof gives us as corollary a well-known result on trap spaces.
Corollary 3.1.Trap spaces of a Boolean network are independent of the update scheme.
Proof.From the proof of Theorem 3.1, we can see that the theorem holds for any update scheme associated to the Boolean network.Since the Petri net encoding of a Boolean network is independent of its update scheme and siphons are a static property of a Petri net, we get that trap spaces of a Boolean network are independent of its update scheme.
Note that the original proof for this property of trap spaces (see Theorem 1 of [7]) only considers the two popular update schemes (i.e., synchronous and fully asynchronous).Theorem 3.1 exhibits the very first theoretical application of the connection between trap spaces of Boolean networks and siphons of Petri nets.
Theorem 3.2.Let N be a Boolean network and P be its Petri net encoding.
A subspace m is a minimal trap space of N if and only if its mirror S is a maximal conflict-free siphon of P.
Proof.First, we show that if m is a minimal trap space of N , then S is a maximal conflict-free siphon of P (*).Since m is a trap space of N , S is a conflict-free siphon of P by Theorem 3.1.Assume that S is not maximal.Then, there is another conflict-free siphon S ′ such that S ⊂ S ′ .
By Theorem 3.1, there is a trap space m ′ corresponding to S ′ .Following the , thus m ′ < m.This contradicts to the minimality of m.Hence, S is a maximal conflict-free siphon of P.
Second, we show that if S is a maximal conflict-free siphon of P, then m is a minimal trap space of N (**).Since S is a conflict-free siphon of P, m is a trap space of N by Theorem 3.1.Assume that m is not minimal.From (*) and (**), we can conclude the proof.
We here showcase a theoretical application of the connection between trap spaces in Boolean networks and conflict-free siphons in Petri nets.We use it to prove a property of minimal trap spaces, which has surprisingly not been formally proved.Specifically, all minimal trap spaces of a Boolean network are mutually disjoint.This property is important because it can benefit attractor identification of Boolean networks.Specifically, in [36], the authors use random walks inside each minimal trap space to obtain approximations for attractors of a Boolean network under the fully asynchronous update scheme, then they use CTL model checking to verify the quality of the approximations.In [37], the authors use the set of minimal trap spaces as a seed to speedup their previous attractor identification method that relies on feedback vertex sets and reachablity analysis.The soundness of the two above approaches comes from the separation of minimal trap spaces.
Note that it would be not difficult to obtain a direct proof on trap spaces for this property, which follows the same structure as the proof on siphons.
However, we emphasize here the potential of using the connection between Boolean networks and Petri nets to explore and prove properties of trap spaces in Boolean networks.Consider two any distinct minimal trap spaces m 1 and m 2 .Assume that Let S 1 and S 2 be the mirrors of m 1 and m 2 , respectively.By Theorem 3.2, S 1 and S 2 are maximal conflict-free siphons of P. We have that S = S 1 ∪ S 2 is also a siphon because of Proposition 2.1.For every node v ∈ V , assume that p v ∈ S and p v ∈ S hold.
Since S 1 and S 2 are conflict-free, there are all two cases.Case 1: and p v ∈ S 2 .Case 2: p v ∈ S 2 and p v ∈ S 1 .These two cases lead to This is a contradiction.Hence, for every node v ∈ V , p v ∈ S and p v ∈ S cannot hold together.Therefore, S is conflict-free.Now, we have that S is a conflict-free siphon but S 1 ⊂ S or S 2 ⊂ S holds because S 1 ̸ = S 2 .This contradicts to the maximality of S 1 and S 2 .Hence, A natural computational application of Theorem 3.1 is that we can efficiently decide whether a subspace m is a trap space.In PyBoolNet [21], this is checked by using the percolation on the prime implicants of the Boolean functions.As we have mentioned at the beginning of this article, the computation of prime implicants is a demanding task for complex Boolean networks, even is sometimes intractable.Hence, the checking method in [21] shows its Note that there are no existing methods specifically designed for computing maximal conflict-free siphons (even maximal generic siphons) of a Petri net.The reason might be that researchers mainly focus on minimal generic siphons [35] in the field of Petri nets.While adapting those methods to obtain minimal conflict-free siphons would sometimes be possible, the switch from minimality to maximality is quite a leap.Hence, we here propose several methods for computing maximal conflict-free siphons of a Petri net.The details of the proposed methods shall be given in the next section.

Computation methods
First, we discuss the complexity of siphon computation in Petri nets.
Siphons are a prominent concept in the field of Petri nets, but unfortunately there are very few studies focusing on the complexity aspect.In this field, researchers mainly focus on practical methods for computing minimal generic siphons (also many related types) in general or special Petri nets and the applications of such types to the control of real-world systems modeled by Petri nets [35].The problem of finding a minimal siphon of a 1-safe Petri net is solvable in polynomial time [38].Clearly, the problem of finding a siphon of a 1-safe Petri net is also solvable in polynomial time.However, the problem of computing all (minimal) siphons is not easier than the problem of computing a (minimal) siphon but its complexity still not clear.Note that the number of siphons (even minimal siphons) can be exponential in the number of places of the Petri net [35].Moreover, there is no complexity result for the case of maximal siphons.Regarding the conflict-free siphons, we believe that the polynomial algorithm for computing a minimal generic siphon presented in [38] can be adapted to find a (minimal) conflict-free siphon.This is not in contrast to the NP-hardness of some problems on trap spaces in Boolean networks [39] because in general the number of transitions of the Petri net encoding of a Boolean network can be exponential in the number of nodes of this Boolean network.However, again the complexity of the problem of computing all (minimal/maximal) conflict-free siphons is still open.

Characterization
We here show the characterization of all conflict-free siphons of the encoded Petri net P = (P, T, W ). Suppose that S is a generic siphon of P.
If a place p should belong to S, then by Proposition 2.1 all the transitions in pred(p) must belong to succ(S).A transition t belongs to succ(S) if and only if there is at least one place p ′ in S such that p ′ ∈ pred(t).Hence, for each transition t ∈ pred(p), we can state that The system of all the rules of the above form with respect to all pairs (p, t) where p ∈ P, t ∈ T, t ∈ pred(p) fully characterizes all generic siphons of a Petri net and has been used with SAT solvers in [16,17].To make S to be a conflict-free siphon, we need to add to the system the rule for each node v ∈ V .By definition, the final system fully characterizes all conflict-free siphons of the encoded Petri net.

Constraint satisfaction problem
A Constraint Satisfaction Problem (CSP) is defined by a triple giving its variables, their domains, and the constraints on those variables.The following Boolean CSP directly derives from the above characterization: • D(p) = B for all p ∈ R, i.e., the variables are Boolean, Proposition 4.1.C(P) is satisfied by a valuation r if and only if is a conflict-free siphon of P.
Proof.By the former part ¬p v ∨¬p v = 1 of C, the conflict-freeness is imposed because for any satisfable valuation r, r(p v ) = r(p v ) = 1 is impossible for all v ∈ V .As shown in [17], the latter part of C can characterize the set of all generic siphons of P. Hence, we can conclude the proof.
In [17], the set of all siphons of a given Petri net is characterized by a similar Boolean CSP except the conflict-freeness constraint.From the encoded CSP, the set of all minimal siphons of the Petri net can be enumerated in the set inclusion order.For enumerating siphons in the set inclusion order, the method proposed in [17] uses the technique that labels directly the Boolean variables with increasing value selection (i.e., to test first the absence, then the presence of a place in the candidate solution).The method has two implementations, one uses an iterated SAT procedure and the other uses Constraint Programming (CP) with backtracking.
One natural question is that how to use the CSP-based method for enumerating all the maximal conflict-free siphons of a Petri net encoding a Boolean network?Of course, the set of all conflict-free siphons of the Petri net can easily characterized by the CSP model presented in [17] along with the additional constraint ¬p v ∨ ¬p v = 1, for each v ∈ V , which represents the conflict-freeness.However, the main concern is to enumerate all the maximal ones, which is not trivial to adapt from the CSP-based method.
By Proposition 4.1, the set of all maximal conflict-free siphons of P can be enumerated in the (maximality) set inclusion order, by restarting the search each time a conflict-free siphon S is found, with the following additional constraint for disallowing any subset of that conflict-free siphon: p̸ ∈S p = 1.
For enumerating conflict-free siphons in the set inclusion order, we can use the same technique as used in [17] but with the opposite setting, i.e., labeling directly the Boolean variables with decreasing value selection.The correctness of this technique comes from the fact that once S is found, it is the conflict-free siphon of maximum cardinality among all the remaining feasible conflict-free siphons.Similar to [17], the newly CSP-based method can also be implemented with SAT and CP solvers.
This method was implemented using the state-of-the-art CP solver Chuffed6 [40] via its MiniZinc [41] interface.Because it is a high-level interface, the backtrack-and-replay method of [17] was not used but rather the alternative implementation with two global constraints for lexicographic ordering (ensuring enumeration of solutions) and iterated non-subset of each already found solution (for maximality).
For the SAT-based method, however a more direct method is to use a MaxSAT solver.We construct a MaxSAT problem with the following hard clauses: We set a soft clause for each variable of the CSP and then use a "minimal correction subset" blocking strategy, which will ensure set-inclusion maximality of the solutions.We implement this approach by using the RC2 MaxSAT solver [42] available through the python-sat package7 .

Answer set programming-based method
Another possible method is to translate the characterization shown in Subsection 4.1 into the ASP L as follows.We introduce atom p-v (resp. n-v) to denote place p v (resp.p v ), ∀v ∈ V .The set of all atoms in L is given as A = v∈V {p-v, n-v}.For each pair (p, t) where p ∈ P, t ∈ T, t ∈ pred(p), we translate the rule (1) into the ASP rule a_1; ... ; a_k :-a.
where a ∈ A is the atom representing place p and {a_1, . . ., a_k} ⊆ A is the set of atoms representing places in pred(t).The rule (2) is translated into the ASP rule for each v ∈ V .This ASP rule guarantees that two places representing the same node in N never belong to the same siphon of P, representing the conflict-freeness.Naturally, a Herbrand model (see, e.g., [43]) of L is equivalent to a conflict-free siphon of P. To guarantee that a Herbrand model is also a stable model (an answer set), we need to add to L the two choice rules {p-v}.{n-v}.
for each v ∈ V .Note that the number of atoms of L is only 2n, whereas the ASP encoding shown in [7] has as many atoms as the number of prime implicants of the Boolean network and that number might be exponential in n.In [8], there is an ASP characterization of trap spaces that does not rely on minimal DNFs either and thus seems very similar to our ASP encoding.
Remarkably it only requires the DNF for the activation part, using the information that it will only be used for locally-monotonic Boolean networks.
We would therefore expect that, when available, it will have comparable performance on the ASP part (the ASP program would be approximately twice smaller, though redundancy is not always bad in that field), but can also avoid combinatorial explosion of the Petri net encoding for some formula where the activation DNF is simple but the inhibition is not.Since mpbn is included in our benchmark this will be evaluated in our experiments.Now, a solution (simply an answer set) A ⊆ A of L is equivalent to a conflict-free siphon S of P, thus a trap space m of N .The conversion from ing multiple answer sets is built into ASP solvers and the solving collection POTASSCO [43] also features the option to find set-inclusion maximal answer sets with respect to the set of atoms.Naturally, a set-inclusion maximal answer set of L is equivalent to a maximal conflict-free siphon of P, thus a minimal trap space of N .By using this built-in option, we can compute all the set-inclusion maximal answer sets of L (resp.all the minimal trap spaces of N ) in one execution.

Integer linear programming-based method
We first show how an Integer Linear Programming (ILP) I can define a set of all conflict-free siphons of the encoded Petri net P. We introduce for each v ∈ V .This inequality forbids both p-v and n-p receive the value 1, thus representing the conflict-freeness.Since we only consider feasible solutions, the objective function is set to max p-v for some v ∈ V .Naturally, a solution I of I is equivalent to a conflict-free siphon S of P. The conversion is that where a-p is the binary variable presenting place p.
We can see the similarity between I and the encoded ASP shown in the previous subsection.However, due to the nature of solutions of an ILP, it is hard to compute all the set-inclusion maximal solutions of I in one execution of an ILP solver.Hence, we propose an iterative approach as follows.
The conflict-free siphon of maximum cardinality is of course maximal.
Therefore, we impose the following objective function: Now, I can be solved using a general purpose ILP solver.If it admits any solution I * , the corresponding conflict-free siphon (say S * ) is maximal.Hence, it makes sense that it does not need to find any other conflict-free siphon of the net that is strictly contained in S * .To do this, we add to I a new inequality where a-p is the binary variable presenting place p. Now, we solve I again to find a new solution.If a new solution I ′ exists, then let S ′ be its corresponding conflict-free siphon.Indeed, abide by the newly added inequality, we have S ′ ∩ (P \ S * ) ̸ = ∅ because there is some a-p with p ∈ P \ S * such that I ′ (a-p) = 1.This implies that it is impossible that S ′ = S * or S ′ ⊂ S * .
By the objective function, it means that S ′ is the conflict-free siphon of maximum cardinality among the conflict-free siphons that are not contained in S * .Hence, S ′ is also a maximal conflict-free siphon.Again, we add to I a new inequality with respect to the newly found siphon.The above process is iterated until I becomes unfeasible, this means that there is no further maximal conflict-free siphon.Thus, all the maximal conflict-free siphons of the Petri net have been found.
Since we used the MiniZinc framework to interface with the CP solver, it was simple to make the slight modifications described above and to use that same interface to call the Coin-OR CBC solver8 [44].

Computation of special types of trap spaces
In the field of systems biology, biologists may want to compute more special types of trap spaces beyond minimal trap spaces [21], which also play crucial roles in analysis and control of Boolean networks [22,19].We shall show that our proposed methods can be easily adjusted to compute such popular types of trap spaces.We illustrate the adjustments via the ASPbased method (see Subsection 4.3) because ASP is declarative by nature, but these adjustments are completely applicable for other approaches such as MaxSAT, CP, and ILP.
First, the work presented in [19] uses the concept of stable motifs to build the succession diagram of a Boolean network, a summary of the decisions in the network dynamics that lead to successively more restrictive nested stable motifs.The succession diagram is useful for control and decision making on this Boolean network.In particular, the proposed control methods are independent to the update scheme.Note that, in [19], the succession diagram is also used to identify all attractors of a Boolean network under the fully asynchronous update scheme.It has been shown that a stable motif of a Boolean network is equivalent to a maximal trap space of this Boolean network [19].Indeed, the computation of stable motifs is a bottleneck of the methods proposed in [19].Hence, it is necessary to develop an efficient method for computing maximal trap spaces of a Boolean network.We shall show how to adjust the ASP-method presented in Subsection 4. that ensures that every answer set of L cannot be empty.Then a set-inclusion minimal answer set of L is equivalent to a minimal conflict-free siphon of P, thus a maximal trap space of N .
Second, we consider fixed points in Boolean networks.To date, the analysis of the fixed points of a Boolean network remains a very useful tool in understanding the behavior of complex biological models not only due to the fact that in some cases the full computation of complex attractors remains intractable, but also because for many biological systems, the expected longterm behavior is not cyclic [45].Furthermore, the fixed point computation is also the crucial starting point for several state-of-the-art methods for computing complex attractors of Boolean networks [37].Let s be a fixed point of a Boolean network N .We have a subspace m corresponding to s as follows: that ensures that for every conflict-free siphon S, it contains either p-v or n-v for every v ∈ V .Equivalently, the trap space corresponding to S is always a fixed point.Now, the set of answer sets of the encoded ASP is equivalent to the set of fixed points of N .In particular, when solving the encoded ASP using an ASP solver, we do not need to use the built-in option for computing set-inclusion maximal answer sets.Note that we can also build another ASP characterizing all fixed points of N based on the equivalence between a fixed point of N and a deadlock of its Petri net encoding [23].This approach may give a more compact ASP.
Third, we consider the trap spaces intersecting a given subspace m * of a Boolean network.Such trap spaces (along with minimal trap spaces) are used in the phenotype control method [22].This method uses the prime implicant-based method [7,21] to compute trap spaces, which has been shown inefficient.Hence, having a more efficient method for computing such trap spaces can push the barrier previously existing in this control method.A trap space m intersects m * if and only if For the former case, we add to L the ASP rule that ensures that m(v) cannot be 1.For the latter case, we add to L the ASP rule that ensures that m(v) cannot be 0. Now L characterizes all trap spaces that intersect m * .
Finally, we consider the trap spaces that are inside a given subspace m * of a Boolean network.Such trap spaces are used in the iterative procedure of building the succession diagram of a Boolean network [19], which is hierarchical.We first adjust L to characterize all such trap spaces.A trap space we add to L the ASP rule that ensures that m(v) = 1.It is noted that if we want to compute maximal trap spaces inside m * , we need to exclude the conflict-free siphon corresponding m * from the solution space.Specifically, we need to add to L the ASP rule p-v_i1; n-v_i1; . . .; p-v_ik; n-v_ik.
where {v i 1 , . . ., v i k } is the set of free nodes of m * .This rule ensures that m ̸ = m * .In the case that m * = ε, we have all maximal trap spaces of the original Boolean network.

Motivating example
For a few years now we have been collaborating with biologists who build very large detailed and annotated maps and now wish to analyze the dynamics of the corresponding models.One of the main maps studied this way represents knowledge about the Rheumatoïd Arthritis [46], and was the main motivation for the development of a tool to automatically transform it into an executable Boolean network [6].In the supplementary material of the pa- In practice, even if there is a huge number of attractors in such a model, obtaining a sample of those can reveal very useful to invalidate the model and lead to further refinement.In particular, it provides a feature-rich alternative to random simulations for this type of very non-deterministic model.Being able to detect that there are inconsistencies with published experimental data in some of the first 1000 attractors, for instance, can lead to a much quicker Systems Biology loop: model, invalidate, refine.
However, using a state-of-the-art tool like PyBoolNet [7] on that model unfortunately fails at the phase of prime-implicant generation.mpbn [9] can return the first 1000 solutions within 1.43s, but indeed, it limits the modeling range of the modelers as it does not permit using non-locally-monotonic Boolean functions.This is also true for the Alzheimer model also mentioned in that same article and originally from [47] (F4 file in the original supplementary material, and "Alzheimer" in Table 2), where PyBoolNet also fails at the prime-implicant computation and mpbn does not give any answer because this model is actually non-locally-monotonic.The current practice usually revolves then around fixing some source nodes to plausible values and reducing the model accordingly.While this approach makes sense, it relies on potentially arbitrary decisions, and hides away critical modelling choices that were clearly not part of the original Boolean network or even of the starting map.
For the "RA apoptosis" model, using the ASP-based method presented in Subsection 4.3, it is now possible to obtain the first 1000 minimal trap spaces (including ones that contain more than one state) within 0.19s, which is much quicker than mpbn.The needed time for the "Alzheimer" model is 0.79s.

Evaluation
To evaluate the performance of the newly proposed methods (implemented as a Python package named Trappist and available on the Python package index 9 ) and the state-of-the-art methods (bioLQM10 , PyBoolNet ), we compared them on both PyBoolNet's own model repository and many real-world models from various sources in the literature.To our knowledge, these models are a highly representative sample of Boolean models currently available.It is worth noting that mpbn [9] only handles locally-monotonic models, whereas the other methods can handle general models.To obtain a more comprehensive comparison, we also used random models generated by a third-party software BoolNet R package [31].As explained in Section 5, in our benchmarks, we only searched for the first 1000 minimal trap spaces for each model.It is worth noting that unlike existing analysis shown in the literature, we did not fix specific values for source nodes in all the considered models.
To solve the ASP problems, we used the same ASP solver Clingo [43] and the same configuration as that used in PyBoolNet [7,21] and mpbn [9].Specifically, we used the configuration -heuristic=Domain -enum-mod=domRec -dom-mod=3 (subset maximality, equivalent to the deprecated --dom-pref=32 --heuristic=domain --dom-mod=7 used by PyBoolNet).We ran all the benchmarks on a machine whose environment is CPU: Intel® Core™ i9-11950H 2.60GHz × 16, 16 GB DDR4 RAM, Ubuntu 20.04.5 LTS.Finally, we set a time limit of three minutes for each model.).This iterative approach may be less efficient than the way ASP solvers use to enumerate multiple solutions (answer sets), which is an advantage of ASP solvers [43].Hence, when the number of solutions increases, the inferiority of Trappist-MaxSAT compared to Trappist-ASP will be exhibited more clearly.The two remaining variants, Trappist-CP and Trappist-ILP, are much less efficient than Trappist-MaxSAT and Trappist-ASP in every model, even are more than three orders of magnitude slower in some models.The first reason for their bad performance is that they are also iterative methods like Trappist-MaxSAT, thus they are not efficient for "enumeration" problems.Upon closer inspection, for the Boolean CSP characterizing conflict-free siphons, CP seems to be something that is a "less-efficient-SAT", handling mostly Boolean constraints and making little use of the global constraints only added for the iterative 11 https://github.com/hklarner/pyboolnet/tree/master/pyboolnet/repositorypart.For ILP, it may be even worse, since the problem is purely Boolean (no real or integer numbers whatsoever).This is confirmed by the observation that for some quite large models (e.g., the grieco mapk, zhang tlgl, and zhang tlgl v2 models), Trappist-ILP is much slower than Trappist-CP.
Note that the inferiority of ILP compared to ASP with respect to the trap space enumeration has been reported in [7].Hereafter, we shall compare the best variant of Trappist (i.e., Trappist-ASP) with other methods.
As shown in Table 1, for most of the models of the PyBoolNet repository, the results are comparable with all minimal trap spaces found very fast.However upon closer inspection, we can see some notable differences.
First, Trappist-ASP is far more efficient than bioLQM in every model with speedups between 5× and 16×.Second, for small models, PyBoolNet and mpbn are comparable to Trappist-ASP.However, on every model that was a bit challenging for PyBoolNet or mpbn, Trappist-ASP is far more efficient with speedups between 3× and 5× for the case of mpbn, and between 5× and 1783× for the case of PyBoolNet.In particular, the second best variant of Trappist (i.e., Trappist-MaxSAT) is even far more efficient than bioLQM and PyBoolNet, and is comparable to mpbn on every model.It is worth noting that for 3 of the 29 models, mpbn did not give any answer because these models are non-locally-monotonic but all the other methods did, which confirms the limit of mpbn on the applicable class of models.

BBM repository
The research group behind the BBM repository [48] has recently undertaken considerable effort for building a collection of real-world Boolean models from various sources used in systems biology.It aims to be a comprehensive collection suitable for benchmarking and testing new tools and methods.BBM consists of 211 models (24 out of them are non-locally-monotonic), peaking at 321 nodes, 1100 regulations among the nodes, and 133 source nodes, respectively.It is released and maintained at https://github.com/sybila/biodivine-boolean-models.We here tested all the compared methods on this model repository.first see that Trappist-ASP and Trappist-MaxSAT are still the two best methods as they can handle every model within 1s and always can handle more models than all the remaining methods on every time limit.Second, Trappist-CP is better than Trappist-ILP, which is consistent with their comparison shown in the previous subsection.Third, one notable remark is that for the time limit of 100s or 180s, Trappist-CP can handle more models than all bioLQM, PyBoolNet, and mpbn.This remark shows that even without focusing on the optimization of our implementation, our alternative approach is still better than the state-of-the-art methods on a certain set of real-world models.This is supported by the fact that our alternative approach avoids the need for computing prime implicants (as opposed to PyBoolNet) and can handle non-locally-monotonic Boolean networks (as opposed to mpbn).for the case of many minimal trap spaces.

Selected models
We used a set of real-world Boolean networks lying in various scales collected from numerous bibliographic sources in the literature.Most of these models are quite big (in size), complex (i.e., having high average in-degree, which is related to the number of prime implicants), and have never been fully analyzed.Note that these models are not included in the PyBoolNet and BBM repositories.We then applied bioLQM, PyBoolNet, mpbn, and the four variants of Trappist to computing minimal trap spaces of these realworld models.Fourth, regarding the comparison of the ASP-based methods (i.e., PyBoolNet, mpbn, and Trappist-ASP), we note that for all the models where PyBoolNet did not finish before the time limit, the timeout occurred during the computation of the prime implicants.Hence, not even a single minimal trap space was output by that method.For all the remaining models, once PyBoolNet went through the prime-implicant phase, its ASP solving phase quickly returned the first 1000 minimal trap spaces, all under one second.
Hence, with the experimental results shown in this subsection as well as the two previous subsections, the practical differences between the ASP encoding of Trappist-ASP and that of PyBoolNet are not distinctly exposed.The fact that our new ASP encoding is guaranteed to be linear in the number of nodes of the original model (see Subsection 4.3) does not seem to be crucial here, however a much deeper analysis of those cases shall be shown in the next subsection.

Randomly generated models
We randomly generated a set of N-K models [1] with network size n in the set {100, 150, 200, 250, 300, 350, 400} and in-degree K = 3 (i.e., each node has exactly three input nodes).We chose N-K models because they are a useful tool for studying the dynamics of Boolean networks [1,7,19].For each network size, 50 instances were generated using the generateRandomNKNetwork function.In total, we have 350 random models.We then applied the compared methods to these models and recorded the running time of each method for each model.It is worth noting that N-K models usually have small numbers of minimal trap spaces [7].Hence, we searched for all solutions in each model, which makes the comparison to bioLQM more comprehensive.In addition, each node has only three input nodes, leading to a small number of prime  Regarding locally-monotonic Boolean networks, the performance of mpbn is roughly comparable to that of Trappist-ASP or Trappist-MaxSAT.However, mpbn is quite slower than Trappist-ASP on average.This shows the practical advantage of Trappist-ASP compared to mpbn, though its ASP encoding may be more complex than that of mpbn in theory.

Conclusion
In this article we have explored and proved for the first time the equivalence between (minimal) trap spaces of a general Boolean network and (maximal) conflict-free siphons of its Petri net encoding.We have shown several useful applications of this finding to studying properties of trap spaces in Boolean networks.As an important practical application of the equivalence, we have proposed a new approach for the computation of minimal trap spaces in Boolean networks, based on the enumeration of maximal conflictfree siphons of Petri nets.We have also proposed four possible methods using MaxSAT, CP, ILP, and ASP for implementing the new approach.In particular, we have shown how to adjust our approach to compute several specific types of trap spaces (e.g., maximal trap spaces, fixed points), which besides minimal trap spaces also play crucial roles in the analysis and control of Boolean networks.The proposed methods for the minimal trap space computation have been evaluated on many real-world models from the literature as well as randomly generated models.The experimental results show that the new approach vastly outperforms all the state-of-the-art methods in terms of general Boolean networks and is comparable to the mpbn method even much better on average in terms of locally-monotonic Boolean networks.We believe that this opens up the way to a much better analysis of large Boolean networks, which is needed with the advent of automatic model-generation pipelines [60].
Although the experimental results show the superiority of our approach to mpbn in general, we however note that there is a model in the BBM repository (with identifier 122) where all the four proposed methods for the new approach did not manage to finish the Petri net conversion before the timeout, whereas mpbn can still handle this model.The model is not very large but its Boolean functions are rather complicated.This points to the fact that our current choice of using a BDD-based translation to obtain that Petri net encoding, though it provides a small/efficient ASP might be too costly to handle the complex models.In such a case, a more naive encoding might provide a much larger ASP program, with many redundant rules, but easier/faster to obtain.The evaluation of the feasibility of such strategy, and of its impact on smaller instances, remains to be done.Recognizing that a model is locally-monotonic and applying in that specific case dedicated strategies as those of mpbn might also be a partial solution.
Another direction to speed up our approach in the side of Boolean networks is to apply reduction techniques to the original Boolean network.Many reduction techniques on Boolean networks [61,62] have been proposed and some of them fully preserve attractors of a Boolean network under the fully asynchronous update scheme.In particular, a reduction technique on elimination of negatively auto-regulated nodes with respect to asynchronous attractors has recently been proposed [62].However, there are two major issues needed to be considered.First, the question of whether these reduction techniques fully preserve minimal trap spaces of a Boolean network is still open.
Second, although these reduction techniques can reduce the number of nodes, they can also increase the complexity of Boolean update functions [61], which is also an important factor for the performance of computation methods.It raises the question of whether they really simplify the computational burden of trap space computation.We will deeply investigate the two issues.Furthermore, we believe that the connection between trap spaces and siphons can be a very useful tool for addressing the first issue.
It is worth noting that there may be possibly other methods for computing minimal/maximal conflict-free siphons in Petri nets, like the methods for generic siphon computation in the field of Petri nets (see [35] for a survey about these methods).Although these approaches do not directly support the minimal/maximal conflict-free siphon computation now, we plan to investigate them in the future.In particular, several approaches based on the network structure at the Petri net level (e.g., the decomposition approaches [63,64] for identifying minimal generic siphons) can be adapted to help the identification of minimal conflict-free siphons.Making use of the specific structure (1-safe, place-complementary) might also reveal new techniques to be considered.It is potentially possible because in the field of Petri nets, most of the methods for identifying minimal generic siphons focus on various net classes with special structures [35].The above potential approaches could replace our proposed methods if they give significantly better performance.However, the current methods appear to already perform very well even on the biggest models we have considered.
Finally, we think that the links between Petri nets and Boolean networks that we stumbled upon in this article might have deeper roots.Exploring those connections might lead both to interesting topics of research for Petri nets, like a notion of trap-spaces, and for Boolean networks.We also believe that the connection between trap spaces of Boolean networks and siphons of Petri nets can be a very useful tool for exploring and proving more new properties of trap spaces in Boolean networks, as we have used it to successfully prove the independence of trap spaces to the update scheme and the separation of minimal trap spaces.Diving into this direction is promising and one of our future work.
For example, m = ⋆ ⋆ 1 (for simplicity, we shall write subspaces likes states as a sequence of values) means that D m = {v 3 }, m(v 3 ) = 1, and it is equivalent to the set of states {001, 011, 101, 111}.We denote S ⋆ N = (B ∪ {⋆}) n the set of all possible subspaces of N .Note that |S ⋆ N | = 3 n and S N ∈ S ⋆ N [7].

Figure 1 (
Figure 1(b) shows the dynamics of this model under the fully asynchronous update scheme (i.e., only one node is updated at each time step).The model has all two trap spaces, m 1 = 11 and m 2 = ⋆⋆.Since m 1 < m 2 , m 1 is the only minimal trap space of the Boolean network.
Petri net encoding of the model.Circles denote places, whereas rectangles denote transitions.

Figure 1 :
Figure 1: Influence graph, dynamics, and Petri net encoding of the Boolean network of Example 2.1.

Definition 2 . 2 .
A Petri net is a weighted bipartite directed graph (P, T, W ), where P is a non-empty finite set of vertices called places, T is a non-empty finite set of vertices called transitions, P ∩T = ∅, and W : (P ×T )∪(T ×P ) → N is a weight function attached to the arcs.
Then, there is another trap space m ′ such that m ′ < m.By the definition of the partial order < on subspaces, S N [m ′ ] ⊂ S N [m].Let S ′ be the mirror of m ′ .S ′ is a conflict-free siphon by Theorem 3.1.Following the definition of a mirror, S ⊂ S ′ , which contradicts to the maximality of S. Hence, m is a minimal trap space of N .

Theorem 3 . 3 .
Let N = (V, F ) be a Boolean network.For any two distinct minimal trap spaces m 1 and m 2 of N , we have thatS N [m 1 ] ∩ S N [m 2 ] = ∅.Proof.Let P be the Petri net encoding of N .If N has only one minimal trap space, then the theorem trivially holds.Note that by Theorem 3.2, N always has at least one minimal trap space because P has at least one maximal conflict-free siphon.Hence, we consider the case that N has at least two minimal trap spaces.
limitations.Instead, we can first compute the mirror S m of m in the Petri net encoding.Then, by Proposition 2.1 and Theorem 3.1, we can check if pred(S m ) ⊆ succ(S m ).Note that the Petri net construction is less computationally demanding than the prime-implicant computation because it only requires computing generic (not prime) implicants of the Boolean functions[23].In addition, the worst case time complexity of the above checking method is quadratic in the number of transitions of the Petri net.Furthermore, by Theorem 3.2, we can reduce the problem of computing all minimal trap spaces of a Boolean network to the problem of computing all maximal conflict-free siphons of its Petri net encoding.Note that in the case of special types of trap spaces (e.g., fixed points), this can be put in regard to special types of siphons in Petri nets.See Subsection 4.5 for more discussions about many special types of trap spaces.It might actually be possible to generalize our result to any 1-safe place-complementary (i.e., places are defined by pairs such that the markings are complementary) Petri net to define a notion of trap spaces that might be useful for the analysis of Petri nets, but this is out of the scope of the present article.Note also that conversely, investigating static analyses on such 1-safe place-complementary nets might allow for a more efficient computation of their siphons and hence of trap spaces.

Definition 4 . 1 .
Given a Petri net P = (P, T, W ) encoding a Boolean network N = (V, F ).The CSP C(P) is the triple (R, D, C) where • R = P , i.e., a variable is introduced for each place of P, 3 to compute maximal trap spaces.We first provide the definition of maximal trap spaces.Let ε be the special trap space of N where all the nodes are free.Of course, ε corresponds to the special conflict-free siphon ∅.A trap space m is called maximal if m ̸ = ε and there is no other trap space m ′ such that m ′ ̸ = ε and m < m ′ .Analogously, a conflict-free siphon S is called minimal if S ̸ = ∅ and there is no other trap space S ′ such that S ′ ̸ = ∅ and S ′ ⊂ S. By using the reasoning similar to the proof of Theorem 3.2, we can easily conclude that a maximal trap space of N is equivalent to a minimal conflict-free siphon of its encoded Petri net P. Let L be the ASP characterizing all conflict-free siphons of P (seeSubsection 4.3).Naturally, we need to exclude ∅ from the solution space of L (equivalently exclude ε from the set of trap spaces).To do this, we add to L the ASP rule p-v_1; n-v_1; . . .; p-v_n; n-v_n.
all nodes are fixed in m.Clearly, s is a trap set of N regardless of the update scheme.Hence, m is a trap space of N .In addition, since |S N [m]| = 1, m is also a minimal trap space.To compute all fixed points of N , we can add more constraints to the encoded ASP characterizing all conflict-free siphons (equivalently trap spaces).For every v ∈ V , we add to the encoded ASP the rule p-v; n-v.
per, an excerpt of the map, focused around the apoptosis (cell death) module is transformed into a model of reasonable size, namely 180 Boolean variables (model F5_RA_apoptosis_executable_module.sbml of supplementary material S3, and model "RA apoptosis" of Subsection 6.3).The study of such model, though, is a big hurdle.Indeed, as stated in the article about another model of the same size: "The size of the CaSQ-inferred MAPK model (181 nodes) made the calculation of stable states a non-realistic endeavour."

Figure 2 (Figure 2 :
Figure 2 (upper panel) shows cumulative numbers of the BBM models that have less than 1000 minimal trap spaces solved by the compared methods with respect to enumerating the first 1000 minimal trap spaces.The number of such models is 134 (per all 211 models), and 15 of them are non-locallymonotonic.This model set allows us to fairly consider bioLQM for comparison, since bioLQM always requires to compute all minimal trap spaces.We can

Figure 2 (
Figure 2 (lower panel) shows cumulative numbers of the BBM models solved by the compared methods (except bioLQM, Trappist-CP, and Trappist-ILP) with respect to enumerating the first 1000 minimal trap spaces.We omit the results of Trappist-CP and Trappist-ILP because they can handle no model with more than 1000 minimal trap spaces.Again, we can see that Trappist-ASP and Trappist-MaxSAT are the two best methods as theycan handle every but one model within 5s.They also always handle many more models than both PyBoolNet and mpbn on every time limit.Note that with the time limit of 0.5s, Trappist-ASP can handle 14 more models than Trappist-MaxSAT, which is opposed to the case of models with less than 1000 minimal trap spaces (see Figure2(upper panel)).This observation confirms the disadvantage of Trappist-MaxSAT compared to Trappist-ASP

904Second,
Trappist-ASP (even Trappist-MaxSAT) is far more efficient than both bioLQM and PyBoolNet on every model where the comparison is possible.For most models, the speedups of Trappist-ASP compared to bioLQM and PyBoolNet are between one and three orders of magnitude.This again confirms the superiority of Trappist-ASP compared to the other methods that can handle general Boolean networks.Third, for 11 of the 32 models (more than 34%), mpbn did not give any answer because these models are non-locally-monotonic.For 21 of the 32 models where mpbn returned the answers, mpbn and Trappist-ASP are roughly comparable in computation time, but mpbn appears quite slower on average.In particular, for the Rho-GTPases model, mpbn is 577× slower than Trappist-ASP.This observation along with the comparisons between mpbn and Trappist-ASP in the previous subsections are quite surprising because the ASP encoding of mpbn only requires the DNF for the activation part of a Boolean function, whereas that of Trappist-ASP requires both the activation and inhibition parts (see Subsection 4.3).However, the reason may lie on the differences in the ASP encoding characteristics of the two methods and the fact that mpbn needs to spend time checking the local-monotonicity of each Boolean function in a Boolean network.We expect that mpbn may outperform Trappist for a certain set of models, but not for the set of real-world models considered in this article.

Figure 3 :
Figure 3: Cumulative numbers of random models solved by the compared methods with respect to enumerating all the minimal trap spaces.

Figure 3
Figure3shows cumulative numbers of random models solved by the compared methods with respect to enumerating all the minimal trap spaces.The number of succeeded models within three minutes for each method is: bioLQM binary variable p-v (resp.n-v) to denote place p v (resp.p v ), ∀v ∈ V .The set of all binary variables in I is v∈V {p-v, n-v}.For each pair (p, t) where

Table 1
shows the experimental results on the models from the official PyBoolNet repository11.Column n denotes the number of nodes of each model.Column |M | denotes the number of minimal trap spaces and for each method is given the computation time in seconds, asking only for the first 1000 minimal trap spaces."NF"means that the method did not finish the computation within the time limit of three minutes.In the case of bioLQM, "N/A" means that the number of all minimal trap spaces of the model is larger than 1000 and we did not record the running time of bioLQM because it always requires to compute all minimal trap spaces.A number in bold indicates a ratio greater than three compared to the best result."NM"indicates a non-locally-monotonic model.There are four variants of Trappist: SAT (i.e., Trappist-MaxSAT, the MaxSAT-based method shown in Subsection 4.2), CP (i.e., Trappist-CP, the CP-based method shown in Subsection 4.2), ILP (i.e., Trappist-ILP, the ILP-based method shown in Subsection 4.4), and ASP (i.e., Trappist-ASP, the ASP-based method shown in Subsection 4.3).We first analyze the results of the four variants of Trappist.We can see that Trappist-MaxSAT and Trappist-ASP are comparable in most models, but Trappist-ASP is much faster for the jaoude thdiff and selvaggio emt models where the number of minimal trap spaces is greater than 1000.The latter can be explained by the fact that Trappist-MaxSAT follows an iter- Table 2 shows the obtained experimental results.A number in bold indicates a ratio greater than or equal to 10 compared to the best result.The remaining notations are similar to those in Table 1.Hereafter, we analyze in detail the results with respect to minimal trap space computation.