Ferdinanda Camporesi

Thèse De Doctorat

Mme Yang

M Giacobazzi

François M Fages

M Feret

M Harmer

M Thieffry

Denis Éns

Soutenue par

Keywords: Was sich überhaupt sagen lässt, lässt sich klar sagen; und wovon man nicht reden kann, darüber muss man schweigen Signaling pathways, abstract interpretation, rule-based modeling, model reduction, bisimulations, information flow

Le comportement d'une cellule dépend de sa capacité à recevoir, propager et intégrer des signaux, constituant ainsi des voies de signalisations. Les protéines s'associent entre elles sur des sites de liaisons, puis modifient la structure spatiale des protéines voisines, ce qui a pour effet de cacher ou de découvrir leurs autres sites de liaisons, et donc d'empêcher ou de faciliter d'autres interactions.

En raison du grand nombre de différents complexes biomoléculaires, nous ne pouvons pas écrire ou générer les systèmes différentiels sous-jacents. Les langages de réécritures de graphes à sites offrent un bon moyen de décrire ces systèmes complexes. Néanmoins la complexité combinatoire resurgit lorsque l'on cherche à calculer de manière effective ce comportement. Ceci justifie l'utilisation d'abstractions.

Nous proposons deux méthodes pour réduire la taille des modèles de voies de signalisation, décrits en Kappa. Ces méthodes utilisent respectivement la présence de symétries parmi certains sites et le fait que certaines corrélations entre l'état de diffé r e n t e s p a r t i e s d e s c o m p l e x e s b i o m o l é c u l a i r e s n ' o n t p a s d'impact sur la dynamique du système global. Des sites qui ont la même capacité d'interaction sont liés par une relation de symétrie. Nous montrons que cette relation induit une bisimulation qui peut être utilisée pour réduire la taille du modèle initial. L'analyse du flot d'information détecte les parties du système qui influencent le comportement de chaque site. Ceci nous autorise à c o u p e r l e s e s p è c e s m o l é c u l a i r e s e n p e t i t s m o r c e a u x p o u r é c r i r e u n n o u v e a u système. Enfin, nous montrons comment raffiner cette analyse pour tenir compte d'information contextuelle.

Les deux méthodes peuvent être combinées. La solution analytique du modèle réduit est la projection exacte de la solution originelle. Le calcul du modèle réduit se fait au niveau des règles, en évitant l'exécution du modèle initial.

Context and motivation

The behaviour of a cell is driven by its capability to receive, propagate and communicate signals. These communications are carried out by interactions between proteins. Proteins can bind together on some binding sites and modify their spatial structure. This can reveal or hide some binding sites, so new communications can be allowed or existing ones can be inhibited. Signalling pathways gather several interactions that describe how a specific signal induces the activation of a given protein. Since each protein has several interaction sites, these systems suffer from combinatorial complexity. This has several impacts and makes these systems very hard to be represented and simulated.

We are interested in mechanistic models that reflect in a direct way the underlying mechanisms in the systems we study. A common way to represent the knowledge we have on this kind of systems is by the means of pathway maps. A pathway map is a graph where each node represents a protein, a bio-molecular complex (that we call a species) or a pattern, and each arc represents some kind of interaction described in some informal language. Pathway maps supply a good way to organise knowledge but no formal semantics is associated with them. Another approach is based on the use of systems of ordinary differential equations (ODEs). Generally each variable denotes the concentration of some species and the system describes the way the variables evolve in time. Since the number of species is huge it is impossible to write the system and a lot of simplifications are made. Typical solutions are to neglect some species or to quotient some others. The way these simplifications are made is often not so clear and once that the model is written we cannot assign it a meaning. So it is not even possible to update 2 CHAPTER 1. INTRODUCTION them. Furthermore, a model should not be considered as a single entity. We are indeed more interested in families of models corresponding to some variations of common meta-models. Then, it is important to ease the navigation between models in order to test various sets of assumptions about mechanistic details [START_REF] Basso-Blandin | A knowledge representation meta-model for rule-based modelling of signalling networks[END_REF][START_REF] Vincent Danos | Rule-based modelling and model perturbation[END_REF][START_REF] Harmer | Rule-based modelling and tunable resolution[END_REF]. There are two main reasons for which ODEs models can hardly achieve this goal. The first one is that they do not describe the biochemical structure of components, the second one is due to their size.

Rule-based languages, as Kappa, supply a powerful way to describe formally the knowledge we have on biological systems and allow to model their behaviour. Any kind of modification is a completely local process so it becomes easy to change the behaviour of the system we want to study. The language is close to the representation of the knowledge and for each rule we are able to give a description in natural language. At the same time each rule is a formal object to which we can assign a semantics. Between all the possible choices we focus on differential semantics, where each connected component in the rules is associated to an equation describing the evolution in time of the species concentration related to it. By means of rule-based languages we can write compact and handy models but, sadly, the combinatorial complexity problem appears again if we want to run a simulation of the system. There is need for abstraction.

Abstract Interpretation has been introduced forty years ago by Patrick and Radhia Cousot. This is a theory of sound approximation of mathematical structures. In particular it allows to formally relate semantics models given at different precision levels. Abstract Interpretation has been being used successfully in several areas of computer science [START_REF] Cousot | Abstract interpretation: Theory and practice[END_REF], ranging among semantics, verification and proof, model-checking, program transformation and optimisation, typing, etc. One of its main application is static analysis of programs. The behaviour of a program is described as the least fixpoint of a monotonic operator F over the elements of a concrete domain D. The abstraction changes the descriptional level of the program behaviour. This change is performed by introducing a new abstract domain D 7 with an abstract operator F 7 defined on it. This can be formalised in several way. The most common approach is based on Galois connection.

In our work, we use Abstract Interpretation for several purposes.

1. We provide a generic framework to describe exact model reductions of ODEs semantics. The solution of the reduced system is the exact projection of the solution of the initial system and the abstraction is formalised as a change of variables. Abstract Interpretation provides convenient ways to define abstractions compositionally. The principle of concepts separation allows for the design of very complex abstrac-tions as a composition of simpler ones. Following this guideline, we propose a generic way to combine model reductions.

2. We define an abstraction based on symmetries between sites. Two sites are defined as symmetric when they play the same role in the semantics. For example, if we have k phosphorylation sites that are symmetric and ps 1 ,...,s k q is the tuple describing their state, we can replace the tuple with an integer n Pr 1,ks specifying the number of them that is phosphorylated and neglecting their position. We show that an equivalence relation based on symmetries induces a bisimulation and we use this bisimulation to reduce the dimension of the ODEs semantics.

3. We define an abstraction that tracks the information flow between different regions of chemical species. Our method is based on the idea that, as described by rules, the transformations are purely local. So instead of considering a full species we can consider just a part of that.

From this information, we can detect statically when the correlation between the state of two sites matters for the semantics. Abstracting away useless correlations allows us to cut species into partial species, that we call fragments. The set of fragments defines our abstract domain, from we which we can derive a reduced systems.

Case studies

We begin with examining several case studies in order to facilitate intuitions about the model reductions we aim to achieve. For the sake of simplicity, we use reaction networks. In the following chapters, we will show how to compute these model reductions automatically from a high level specification in Kappa, without ever generating the underlying reaction networks.

A protein with independent sites

Let us start with an example from [START_REF] Vincent Danos | Abstracting the differential semantics of rule-based models: exact and automated model reduction[END_REF].

Model

We consider a simple set of reactions.

p1q A, B Ø AB k A ,k 1 A p2q A, BC Ø ABC k A ,k 1 A p3q B, C Ø BC k C ,k 1 C p4q AB, C Ø ABC k C ,k 1 C CHAPTER 1. INTRODUCTION
This system describes an agent B that can bind simultaneously and reversibly to two other agents, A and C. The first reaction states that an agent B can bind to an agent A at a rate constant k A (direct arrow). This reaction is reversible as illustrated by the reverse arrow and the agents can dissociate at a rate constant k 1 A . The second reaction states that a complex BC can bind to an agent A at a rate constant k A and also that this reaction is reversible with a rate constant equal to k 1 A . The third reaction states that an agent B can bind to an agent C at a rate constant k C and also that this reaction is reversible with a rate constant equal to k 1 C . The fourth reaction states that a complex AB can bind to an agent C at a rate constant k C and also that this reaction is reversible with a rate constant equal to k 1 C . Totally, six sp ecies are p ossible: A, B, C, AB, BC and ABC. The behaviour of this system of reactions can be defined by the means of the mass action principle, stating that the reactants and the products of each reaction are consumed and produced according to the rate of this reaction. The rate of a reaction is defined as the product between the rate constant and the concentration of the reactants of this reaction.

For example, the rate of the second reaction, where A binds B,isk A rAsrBs (rAs is the traditional notation for the concentration of A,thatistheamoun t of Aspe ru n i tv o l u m e ) .

So, we can write the associated system of differential equations describing the time derivative for each of the six possible species.

rAs 1 " k 1
A prABs`rABCsq ´kA rAsprBs`rBCsq rBs 1 " k 1

A rABs`k 1 C rBCs´rBspk A rAs`k C rCsq rCs 1 " k 1 C prBCs`rABCsq ´kC rCsprBs`rABsq rABs 1 " k A rAsrBs`k 1 C rABCs´rABspk 1 A `kC rCsq rBCs 1 " k C rBsrCs`k 1 A rABCs´rBCspk 1 C `kA rAsq rABCs 1 " k A rAsrBCs`k C rABsrCs´rABCspk 1 A `k1

C q. We can observe that the differential system is autonomous, meaning that the time derivatives of variables do not explicitly depend on time.

Once the values of initial state and the rate constants have been fixed, it is possible to integrate the system and to calculate the time course of each variable.

Model reduction

By observing the set of reactions, we can see that the rate constant of the reactions:

CASE STUDIES

5

A, B Ñ AB and:

A, BC Ñ ABC is equal to k A in both cases. This can be interpreted as the fact that for a given B, its capability to bind with an A does not depend on the fact that it is already bound to a C or not.

Analoguously, the rate constant of the reactions:

AB Ñ A, B
and:

ABC Ñ A, BC is k 1
A in both cases. This means that the capability of an A to dissociate from a B does not depend on the fact that B is linked to a C or not.

The same way the rate constant of the reactions:

B, C Ñ BC and:

AB, C Ñ ABC is the same (k C ), and also the one of the reactions:

BC Ñ B, C
and:

ABC Ñ AB, C
that is equal to k 1 C . So we can imagine that it is possible to split our system into two indepent ones, where we cut B in two parts and for each part we retain only the information about its bond to A (or to C)a n dw ef o r g e ta l lt h ei n f o r m a t i o n about the fact that is bond to C (respectively to A)o rn o t .

The two subsystems are shown in Figure 1.1.

For the moment, let us consider just the subsystem on the left (where we forget the information about C). We introduce two new variables: rAB?s to denote the total concentration of AB and ABC, rB?s to denote the total concentration of B and BC. More specifically: rAB?s :"rABs`rABCs rB?s :"rBs`rBCs. So in our subsystem we will have three different "species": A, B?a n dAB?. We can write the following differential system to describe the time derivative of our new species:

rAs 1 " k 1
A rAB?s´k A rAsrB?s rAB?s 1 "rABs 1 `rABCs 1 " k A rAsrB?s´k 1 A rAB?s rB?s 1 "rBs 1 `rBCs 1 " k 1 A rAB?s´k A rAsrB?s. In the same way it is possible to write a differential system of equations also for the subsystem showed on the right of Figure 1.1. There we will introduce the two following new variables: r?BCs :"rBCs`rABCs r?Bs :"rABs`rBs and obtain the following system of differential equations:

rCs 1 " k 1
C r?BCs´k C rCsr?Bs r?BCs 1 "rBCs 1 `rABCs 1 " k C rCsr?Bs´k 1 C r?BCs r?Bs 1 "rBs 1 `rABs 1 " k 1 C r?BCs´k C rCsr?Bs.

CASE STUDIES

Dependence index

The example shows us that it is possible to exploit structural features of a given differential system to infer specific linear combinations of its variables with a self-consistent dynamics. Now we wonder if, once that we have split the original system into two separated ones, we are able to recover the original information. To this purpose we introduce a new variable: r?B?s"r?Bs`r?BCs"rB?s`rAB?s to denote the total concentration of B.

So:

1. rABCs r?B?s gives the proportion of Bsw i t hbo t ha nA and a C attached,

2.

rAB?s r?B?s gives the proportion of Bsw i t ha nA attached,

3.

r?BCs r?B?s gives the proportion of Bsw i t haC attached.

The fact that a protein B is bound to A is independent from the fact that it is bound to C if, and only if, the first expression is the product of the two following ones. That is to say: rABCs r?B?s " rAB?s r?B?s ¨r?BCs r?B?s .

This is equivalent to:

rABCs¨r?B?s"rAB?s¨r?BCs and to: rABCs r?BCs " rAB?s r?B?s .

That is to say that the probability of B to be linked with A knowing that it is bound to C is equal to the probability of B to be linked with A knowing nothing about C. By this equation we can define a dependence index χ as follows:

χ :"rABCs¨r?B?s´rAB?s¨r?BCs,

CHAPTER 1. INTRODUCTION

and after a computation we obtain:

dχ dt "´χpk A rAs`k C rCs`k 1 A `k1 C q.
So the property:

rABCs" rAB?s¨r?BCs r?B?s is an invariant of the system, if it hold at time t,i th o l d sa ta n yt i m et 1 • 0.

A protein with information flow

Now we present a second example. This model is a particular instance of a generic example that can be found in [START_REF] Nikolay | Signaling through receptors and scaffolds: Independent interactions reduce combinatorial complexity[END_REF]. This generic example describes a protein in which several sites, called master sites, control the behaviour of some other sites, that we call subordinate. In such a case, we say that there is a flow of information from the master sites to the subordinate sites. In this section, we focus to the case when there is only one master site and two subordinate sites, but our framework can deal with any number of master sites and any number of subordinate sites.

Model

Now we assume that we have a protein with three sites. We denote a protein as a tuple of symbols among p and u. p denotes a phosporylated site, whereas u denotes an unphosporylated one. So, for instance, a protein that has all its three sites phosporylated is denoted as pp, p, pq.

Our system is fully described by the following set of reactions.

p1qp u, u, uqÑp u, p, uq k c p2qp u, p, uqÑp p, p, uq k l p3qp u, p, pqÑp p, p, pq k l p4qp u, p, uqÑp u, p, pq k r p5qp p, p, uqÑp p, p, pq k r

The set describes a system where, in a protein that has all the sites not activated, the first one to be activated is the central one (as asserted by the first reaction). Once that a protein has the central site activated it can activate also the left and the right ones.

The first reaction states that a protein with no site activated can activate the central one with a rate constant equal to k c . The second rule states that ap r o t e i nw h i c hh a st h ec e n t r a ls i t ea c t i v a t e dc a na c t i v a t et h el e f to n ew i t h 1.2. CASE STUDIES ar a t ec o n s t a n te q u a lt ok l . The third rule states that a protein which has the central and the right site activated can activate the left one with a rate constant equal to k l . The fourth rule states that a protein which has the central site activated can activate the right one with a rate constant equal to k r . The fifth rule states that a protein which has the central and the left site activated can activate the right one with a rate constant equal to k r .

Model reduction

We can notice that the rate constants of the reactions: pu, p, uqÑpp, p, uq and:

pu, p, pqÑpp, p, pq are both equal to k l . This suggests us that the capability of the left site to be activated does not depend on the fact that the right site is activated or not.

The same way, the rate constants of the reactions:

pu, p, uqÑpu, p, pq and: pp, p, uqÑpp, p, pq are both equal to k r . This suggests us that the capability of the right site to be activated does not depend either on the fact that the left site is activated or not. As before, we can imagine to split our system into two smaller ones as showed by Figure 1.2.

We introduce two new variables for the subsystem on the left: rpu, p, ?qs :"rpu, p, uqs `rpu, p, pqs, rpp, p, ?qs :"rpp, p, uqs `rpp, p, pqs and two new variables for the subsystem on the right: rp?, p, uqs :"rpu, p, uqs `rpp, p, uqs, rp?, p, pqs :"rpu, p, pqs `rpp, p, pqs.

We can compute the dynamic of the new subsystem and, for the one on the left, we obtain: rpu, u, uqs 1 "´k c rpu, u, uqs, rpu, p, ?qs 1 "´k l rpu, p, ?qs `kc rpu, u, uqs, rpp, p, ?qs 1 " k l rpu, p, ?qs. Whereas for the one on the right we get: rpu, u, uqs 1 "´k c rpu, u, uqs rp?, p, uqs 1 "´k r rp?, p, uqs `kc rpu, u, uqs rp?, p, pqs 1 " k r rp?, p, uqs.

Dependence index for the second example As in the previous example, we wonder if, once that we have split the original system into two separate ones, we are able to recover the original information. Again we introduce a new variable: rp?, p, ?qs :"rp?, p, uqs `rp?, p, pqs " rpu, p, ?qs `rpp, p, ?qs. p?, p, ?q denotes a protein that has the central site phosphorylated, but of which we ignore the status of the left and right sites.

The states of the left site and the right one will be independent if, and only if, the probability that the right site is activated knowing that the left site is activated will be equal to the probability that the right site is activated knowing nothing about the left site, that is: rpp, p, pqs rpp, p, ?qs " rp?, p, pqs rp?, p, ?qs .

By this equation we can define a dependence index χ as follows:

χ :"rpp, p, pqs ¨rp?, p, ?qs ´rp?, p, pqs ¨rpp, p, ?qs and after a computation we get: dχ dt "´χ ¨pk l `kr q`k c ¨rpp, p, pqs ¨ru, u, us.

So the property χ " 0 is not an invariant of the system. This suggest that we can split the system into two subsystems, but we cannot recombine the system without errors, in a time independent way.

A protein with symmetries

The first two examples we have seen so far exploit the same kind of idea to reduce a model. They are based on the fact that whenever the correlations, if any, between different parts of the system have an influence on the behaviour of no other site, it is possible to abstract these correlations away. Which means intentionally that we can split proteins into independent subparts. Another kind of phenomenon that may appear, and that we can use to reduce a system, is the one of "redundancy". We can have a system with several parts that represent the same kind of information and capabilities, so we can collapse all these different parts in only one and taking in account the cardinality.

Model

For a better understanding, let us have a look to a concrete example. The system showed in Figure 1.3 describes the behaviour of a protein with three sites px 1 ,x 2 ,yq. More specifically:

-reactions 1 ´4d e s c r i bet h ep h o s po r y l a t i o no ft h es i t ex 1 ; -reactions 5 ´8d e s c r i bet h ep h o s po r y l a t i o no ft h es i t ex 2 ; -reactions 9 ´12 describe the phosporylation of the site y.

Model reduction

As we can observe, the activation rate constant of x 1 and x 2 is the same: k m . Moreover, the activation rate constant of y changes according to the number of the sites x i that are phosporylated (it is equal to k 0 when both x 1 and x 2 are unphosporylated, to k 1 when just one of them is phosporylated, and to k 2 when they are both phosporylated).

This peculiarity can be used to reduce our model. The idea is to forget about which sites x i are phosporylated and to remember just how many phosporylated sites we have. When two or more sites have the same capability of interaction, as x 1 and x 2 in our case, we define them symmetric. This equivalence relation over sites can be lifted to an equivalence relation " over proteins, so we say that two proteins are "-equivalent if the number of phosphorylated sites among x 1 and x 2 is the same for both proteins.

In our case we have the following equivalence classes over states: paqp u, p, uq"p p, u, uq pbqp u, p, pq"p p, u, pq, and the original system is equivalent to the following reduced one: p1qp u, u, uqÑp p, u, uq 2k m p2qp u, u, pqÑp p, u, pq 2k m p3qp p, u, uqÑp p, p, uq k m p4qp p, u, pqÑp p, p, pq k m p5qp u, u, uqÑp u, u, pq k 0 p6qp p, u, uqÑp p, u, pq k 1 p7qp p, p, uqÑp p, p, pq k 2 .

Where:

-reaction 1 describes the activation of one site x i (i Pt1, 2u)inaprotein where all sites are unphosporylated;

CASE STUDIES

13

-reaction 2 describes the activation of one site x i in a protein where all the sites x i are unphosporylated the site y is phosporylated;

-reaction 3 describes the activation of a site x i in a protein where the other site x j is phosporylated and the site y is unphosporylated;

-reaction 4 describes the activation of a site x i in a protein where the other site x j is phosporylated and the site y is phosporylated too;

-reaction 5 describes the activation of the site y where no site x i is phosporylated;

-reaction 6 describes the activation of the site y in a protein that has one site x i phosporylated;

-reaction 7 describes the activation of the site y in a protein where all the sites x i are phosporylated.

So we partitioned the set of reachable configurations for the protein X into pm `1q2 n "-equivalence classes, where, in our case, m " 2a n dn " 1. From this, we have been able to pass from an original set of twelve reactions to a simplified one with just seven reactions.

A protein with information flow and symmetries

The two kinds of model reduction that we have seen respectively in Sections 1.2.1 and 1.2.2, and in Section 1.2.3 can be combined. Let us introduce an example to illustrate this. We consider two kinds of agents, P and X. Instances of P denotes phosphate ions, whereas instances of X denote copies of a given protein. We assume that each protein X has two kinds of sites:

• m sites x 1 ,..,x m ;

• n sites y 1 ,..,y n ; where m and n are two integer parameters of the model.

We assume that each site can recruit at most one phosphate ion P and, then, dissociate from it.

The state of a protein A is denoted as an (ordered) tuple of symbols among tu, pu. The symbol u indicates an unphosphorylated site, whereas the symbol p indicates a phosphorylated one. For example, if m " 2a n d n " 1, a protein X having the sites x 1 and y 1 phosphorylated and the site x 2 unphosphorylated is denote by Xrp, u, ps. We assume that the sites x 1 ,..,x m can all be phosphorylated at the same rate constant k. This means that for each integer i between 1 and m the phosphorylation of the site x i does not depend on the phosphorylation state of the other sites. Moreover, we also assume that for every integer j between 1a n dn, the phosphorylation of the site y j depends both on the index j and on the number of sites among x 1 ,..,x m which are currently phosphorylated in the protein X. The rate constant of activation of the site y j in a protein X which have exactly i sites among x 1 ,..,x m activated is denoted by k j,i . Lastly, we assume that every phosphorylated site can be unphosphorylated at the same rate constant k d .

In Figure 1.4 we show the set of reactions for the model with parameters m " 2a n dn " 1.

In the general case, there are 2 m`n reachable configuration for the protein X. Thus, when m `n gets big, we can no longer enumerate chemical species, nor reactions, and the integration of the differential semantics is impossible due to combinatorial complexity. We notice that we can use symmetries among the sites x 1 ,..,x m so as to reduce the dimension of the semantics. Indeed, what is important is how many sites x i of the protein are phosphorylated and not which of these sites are phosphorylated. Thus we propose to ignore any distinction between them. In this way, the set of reachable configurations for the protein X is partitioned into pm `1q2 n "-equivalence classes. A simplified set of reactions can be proposed, by choosing a representative among each "-equivalence class. Indeed, up to updating reaction rate constants, we may assume that the sites x 1 ,..,x m are always phosphorylated in increasing order, and dephosphorylated in decreasing order. In Figure 1.5 we show the set of the so obtained simplified reactions (for m " 2 and n " 1). We can notice that whenever the sites x 1 and x 2 are both unphosphorylated, only the site x 1 can be phosphorylated (with a rate twice as big as in the initial reaction) and that whenever the sites x 1 and x 2 are both phosphorylated, only the site x 2 can be dephosphorylated (at a rate constant twice bigger than in the initial reaction). This reduced system can be refined further by noticing that the behaviour of each site y j is only controlled by the state of the sites x i (when the integer i ranges among 1 and m). As a consequence, we can safely cut each protein into n parts, each one documenting the state of only one site y j and the state of every site x i . As a result, we obtain a self-consistent differential equations made of 2pm `1qn variables (instead of 2 m`n in the initial model).

Conclusive remarks

We have described four examples where we have been able to reduce the dimension of the underlying systems of ODEs.

In the two first ones we have been able to split the original system into two independent ones, by exploiting a lack of flow of information between some sites. More specifically, in the first example we got two independent subsystems. The transformation is invertible and we are able to recover the concentration of any species. This is a strong property which is hard to prove and which is hardly ever satisfied. In the second example we obtained two self-consistent subsystems. There we abstracted away some information and we are not able to recover the concentration of any species any longer. This reduction is based on a weaker property, that we are more likely to encounter in realistic models.

In the third example we exploited another kind of property. We observed that some sites exhibit the same capabilities so we can forget about their position and consider just their cardinality. Unlike the two first examples, we do not cut the species, but still we carry less information about them.

In the fourth example, we showed that it is possible to combine the reductions that are based on the lack of information flow and the ones that are based on symmetries.

By these examples we showed that it is possible to exploit structural features of a given differential system to identify a set of macro-variables, i.e. a specific combination of the system variables, that have a self-consistent dynamic. In the rest of the thesis we will show also how this can be done in the CHAPTER 1. INTRODUCTION case where the dynamic is described by rules, and not just by reactions. As we will see, working with rules as a big advantage. In fact it is possible to exploit the high level of description offered by the rules, so as to derive directly the reduction from the rules without having to ever explicitly consider the ground set of corresponding reactions.

Overview 1.3.1 Kappa

Kappa is a formal language based on site graph rewriting. Proteins are typically denoted by agents. The properties of a given agent are expressed by some sites that may carry an internal state. Moreover, potential links between proteins are specified by bonds between agent sites. Interactions between sites are described by the means of rules. These rules are contextfree, which means that there is no need to describe the whole state of each chemical species, but only the information that matters to trigger or to tune the speed of the interaction.

For example, a rule of the form:

A 1 pbq, B 2 paqÑA 1 pb B2@a q, B 2 pa A1@b q describes how the proteins A and B bind together. This can happen when the site b in A and the site a in B are both free. In the rule, there is no need to consider the sites of the proteins the state of which has no influence on the reaction. For instance, we may assume (as in the example of Section 1.2.1) that the protein B has another site that can bind to a protein C and that this potential bond does not influence the capability of B to bind with A. Under this assumption, our rule is a symbolic representation for the following set of reactions:

p1q A, B Ñ AB, p2q A, BC Ñ ABC.
Kappa is formally introduced in Chapter 3. There we describe the effect of applying a rule to a pattern. This is used to define the set of reactions induced by a set of Kappa rules. Then we introduce the differential semantics of a Kappa model as the solution of the set of differential equations that are obtained by applying the principle of mass action. This construction is required to state and prove the soundness of our analyses. Yet we will never compute effectively neither the underlying set of reactions, nor the set of differential equations.

In Chapter 5, we show that we can factor the consumption and the production of a given pattern as an expression of other patterns. It is worth noting that we deal faithfully with potential side effects, i.e. transformations that are not explicitly described by the rules (for instance, in the case we delete an agent without checking that all of its sites are free).

Symmetries based reduction

Some biological systems exhibit proteins with sites having the same capabilities of interaction. For example, a protein can have several phosphorylation sites, but the only relevant information is given by the number of them that are phosphorylated and not what is their position. We define this kind of sites as symmetric. Roughly speaking, we say that two sites x and y are symmetric for a system of rules R if any potential interaction with the site x can be done with the site y instead, and at the same rate constant.

This notion is formalised in Chapter 4. There we introduce an operation of transposition that permutes the state of sites in agent instances. Then this operation is lifted to the level of patterns, rules, agent matchings, pattern embeddings and transition labels. It follows that our notion of symmetry is compatible with the operational semantics: it induces a bisimulation.

Bisimulations [START_REF] Milner | Communication and Concurrency[END_REF] are an established form of equivalence for transition systems. Here we use a quantitative version of bisimulation that accounts for ODEs semantics. Given two systems, a bisimulation is a couple of equivalence relations between their states and their transitions. A system with symmetries is equivalent to a reduced system where the states are lumped according to their equivalence classes.

Context-insensitive flow analysis

In computations, the final value of a variable x may depend on the initial value of a variable y. This is captured by the notion of information flow [START_REF] Abadi | Secrecy by typing in security protocols[END_REF]. In our specific example we say that the variable y flows into x. When a variable x flows in n variables y 1 ,...,y n we face to a potential correlation. Symmetrically, when n variables y 1 ,...,y n flow in a single variable z,t h e correlation among y 1 ,...,y n may constrain the behaviour of the variable z.

In Chapter 6 we propose a method to over-approximate all useful correlations. The result is a linear change of variables which reduces the dimension of the initial semantics. The reduced system is computed directly at the level of rules and we do not need any effective computation of the original one. Given a set of species and a set of rules we firstly compute a symbolic representation of all the possible species. We call this representation contact CHAPTER 1. INTRODUCTION map. Then, scanning rule by rule, we annotate the contact map with some information between the sites that are tested and sites that are modified. This annotation induces a set of patterns, that we call fragments. Roughly speaking, fragments are patterns that are obtained by starting from a single site and extending the pattern by following the information flow backward. That is to say that a fragment describes only the states of the sites that impact the behaviour of the starting site. By construction, we can prove that the consumption and the production of every fragment can be expressed as an expression of the concentration of the other fragments.

Context-sensitive flow analysis

The analysis in Chapter 6 is context-insensitive. It gathers all the information about the sites of each protein in a single node, regardless the state of its sites.

Between a concrete representation of a set of species and the one that is based on the contact map, there are several intermediate representations. We show that it is possible to tune the description of the information flow by changing the level of representation. In Chapter 7, we introduce Σ-graphs to generalise the concept of contact map. In Σ-graphs, each kind of agent may occur several times, which enables to refine the annotation of the flow of information according to different contextual conditions.

In Chapter 8, we show how to abstract the flow of information at different levels of resolution with respect to the choice of a Σ-graph and we extend the definition of fragments accordingly. We notice that, in this more general setting, the constraints on the flow of information are not enough to ensure the self-consistency of the fragments. Indeed, we notice that the soundness of our approach relies on the fact that the grain of resolution in the abstraction of the reactants of a reaction should always be at least as refined as the one of the products of this reaction: this is the principle of backward compatibility. We propose a closure operator about the annotations of Σ-graphs, which computes the least annotation that is backward compatible. As a result, we get a sound annotation of arbitrary Σ-graphs, that induces self-consistent sets of fragments.

Our method is a kind of partitioning [START_REF] Bourdoncle | Abstract interpretation by dynamic partitioning[END_REF], a generic method for refining abstractions.

RELATED WORKS

Related works 1.4.1 Bisimulation

In [START_REF] Buchholz | Bisimulation relations for weighted automata[END_REF] is proposed a notion of bisimulation for weighted labeled transition systems. It is shown that it is possible to reduce them by merging individual states into equivalence classes while the behaviour of the complete automaton is preserved. Our notion of bisimulation is induced by an equivalence on variables, so less general. Yet, we do this restriction in order to have means to discover efficiently these bisimulations. The framework presented in [START_REF] Buchholz | Bisimulation relations for weighted automata[END_REF] provides a very general definition of bisimulation, but this is not clear how to find these bisimulations in practice.

In [START_REF] Cardelli | Symbolic computation of differential equivalences[END_REF], equivalence relations among variables are used to induce bisimulations also in the context of reaction networks. Indeed the characterisation of the most general bisimulation that can be expressed this way is provided, as well as an effective algorithm to compute it. Yet, the models we address in this thesis are highly combinatoric and they usually cannot be described compactly as a reaction network. Thus, the approach that is proposed in [START_REF] Cardelli | Symbolic computation of differential equivalences[END_REF] does not scale for our purpose. In [START_REF] Petrov | Maximal Reduction of ODE Semantics of Rule-based Models: Syntax-Independent Setup[END_REF], a more general framework to discover linear changes of variables in reaction networks is proposed. The same problem of scalability persists.

In [START_REF] Cardelli | Comparing chemical reaction networks:a categorical and algorithmic perspective[END_REF], it is shown how to relate two reaction networks, automatically, by the means of a bisimulation induced by an equivalence relation over the variables of the system. Even this method needs the computation of the reaction networks and suffers from the same problems of scalability.

The concept of bisimulation is highly related to the one of lumpability [START_REF] Buchholz | Exact and ordinary lumpability in finite markov chains[END_REF]. A Markov chain is lumpable with respect to a given aggregation (quotienting) of its states, if the lumped chain preserves the Markov property. The relation between lumpability and bisimulation is studied in [START_REF] Feret | Lumpability abstractions of rule-based systems[END_REF].

Information flow

Dependencies between sites and reactions have been used in systematic methods for (hand-)writing coarse-grained models. In [START_REF] Nikolay | Signaling through receptors and scaffolds: Independent interactions reduce combinatorial complexity[END_REF] it is showed, by examples, that a mechanistic reduction of the system can by computed using hierarchical control relationships between sites. In [START_REF] Conzelmann | Exact model reduction of combinatorial reaction networks[END_REF] a reduced model is written directly from the so called control graph, characterising the information flow. However these methods are not automated (there is no semantics) and suffer from combinatorial blow up in the case of chains of agents and site modifications that propagate through bindings [START_REF] Holger Conzelmann | Mathematical Modeling of Cellular Signal Transduction Pathways -A Domain-Oriented Approach to Reduce Combinatorial Complexity[END_REF]. This problem can be solved by neglecting some species but then the dynamics of the system is not preserved. The framework in [START_REF] Nikolay | Domain-oriented reduction of rule-based networks models[END_REF], for automatically reducing the ODEs of protein networks, suffers from the same lack of soundness when site modifications propagate through bindings. Our approach deals efficiently with this case: even in the case of site modifications that propagate through bindings, we capture just enough information to ensure soundness, but few enough information to ensure scalability.

Our context-insensitive information flow analysis improves and extends the fully context insensitive ones that have been proposed in [START_REF] Vincent Danos | Abstracting the differential semantics of rule-based models: exact and automated model reduction[END_REF][START_REF] Feret | Internal coarse-graining of molecular systems[END_REF]. There the species are cut in a homogeneous way just according to a type information. It is worth noting that in [START_REF] Feret | Internal coarse-graining of molecular systems[END_REF] it is considered a set of 71 rules expanding into 18 051 984 143 555 729 567 species that is reduced into 175 988 fragments. Our analysis is a strict improvement of the one presented there.

[36] proposes a fully context sensitive analysis where the abstraction of the information flow is done on the concrete, thanks to a direct interaction on molecular species. Then a self consistent change of variables is computed by saturation. Moreover, it applies on pure Kappa only (without side effects). Our framework provides a full span of intermediary abstractions and accounts for side effects.

Stochastics semantics

Reduced models have been proposed also for stochastics semantics. In [START_REF] Feret | Stochastic fragments: A framework for the exact reduction of the stochastic semantics of rule-based models[END_REF], stochastics fragments are proposed to track the flow in CTMCs models. The reduction is not very impressive. This is due to the fact that more potential correlations become meaningful in a stochastic setting.

In [START_REF] Thomas | Solutions of ordinary differential equations as limits of pure jump markov processes[END_REF][START_REF] Thomas | Limit theorems for sequences of jump markov processes approximating ordinary differential processes[END_REF], it is shown that the differential semantics is the expected behaviour of the stochastic one when both the initial mixture size and the volume diverge with a constant ratio. In this case, ground refinements with lower arities, corresponding to epis which do not preserve the number of components, are negligible anyway.

Other model reduction

Other kinds of reduction have been studied. In [START_REF] Gay | On the subgraph epimorphism problem[END_REF], it is proposed a comparison between models based on topological properties. The perspective is more on explaining which transformations are necessary to go from a model to another one, regardless of quantitave properties.

Concentrations and time-scales separation plays a very important role in model reduction. The framework in [START_REF] Gorban | Dynamic and static limitation in multiscale reaction networks, revisited[END_REF][START_REF] Radulescu | Reduction of dynamical biochemical reactions networks in computational biology[END_REF] applies concentration and timescales separation to reduce linear reaction networks. The reduced system is build on the base of a dominant kinetic system over the constant rate of the 1.5. OUTLINE original one. Tropicalisation [START_REF] Radulescu | Model reduction of biochemical reactions networks by tropical analysis methods[END_REF][START_REF] Sommer-Simpson | Hybrid reductions of computational models of ion channels coupled to cellular biochemistry[END_REF] permits to generalise these approaches to arbitrary systems of ODEs. Those methods rely on a solid physical justification. Yet, they perform numerical approximations without providing explicit bounds on the accumulated errors. There are valid under the asymptotic assumption that fast reactions are infinitely quicker than slow one. In [START_REF] Beica | Efficient reduction of kappa models by static inspection of the rule-set[END_REF], these methods are applied to Kappa models but no proof of soundness is given.

In [START_REF] Madelaine | Structural simplification of chemical reaction networks preserving deterministic semantics[END_REF][START_REF] Madelaine | Normalizing chemical reaction networks by confluent structural simplification[END_REF], the authors use time-scale separation to reduce models of metabolic networks. They rely on the fact that some species always reach a fast equilibrium, to replace their transient concentration, by their concentration at equilibrium.

Outline

In Chapter 2, we describe a generic framework to define and reduce differential semantics for systems of ODEs. We also explain how to combine different kinds of model reduction. In Chapter 3, we introduce Kappa. We define its syntax, semantics and we show how the consumption and the production of species can be expressed directly at the level of rules. In Chapter 4, we propose a framework that exploits symmetries between sites, showing how a relation based on sites having the same capabilities of interaction induces a bisimulation. In Chapter 5, we show how to express the consumption and the production of patterns as an expression of the concentration of other patterns. In Chapter 6, we show how to construct an abstract semantics tracking the flow of information between different regions of chemical species. In Chapter 7, we introduce Σ-graphs as a means to describe relations among the sites of species, at different levels of resolution. In particular we study structure preserving functions to build correspondences between Σ-graphs and between relations on their respective sites. In Chapter 8, we study a framework to tune the analysis accordingly to a context and we supply a way to find smaller reduced differential models.

Chapter 2

Reduction of differential semantics

In this chapter we describe a generic framework to define and reduce differential semantics. A first version of this framework has been introduced in [START_REF] Vincent Danos | Abstracting the differential semantics of rule-based models: exact and automated model reduction[END_REF][START_REF] Feret | Internal coarse-graining of molecular systems[END_REF]. We have extended this framework in [START_REF] Camporesi | Formal reduction of rule-based models[END_REF][START_REF] Camporesi | Combining model reductions[END_REF].

Concrete semantics

Let V be a finite set. Maps from V to R form a normed vector space with the norm }¨} that is defined as follows:

}⇢} :" max XPV |⇢pXq|
where, for every real number x, |x| denotes the absolute value of x.

For U as u b s e to fV Ñ R, we define }U }"sup ⇢PU }⇢} § `8. If V is a set of species and ⇢pXq the concentration of the species X, then }⇢} controls the total number (per unit volume) of species in the system. A map ⇢ such that for all X P V, ⇢pXq • 0i sc a l l e dastate.

Let V be a set of variables. We define a state over V as a mapping ⇢ from V to R such that:

⇢paq • 0f o ra l la P V.
We define an autonomous system as a pair pV, Fq, where V is a finite set of variables and F is a continuously differentiable function from V Ñ R to V Ñ R.

Example 2.1.1. We illustrate this definition on the case study of Section 1.2.1. Following the principle of mass action law, the reactions:

CHAPTER 2. REDUCTION OF DIFFERENTIAL SEMANTICS p1q A, B Ø AB k A ,k 1 A p2q A, BC Ø ABC k A ,k 1 A p3q B, C Ø BC k C ,k 1 C p4q AB, C Ø ABC k C ,k 1 C .
are inducing the following system of differential equations:

rAs 1 " k 1 A prABs`rABCsq ´kA rAsprBs`rBCsq rBs 1 " k 1 A rABs`k 1 C rBCs´rBspk A rAs`k C rCsq rCs 1 " k 1 C prBCs`rABCsq ´kC rCsprBs`rABsq rABs 1 " k A rAsrBs`k 1 C rABCs´rABspk 1 A `kC rCsq rBCs 1 " k C rBsrCs`k 1 A rABCs´rBCspk 1 C `kA rAsq rABCs 1 " k A rAsrBCs`k C rABsrCs´rABCspk 1 A `k1 C q. V Ñ R A fi Ñ k 1 A p⇢pABq`⇢pABCqq ´kA ⇢pAqp⇢pBq`⇢pBCqq B fi Ñ k 1 C p⇢pBCq`⇢pABCqq ´kC ⇢pCqp⇢pBq`⇢pABqq C fi Ñ k 1 A ⇢pABq`k 1 C ⇢pBCq ´⇢pBqpk A ⇢pAq`k C ⇢pCqq AB fi Ñ k A ⇢pAq⇢pBq`k 1 C ⇢pABCq ´⇢pABqpk 1 A `kC ⇢pCqq BC fi Ñ k C ⇢pBq⇢pCq`k 1 A ⇢pABCq ´⇢pBCqpk 1 C `kA ⇢pAqq ABC fi Ñ k A ⇢pAq⇢pBCq`k C ⇢pABq⇢pCq ´⇢pABCqpk 1 A `k1 C q.
By the Cauchy-Lipschitz theorem [START_REF] Edward | Ordinary Differential Equations[END_REF], for any state ⇢ 0 over V, the system of equations: # ⇢ 1 ptq"Fp⇢ptqq ⇢p0q"⇢ 0 has a unique maximal differentiable solution:

f ⇢ 0 : r0,T ⇢ 0 qÑpV Ñ Rq, with T ⇢ 0 § `8.
The concrete semantics of the system pV, Fq is the mapping JV, FK which associates the unique maximal differentiable solution f ⇢ 0 to each state ⇢ 0 over V (in this context, ⇢ 0 is called the initial state). An autonomous system pV, Fq is said to be positive if, and only if, for any state ⇢ 0 over V and any t Pr0,T ⇢ 0 q, f ⇢ 0 ptq is a state over V as well.

It is worth noting that any autonomous system that is defined by the means of the mass action law principle is positive.

Exact reduction

Starting from a positive autonomous differential system, we want to define as pe c i fi cn o t i o no fl i n e a rr e d u c t i o nf o ri t . T od ot h i sw er e c u rt oi d e a sf r o m Abstract Interpretation, a general framework to approximate the semantics of programs [START_REF] Cousot | Abstract interpretation: a unified lattice model for static analysis of programs by construction or approximation of fixpoints[END_REF]. This way, the notion of system reduction that we use can be seen as an abstraction map, that is a transformation from a concrete state space to an abstract one. For us, the concrete state space is given by the set of species concentrations, whereas the abstract one is given by the concentrations of some abstract observables.

If we consider two sets V and V 7 ,am a p from V Ñ R to V 7 Ñ R is:

-positive if for all ⇢ • 0, p⇢q • 0;

-expansive if for all subset U of V Ñ R `, } pU q} † `8 implies }U } † `8.

We write : R A ( R B whenever is a linear positive expansive map from the normed vector space R A to the normed vector space R B . We define a model reduction as a tuple pV, F, V 7 , , F 7 q where:

• the pair pV, Fq is an autonomous system,

• V 7 is a (finite) set of abstract variables,
• is a linear positive expansive map from pV Ñ Rq to pV 7 Ñ Rq,

• F 7 ac o n t i n u o u s l yd i fferentiable function from pV 7 Ñ Rq to pV 7 Ñ Rq, and such that the following diagram commutes:

CHAPTER 2. REDUCTION OF DIFFERENTIAL SEMANTICS R V 7 R V 7 R V R V ˝ ˝ / / F 7 / / F
Since is positive we have that (concrete) states are mapped to (abstract) states.

Example 2.2.1 (continued). Keeping on with the example of Section 1.2.1, the autonomous system pV, Fq can be completed into a model reduction as follows.

The set of observables V 7 is defined as tA, AB?,B?,C,?BC, ?Bu. The concentration of these observables is defined by the following constraints: rAB?s"rABs`rABCs rB?s"rBs`rBCs r?BCs"rBCs`rABCs r?Bs"rBs`rABs which can be formalised by the following abstraction function :

: $ ' ' ' ' ' ' ' ' ' ' ' ' ' & ' ' ' ' ' ' ' ' ' ' ' ' ' % R V Ñ R V 7 ⇢ fi Ñ $ ' ' ' ' ' ' ' ' ' ' ' & ' ' ' ' ' ' ' ' ' ' ' % V Ñ R A fi Ñ ⇢pAq AB? fi Ñ ⇢pABq`⇢pABCq B? fi Ñ ⇢pBq`⇢pBCq C fi Ñ ⇢pCq ?BC fi Ñ ⇢pBCq`⇢pABCq ?B fi Ñ ⇢pABq`⇢pBq.
The behaviour of the observables is defined by the following equations:

rAs 1 " k 1 A rAB?s´k A rAsrB?s rAB?s 1 " k A rAsrB?s´k 1 A rAB?s rB?s 1 " k 1
A rAB?s´k A rAsrB?srCs 1 " k 1 C r?BCs´k C rCsr?Bs r?BCs 1 " k C rCsr?Bs´k 1 C r?BCs r?Bs 1 " k 1 C r?BCs´k C rCsr?Bs.

These equations can be encoded in the function F 7 that is defined as fol-

EXACT REDUCTION

lows:

F 7 : $ ' ' ' ' ' ' ' ' ' ' ' ' ' & ' ' ' ' ' ' ' ' ' ' ' ' ' % R V 7 Ñ R V 7 ⇢ 7 fi Ñ $ ' ' ' ' ' ' ' ' ' ' ' & ' ' ' ' ' ' ' ' ' ' ' % V 7 Ñ R A fi Ñ k 1 A ⇢ 7 pAB?q´k A ⇢ 7 pAq⇢ 7 pB?q AB? fi Ñ k A ⇢ 7 pAq⇢ 7 pB?q´k 1 A ⇢ 7 pAB?q B? fi Ñ k 1 A ⇢ 7 pAB?q´k A ⇢ 7 pAq⇢ 7 pB?q C fi Ñ k 1 C ⇢ 7 p?BCq´k C ⇢ 7 pCq⇢ 7 p?Bq ?BC fi Ñ k C ⇢ 7 pCq⇢ 7 p?Bq´k 1 C ⇢ 7 p?BCq ?B fi Ñ k 1 C ⇢ 7 p?BCq´k C ⇢ 7 pCq⇢ 7 p?Bq.
The following theorem holds.

Theorem 2.2.2 (Soundness). Let pV, F, V 7 , , F 7 q be a model reduction. Let ⇢ 0 be an initial state over V. We denote as f : r0,TqÑR V the maximal solution of the autonomous system pV, Fq with initial condition f p0q"⇢ 0 and as f 7 : r0,T 7 qÑR V 7 the maximal solution of the autonomous system pV 7 , F 7 q with initial condition f 7 p0q" p⇢ 0 q. With these notations, we have: T " T 7 and f 7 " ˝f .

Proof. Since f is differentiable on r0,Tq and because is linear, the function ˝f is diferentiable on r0,Tq. Moreover, for t † T , one has: p ˝f q 1 ptq" pf 1 ptqq " pFpf ptqqq " F 7 p pf ptqqq because is linear, f is a solution of F and ˝F " F 7 ˝ by assumption. Hence ˝f is differentiable on r0,Tq, and it is the (unique) solution of the autonomous system pV 7 , F 7 q for the initial condition p⇢ 0 q on r0,Tq. In other words, on r0,Tq we have ˝f " f 7 . It follows that T § T 7 . But, in fact, T " T 7 . To see this, suppose T † 8, then }f ptq} diverges as t tends to T and being expansive, so does } pf ptqq}.

It follows from Theorem 2.2.2 that if the system pV, Fq is positive, then the system pV 7 , F 7 q is positive as well.

The reduction guarantees that:

Projections-based reductions

In this section, we specialise this framework to the case where the model reduction can be induced by a bisimulation relation induced by an equivalence relation over the variables of the system. We start by taking:

1. ac o n c r e t ea u t o n o m o u ss y s t e mpV, Fq, 2. af u n c t i o nr from V to V such that r is idempotent (i.e. r ˝r " r).

We use the function r to define an equivalence relation over V, by saying that v 1 " r v 2 if and only if rpv 1 q"rpv 2 q. Moreover, for any variable v P V the variable rpvq is called the representative of the equivalence class of v. We define two linear projections P r and Z r as follows:

P r p⇢q :

# V Ñ R v fi Ñ ∞ t⇢pv 1 q|rpv 1 q"vu,
and Z r p⇢q :

$ ' & ' % V Ñ R v fi Ñ ⇢pvq if rpv 1 q"v v fi Ñ 0o t h e r w i s e .
P r is used to gather the values of each " r -equivalent variable and to store the result to the value of the representative of each " r -equivalence class. Z r ignores the values of the variables which are not the representative of their " r -equivalence class. We notice that P r : R V ( R V and that the following diagram commutes:

/ / P r ' ' P r ⇤ ⇤ Z r 2.3. PROJECTIONS-BASED REDUCTIONS 29
Now we provide additional requirements over the relation r so that it induces a bisimulation relation over the states of the system. Definition 2.3.1. Given an autonomous system pV, Fq and a relation r, we say that that r induces a bisimulation over pV, Fq if and only if for any pair p⇢, ⇢ 1 q of states over V, if P r p⇢q"P r p⇢ 1 q, then P r pFp⇢qq " P r pFp⇢ 1 qq.

The previous definition is equivalent to say that the relation r induces a bisimulation if, and only if, the following diagram commutes:

/ / F ✏ ✏ P r / / F # # P r ; ; P r
The following theorem states that whenever the relation r induces a bisimulation, then the projections P r and Z r can be used to define a model reduction.

Theorem 2.3.2. If r induces a bisimulation, then pV, F, V,P r ,P r ˝F ˝Zr q is a model reduction.

Proof. The proof is given by the following commutative diagram:

/ / F Pr ⇢ ⇢ P r / / Z r ˝Pr / / F / / P r
More precisely, given ⇢ P R V , we have: P r pFp⇢qq " P r pFpP r p⇢qqq " P r pFpZ r pP r p⇢qqqq "r P r ˝F ˝Zr spP r p⇢qq.

CHAPTER 2. REDUCTION OF DIFFERENTIAL SEMANTICS

pu, uqÑpp, uq @k 1 pu, pqÑpp, pq @k 1 (a) Phosphorylation of the first site.

pu, uqÑpu, pq @k 1 pp, uqÑpp, pq @k 1 (b) Phosphorylation of the second site.

pp, pqÑ @k 2 (c) Degradation. Example 2.3.3. We instantiate our framework on a simple example.

In this example we consider one kind of protein. We suppose that this protein has two sites. The state of a protein is denoted as an ordered couple of symbols among tu, pu. The symbol u indicates an unphosphorylated site, whereas the symbol p indicates a phosphorylated one. For example, a protein having both sites phosphorylated is denoted as pp, pq.

We start by considering the reactions that are given in Figure 2.1. Each site of a protein can be phosphorylated with the same rate constant k 1 . Moreover, we assume that a protein that has both sites phosphorylated can be degraded with a rate constant k 2 . Intuitively, both sites of the protein play exactly the same role. Our goal is to justify that we can abstract each instance of a protein by the number of its sites that are phosphorylated. This way, we would get the simplified rules that are given in Figure 2.2.

The set of variables V is defined as: tpu, uq, pu, pq, pp, uq, pp, pqu.

We want to identify the proteins that have exactly one activated site, no matter if it is the first or the second one. Thus, we define the mapping r by rpu, uq"pu, uq, rpu, pq"rpp, uq"pu, pq, rpp, pq"pp, pq.

Since we have only unary reactions, the underlying differential system is linear, and we can use matrix notation (but our framework also apply to non linear systems).

We denote each element ⇢ of R V as a vector r⇢pu, uq, ⇢pu, pq, ⇢pp, uq, ⇢pp, pqs. We get, by using a matrix notation: Then we can check that:

F " » - - - ´2k 1 000 k 1 ´k1 00 k 1 0 ´k1 0 0 k 1 k 1 ´k2
P r ˆF ˆZr " » - - - ´2k 1 000 2k 1 ´k1 00 00 0 0 0 k 1 0 ´k2 fi ffi ffi fl ,
thats to say that the matrix P r ˆF ˆZr is exactely the one that is induced by the set of the simplified reaction in Figure 2.2.

Combining model reductions

An existing model reduction can be abstracted further thanks to a bisimulation induced by an equivalence relation over the concrete variables.

Theorem 2.4.1. Let pV, F, V 7 , , F 7 q be a model reduction, r be an idempotent mapping over V such that r induces a bisimulation over the autonomous system pV, Fq, and r 7 be an idempotent mapping over V 7 . We assume that the following square:

P r P r 7
commutes. Under this assumption, the tuple pV, F, V 7 ,P r 7 ˝ ,P r 7 ˝F7 ˝Zr 7 q is a model reduction.

Proof. The proof is given by the following commutative diagram:

Pr F F Pr Pr P r 7 Z r 7 P r 7 F 7 P r 7 P r 7 CHAPTER 2.

REDUCTION OF DIFFERENTIAL SEMANTICS

More precisely, given ⇢ P R V ,w eh a v et h a t : rP r 7 ˝ spFp⇢qq " r ˝Pr spFp⇢qq " pP r pFp⇢qqq " pP r pFpP r p⇢qqqq " P r 7 p pFpP r p⇢qqqq " P r 7 pF 7 p pP r p⇢qqqq " P r 7 pF 7 pP r 7 p p⇢qqqq " P r 7 pF 7 pZ r 7 pP r 7 p p⇢qqqqq This way, the abstraction function is obtained as composing the initial abstraction function with the projection P r 7 over the abstract observables. Moreover, the abstract counterpart is defined as P r 7 ˝F7 ˝Zr 7 , meaning that:

1. firstly, we ignore the contribution of each observable which is not the representative of its equivalence class;

2. then, we apply the former abstract counterpart function F 7 ;

3. finally, we collect the contribution of each observable according to their representative.

It is interesting to observe that no commutative diagram is required to relate the functions F 7 and P r 7 . As a conseguence, we just need to prove that r induces a bisimulation in the concrete. Then, to derive this construction, we have to prove that P r 7 ˝ " ˝Pr . To prove this, only the structure of the abstract variables matters (not their dynamics), so the proof is quite simple.

Example 2.4.2. We can use our framework to formalise the reduction we have introduced for the example in Section 1.2.4.

In this example, the protein X has m `n sites: m sites x 1 ,. . . ,x m which are pair-wisely symmetric, and n sites y 1 ,. . . ,y n which are controlled only by the state of the sites x 1 ,. . . ,x m .

We define the function r that maps each configuration of the protein X, to the configuration in which:

1. the state of the site y j is the same for every i between 1 and n, 2. the number of phosphorylated sites among the sites x 1 ,. . . ,x m is the same, 3. there exists k between 1 and m, such that x i is phosphorylated if and only if i ranges between 1 and k.

Since the state of each y j is only controlled by the state of the sites x i .W e can cut each configuration of the protein X into n fragments. Each fragment documents the state of a site y j and the state of all sites x i . The abstraction function maps each state to the function mapping each fragment to the sum of the concentration of the configurations which have the same state for the site y j and the same state for every site x i .

It is worth noting, that whenever a fragment describes the state of a site, it also describes the state of any site that is symmetric to this site. As a consequence we can define, the function r 7 which maps each fragment of the protein X, to the fragment in which:

1. the same site y j is documented and with the same state, 2. the number of phosphorylated sites among the sites x 1 ,. . . ,x m is the same, 3. there exists k between 1 and m, such that x i is phosphorylated if and only if i ranges between 1 and k.

We can check that the following diagram:

P r P r 7
commutes.

As a conclusion, we can simplify the fragments further by taking into account symmetric sites. In fine, we get 2pm `1qn fragments.

Conclusion

We have introduced a generic framework to formalise model reductions for the ODEs semantics of reaction networks. We have considered two kinds of reduction. The first one is based on generic changes of variables. The second one has more structure, it is induced by a bisimulation that is defined by the means of an equivalence relation over the variables of the ODEs. We have shown how to combine these two kinds of model reduction.

We have stated the soundness of our approach: the maximal solutions of the reduced models are the exact projection of the solutions of the initial system.

We are left to profide effective ways of discovering changes of variables and species-based bisimulations. Whereas some frameworks in the literature [START_REF] Petrov | Maximal Reduction of ODE Semantics of Rule-based Models: Syntax-Independent Setup[END_REF] have proposed to explore the set of potential reductions directly at the description level of reaction networks, we will use the high level representation offered by Kappa. This way, our algorithm will only scan the set of Kappa rules and we will never compute the underlying set of chemical reactions.

Chapter 3 Kappa

We introduce Kappa. Kappa is a formal language, based on site graphrewriting, that is suitable to represent and simulate models of signalling pathways [START_REF] Vincent Danos | Rule-based modelling of cellular signalling, invited paper[END_REF][START_REF] Vincent Danos | Scalable simulation of cellular signaling networks[END_REF].

In Kappa chemical species are described as graphs, made of agents. These agents may denote proteins and they may contain some sites. These sites can be bound pair-wise, which encodes for links between proteins. Additionally, sites may carry internal states, that denote properties (as a phosphorylation state for instance). Unlike other site graph-rewriting languages as BNGL [START_REF] Michael | Bionetgen: software for rule-based modeling of signal transduction based on the interactions of molecular domains[END_REF], in Kappa, in each agents, sites are fully identified by a unique site identifier. The main advantage is that it reduces the potential number of embeddings between site-graphs. Indeed, the number of embeddings from a connected site-graph into another connected site-graph is at most linear in the number of agents of the latter one, whereas it can be exponential with more general classes of site-graph.

Interactions between sites are described by the means of rules. These rules are context-free, which means that there is no need to describe the whole state of each chemical species, but only the information that matters to trigger or to tune the speed of the interaction. Because of this, Kappa offers a high level description of chemical interactions. We will see in further chapters that this granularity of description is helpful to discover important properties of interest, that can then be used to reduce the combinatorial complexity of models.

Example

Let us recall the example from Section 1.2.1. We had the following set of reactions:

p1q A, B Ø AB k A ,k 1 A p2q A, BC Ø ABC k A ,k 1 A p3q B, C Ø BC k C ,k 1 C p4q AB, C Ø ABC k C ,k 1 C
over the following set of species:

1. A 2. B 3. C 4. AB 5. BC 6. ABC.
In Figure 3.1 we can see a graphical representation of this set. In Kappa, these species are syntactically denoted as follows: 4. A 1 pb B2@a q, B 2 pa A1@b , cq 5. B 1 pa, c C2@b q, C 2 pb B1@c q 6. A 1 pb B2@a q, B 2 pa A1@b , c C3@b q, C 3 pb B2@c q.

1. A 1 pbq 3.1. EXAMPLE b A B a B a b A (a) A 1 pbq, B 2 paqØA 1 pb B2@a q, B 2 pa A1@b q b A B c B c b C (b) B 1 pcq, C 2 pbqØB 1 pc C2@b q, C 2 pb B1@c q
In Kappa rules, the "don't care, don't write" principle matters: we do not have to specify the whole reactants involved in a reaction but it is enough to express the minimal context that influences this interaction. So a rule can be seen as a symbolical representation for the set of the reactions that can be obtained as a refinement [START_REF] Vincent Danos | Rule-based modelling, symmetries, refinements[END_REF][START_REF] Vincent Danos | Rule-based modelling and model perturbation[END_REF] of this rule.

In our example, the set of reactions can be transformed in the following set of rules:

paq A 1 pbq, B 2 paqØA 1 pb B2@a q, B 2 pa A1@b q k A ,k 1 A pbq B 1 pcq, C 2 pbqØB 1 pc C2@b q, C 2 pb B1@c q k C ,k 1
C . The first rule states that whenever an agent A has a site b that is free, A can bind, by the site b, to an agent B that has its site a free (and neglecting the state of the site c of B, that is to say neglecting whether or not the agent B is already bound to an agent C).

That was expressed by both following reactions:

p1q A, B Ø AB k A ,k 1 A p2q A, BC Ø ABC k A ,k 1
A . The same way, the second rule states that whenever an agent C has a site c that is free, C can bind, by the site c, to an agent B that has its site c free (and neglecting the state of the site a of B, i.e. neglecting if the agent B is already bound to an agent A).

That was expressed by both following reactions: a) and 3.2(b) we can see a graphical representation of the two rules. In Figure 3.3 we give an intuition of the rewriting procedure that allow us to pass from rules to reactions. This will be explained deeper in the next paragraphs.

p3q B, C Ø BC k C ,k 1 C p4q AB, C Ø ABC k C ,k 1 C . In Figures 3.

Syntax

In Kappa, proteins are typically represented by agents. The properties of ag i v e na g e n ta r ee x p r e s s e db ys o m es i t e st h a tm a yc a r r ya ni n t e r n a ls t a t e . Moreover, potential links between proteins are specified by bonds between agent sites.

Signature

Now let us formally introduce the syntax of Kappa.

We assume that we are given:

1. afi n i t es e to fa g e n t st y pe sA (representing different kinds of proteins);

2. afi n i t es e to fs i t e sS (corresponding to protein domains); Intuitively, Σ ◆ pAq is the set of sites which can bear a modifiable internal state w P I (such as a level of energy), whereas Σ λ pAq is the set of sites which can be bound to some other sites. We also denote by Σ the signature map that associates to each agent type A P A the combined interface Σ ◆ pAqYΣ λ pAq.

Patterns

The full syntax for agents is given by the grammar in Figure 3.4.

An agent identifier l belongs to the set N of natural numbers, or to a copy N of the set of natural numbers. Most agents will be identified by numbers in N, whereas identifiers in N will be used temporary when agents are created, before that a proper identifier is allocated.

An interface σ is a list of sites with internal states (denoted as subscripts) and binding states (denoted as superscripts). For every agent A, the set of its internal sites is given by Σ ◆ pAq, whereas the set of its binding sites is given by Σ λ pAq. A site x that has an internal state w P I is written as x w .

When a site is written as x ✏ it means that it does not have an internal state. This can happen:

1. if x P ΣpAqzΣ ◆ pAq, 2. or if the internal state is not specified.

We usually omit the symbol '✏' in examples.

If a site x is in Σ λ pAq, x can be free or bound to some other site. There are several levels of knowledge about the binding states and also several levels of information about the bonds. More specifically:

1. The symbol '✏' means that the site is free.

2. The question mark '?' is used when there is no information about the binding site (it can be free or bound).

3. A binding type B@y is used to denote that the site is linked to the site y of some agent B.

4. A site address B l @y means that the site is linked to the site y of the agent B with identifier l.

A wildcard bond '

´' is used to denote a site that is bound but there is no information about its pattern.

As in the case of internal states, the symbol '✏' is generally omitted. Sometimes we refer to a site as a triple pA, i, xq in A ˆN ˆS.

Definition 3.2.1 (Agent). An agent is defined by a type A in A, an identifier l and an interface σ. Such an agent is denoted by A l pσq.

Definition 3.2.2 (Expression).

An expression E is a sequence of agents such that:

1. each agent is different, by the type or by the identifier, from all the others;

2. for every interface σ, each site appears at most once in the interface σ;

3. each site name occurring in the interface of the agent A occurs in ΣpAq;

4. each site name which occurs in the interface of the agent A with an internal state distinct from '✏' occurs in Σ ◆ pAq;

5. each site name which occurs in the interface of the agent A with a binding state distinct from '✏' occurs in Σ λ pAq.

Given an expression E and an agent A, we define by agentspE, Aq the set of identifiers l such that there exists an agent A in E with identifier l. Definition 3.2.3 (Structural equivalence). The structural equivalence is defined as the smallest equivalence relation on expressions such that:

1. E, A l pσ,s,s 1 , σ 1 q,E 1 " E, A l pσ,s 1 , s, σ 1 q,E 1 3.2. SYNTAX 2. E, a, a 1 ,E 1 " E, a 1 , a, E 1
This equivalence states that the order of sites inside interfaces and the order of agents inside expressions do not matter. Definition 3.2.4 (Pattern). A pattern is an expression E such that if there is an agent A l that holds a site x wich carries a bound A 1 l 1 @x 1 , then there is an agent in E of type A 1 with identifier l 1 , that exhibits a site x 1 with a bound A l @x.

So a pattern has no dangling reference. A pattern is said to be proper if it has only proper agent identifiers (in N).

A pattern is disconnected if E " E 1 ,E 2 where E 1 and E 2 are both not empty patterns. Otherwise, it is connected. A disconnected pattern can be decomposed in a set of connected patterns, called its connected components. Definition 3.2.5 (Pattern component). A pattern component is a connected pattern. Definition 3.2.6 (Mixture). A mixture M is a proper pattern that is fully specified, i.e. such that for every agent A in M the interface of A is fully documented (that is to say it describes the binding state of each site in Σ λ pAq and the internal state of each site in Σ ◆ pAq). Definition 3.2.7 (Species). A species is a non-empty connected mixture or, equivalently, a fully specified non-empty pattern component.

In Figure 3.5 we can see a graphical representation of two agents, respectively R 1 pY1 p , lq and R 2 pY1 p , l E@r q. Both agents are of type R with two sites: Y 1, that expresses an internal state, and l, that expresses a binding state. The agent of Figure 3.5(a) has the internal state of Y 1p h o s p h o r y l a t e d( t h i s is denoted by p)w h e r e a st h es t a t eo ft h es i t el is free. The agent of Figure 3.5(b) has the internal state of Y 1p h o s p h o r y l a t e da sw e l l ,b u tt h es i t el is linked to the site r of some agent E (this is denoted by the binding type E@r).

In Figure 3.6 we can see a species composed by two agents, R 1 and E 1 , that are connected by a bond (there is a link between the site l of the agent R 1 and the site r of the agent E 1 ).

Rules

The dynamic of a system is described by the means of rules. A rule is given by apairofpatternspE `,E r q and a rate constant k (which is a non negative real number), and is usually written as 1. creation: some agents Aīpσq with their full interfaces ΣpAq, with all sites free and all sites s P Σ ◆ defined, are added ( ī P N);

E `k Ñ E r (or, equivalently, E `Ñ E r @k). l Y1 p 1 R (a) R 1 pY1 p , lq l Y1 p E@r 2 R (b) R 2 pY1 p , l E@r q
2. unbinding: some occurences of the wildcard '´', some binding type and some site addresses A i @n are removed;

3. deletion: some agents are removed;

4. modification: some (non empty) internal states are replaced with other (non empty) internal states;

5. binding: some free sites are bound pairwise by using appropriate site addresses.

Between the agents that are neither removed, nor created, there is a bijective correspondence assured by agent types and identifiers. Any two proper agents in correspondence have the same type and their interfaces document the same sites. Note that, according to Definition 3.2.8, binding types and wildcards can be removed but not created.

SYNTAX

Rules with side effects.

We say that a system of rules has side effects if it is possible to modify the state of sites that are not documented in the left hand side of the rules. More precisely, it may happen only in the two following cases:

1. when we remove an agent without checking the binding state of all its sites;

2. when we remove a bond denoted by a binding type or the symbol '´'.

In the first case a side effect is possible (may semantics), in the latter one a side effect is sure (must semantics).

Definition 3.2.9 (May set). Given a rule r we define MAYprq as the set of sites in r that may raise side effects when the rule is applied.

Definition 3.2.10 (Must set). Given a rule r we define MUST prq as the set of sites in r that raise side effects whenever the rule is applied.

Example 3.2.11. Let us consider the following rule r 1 :

A 1 pq k ÑH
that is deleting an agent of type A without any check. If we apply the rule to a mixture of the form:

A 1 pbq,
it happens that all the agents in the mixture are documented in the rule. Instead, if we apply the rule to the following mixture:

A 1 pb B1@a q, B 1 pa A1@b q,
it happens that the agent B 1 is modified even if it is not documented in the rule. So MAYpr 1 q is equal to the site b of the agent A.

Let us consider now the following rule r 2 :

A 1 pb B@a q k ÑH
that is deleting an agent of type A with a link to the site a of some agents B. In this case, even if it is not directly documented by the rule, an agent of type B is modified every time that the rule is applied. So MUST pr 2 q is equal to the site b of the agent A.

Semantics

Now we describe the semantics of Kappa. Firstly, we formalise the effect of applying a rule on a pattern. We use this to define the set of (ground) reactions that are induced by a set of rules in Kappa. Then, we introduce the differential semantics of a Kappa model, as the solution of the set of differential equations that are obtained by applying the principle of mass action over the underlying set of reactions.

Operational semantics

Now we will describe how to apply a rule r, E `k Ñ E r ,t oam i x t u r eE. First of all, it is necessary that the context expressed by the lhs is present in E.

Technically sp eaking, we will say that E `embeds into E.

Example 3.3.1. To have an intuition, we can have a look to Figure 3.7 and observe that the pattern described on the left matches, in some intuitive way, the species described on the right. There we have (on the left) an agent of type R that documents two sites: Y 1 that is specified to be unphosphorylated and l that shows a bond to an agent E by some site s. So we can imagine that the agent R on the left can be matched with the agent R on the right. This one exhibits exactly the same two sites, Y 1 and l.

The state of Y 1 is the same (u) both for the pattern on the left and for the species on the right, so they match. The binding state, denoted by l, corresponds to a binding type in the pattern and to an explicit link in the species. Since the binding type of the pattern denotes a bond to an agent E through the site r whereas the species exhibits an explicit link to the agent E 1 by the site r, they match as well.

Let us describe those concepts formally.

Definition 3.3.2 (Substitution). A substitution φ is a partial mapping from pairs agent/identifier pA, lq (in A ˆpN Y Nq) to agent identifiers (in N Y N).
Clearly, given a pattern E, a substitution φ can be applied only if pA, lqP dompφq for any l P agentspE, Aq.

The purpose of a substitution φ is to replace the agent identifier l with φpA, lq (in the agent).

Definition 3.3.3 (Injective substitution).

A substitution φ is injective if, and only if, for any agent type A and for any two identifiers l, l 1 , we have φpA, lq"φpA, l 1 qñl " l 1 .

◆ " ◆ `, ✏ ùñ ◆ |ù ◆ λ " λ `ùñ λ |ù λ Ǹl @n |ù N @n N l @n |ù λ |ù ? ◆ |ù ◆ `^λ |ù λ `|ù n λ ◆ |ù n λ ◆σ |ù ✏ s |ù s `^σ |ù σ `ùñ s, σ |ù s `, σ σ |ù σ `ùñ N l pσq| ùN l pσ `q Figure 3.8: Agent matching.
An injective substitution is a good candidate to identify the agents of two patterns. More precisely, each agent A `pσ `q in the first pattern can be identified with the agent A l pσq if:

1. agents identifiers are the same, i.e. l " φpA, `q; 2. the signature σ contains more information than the signature σ `.

This second property is formalized by the matching relation |ù given in Figure 3.8.

Yet, since interfaces are defined up to permutations of sites, one may have to reorder the sites before applying the matching relation. This is possible thanks to the structural equivalence defined in Definition 3.2.3. Now we are ready to define an embedding between two patterns. Definition 3.3.4 (Embedding). An embedding φ between two patterns E ànd E is an injective substitution such that:

1. dompφq"tpA, lq|A P A,l P agentspE `,Aqu, 2. for any pA, lqPdompφq, there exists an agent a 1 such that a " a 1 and a 1 |ù φpa `q, where a `is the unique agent in E `of type A with identifier l and a is the unique agent in E of type A with identifier φpA, lq.

Example 3.3.5 (continued). In our example (eg. see Figure 3.5), the embedding between the pattern R 1 pY1 p , lq on the left, and the pattern R 2 pY1 p , l E@r q on the right is induced by the injective substitution that maps the pair pR, 1q to the agent identifier 2.

Definition 3.3.6 (Clean substitution). A clean substitution is a substitution such that for any couple pA, lqPpA ˆNqXdompφq, we have:

φpA, lq" l.

Definition 3.3.7 (Clean embedding). An embedding is clean if it is a clean substitution.

Definition 3.3.8 (Isomorphic embedding). Whenever there exist an embedding φ between E `and E and an embedding φ 1 between E and E `we say that φ is an isomorphic embedding.

We notice that embeddings between two species are isomorphic embeddings.

Generally, given two pattern components C 1 and C 2 there can be several embeddings of the former into the latter. We will write rC 1 ,C 2 s for the set of such embeddings. In usual graph theory, the number of embeddings between two connected graphs may be exponential with respect to the size of these graphs. In Kappa, the number is at worst linear due to the fact that sites are uniquely named. We call this the rigidity principle. Lemma 3.3.9 (rigidity). An embedding of a pattern component C 1 into a pattern component C 2 is fully defined by the image of one agent. That is to say, whenever there are i, φ, and φ 1 such that φ PrC 1 ,C 2 s, φ 1 PrC 1 ,C 2 s and φpiq"φ 1 piq, then φ " φ 1 .

Proof. Given two agents, n and n 1 we say that there is a basic path from A 0 to A 1 if there exist a site x belonging to n and a site x 1 belonging to n that are bound together. We denote it as n.x " x 1 .n 1 .

Given two agents, n and n 1 we say that there is a path from n to n 1 ,i f there exists a finite sequence of agents A i such that A 0 " n and for any i it exists a basic path from A i to A i`1 .

We denote a path between n and n 1 as a sequence

n.x " px i .A i`1 .x i`1 "q ‹ x 1 .n 1
λ " ✏,N@n, ´, ? ùñ φpλq"λ φpN l @nq"N φpN,lq @n φpn λ ◆ q"n φpλq ◆ φps, σq" φpsq, φpσq φpN l pσqq " N φpN,lq p φpσqq Figure 3.9: Agent substitution.

where n is the starting agent, x is the site of n that is linked to the successor, n 1 is the final agent and x 1 is its entry site. Between n and n 1 there could be ap o s s i b l ye m p t yl i s to fa g e n t sd e n o t e da sx i .n i .x i`1 , where n i is the agent, x i is the entry site and x i`1 is the exit site. Now, let C 1 and C 2 be two pattern components and φ, φ 1 be two different embeddings in rC 1 ,C 2 s.

Let us suppose it exists n P A C 1 such that φpnq"φ 1 pnq. If there is just one agent in C 1 then φ " φ 1 and we have done. Otherwise, since

C 1 is connected, it exists an agent n 1 in C 1 such that there is a path from n to n 1 in C 1 . Let p " n.x " x 1 .n 1 .x 2 " ¨¨¨" x 1 .n 1 be this path. So the image of p by φ is in C 1 .
We know that φpnq"φ 1 pnq, so φpnq.x " φ 1 pnq.x and φpn 1 q"φ 1 pn 1 q. Since this is true for all the steps in the path, we have φ " φ 1 .

In general an epimorphism (epi) is an embedding

φ PrC 1 ,C 2 s such that, for all φ 1 PrC 2 ,C 3 s, φ 2 PrC 2 ,C 3 s, φ 1 φ " φ 2 φ implies φ 1 " φ 2 .
Lemma 3.3.10. An embedding between two non-empty connected components is necessarily an epimorphism. That is to say, if C is a pattern component, φ PrC 1 ,Cs is an epi if and only if C 1 is not empty.

Proof. We have to prove that if φ 1 ˝φ " φ 2 ˝φ, then φ 1 " φ 2 .

Let C be a pattern component, C 1 be non-empty and φ PrC 1 ,Cs. Let C 2 be another pattern component and φ 1 , φ 2 Pr C, C 2 s. Since C 1 is not empty we can consider n P C 1 such that φ 1 pφpnqq " φ 2 pφpnqq.

Let n 1 " φpnq.W eh a v eφ 1 pn 1 q"φ 2 pn 1 q. Since C 2 is a pattern component we can apply Lemma 3.3.9, so φ 1 " φ 2 .

Corollary 3.3.11. φ Pr Z 1 ,Z 2 s is an epi if and only if the image of Z 1 intersects each component of Z 2 .
◆r✏s"◆◆ rw r s"w r λr✏s"✏λ rN l @ns"N l @n λrN @ns"λ λr´s " λ λr?s"λ n λ ◆ rn λr ◆r s"n λrλrs ◆r◆rs

σr✏s"σ ps, σqrs r , σ r s"srs r s, σrσ r s N l pσqrN l pσ r qs " N l pσrσ r sq Now, let E be a pattern, let r :" E `k Ñ E r be a rule and let φ be an embedding between E `and E. Since for any agent A we have agentspE `,Aq Ñ N, φ is clean. We are ready to define the result of the application of the rule r to the pattern E.

In order to do this, we need to consider three different kinds of agents:

1. the agents A l `pσ `q that are preserved by the rule: A l `pσ `q appears in E ànd there exists an interface σ r such that A l `pσ r q appears in E r ;

2. the agents A lr pσ r q that are created by the rule: A lr pσ r q appears in E r but there is no agent of type A with identifier l r that appears in E `;

3. the agents A l `pσ `q that are deleted by the rule: A l `pσ `q appears in E but there is no agent of type A with identifier l `that appears in E r .

We need to extend the embedding φ in order to be able to deal with newly created agents. Thus we define the clean injective substitution φ ‹ over dompφqYpA ˆNq by φ ‹ pA, iq"φpA, iq for any pA, iqPdompφq and φ ‹ pA, īq" ī when ī P agentspE r ,AqX N (this way, φ ‹ preserves temporary identifiers).

Then:

1. for any agent A l `pσ `q that is removed, the agent of type A with identifier φpA, l `q is removed in E;

2. for any agent A r pσ r q that is created, the agent φ ‹ pA r pσ r qq is added in E;

3. and for any agent A l `pσ `q that is preserved:

(a) we denote by A r pσ r q and Apσq the agents in E r and E which have the same type and the same identifier as the agent A `pσ `q;

(b) then we select an agent A 1 pσ 1 q (the choice does not matter) such that Apσq"A 1 pσ 1 q and A 1 pσ 1 q| ù φpA `pσ `qq;

(c) then the agent Apσq is replaced with agent A 1 pσ 1 qr φ‹ pA r pσ r qqs, where .r.s is the replacement function defined in Figure 3.10.

We denote by ErE r s φ the obtained expression (which is well defined up to "-equivalence). One shall notice that ErE r s φ might not be a pattern, because there might be some pending bonds, which are sites with a binding state of the form A l @x such that:

1. either the agent of type A and identifier l has been removed; 2. or the site x of the agent A and identifier l has been made free.

In order to remove pending bonds, we introduce a function clean such that cleanpEq is obtained by replacing with the symbol ✏ each site address A l @x such that:

1. there is no agent A of identifier l in E; 2. or the site x of the agent type A with identifier l is free.

When we apply a rule to a mixture, we expect that the result of the application of the rule will be a mixture as well. Anyway, we notice that cleanpErE r s φ q might not be a mixture because of temporary identifiers. To allocate fresh proper identifiers for the newly created agents, we introduce af u n c t i o nfresh between patterns. freshpEq is obtained by replacing any temporary identifier ī of the agent A by M pAq`i `1, where M pAq is the maximum element of the set t0uYtN X agentspE, Aqu.

Now we can define the operational semantics as a labeled transition system.

The states of the system are mixtures (up to "). We shall notice that the impact of applying a rule E `k Ñ E r on a mixture is fully defined (up to ")b ythecleanem beddingφ between the lhs E `of the rule and the mixture E. So, we define the set L of labels as the set of tuples pr, E, φq, where:

1. r is a rule, 2. E is a state, and 3. φ is an embedding between the left hand part of the rule and E. We consider the following signature:

A "t Au I "H S "t a, bu Σ λ pAq"t a, bu Σ ◆ pAq"H ,
the following mixture:

A 1 pa A2@b , b A3@a q, A 2 pa, b A1@a q, A 3 pa A1@b , bq and the following rule:

A 1 paq k Ñ A0pa, bq.
Intuitively, this rule can be applied with an agent of type A, that has the site a which is free (and without considering the state of the site b). Applying the rule consists in removing the agent A 1 paq before creating a new agent A 0 pa, bq of type A with both sites a and b free (no site is preserved).

There exists only one embedding between the lhs A 1 paq of the rule and the mixture E, that is:

φ "rA, 1 Ñ 2s.

ErE `sφ is equal to the expression A 1 pa A2@b , b A3@a q, A0pa, bq, A 3 pa A1@b , bq.

This expression has a dangling bond on the site a of the agent A 1 :

A 1 pa A2@b , b A3@a q,
so the primitive clean is applied to remove it. Indeed the result of: cleanpErE r s φ q is equal to the expression:

A 1 pa, b A3@a q, A0pa, bq, A 3 pa A1@b , bq.

Then the temporary identifier 0 is replaced with 4 by the primitive fresh and the result of: is equal to: A 1 pa A2@b , b A3@a q, A 4 pa, bq, A 3 pa A1@b , bq, as depicted in Figure 3.12.

Differential semantics

In order to define the concrete differential semantics for Kappa, we need to consider a set of rules R and a finite set of species V such that:

1. V is closed under application of the rules in R,

2.

V has at most one representative for each species isomorphism class.

More formally:

1. for any mixture E, any pattern component which is isomorphic to an element in V,a n yr u l eE `Ñ E r , and any embedding φ between E ànd E, each pattern component in cleanpErE r s φ q is isomorphic to an element in V;

2. for any pair pv, v 1 q of elements in V, if there exists an embedding between v and v 1 , then v " v 1 .

In order to ensure the finiteness of the set V, we assume that species contain no cycle. Formally, for any species S, we define the non-oriented graph GpSq, by the following constraints:

1. the nodes of GpSq are the agents of the species S;

2. there is an edge between to nodes pA, iq and pA 1 ,i 1 q in GpSq if and only if, there exists two site names x and x 1 such that there is a link between the site pA, i, xq and pA 1 ,i 1 ,x 1 q in the species S.

For any species S, we assume that:

1. for every two agents pA, iq and pA 1 ,i 1 q, there is at most one link in the species S, between the sites of the agent pA, iq and the sites of the agent pA 1 ,i 1 q;

2. the graph GpSq is acyclic.

The states ⇢ of the system are mappings from chemical species v P V to real numbers in R `(⇢pvq denotes the concentration of the species v). So as to define the function F which specifies the behavior of the system, we consider the set of chemical reactions which are generated by the set of rules R.

Given a rule r :" E `k Ñ E r in R, we may assume without any loss of generality that E `is written as C 1 ,...,C k where each C i is a pattern component.

A reaction is obtained, by choosing for any integer i between 1 and k, ar e a c h a b l es p e c i e sv i P V and an embedding φ i between C i and v i . The expression v 1 ,...,v k might not be a mixture because distinct species may share some agent identifiers. In order to define the product of a reaction, we choose k species w 1 ,...,w k and k embedding 1 ,..., k such that w 1 ,...,w k is a mixture, and that for any i between 1 and k, i is an embedding between v i and w i . This way, we form a composite embedding φ " ∞ i i ˝φi between E `and w 1 ,...,w k . The result of the application of the rule r on w 1 ,...,w k along φ is isomorphic to a tuple of species in V that we denote by p 1 ,...,p l (we can check that p 1 ,...,p l does not depend on the choice of the w 1 ,...,w k ).

Then the function F is obtained by summing up the contribution of each reaction. The consumption of the reactants will give the following negative contribution:

Fp⇢qpv j q " γ π i p⇢pv i q|1 § i § kq.
whereas the positive contribution is given by the production of species in V:

Fp⇢qpp j 1 q " γ π i p⇢pv i q|1 § i § kq.
Where:

1. γ is the quotient between k and the number of embeddings from E `to itself, 2. j ranges between 1 and k,a n d 3. j 1 ranges between 1 and l.

The obtained autonomous system pV, Fq is positive. Indeed, for any species v P V, Fpvq can be written as: ´⇢pvq¨P r⇢pv 1 q,...,⇢pv m qs `Qr⇢pv 1 1 q,...,⇢pv 1 n qs, where P and Q are two polynomial mappings with positive coefficients and v 1 ,...,v m ,v 1 1 ,...,v 1 n are m `n species in V.

Conclusion

We have introduced the syntax and the semantics of Kappa. We have seen that Kappa offers a compact description of reaction networks. Indeed each rule denotes a symbolic representation of a set of reactions, that applies the same transformation in different contexts of application.

We have introduced the ODEs semantics of a set of rules as the ODEs system that is obtained by applying the principle of mass action law to the underlying set of reactions. This is a mathematical definition that is mandatory to state the soundness of our approach. We will never compute the underlying set of reactions of a Kappa model explicitly.

Chapter 4 Symmetries

In this chapter we investigate a class of sites with specific properties of symmetry. Given two sites x and y in an agent A and a set of rules R, we will say that they are symmetric if they play the same role respect to the set of rules R.

After providing some intuitions over well-chosen examples, we will formalise the notion of "playing the same role". Then, we show that the equivalence relation, that identifies the species that can be obtained by swapping symmetric sites, induces a bisimulation over the semantics of R, hence a model reduction.

Case studies

We start with a series of examples to illustrate how to detect when some sites have the same capability of interaction. This information will be used to transform the original system into a more compact one.

First case study

In our first example, we consider one kind of agent, A. We suppose that an agent A has two sites:

1. as i t ex, 2. as i t ey.

The state of a protein A is denoted as an ordered couple of symbols among tu, pu. The symbol u indicates an unphosphorylated site, whereas the symbol p indicates a phosphorylated one. For example, a protein A having both sites x and y phosphorylated is denoted as Arp, ps. We start by considering the set of reactions given in Figure 4.1. The sites x and y of the protein A can all be phosphorylated at the same rate constant k 1 . Moreover, we assume that a protein A that has both sites phosphorylated can be degraded with a rate constant k 2 .

This model can be encoded in Kappa thanks to the following set of rules:

1. A 1 px u qÑA 1 px p q @ k 1 2. A 1 py u qÑA 1 py p q @ k 1 3. A 1 px p , y p qÑ @ k 2 .
The first spontaneous observation is that x and y have exactly the same activation rate. Now we wonder if x and y play an identical role in each instance of the protein A. So, for each rule, we propose to replace the occurrence of each site with all the combinations among x and y, while dividing the kinetic rates by the number of combinations (in all the set). By performing this change, we need to take care of gain and loss of automorphisms.

In our specific case the site x in the first rule will be substituted twice, once with x and once with y. Since there are two possible combinations the rate constant k 1 will be divided by 2.

From our set of rules we obtain the following substitutions:

1. A 1 px u qÑA 1 px p q @ k 1 4.1. CASE STUDIES 57 (a) A 1 px u qÑA 1 px p q @ k1 2
(by changing nothing) (b) A 1 py u qÑA 1 py p q @ k1 2

(by replacing x with y)

2. Apy u qÑApy p q @ k 1 (a) Apx u qÑApx p q @ k1 2

(by replacing y with x)

(b) Apy u qÑApy p q @ k1 2
(by changing nothing)

3. A 1 px p , y p qÑ @ k 2 (a) A 1 px p , y p qÑ @ k2 2 (by changing nothing) (b) A 1 py p , x p qÑ @ k2 2
(by replacing x with y and y with x).

By summing up the rules that are syntactically equivalent, we obtain the following set:

1. A 1 px u qÑA 1 px p q @ k1 2 `k1 2
(given by 1.paq`2.paq)

2. A 1 py u qÑA 1 py p q @ k1 2 `k1 2
(given by 1.pbq`2.pbq)

3. A 1 px p , y p qÑ @ k2 2 `k2 2
(given by 3.paq`3.pbq).

So we find a set of rules that is identical to the one we started from. By this, we can conclude that the sites x and y play exactly the same role and that the set of reactions showed in Figure 4.2 is equivalent to the one showed in Figure 4.1.

Second case study

As in the first case study, we will consider an agent A carrying two sites, x and y, that can be phosphorylated or not. Anyway the behaviour of the system will be slightly modified. Like before the sites can be both activated, but that time x has an activation rate constant equal to k 1 , whereas y has CHAPTER 4. SYMMETRIES an activation rate constant equal to k 2 . Once that a protein A has both sites x and y phosphorylated, it can be degraded with a rate constant equal to k 3 . The behaviour of the system is described by the set of reactions given in Figure 4.3 and it corresponds to the following set of Kappa rules.

1. Apx u qÑApx p q @ k 1 2. Apy u qÑApy p q @ k 2 3. Apx p , y p qÑ @ k 3 .

As before, we wonder if x and y play exactly the same role for each instance of the protein A. So, again, we propose to replace each rule with all the combinations of rules that can be obtained by replacing (independently) each occurrence of x and y with x or y and dividing the kinetic rates by the number of combinations (in all the set). By performing this change, we need to take care of gain and loss of automorphisms.

With our example we obtain the following set of substitutions.

1. A 1 px u qÑA 1 px p q @ k 1 (a) A 1 px u qÑA 1 px p q @ k1 2
(by changing nothing) (b) A 1 py u qÑA 1 py p q @ k1 2

(by replacing x with y)

2. A 1 py u qÑA 1 py p q @ k 2 (a) A 1 px u qÑA 1 px p q @ k2 2
(by changing nothing) (b) A 1 py u qÑA 1 py p q @ k2 2

(by replacing x with y)

3. A 1 px p , y p qÑ @ k 3 (a) A 1 px p , y p qÑ @ k3 2 (by changing nothing) (b) A 1 py p , x p qÑ @ k3 2
(by replacing x with y and y with x)

And we get the following set of rules. 2. A 1 py u qÑA 1 py p q @ k1 2 `k2 2 (given by 1.pbq`2.pbq)

1. A 1 px u qÑA 1 px p q @
3. A 1 px p , y p qÑ @ k3 2 `k3 2
(given by 3.paq`3.pbq)

As we can observe, in order to recover the set of rules that we started from, it is necessary that k 1 " k 2 . So, the site x and y play exactly the same role if and only if k 1 " k 2 . In this case, we are back to the example of Section 4.1.1.

Third case study

In our third example, we consider a protein A carrying two sites, x and y. This two sites can be free or can be bound to another instance of the same site (in a different protein). Here we face with a case of polymerisation, so it is not possible anymore to write the full set of reactions. Anyway the behaviour of the system can be summarised by the following set of Kappa rules.

1. A 1 pxq, A 2 pxqÑA 1 px A2@x q, A 2 px A1@x q @ k 2. A 1 pyq, A 2 pyqÑA 1 py A2@y q, A 2 py A1@y q @ k.

As in the previous cases we would like to understand if x and y play exactly the same role in each instance of the protein A. Again, we propose to replace each rule with all the combinations of rules that can be obtained by replacing (independently) each occurrence of x and y with x or y and dividing the kinetic rates by the number of combinations (in all the set). By performing this change, we need to take care of gain and loss of automorphisms.

From our example we obtain the following set of substitutions.

1. A 1 pxq, A 2 pxqÑA 1 px A2@x q, A 2 px A1@x q @ k CHAPTER 4. SYMMETRIES (a) A 1 pxq, A 2 pxqÑA 1 px A2@x q, A 2 px A1@x q @ k 4

(by changing nothing) (b) A 1 pyq, A 2 pxqÑA 1 py A2@x q, A 2 px A1@y q @ k 4 ¨1 2 (by replacing x with y in A 1 ) (c) A 1 pxq, A 2 pyqÑA 1 px A2@y q, A 2 py A1@x q @ k 4 ¨1 2 (by replacing x with y in A 2 ) (d) A 1 pyq, A 2 pyqÑA 1 py A2@y q, A 2 py A1@y q @ k 4

(by replacing x with y in both A 1 and A 2 ) 2. A 1 pyq, A 2 pyqÑA 1 py A2@y q, A 2 py A1@y q @ k (a) A 1 pyq, A 2 pyqÑA 1 py A2@y q, A 2 py A1@y q @ k 4 (by changing nothing) (b) A 1 pxq, A 2 pyqÑA 1 px A2@y q, A 2 py A1@x q @ k 4 ¨1 2 (by replacing y with x in A 1 ) (c) A 1 pyq, A 2 pxqÑA 1 py A2@x q, A 2 px A1@y q @ k 4 ¨1 2 (by replacing y with x in A 2 ) (d) A 1 pxq, A 2 pxqÑA 1 px A2@x q, A 2 px A1@x q @ k 4 (by replacing y with x in both A 1 and A 2 ) and we obtain the following set of rules:

1. A 1 pxq, A 2 pxqÑA 1 px A2@x q, A 2 px A1@x q @ k 2
(given by 1.paq`2.pdq) 2. A 1 pyq, A 2 pyqÑA 1 py A2@y q, A 2 py A1@y q @ k 2 (given by 2.paq`1.pdq) 4.1. CASE STUDIES 61 3. A 1 pxq, A 2 pyqÑA 1 px A2@y q, A 2 py A1@x q @ k 2 (given by 1.pbq`1.pcq`2.pbq`2.pcq).

So, since the third rule does not belong to the original set, the two systems are equivalent if, and only if, k is equal to 0.

Fourth case study

In our last example, we consider again a protein A carrying two sites, x and y. The two sites can be bounded together or to another instance of the same site. As before, that system allows polymerization, so it is not possible to write the full set of reactions. Anyway, we can describe its behavior by the following set of Kappa rules.

1. A 1 pxq, A 2 pxqÑA 1 px A2@x q, A 2 px A1@x q @ k 1 2. A 1 pyq, A 2 pyqÑA 1 py A2@y q, A 2 py A1@y q @ k 2 3. A 1 pxq, A 2 pyqÑA 1 px A2@y q, A 2 py A1@x q @ k 3 4. A 1 pyq, A 2 pxqÑA 1 py A2@x q, A 2 px A1@y q @ k 4 .

If we apply the transformation that replaces each rule with all the combinations of rules which can be obtained by replacing (independently) each occurence of x and y with x or y, we get this result.

1. A 1 pxq, A 2 pxqÑA 1 px A2@x q, A 2 px A1@x q @ k 1 (a) A 1 pxq, A 2 pxqÑA 1 px A2@x q, A 2 px A1@x q @ k1 4 (by changing nothing) (b) A 1 pyq, A 2 pxqÑA 1 py A2@x q, A 2 px A1@y q @ k1 4 ¨1 2 (by replacing x with y in A 1 ) (c) A 1 pxq, A 2 pyqÑA 1 px A2@y q, A 2 py A1@x q @ k1 4 ¨1 2 (by replacing x with y in A 2 ) (d) A 1 pyq, A 2 pyqÑA 1 py A2@y q, A 2 py A1@y q @ k1 4 (by replacing x with y both in A 1 and A 2 ) 2. A 1 pyq, A 2 pyqÑA 1 py A2@y q, A 2 py A1@y q @ k 2 (a) A 1 pyq, A 2 pyqÑA 1 py A2@y q, A 2 py A1@y q @ k2 4 (by changing nothing) (b) A 1 pxq, A 2 pyqÑA 1 px A2@y q, A 2 py A1@x q @ k2 4 ¨1 2 (by replacing y with x in A 1 ) (c) A 1 pyq, A 2 pxqÑA 1 py A2@x q, A 2 px A1@y q @ k2 4 ¨1 2 (by replacing y with x in A 2 ) (d) A 1 pxq, A 2 pxqÑA 1 px A2@x q, A 2 px A1@x q @ k2 4

(by replacing y with x both in A 1 and A 2 ) 3. A 1 pxq, A 2 pyqÑA 1 px A2@y q, A 2 py A1@x q @ k 3 (a) A 1 pxq, A 2 pyqÑA 1 px A2@y q, A 2 py A1@x q @ k3 4 (by changing nothing) (b) A 1 pyq, A 2 pyqÑA 1 py A2@y q, A 2 py A1@y q @ k3 4

¨2

(by replacing x with y in A 1 ) (c) A 1 pxq, A 2 pxqÑA 1 px A2@x q, A 2 px A1@x q @ k3 4

¨2

(by replacing y with x in A 2 ) (d) A 1 pyq, A 2 pxqÑA 1 py A2@x q, A 2 px A1@y q @ k3 4 (by replacing x with y in A 1 and y with x in A 2 ) 4. A 1 pyq, A 2 pxqÑA 1 py A2@x q, A 2 px A1@y q @ k 4 (a) A 1 pyq, A 2 pxqÑA 1 py A2@x q, A 2 px A1@y q @ k4 4 (by changing nothing) (b) A 1 pxq, A 2 pxqÑA 1 px A2@x q, A 2 px A1@x q @ k4 4

¨2

(by replacing y with x in A 1 )

CASE STUDIES

63

(c) A 1 pyq, A 2 pyqÑA 1 py A2@y q, A 2 py A1@y q @ k4 4

¨2

(by replacing x with y in A 2 ) (d) A 1 pxq, A 2 pyqÑA 1 px A2@y q, A 2 py A1@x q @ k3 4

(by replacing y with x in A 1 and x with y in A 2 ).

By summing up syntactically equivalent rules, we obtain:

1. A 1 pxq, A 2 pxqÑA 1 px A2@x q, A 2 px A1@x q @ k1 4 `k2 4 `k3 2 `k4 2 (given by 1.paq`2.pdq`3.pcq`4.pbq) 2. A 1 pyq, A 2 pyqÑA 1 py A2@y q, A 2 py A1@y q @ k1 4 `k2 4 `k3 2 `k4
2 (given by 1.pdq`2.paq`3.pbq`4.pcq) 3. A 1 pxq, A 2 pyqÑA 1 px A2@y q, A 2 py A1@x q @ k1 8 `k2 (given by 1.pcq`2.pbq`3.paq`4.pdq) 4. A 1 pyq, A 2 pxqÑA 1 py A2@x q, A 2 px A1@y q @ k1 8 `k2 8 `k4 4 `k4 4 (given by 1.pbq`2.pcq`3.pdq`4.paq).

We notice that the rules: A 1 pxq, A 2 pyqÑA 1 px A2@y q, A 2 py A1@x q and: A 1 pyq, A 2 pxqÑA 1 py A2@x q, A 2 px A1@y q perform exactly the same action. Thus we can gather their contribution. As a result, we can conclude that the initial system and the transformed one will have the same behaviour if, and only if,

k 1 " k 2 " k 3 `k4 . A z #l B.x A z #l B.y

Permutations of sites in Kappa 4.2.1 Transpositions of sites

In this section, we formalise the action of a transposition of two sites on patterns and rules. This notion will be used to define when two sites are symmetric for a given set of rules.

We consider two kinds of transformation of patterns:

1. transposition of binding types;

2. transposition of states.

The former one consists in replacing a site name with another one in an instance of a binding type. This is defined as follows:

Definition 4.2.1 (Transposition of binding types). A transposition of binding types is defined as a tuple pA, l, z, B, x, yqPA ˆN ˆS ˆA ˆS ˆS such that z P Σ λ pAq and x, y P Σ λ pBq.

In Figure 4.4 we can see an agent A with a site z that exhibits a binding type B@x that is replaced with a binding type B@y. The second kind of transposition consists in permuting the state of two sites in one agent. This is defined as follows: Definition 4.2.2 (Transposition of states). A transposition of states is defined as a tuple pA, l, x, yqPA ˆpN Y NqˆS ˆS such that the following properties are satisfied:

1. the site x belongs to the set ΣpAq; 2. the site x belongs to Σ ◆ pAq if and only if the site y belongs to Σ ◆ pAq; In Figure 4.5 a transposition of states is applied to an agent A that has the site x phosphorylated and the site y unphosphorylated. The result is an agent A where the states of the two sites are swapped (after the transposition the site x is unphosphorylated and the site y is phosphorylated).

A transposition is either a transposition of binding types or a transposition of states. The set of all transpositions is denoted by T.

Action of a transposition on patterns

We will see how transpositions operate on patterns.

Action of a transposition of binding types on a pattern

Let E be a pattern. A transposition of binding type t :"p A, l, z, B, x, yq operates on E in the following way (as showed in Figure 4.4):

1. if E contains an agent A with identifier l documenting the site z, then if the binding state of z is the binding type B@x, it is replaced with the binding type B@y;

2. else if the binding state of z is the binding type B@y, then it is replaced with the binding type B@x;

3. in any other cases, E is not modified.

Action of a transposition of states on a pattern.

Let E be a pattern. If E exhibits an agent A with identifier l, the transposition of states pA, l, x, yq denotes that we want to permute the internal state or the binding state of the sites x and y in the agent A with identifier l (as showed in Figure 4.5). The transformation is defined in two steps.

Firstly we define E 1 as the expression which is obtained by replacing any instance of a site address A l @x with the site address A l @y and vice versa.

Let us write E 1 as a sequence a 1 1 ,..,a 1 n of agents. We know that there exists au n i q u ea g e n ta 1 k in E 1 of type A and identifier l. Let us write a 1 k :" A l pσq. We define the expression E 2 by replacing in E 1 the agent a 1 k with the agent A l pσ 1 q where σ 1 is defined as the interface where:

1. the site x appears in σ 1 if and only if the site y appears in σ, then the value of the two sites is the same;

2. the site y appears in σ 1 if and only if the site x appears in σ, then the value of the two sites is the same;

3. any site z in ΣpAqztx, yu that appears in σ it appears also in σ 1 with the same value.

The expression E 2 is called the result of the application of the transposition t on the pattern E. Whenever there is no agent A with identifier l in the pattern E then the pattern E remains unchanged.

Given a transposition t, we denote by subspt, Eq the result of the application of the transposition t on the pattern E. We notice that if E is a pattern, then subspt, Eq is a pattern too. Moreover, if E is a proper pattern (resp. a mixture, resp. a species), then subspt, Eq is a proper pattern (resp. a mixture, resp. a species) as well.

Example 4.2.3. We consider the following signature:

• A "tA, Bu,
• S "tx, y, zu,

• I "H, • Σ ◆ pAq"Σ ◆ pBq"H,
• and Σ λ pAq"Σ λ pBq"tx, y, zu.

We consider the pattern:

E :" A 1 px A 2 @
y q,A 2 py A 1 @x ,z B@x q.

PERMUTATIONS OF SITES IN KAPPA

67

Applying the transposition of binding types t 1 :"p A, 2, z, B, x, yq to E replaces the binding type B@x with the binding type B@y in the agent A with identifier 2: subspt 1 ,Eq"A 1 px A 2 @y q,A 2 py A 1 @x ,z B@y q.

Moreover, applying the transposition of states t 2 :"p A, 1, x, yq to E is computed in two steps. Firstly we replace the site address A 1 @x with the site address A 1 @y , secondly we replace the site name x with the site name y in the agent A with identifier 1. Thus, we get: subspt 2 ,Eq"A 1 py A 2 @y q,A 2 py A 1 @y ,z B@x q.

Lastly, applying the transposition of states t 3 :"p A, 2,y,zq is computed in two steps. Firstly we replace the site address A 2 @y with the site address A 2 @z, secondly we swap the states of the site y and of the site z in the agent A with identifier 2. Thus, we get: subspt 3 ,Eq"A 1 px A 2 @z q,A 2 pz A 1 @x ,y B@x q.

Action of a transposition on a rule

Given a set of rules R, let us consider a rule r :" E `k Ñ E r and a transposition t. The rule:

r 1 :" subspt, E `q k 1 Ñ subspt, E r q,
where k 1 " k ¨cardprsubspt,E `q,subspt,E `qsq cardprE `,E `sq , is well-defined.

In such a case, the rule r 1 is called the action of the transposition t on the rule r, and it is denoted by subs R pt, rq. Special care has to be taken about the kinetic rates of rules to account for the potential gain/loss of automorphisms in their lhs.

Action of a transposition on a rule application

In this section, we show that the action of a transposition is compatible with the notion of matching between patterns and with the notion of agent replacement. As a consequence we can apply transpositions directly on rule applications. Proposition 4.2.4 (Transposition of states on agent matching). Let A `pσ `q and B i pσ i q be two agents such that B i pσ i q| ùA `pσ `q and let t "pB, i, x, yq be a transposition that operates on B i pσ i q. Then the transposition t 1 "pA, `, x, yq is such that subspt, B i pσ i qq |ù subspt 1 ,A `pσ `qq.

Proof. Since B i pσ i q| ùA `pσ `q we know that the type of the two agents is the same. So Σ ◆ pAq"Σ ◆ pBq and Σ λ pAq"Σ λ pBq The only sites that can be affected by the transposition are x and y. We face several cases.

1. x and y do not appear in σ `. We consider σ i " σ i 1 , σ i 2 , where σ i 2 is equal to σ i without the sites x, y and σ i 2 is equal to the site x, y in σ i . Since x and y do not appear in σ `we know that

σ i 1 |ù ✏ and σ i 2 |ù σ `. So subspt, B i pσ i 1 , σ i 2 qq " B i pσ 1 i 1 , σ i 2 q and subspt, A `q"A `pσ `q. Since σ 1 i 1 |ù ✏ and σ i 2 |ù σ `,w eh a v esubspt, B i pσ i qq |ù subspt, A `pσ `qq.
2. x appears in σ `and y does not. If x appears in σ `then it appears also in σ i . We can write σ `" x `, σ 1 `and σ i "

σ 1 i ,x i , σ 2 i where σ 1 i " ✏ or σ 1 i " y i .W e h a v e σ 1 i |ù ✏, x i |ù x `and σ 2 i |ù σ 1 `.W e t a k e t 1 " pA, `, x, yq. subspt, B i pσ i qq " subspt, B i pσ 1 i ,x i , σ 2 i qq. subspt 1 ,A `pσ `qq " subspt, A `px `, σ 1 `qq " A `py `, σ 1 `q.
Since the transposition t on B i assigns the former value of the site x to the site y,w eh a v ey i |ù y `, subspt, B i pσ

1 i qq |ù ✏ and subspt, B i pσ 2 i qq " B i pσ 2 i q| ùA `pσ 1 `q"subspt 1 ,A `pσ 1 `qq.
So subspt, B i pσ i qq |ù subspt 1 ,A `pσ `qq.

3. y appears in σ `and x does not. This case is symmetrical to the previous one.

4.

x and y appear in σ `. Since x and y appear in σ `they appear also in σ i . Let us write σ `" x `,y `, σ 1 `and σ i " x i ,y i , σ 1 `.W eh a v et h a tx i |ù x `, y i |ù y `and σ 1 i |ù σ 1 `.W et a k et 1 "p A, `, x, yq. Since the transpositions just swaps the value of x and y we have that subspt, B i pσ i qq |ù subspt, A `pσ `qq.

Proposition 4.2.5 (Transposition of binding types on agent matching).

Let A `pσ `q and B i pσ i q be two agents such that B i pσ i q| ùA `pσ `q and let t "p B, i, z, C, x, yq be a transposition on binding types that operates on B i pσ i q. Then subspt, B i pσ i qq |ù subspt 1 ,A `pσ `qq, where t 1 is the transposition pA, `, z, C, x, yq.

Proof. We have the following cases.

1. The site z does not appear in σ `.W eh a v esubspt 1 ,A `pσ `qq " A `pσ `q.

Since the transposition t does not modify any other site in B i pσ i q, subspt, B i pσ i qq |ù A `pσ `q.

PERMUTATIONS OF SITES IN KAPPA

2. The site z appears in σ `and σ i can be written as z C@x , σ 1 i . We can have σ `" z C@x , σ 1 `or σ `" z ? , σ 1 `. Since B i pσ i q| ùA `pσ `q,w ek n o wt h a tσ 1 i |ù σ 1

`and z in σ `is matched by z C@x . So the state of z in σ `can be z C@x or ?. In the former case we have subspt, B i pz C@x , σ 1 i qq " B i pz C@y , σ 1 i q| ù A `pz C@y , σ 1 `q"subspt 1 ,A `pσ `qq; in the latter subspt, B i pz C@x , σ 1 i qq " B i pz C@y , σ 1 i q| ùA `pz ? , σ 1 `q"subspt 1 ,A `pσ `qq.

Proposition 4.2.6 (Transposition of states on patterns embedding). Let E `,E be two patterns and t "p A, i, x, yq be a transposition on states that operates on E. Let φ be an injective substitution. Then, if φ induces an embedding from E `to E, then there exists a transposition t 1 such that φ induces an embedding from subspt 1 ,E `q to subspt, Eq.

Proof. Since φ induces an embedding we know that for every agent pA, lq such that A P A and l P agentspE `,Aq, there exists an agent a 1 such that a " a 1 and a 1 |ù φpa `q, where a `is the unique agent in E `of type with identifier l and a is the unique agent in E of type A with identifier φpA, lq. So if we apply the transposition t "pA, i, x, yq to E, we face several cases.

1. There is j P agentspE `,Aq such that i " φpA, jq. Let a 1 be such that a i " a 1 and a 1 |ù a j . Then, by Proposition 4.2.4, it exists t 1 such that subspt, a i q| ùsubspt 1 ,a j q.S oφ induces an embedding from subspt 1 ,E `q to subspt, Eq.

2.

There is no j P agentspE `,Aq such that i " φpA, jq. So, we face two possibilities:

(a) The site x of the agent A i denotes an address C k @z and there is an agent C l in E `such that pC, kq"φpC, lq and the site z of C l denotes the binding type A@x. Then we take t 1 "p C, l, A, x, yq.

We can write E `as C l pσ l q,E 1 `" C l pz A@x σ 1 l q,E 1 `. subspt 1 ,E `q" C l pz A@y σ 1 l q. We have E " A i pσ i q,E 1 " A i px C k @z σ i q,E 1 and subspt, Eq" C l pz A@x σ 2 l q.S o φ induces an embedding from subspt 1 ,E `q to subspt, Eq.

(b) Otherwise we take t 1 "p C, k, A, x, yq, where k is an index that does not appear in E 1 `,a n dw eh a v et h a tφ induces an embedding from subspt 1 ,E `q"E `to subspt, Eq. CHAPTER 4. SYMMETRIES Proposition 4.2.7 (Transposition of binding types on patterns embedding). Let E `,E be two patterns and t "pA, i, z, B, x, yq be a transposition on binding types that operates on E. Let φ be an injective substitution. Then if φ induces an embedding from E `to E, then there exists a transposition t 1 such that φ induces an embedding from subspt 1 ,E `q to subspt, Eq.

Proof. Since φ is an embedding we know that for any agent pA, lq such that A P A and l P agentspE `,Aq, there exists an agent a 1 such that a " a 1 and a 1 |ù φpa `q, where a `is the unique agent in E `of type with identifier l and a is the unique agent in E of type A with identifier φpA, lq.S oi fw ea p p l yt h e transposition t "pA, i, z, B, x, yq to E, we face two cases.

1. There is j P agentspE `,Aq such that i " φpA, jq. Let a 1 be such that a i " a 1 and a 1 |ù a j . Then, by Proposition 4.2.5, it exists t 1 such that subspt 1 ,a i q| ùsubspt, a j q.S oφ induces an embedding from subspt 1 ,E `q to subspt, Eq.

2.

There is no j P agentspE `,Aq such that iφpA, jq. In this case we take t 1 "pC, k, A, x, yq, where k is an index that does not appear in E 1 `,a nd we have that φ induces an embedding from subspt 1 ,E `q to subspt, Eq. Proposition 4.2.8 (Agent replacement). Let A i pσ r q and A i pσ i q be two agents and t "pA, i, x, yq be a transposition of states that applies to A i pσ i qrA i pσ r qs. Then it exists a transposition t 1 such that: subspt, A i pσ i qrA i pσ r qsq " subspt, A i pσ i qqrsubspt 1 ,A i pσ r qqs.

Proof. We face the following cases.

1. The sites x and y do not appear in σ r . There we can take t 1 " t, then rsubspt 1 ,A i pσ r qqs " A i pσ r q and we have subspt, A i pσ i qrA i pσ r qsq " subspt, A i pσ i qqrsubspt 1 ,A i pσ r qqs.

2.

The site x appears in σ i and the site y does not.

We can write σ i " x i , σ 1 i and σ r " x r , σ 1 r .W eh a v e : subspt,

A i px i , σ 1 i qrA i px r , σ 1 r qsq " subspt, A i px i , σ 1 i qrpx r , σ 1 r qsq " subspt, A i px i rx r s, rσ 1 i , σ 1 r sq
x i rx r s"x r so:

subspt, A i px i rx r s, rσ 1 i , σ 1 r sqq " subspt, A i px r , rσ 1 i , σ 1 r sqq " A i py, rσ 1 i , σ 1 r sq

PERMUTATIONS OF SITES IN KAPPA

71

where y has the old value of x r .

On the other side we have:

subspt, A i pσ i qqrsubspt, A i pσ r qqs " subspt, A i px i , σ 1 i qqrsubspt, A i px r σ 1 r qqs " A i py i , σ 1 i qrA i py r , σ 1 r qs " A i py i , σ 1 i qry r , σ 1 r sq " A i py i ry r s, σ 1 i qrσ 1 r sq " A i py r , σ 1
i qrσ 1 r sq y i ry r s"y r , where y r has the old value of x r .

3. The site y appears in σ i and the site x does not.

This case is symmetric to the previous one.

4. The sites x and y appear both in σ i and in σ n . So we can write σ i as x i ,y i , σ 1 i and σ r as x r ,y r , σ 1 r .

subspt, A i px i ,y i σ 1 i qrA i px r ,y r σ 1 r qsq " subspt, A i px i ,y i σ 1 i qrpx r ,y r σ 1 r qsq " subspt, A i px i rx r s,y i ry r srσ 1 i , σ 1 r sqq " A i py i ,x i , σ 1 i qrA i py r ,x r , σ 1 r qs " subspt, A i pσ i qqrsubspt, A i pσ y qqs
As we wanted to show. Proposition 4.2.9. Let λ :"pr, E, φq be a transition label and t :"pA, i, x, yq be a transposition on states that operates on E. Then:

1. if there is no integer j such as φpA, jq"i we have that φ is an embedding between the lhs of r and subspt, Eq;

2. otherwise it exists a transposition t 1 such that if we consider r 1 :" subs R pt 1 ,rq, φ is also an embedding between the lhs of r 1 and subspt, Eq.

Proof. Let us consider the first case. Since a transposition does not change the index of agents, if there is no j such that φpA, jq"i, φ is still an embedding between the lhs of r and subspt, Eq. Otherwise, let j be such that φpA, jq"p A, iq. By definition of embedding A i |ù A j . By Proposition 4.2.4, it exists t 1 such that subspt, A i q| ù subspt 1 ,A j q.S o i f w e t a k e r 1 :" subs R pt 1 ,rq,w eh a v et h a tφ is still an embedding between the lhs of r 1 and subspt, Eq. CHAPTER 4. SYMMETRIES Definition 4.2.10 (Transposition of states on a transition label). Let λ :" pr, E, φq be a transition label and t "p A, i, x, yq be a transposition on states that operates on E. Let r 1 be the rule that is defined as r whenever there is no integer j such as φpA, jq"i or r 1 :" subs R pt 1 ,rq (where t 1 is given by Definition 4.2.9). Let E 1 be the mixture subspt, Eq. We call the triple pr 1 ,E 1 , φq the action of the transposition pA, i, x, yq on the transition label λ and we denote it by subs L pt, λq. Proposition 4.2.11. Let λ :"pr, E, φq be a transition label and t :"pA, i, z, C, x, yq be a transposition on binding types that operates on E. Then:

1. if there is no integer j such as φpA, jq"i we have that φ is an embedding between the lhs of r and subspt, Eq;

2. otherwise it exists a transposition t 1 such that if we consider r 1 :" subs R pt 1 ,rq, φ is also an embedding between the lhs of r 1 and subspt, Eq.

Proof. The proof is analogous to the one for Proposition 4.2.9.

Definition 4.2.12 (Transposition of binding types on a transition label). Let λ :"pr, E, φq be a transition label and t "pA, i, z, C, x, yq be a transposition on binding states that operates on E. Let r 1 be the rule that is defined as r whenever there is no integer j such as φpA, jq"i or r 1 :" subs R pt 1 ,rq (where t 1 is given by Proposition 4.2.11). Let E 1 be the mixture subspt, Eq. We call the triple pr 1 ,E 1 , φq the action of the transposition t on the transition label λ and we denote it by subs L pt, λq.

We recall that if r " E `Ñ E r @k (E r " b 1 ,...,b n )i sar u l e ,i fE " a 1 ,...,a m is a pattern and if φ is an injective substitution that induces an embedding from E `to E, then the result of the application of r on E along φ, which is denoted by ErE r s φ is defined as the mixture a 1 1 ,...,a 1 m , where for any integer i such that 1 § i § m, a 1 i is defined as a i rb j s whenever there exists an integer j such that φpA, jq"i,a n da sa i otherwise.

Proposition 4.2.13. Let r be a rule E `Ñ E r @k, E " a 1 ,...,a m be a pattern and φ be an injective substitution that induces an embedding from E `to E. We have subspt, Eqrsubspt, E r qs φ " subspt, ErE r s φ q, where t denotes the transposition pA, l, x, yq.

Proof. subspt, ErE r s φ q is equal to subspt, pa 1 1 ,...,a 1 m qq where for any integer i such that 1 § i § m, a 1 i is defined as a i rb j s whenever there exists an integer j such that φpA, jq"i,a n da sa i otherwise. We consider psubspt, a 1 1 q,...,subspt, a 1 m qq. Then the only a 1 i that is affected by the transposition t "pA, l, x, yq is the one such that i " l.

There we face two cases:

1. a 1 i is equal to a i rb j s (where j is such that φpA, jq"i), 2. or a 1 i is equal to a i .

In the latter case, a 1 i " a i ,w eh a v esubspt, a i q"subspt, a i q. Otherwise we can apply Proposition 4.2.8, so subspt, a i qrsubspb j qs " subspt, a i rb j sq. Proposition 4.2.14. Let E be a species, λ :"pr, E, φq be a transition label and t "pA, i, x, yq be a transposition that operates on E.

We have:

E λ ›Ñ E 1 ñ subspt, Eq subs L pt,λq ›Ñ subspt, E 1 q
Proof. By Proposition 4.2.6 we know that if t "pA, i, x, yq is a transposition that operates on E,ifφ is an injective substitution that induces an embedding from E `to E, then there exists t `such that φ induces an embedding from subspt `,E `q to subspt, Eq. subs L pt, λq is equal to pr 1 , subspt, Eq, φq, where r 1 is equal to subspt 1 ,E `qÑ subspt 1 ,E r q.

If we take t 1 " t `we have that subspt 1 ,E `q C φ subspt, Eq, so the rule r 1 applies to subspt, Eq.

If we apply r 1 to subspt, Eq we obtain subspt, Eqrsubspt, E r qs φ . subspt, Eqrsubspt, E r qs φ " subspt, ErE r s φ q that is equal to subspt, E 1 q.

The converse application comes from the fact that t is an involution.

Symmetric sites

Transp ositions will b e used in order to identify sites having the same capabilities of interaction.

In the following, we assume that no syntactic rule occurs twice in a model. This does not restrict our framework, since multiple instances of a syntactic rule can be merged, by summing up their rate constants.

By syntactic rules, we mean that we consider rules up to structural congruence ", but not up to rule isomorphism. Definition 4.2.15 (Strong (syntactical) symmetry). The sites x and y are symmetric in A, for the set of rules R, if for every rule r and every transposition t that operates on r, the rule subs R pt, rq belong to the set of rules R as well and the ratio between its rate constant and the number of automorphisms in its lhs is the same. This is a very strong requirement based on a syntactical equivalence. Later we will see a less demanding notion, when rules can be considered up to isomorphisms (e.g. see Definition 4.2.16).

What is interesting for us it is to understand if a given system and the same one, after a transposition on its sites, perform in the same way (i.e. the two systems are equivalent). In order to show that two rules sets are equivalent it can be necessary to reorder interfaces and reindex agents in rules (by applying a same into substitution to both sides of a given rule) and gather some rules having the same lhs and the same rhs (summing up the rates).

Given a rule r and a non negative real number k P R `, we define scalepr, kq as the rule that is obtained by multiplying the rate constant of r by k. Moreover, we define the orbit of the rule r, which is written orbitprq, as the set of rules which can be obtained by applying zero, one, or several transpositions of states to the rule r. Since the lhs and the rhs of a rule are finite expressions, the orbit of a rule is always a finite set.

Our model transformation is formalised by the binary relation ñ over sets of rules, which is defined as follows:

R ñtscalepr 1 , 1 cardporbitprqq q|r P R,r 1 P orbitprqu.
for any set of rules R.

Agents and sites in rules can be reordered using the congruence relation over both hand sides. Moreover, agents can be reindexed using substitutions.

A generalised substitution is a mapping φ from A ˆN Y N to N Y N such that:

1. for any proper identifier l P N we have φplqPN;

2. for any temporary identifier l P N we have φp lqP N.

A generalised substitution is into if, and only if, for any identifier l, l 1 P NY N, φplq"φpl 1 q implies l " l 1 . The extension φ of a generalised substitution φ to agents is defined as in the case of substitution (see Section 3.3). Definition 4.2.16 («-equivalence over rules). Given two rules r :"

E `k Ñ E r and r 1 :" E 1 `k1 Ñ E 1
r , we say that r and r 1 are isomorphic, and we write r « r 1 , if and only if:

1. k " k 1 ,
2. and there exists a generalised substitution φ such that φpE `q"E 1 `and φpE r q"E 1 r .

To understand if two sets of rules are equivalent we need to check if they can be made equal by replacing their rules with «-equivalent ones and by gathering the rules having the same lhs and the same rhs (in such a case, their rates are summed up).

The idea is the following: let us fix an agent type A and two sites x and y in ΣpAq such that x P Σ λ pAqôy P Σ λ pAq and x P Σ ◆ pAqôy P Σ ◆ pAq.S o , in order to detect whether x and y have the same capabilities of interaction, we will replace each rule with the combination of rules which can be obtained by substituting zero, one or several occurrences of x with y, and zero, one or several occurrences of y with x.

If the obtained system of rules is equivalent to the initial one, then the sites x and y have the same capabilities of interaction.

Example 4.2.17. Let us have a look to some example. We start by considering the following set of rules:

A 1 px u q k1 Ñ A 1 px p q A 1 py u q k2 Ñ A 1 py p q A 1 px p , y p q k3 Ñ "
The signature is: A " A, S "tx, yu, I "tu, pu, Σ ◆ "tx, yu and Σ λ "H.

We can notice that whenever the rates k 1 and k 2 are equal, the sites x and y are symmetric in A. So, the system is equivalent to the following one:

A 1 px u q k 1 Ñ A 1 px p q A 1 py u q k 1 Ñ A 1 py p q A 1 px p , y p q k3 Ñ "
where k 1 "

k 1 `k2 2 .
Let us detail the transformation. The first two rules are replaced with two rules each, with a half rate, one applying on the site x,and the other applying on the site y. The four obtained rules are pairwise equal, so we gather them pairwise. When transforming the third rule, we obtain two equivalent rules (with half rate), that we can gather to recover the initial rule.

Example 4.2.18. Let us have a look to a more subtle example and let us consider the following set of rules:

A 1 pxq, A 2 pxq k1 Ñ A 1 px A2@x q, A 2 px A1@x q A 1 pxq, A 2 pyq k2 Ñ A 1 px A2@y q, A 2 py A1@x q A 1 pyq, A 2 pyq k3 Ñ A 1 py A2@y q, A 2 py A1@y q
The signature is: A " A, S "tx, yu, I "H, Σ ◆ "Hand Σ λ "tx, yu.

Here the sites x and y are symmetric whenever k 1 " k 2 " k 3 . This case is more subtle than the previous one, because some rules gain or loose some symmetries during the transformation. For instance, the transformation of the first rule gives four rules. One of them binds the sites x of two agents A, another binds the sites y of two agents A. The lhss of these two rules have the same number of symmetries as the one of the initial rule. Thus, their rate constant are divided by 4 (since the rule is rewritten into 4 rules). Another rule binds the site x of the agent A with identifier 1 and the site y of the agent A with identifier 2, and the last one binds the site y of the agent A with identifier 1 and the site y of the agent A with identifier 2. The number of symmetries in these rules is twice less as the number of symmetries in the initial rule. Thus the rate constant are divided by 8 (4 since the rule is rewritten into 4 rules, and 2 due to the loss of symmetries). But the two obtained rules are equivalent up to reordering and reindexing, thus, we obtain a single rule, the rate constant of which had been divided by 4. The transformation of the remaining rules works the same way, except that the rule which binds the sites x of two agents A and the rule which binds the sites y of two agents A both gain symmetries (the rate constant is divided by 4 and multiplied by 2), and the rule which binds the site x and the site y of two agents A keeps the same number of symmetries (the rate constant is divided by 4). So as to avoid testing for all triples pA, x, yq such that A P A and x, y P ΣpAq, whether the condition in 4.2.15 is satisfied or not, we use a weaker property to preselect the potential triples. Two symmetric sites have necessarily the same set of potential partners, and there internal states range among the same set of values. This can be detected by the static analyses that are proposed in [START_REF] Vincent Danos | Abstract interpretation of cellular signalling networks[END_REF][START_REF] Feret | Reachability analysis via orthogonal sets of patterns[END_REF].

Symmetries and rule applications

In this section we want to show that a pair of symmetric sites induces a bisimulation and how this fact can be exploited to define a model reduction. First of all, we recall the definition of bismulation given in Chapter 2. Definition 4.3.1. Given an autonomous system pV, Fq and a relation r, we say that that r induces a bisimulation over pV, Fq if and only if for any pair p⇢, ⇢ 1 q of states over V, if P r p⇢q"P r p⇢ 1 q, then P r pFp⇢qq " P r pFp⇢ 1 qq.

Indeed, a relation r induces a bisimulation over an autonomous system pV, Fq if, and only if, P r ˝F " P r ˝F ˝Pr .

Definition 4.3.2 (Stoichiometric vector). Given a reaction

React : R 1 ,...,R n Ñ P 1 ,...,P m , we define the stoichiometric vector V pReactq as:

V pReactqpvq" m ÿ i"1 # 1 if P i " v 0 otherwise ´n ÿ i"1 # 1 if R i " v 0 otherwise,
for every species v.

For any species v, we denote as tS v,1 ,...,S v,v R u its orbit. The orbit of as p e c i e si so b t a i n e db ya p p l y i n ge v e r ys e q u e n c eo nt r a n s p o s i t i o n so nt h e species v.

We consider a reaction React induced by a rule rule. We denote as tReact 1 , . . . , React k u its orbit. The orbit of a reaction is obtained by applying every sequence on transpositions on the lhs of the reaction React.

For each natural number j among 1 and k, we write:

React j : R j,1 ,...,R j,n Ñ P j,1 ,...,P j,m and we define γ j as the quotient between the rate constant of the underlying rule and the number of automorphisms in the lhs of this rule. We notice that for every two natural numbers j, j 1 among 1 and k,w e have:

P r pV pReact j qq " P r pV pReact j 1 qq, and:

γ j " γ j 1 .
Given a state ⇢, the overall contribution of the orbit rReacts « to the function F can be expressed as:

k ÿ j"1 ˜γj ˆn π i"1 ⇢pR j,i qˆV pReact j q ¸.
Then, we have: P r ´∞k j"1 pγ j ˆ±n i"1 ⇢pR j,i qˆV pReact j qq " ´∞k j"1 pγ j ˆ±n i"1 ⇢pR j,i qˆP r pV pReact j qqq " ´∞k j"1 pγ 1 ˆ±n i"1 ⇢pR j,i qˆP r pV pReact 1 qqq "

γ 1 ˆ∞k j"1
± n i"1 ⇢pR j,i qˆP r pV pReact 1 qq " γ 1 ˆ±n

i"1 ∞k R j,1 j"1 ⇢pS R,j qˆP r pV pReact 1 qq. But, for any i between 1 and n, we have, by definition of P r :

k R j,1 ÿ j"1 ⇢pS R,j q" k R j,1 ÿ j"1 P r p⇢pS R,j qq.
It follows that: P r ´∞k j"1 pγ j ˆ±n i"1 ⇢pR j,i qˆV pReact j qq " P r ´∞k j"1 pγ j ˆ±n i"1 P r p⇢pR j,i qq ˆV pReact j qq Summing up the contribution for every orbit of reactions, we get that the relation r induces a bisimulation, as stated in the following theorem: Theorem 4.3.3. We have: P r ˝F " P r ˝F ˝Pr .

Conclusion

We have introduced a notion of symmetry among sites for Kappa models. Intuitively, two sites are symmetric in a model, if they play the same role in each instance of protein.

Formally, this is not so easy, because several syntactically different rules may have the same semantics, and we have to take this into account. We defined two notions of symmetry. The first one, called strong symmetry, is purely syntactic (it makes the distinction between two rules having the same semantics). With this notion, two sites are symmetric, if whenever we swap every instance of them in every rule, and we collect the rules that are identical (up to structural congruence), we get back the initial model. The second notion of symmetry considers rules up to their semantics. With this notion, two sites are symmetric, whenever the rule set is semantically equivalent to one that is strongly symmetric.

Chapter 5 Production/consumption of a pattern

In this chapter, we express the derivative of the amount of each pattern in a model as an expression of the amount of other patterns.

Consumption/production of a species

As a preliminary, we reformulate the consumption and the production of a given species in Kappa models.

Let us consider the following set of rules R:

r 1 :" c 1,1 ,...,c !p1q,1 Ñ p 1,1 ,...,p ✓p1q,1 k 1 r 2 :" c 1,2 ,...,c !p2q,2 Ñ p 1,2 ,...,p ✓p2q,2 k 2 ... :" ... r h :" c 1,h ,...,c !phq,h Ñ p 1,h ,...,p ✓phq,h k h
where for every rule r ◆ , ωpιq returns the number of components in the left hand side and θpιq returns the number of components in the right hand side.

For each rule r ◆ , we denote as γ ◆ the quotient between the rate constant k ◆ and the number of automorphisms in the left hand side of the rule r ◆ .

We consider all the ground refinements of R, where every rule r ◆ has νpιq refinements (one for each composite embedding between the lhs of the rule 82 CHAPTER 5. PRODUCTION/CONSUMPTION OF A PATTERN into a tuple of species in V) react p1,1q

:" R p1,1q,1 ,...,R p1,1q,!p1q Ñ P p1,1q,1 ,...,P p1,1q,✓p1,1q ... :" ... react p1,⌫p1qq :" R p1,⌫p1qq,1 ,...,R p1,⌫p1qq,!p1q Ñ P p1,⌫p1qq,1 ,...,P p1,⌫p1qq,✓p1,⌫p1qq For every reaction react ◆,⌧ , ✓p◆, ⌧ q denotes the number of products of the reaction react ◆,⌧ .

Moreover, for every reaction react ◆,⌧ , we denote as φ ◆,⌧ the corresponding embedding between the lhs of the rule rule ◆ and the lhs of the reaction react ◆,⌧ and as φ 1 ◆,⌧ the corresponding embedding between the rhs of the rule rule ◆ and the rhs of the reaction react ◆,⌧ .

Consumption

Given a species v P V, we denote as δ ´pvq the quantity of v that is consumed as a reactant of a reaction.

This quantity is:

δ ´pvq" h ÿ ◆"1 ⌫p◆q ÿ ⌧ "1 γ ◆ !p◆q ÿ j"1 f ´p◆, ⌧,j,vq !p◆q π l"1
⇢pR p◆,⌧ q,l q where: f ´p◆, ⌧,j,vq" " 1i f R p◆,⌧ q,j " v 0o t h e r w i s e .

Production

Given a species v P V, we denote as δ `pvq the quantity of v that is added as a product of a reaction. This quantity is:

δ `pvq" h ÿ ◆"1 ⌫p◆q ÿ ⌧ "1 γ ◆ ✓p◆,⌧ q ÿ j"1 f `p◆, ⌧,j,vq !p◆q π l"1
⇢pR p◆,⌧ q,l q where: f `p◆, ⌧,j,vq" " 1i f P p◆,⌧ q,j " R 0o t h e r w i s e .

CONSUMPTION/PRODUCTION OF A PATTERN 83

Balance

We have expressed the consumption and the production of each chemical species directly at the level of rules.

Proposition 5.1.1. Let R be a chemical species.

We have:

Fp⇢qpvq"δ `pvq´δ ´pvq.

Consumption/production of a pattern

Now we express, for every pattern component P ,t h ed i fference between its production and its consumption. Given a pattern component P and a state ⇢ over V, we define the concentration rP s ⇢ of the pattern P in the state ⇢, as:

rP s ⇢ " ÿ vPV cardprP, vsq cardprP, P sq ⇢pvq.
We usually write rP s instead of rP s ⇢ . We notice that ⇢pP q"r P s whenever the pattern component is a species in the set V. We remind the reader that rP, P 1 s denotes the set of the embeddings from the pattern P into the pattern P 1 . This way, rP, P s denotes the set of automorphisms of the pattern P . We also define the corrected concentration pr P sq ⇢ of a pattern P as follows:

pr P sq ⇢ "rP s ⇢ ˆcardprP, P sq.

We differentiate the expression rP s ⇢ and we obtain that:

rP s 1 ⇢ " ÿ vPV cardprP, vsq cardprP, P sq Fp⇢qpvq.
By linearity, we get that:

rP s 1 ⇢ " ∞ vPV cardprP, vsqFp⇢qpvq cardprP, P sq .
Moreover we know, by Proposition 5.1.1, that for every species v P V:

Fp⇢qpvq" ∞ h ◆"1 ∞ ⌫p◆q ⌧ "1 γ ◆ ∞ ✓p◆,⌧ q j"1 f `p◆, ⌧,j,vq ± !p◆q l"1 ⇢pR p◆,⌧ q,l q ´∞h ◆"1 ∞ ⌫p◆q ⌧ "1 γ ◆ ∞ !p◆q j"1 f ´p◆, ⌧,j,vq ± !p◆q l"1 ⇢pR p◆,⌧ q,l q
The pattern component P is consumed for each occurrence of the pattern P in a reactant R of a reaction react ◆,⌧ . It is worth noting that, whenever CHAPTER 5. PRODUCTION/CONSUMPTION OF A PATTERN the pattern P has n automorphisms, each occurrence of the pattern P corresponds to n embeddings from the pattern component P to the reactant R.

We recall that each ground refinement R L Ñ R R is defined by a rule L Ñ R and a straight-epi from the lhs L of the rule and the lhs R L of the ground refinement. For each ground refinement, we consider every embedding between the pattern component P and the lhs R L of the this ground refinement.

P L R L R R R / / / / ⌘ 1 B B ' ? O O φ ◆,⌧
Conversely, the pattern component P is produced for each occurrence of the pattern P in a reactant R of a reaction react ◆,⌧ . Here again, whenever the pattern P has n automorphisms, each occurrence of the pattern P corresponds to n embeddings from the pattern component P to the reactant R.

P L R L R R R / / / / * J W W ' ? O O φ ◆,⌧
It may happen that, given a ground refinement R L Ñ R R and an injective substitution ', the injective substitution ' induces an embedding both from the pattern component P to the mixture R L and from the pattern component P to the mixture R R . In such as case, the corresponding consumption and production terms cancel pair-wisely. Definition 5.2.1 (proper consumption). We define the proper consumption of the pattern component P as follows.

δ ‹ pP q" ∞ vPV ∞ 'PrP,vs ∞ h ◆"1 ∞ ⌫p◆q ⌧ "1 γ ◆ ∞ !p◆q j"1 f ‹ p◆, ⌧,j,v,'q
± !p◆q l"1 ⇢pR p◆,⌧ q,l q cardprP, P sq where for every rule index ◆, for every reaction index ⌧ , every position j, every species v, and every embedding ' between the pattern component P and the species v, the expression f ‹ p◆, ⌧,j,v,'q is defined as 1 if the following conditions are satisfied:

• the embedding φ ◆,⌧ maps the connected pattern c j,◆ to the species v,

• the instance of P that is defined by the embedding ' is modified by the reaction react ◆,⌧ , and as 0 otherwise.

Definition 5.2.2 (proper production). We define the proper production of the pattern component P as follows:

δ ‹ pP q" ∞ vPV ∞ 'PrP,vs ∞ h ◆"1 ∞ ⌫p◆q ⌧ "1 γ ◆ ∞ ✓p◆,⌧ q j"1 f ‹ p◆, ⌧,j,v,'q
± !p◆q l"1 ⇢pR p◆,⌧ q,l q cardprP, P sq where for every rule index ◆, every reaction index ⌧ , every position j, every species v, and every embedding ' between the pattern component P and the species v, the expression f ‹ p◆, ⌧,j,v,'q is defined as 1 if the following conditions are satisfied:

• the embedding φ ◆,⌧ maps the connected pattern p j,◆ to the species v,

• the instance of P that is defined by the embedding ' has been modified

by the ground refinement react ◆,⌧ , and as 0 otherwise.

Proposition 5.2.3. Let P be a pattern component.

We have:

ÿ vPV ÿ φPrP,vs
Fpvq"rP, P spδ ‹ pP q´δ ‹ pP qq.

Proper consumption of a pattern

Now we express the proper consumption of a pattern as the concentration of other patterns.

Condition

Let us fix a pattern P , a rule index ◆, a reaction index ⌧ , a position j,a species v, and an embedding ' between the pattern component P and the species v. We denote the rule rule ◆ as L Ñ R and the reaction react ◆,⌧ as

R L Ñ R R . P L R L R R R / / / / ⌘ 1 B B ' ? O O φ ◆,⌧
We define the notions of agent instance and site instance as follows:

Definition 5.3.1 (agent instance). Let us consider a pattern P .

We call an agent instance in the pattern P a pair pA, iqPA ˆL such that there exists an agent A with identifier i in the pattern P . Definition 5.3.2 (site instance). Let us consider a pattern P .

We call a site instance in the pattern P a triple pA, i, xqPA ˆL ˆS such that there exists an agent A with identifier i which documents the state of the site x P ΣpAq in the pattern P .

The instance of P that is defined by the embedding ' is modified by the reaction react ◆,⌧ if and only if at least one of both following conditions is satisfied:

• there exist an agent type A P A, two agent identifiers i, i 1 P N,a n da site name x P ΣpAq, such that:

-pA, i, xq is a site instance in the pattern P , -pA, i 1 ,xq is a site instance in the pattern R L , -pA, 'pA, iq,xq"pA, φ ◆,⌧ pA, i 1 q,xq,

-the site instance pA, i 1 ,xq is modified explicitly in the rule rule ◆ ;

• there exist a site instance pA, i, xq in the pattern P and a site instance pA 1 ,i 1 ,x 1 qPMAYprule ◆ qYMUST prule ◆ q, such that:

-the site instances pA, 'pA, iq,xq and pA 1 , φ ◆,⌧ pA 1 ,i 1 q,x 1 q are bound in R L of the reaction react ◆,⌧ , -pA, 'pA, iq,xq is a site instance in R R ,

PROPER CONSUMPTION OF A PATTERN

87

-the site instance pA, 'pA, iq,x 1 q is free in R R .

We gather the proper negative contributions for the concentration of the pattern P according to how the pattern P is glued with a pattern component in the lhs of the rule rule ◆ .

Gluing

Let us explain how we can glue two patterns.

To glue two patterns, we need to define a pairing relation among the agents of each other (these pairs of agents will be considered equal). Moreover it is possible to add links between some site instances, so as to take into account about potential side effects. We do this in two steps. Firstly, we introduce a primitive to gather two patterns while fusing some of their agents. Secondly, we introduce a primitive to add links in patterns.

We start by defining the gluing operation.

Definition 5.3.3 (pairing). Let Z 1 and Z 2 be two patterns. Let A Z 1 and A Z 2 be respectively the set of agents of Z 1 and the set of agents of Z 2 . A P PpA Z 1 ˆAZ 2 q is a pairing between Z 1 and Z 2 if @i, i 1 P A Z 1 and @j, j 1 P A Z 2 we have:

1. if pi, jqPA and pi, j 1 qPA then j " j 1 ;

2. if pi, jqPA and pi 1 ,jqPA then i " i 1 .

Now we define the common region between two patterns, according to ap a i r i n g . I n t u i t i v e l y ,t h ea g e n t so ft h i sc o m m o nr e g i o nb e l o n g st ob o t h patterns, and thus they have two agent identifiers. In order to properly rename these labels, we assume that we are given a bijection Φ from the set pN Y Nq 2 to the set N Y N. Definition 5.3.4 (common part). Let Z 1 and Z 2 be two patterns, and A be a pairing between them.

We define X :" Z 1 X A Z 2 as the pattern that is defined by the following constraints: 5. two sites x and y of the agents A Φpi,jq and A Φpi 1 ,j 1 q are bounded in X if and only if the sites x and y are bounded in the agents A i ,A i 1 of Z 1 and in the agents A j ,A j 1 of Z 2 .

1. A Φpi,
Not every pairing defines a gluing, because two contradicting states could be attached in both patterns to a same site. When it is defined, the gluing between two patterns Z 1 and Z 2 according to a pairing relation A is defined up to isomorphism, as the site graph that refines the site-graph Z 1 X A Z 2 , by adding any information that is avaible either in Z 1 and Z 2 . Special care has to be taken for dealing with the state of bound sites, because they can be defined at different levels of resolution.

The following definition formalises the notion of gluing.

Definition 5.3.5 (gluing). Let Z 1 and Z 2 be two patterns, A be a pairing between them and X be Z

1 X A Z 2 .
The gluing of the patterns Z 1 and Z 2 according to the pairing A is well defined if and only if there exists a pattern Y and three embeddings:

1. γ 1 : Z 1 Ñ Y 2. γ 2 : Z 2 Ñ Y 3. γ X : X Ñ Y such that:
1. for every agent A i in Y , at least one of both following assertions is satisfied:

(a) there exists an agent A j belonging to Z 1 such that i " γ 1 pA, jq;

PROPER CONSUMPTION OF A PATTERN

89

(b) there exists an agent A j belonging to Z 2 such that i " γ 2 pA, jq;

2. for every agent A k in X (we write pi, jq :" Φ ´1pkq), both following assertions are satisfied:

(a) γ X pA, kq"γ 1 pA, iq;

(b) γ X pA, kq"γ 2 pA, jq;

3. for every agent A i in Y and any site x P ΣpAq, the site instance pA, i, xq is documented in Y if and only if at least one of both following assertions is satisfied:

(a) there exists an agent A j belonging to Z 1 such that i " γ 1 pA, jq and the site instance pj, xq is documented in the pattern Z 1 ;

(b) there exists an agent A j belonging to Z 2 such that i " γ 2 pA, jq and the site instance pA, j, xq is documented in the pattern Z 2 ;

4. for every site instance pA, i, xq in Y , the site instance pA, i, xq has a non-empty internal state in Y if and only if at least one of both following assertions is satisfied:

(a) there exists an agent A j belonging to Z 1 such that i " γ 1 pA, jq and the site instance pA, j, xq has a non-empty internal state in the pattern Z 1 ;

(b) there exists an agent A j belonging to Z 2 such that i " γ 2 pA, jq and the site instance pA, j, xq has a non-empty internal state in the pattern Z 2 ;

5. for every site instance pA, i, xq in Y :

(a) the binding state of the site instance pA, i, xq belongs to the set:

t✏uˆtA i @x | A P A,i P N Y N,x P Σ λ pAqu
whenever at least one of both following assertions is satisfied:

i. there exists an agent A j belonging to Z 1 such that i " γ 1 pA, jq and the site instance pA, j, xq has has a binding state in the set:

t✏uˆtA i @x | A P A,i P N Y N,x P Σ λ pAqu in the pattern Z 1 ;
ii. there exists an agent A j belonging to Z 2 such that i " γ 2 pA, jq and the site instance pA, j, xq has has a binding state in the set:

t✏uˆtA i @x | A P A,i P N Y N,x P Σ λ pAqu
in the pattern Z 2 ;

(b) else the binding state of the site instance pA, i, xq is a binding type whenever at least one of both following assertions is satisfied:

i. there exists an agent A j belonging to Z 1 such that i " γ 1 pA, jq and the binding state of the site instance pA, j, xq in the pattern Z 1 is a binding type; ii. there exists an agent A j belonging to Z 2 such that i " γ 2 pA, jq and the binding state of the site instance pA, j, xq in the pattern Z 2 is a binding type;

(c) else the binding state of the site instance pA, i, xq is equal to '´' whenever at least one of both following assertions is satisfied:

i. there exists an agent A j belonging to Z 1 such that i " γ 1 pA, jq and the site instance pA, j, xq has equal to '´' in the pattern Z 1 ; ii. there exists an agent A j belonging to Z 2 such that i " γ 2 pA, jq and the site instance pA, j, xq has equal to '´' in the pattern Z 2 ;

(d) otherwise it is equal to '?'.

Whenever it is defined (up to isomorphism), the pattern Y is called the gluing between the patterns Z 1 and Z 2 according to the pairing A , and is denoted as

Z 1 Y A Z 2 .
Example 5.3.6. In Figure 5.1 we can see an example of gluing.

There we have:

Z 1 " A 3 px B 4 @
x ,y C 5 @y q,B 4 px A 3 @x q,C 5 py A 3 @y q Z 2 " A 6 px B 7 @x q,B 7 px A 2 @x ,z D 8 @z q,D 8 pz B 7 @z q.

We may chose, for the pairing A , any non empty subset of the following set:

tppA, 3q, pA, 6qq, ppB, 4q, pB, 7qqu.

The pattern X identifying the common part between Z 1 and Z 2 is: The corresponding gluing is defined as follows:

A 1 px B 2 @x q,B 2 px A 1 @x q. A 3 B 4 C 5 A 6 B 7 D 8 A 1 B 2 A 9 B 10 C 11 D 12 ψ 1 ψ 2 γ 1 γ 2
A 3,6 px B 4,7 @x ,y C 5 @y q,B 4,7 px A 3,6 @x ,z D 8 @z q,C 5 py A 3,6 @y q,D 8 pz B 4,7 @z q.

We observe that in Definition 5.3.5, the fact that the sites that are both defined in Z 1 and in Z 2 have compatible states is ensured by the existence of the three embeddings.

Then, we define the operation to add a link in a pattern.

Definition 5.3.7 (bonds insertion). Let P be a pattern and B be a set of pairs of site instances, such that:

1. for every pair ps, s 1 qPB, s ‰ s 1 ;

2. for every two distinct pairs ps, s 1 q, ps 2 ,s 3 qPB, we have:

ts, s 1 uXts 2 ,s 3 u"H;

• the agent pA 1 ,i 1 q belongs to the pattern component c ◆,j ;

• pA, i, xq"pA, γ `pA 1 ,i 1 q,x 1 q;

4. for every pair ps, pA, i, xqq P B, there exists no site instance pA 1 ,i 1 ,x 1 q in the pattern component c ◆,j such that pA, i, xq"pA 1 , γ `pA 1 ,i 1 q,xq;

5. for every pair ppA, i, xq, pA 1 ,i 1 ,x 1 qq P B, there exists a site instance pA 2 ,i 2 ,x 2 q in the pattern P such that:

• A 2 " A 1 and x 2 " x 1 ;

• x 2 P Σ λ pA 2 q;

• the binding state of the site instance pA 2 ,i 2 ,x 2 q in the pattern P is either equal to '-', to '?', or to the binding type A@x;

6. A is equal to the set of the pairs ppA, iq, pA 1 ,i 1 qq such that pA, iq is an agent instance in c ◆,j , pA 1 ,i 1 q is an agent instance in P , A " A 1 and γ `pA, iq"γ P pA 1 ,i 1 q.

Then for every pair pA ,BqP › Ñ Mp◆,j,Pq, we define the extended gluing pc ◆,j Y pA ,Bq P q as the pattern pc ◆,j Y A P qÒ B .

Note that in Definition 5.3.8 we have used the assumption that species have no cycle. This way, it is not possible to add a link to a pattern component (this justifies the following constraint: if A ‰H, then B "H), and if the pattern component P is disjoint from the pattern c ◆,j we can create only one bond (this justifies the following constraint: if A "H , then B is a singleton). The other constraints stipulate that a bond may have been removed between a site that has been made free by side effects and a site that were not in the lhs of the rule. Lastly, we assume that the pairing is maximal, so as to identify uniquely each way of gluing two patterns.

Example 5.3.9. Let us have a look to the example depicted in Figure 5.2. As we can observe, there is no common part between the lhs of the rule in 5.2(a) and the pattern in 5.2(b). So, if we consider the gluing between them (figure 5.2(c)), this returns just the disjoint union of the two. Indeed, by computing the extendend gluing (figure 5.2(d)) we notice that the pattern is modified by the rule (figure 5.2(e)).

Contribution

Now we partition the proper consumption of the pattern P , according to the extended gluing that it forms with a pattern component of a rule.

PROPER PRODUCTION OF A PATTERN

95

We get that δ ‹ pP q is equal to:

∞ h ◆"1 γ ◆ ∞ !p◆q j"1 ∞ vPV ∞ 'PrP,vs ∞ M P
› Ñ Mp◆,j,P q g ´p◆, ⌧,j,v,',Mq ± !p◆q l"1 ⇢pR p◆,⌧ q,l q cardprP, P sq where for every rule index ◆, every reaction index ⌧ , every position j, every species v P V, every embedding ' from P to v, and any extended gluing pA ,Bq, the expression g ´p◆, ⌧,j,v,',Mq is defined as 1 if the following conditions are satisfied:

• the embedding φ ◆,⌧ maps the connected pattern c j,◆ to the species v,

• the instance of P that is defined by the embedding ' is modified by the reaction react ◆,⌧ ,

• A "tppA, iq, pA 1 ,i 1 qq | A " A 1 and 'pA, iq"φ ◆,⌧ pA, i 1 qu,

• if A "H , then B is a singleton that describes a link that is removed by side effect; and as 0 otherwise. That is to say that δ ‹ pP q is equal to:

∞ h ◆"1 γ ◆ ∞ !p◆q j"1 ∞ M P › Ñ Mp◆,j,P q ∞ vPV ∞
'PrP,vs g ´p◆, ⌧,j,v,',Mq ± !p◆q l"1 ⇢pR p◆,⌧ q,l q cardprP, P sq .

This expression can be factorised (e.g. see [START_REF] Vincent Danos | Abstracting the differential semantics of rule-based models: exact and automated model reduction[END_REF]) as follows.

Proposition 5.3.10.

δ ‹ pP q" ∞ h ◆"1 γ ◆ ∞ !p◆q j"1 ∞ M P › Ñ Mp◆,j,P q pr c j,◆ Y M P sq ⇢ ± !p◆q χ"1 χ‰j
pr c χ,◆ sq ⇢ cardprP, P sq .

Proper production of a pattern

Now we express the proper production of a pattern as the concentration of other patterns.

96

CHAPTER 5. PRODUCTION/CONSUMPTION OF A PATTERN

Condition

Let us fix a pattern P , a rule index ◆, a reaction index ⌧ , a position j,a species v, and an embedding ' between the pattern component P and the species v. We denote the rule rule ◆ as L Ñ R, and the reaction react ◆,⌧ as

R L Ñ R R . P L R L R R R / / / / * J W W ' ? O O φ ◆,⌧
The instance of P , that is defined by the embedding ', has been modified by the reaction react ◆,⌧ if and only if at least one of both following conditions is satisfied:

• the whole pattern P has been created by the application of the rule rule ◆ ;

• there exist an agent type A P A, two agent identifiers i, i 1 P N,a n da site name x P ΣpAq, such that:

-pA, i, xq is a site instance in the pattern P ,

-pA, i 1 ,xq is a site instance in R R ,
-pA, 'pA, iq,xq"pA, φ ◆,⌧ pA, i 1 q,xq, -the site instance pA, i 1 ,xq is modified explicitly in the rule rule ◆ ;

• there exist a site instance pA, i, xq in the pattern P and a site instance pA 1 ,i 1 ,x 1 qPMAYprule ◆ qYMUST prule ◆ q, such that:

-the site instances pA, 'pA, iq,xq and pA 1 , φ ◆,⌧ pA 1 ,i 1 q,x 1 q are bound in R L and the site,

-pA, 'pA, iq,xq is a site instance in R R ,
-the site instance pA, 'pA, iq,x 1 q is free in R R .

We gather the proper positive contributions for the concentration of the pattern P according to how the pattern P is glued with the rhs of the rule rule ◆ (the pattern P might overlap with zero, one, or several pattern components in the rhs of the rule rule ◆ ). For each gluing, we have to invert the r✏; ✏sE " E ra `,E `; a r ,E r spa, Eq"r a `; a r sa, rE `; E r sE ra `; HsH " a rH;

a r sa "H rApσ `q; Apσ r qsApσq"Aprσ `; σ r sσq r✏; ✏sσ " σ rs `, σ `; s r , σ r ss, σ "r s `; s r ss, rσ `; σ r sσ rx λ `; x λr sx λ " x λ `if λ `" ✏,i P N rx A@x ; x A@x sx λ " x λ rx ´; x ´sx λ " x λ rx ´; x λr sx λ " x ´if λ r ‰F igure 5.3: Inverse substitution.

effect of applying the rule rule ◆ , so as to characterise the most general context that ensures that the rule effectively creates an instance of the pattern P . Because of the potential side effects, applying a rule is not an invertible process. Some links between sites may have been released by side effects. This way, having fixed an embedding from the rhs of a rule and a pattern, there may be zero, one, or several refinements of rule ◆ that may correspond with this embedding. Yet there are at most a finite number of them and they can be enumerated easily. This provides a partitioning of the potential context for producing a given pattern thanks to a given rule.

Inverse substitution

Let us explain how we can invert the application of a rule. Firstly we define this operation in the case of application of a rule that is free of side effects. Definition 5.4.1 (side effects free right refinement of a rule). Let r : E `Ñ E r be a rule and let E be a pattern such that E |ù E r . We define the right refinement of the rule r by the pattern E, written truE, as the rule rE `; E r sE Ñ E defined by inverse substitution (see Figure 5.

3).

The side effects free right refinement of a rule is not the only way to specialise the rule r to produce the pattern E. Some bonds may have been released by side effects. These bonds can be added in the lhs of the refinement thanks to the primitive Ò.

Now we have all the ingredients to define the different ways of producing ag i v e np a t t e r n .

Then for every pair pA ,BqP -› Mp◆,Pq, we define the extended precondition predp◆,P,pA ,Bqq as the pattern prL ◆ ,R ◆ spR ◆ Y A P qqÒ B . Moreover, we define as c 1,◆,P,pA ,Bq ,. . . , c !p◆q,◆,P,pA ,Bq the list of its pattern components.

Note that the inverse substitution may not preserve the connectedness of the pattern P . Let us call the antecedent of P , the pattern in rL ◆ ,R ◆ spR ◆ Y A P q that contains exactly the agent instances pA, γ P pA, iqq and the site instances pA, γ P pA, iq,xq for every agent instance pA, iq and every site instance pA, i, xq of P that has not been created by the rule. Whenever the antecedent of P is not connected, then necessarily each of its pattern component contains a site instance that was free before the application of the rule and bound after. As a consequence, any pattern component of the antecedent, if it is disconnected, contains a site instance that has been modified explicitly by the rule. Then, if the antecedent of P overlaps with L ◆ , then necessarily, each of its pattern component overlaps with L ◆ , and then it is not possible to add a bond without creating a cycle (this justifies the following constraint: if A ‰H, then B "H). If the antecedent of the pattern P is disjoint from L ◆ , then we can create only one bond (this justifies the following constraint: if A "H , then B is a singleton). Lastly, we assume that the pairing is maximal, so as to identify uniquely each way of gluing two patterns.

Example 5.4.3. Let us have a look to the example depicted Figure 5.4. As we can observe, there is no common part between the rhs of the rule Figure 5.4(a) and the pattern Figure 5.4(b). So, if we consider the gluing between the rhs of this rule and pattern (Figure 5.4(c)), this returns just the pattern itself. If we consider the right refinement of the gluing by inverse substitution Figure 5.4(d), there is no way to see that the pattern is produced by the rule. Yet, the site of pattern might have been freed by side effect. This is captured by extending the right refinement, as depicted in Figure 5.4(e).

Contribution

We now partition the proper production of the pattern P , according to the gluing it forms with the rhs of a rule.

We get that δ ‹ pP q is equal to:

∞ h ◆"1 γ ◆ ∞ !p◆q j"1 ∞ vPV ∞ 'PrP,vs ∞ M P
-› Mp◆,P q g `p◆, ⌧,j,v,',Mq ± !p◆q l"1 ⇢pR p◆,⌧ q,l q cardprP, P sq where for every rule index ◆, every reaction index ⌧ , every position j, every species v P V, every embedding ' from P to v, and any extended precondition

CONCLUSION

101 pA ,Bq, the expression g ´p◆, ⌧,j,v,',Mq is defined, as 1 if the following conditions are satisfied:

• the embedding φ 1 ◆,⌧ maps the connected pattern p j,◆ to the species v,

• the instance of P that is defined by the embedding ' is modified by the reaction react ◆,⌧ ,

• A "tppA, iq, pA 1 ,i 1 qq | A " A 1 and 'pA, iq"φ 1 ◆,⌧ pA, i 1 qu,

• if A "H, then B is a singleton that denotes a link that is removed by side effect; and as 0 otherwise. That is to say that δ ‹ pP q is equal to:

∞ h ◆"1 γ ◆ ∞ M P › Ñ Mp◆,P q ∞ vPV ∞ 'PrP,vs
∞ !p◆q j"1 g `p◆, ⌧,j,v,',Mq ± !p◆q l"1 ⇢pR p◆,⌧ q,l q cardprP, P sq .

This expression can be factorised (e.g. see [START_REF] Vincent Danos | Abstracting the differential semantics of rule-based models: exact and automated model reduction[END_REF]) as follows:

Proposition 5.4.4.

δ `pP q" ∞ h ◆"1 ∞ M P
-› Mp◆,P q ± !p◆q χ"1 pr c χ,◆,P,M sq ⇢ cardprP, P sq .

Conclusion

We have reformulated the consumption and the production term of every pattern, as an expression of the quantity of the other patterns.

There are two kinds of consumption terms. The first kind is obtained by gluing the pattern of interest to a connected pattern in the lhs of a rule on a site that is modified by the rule, the second one is obtained by taking the disjoint union between the pattern of interest and a connected pattern in the lhs of a rule while adding a bond to connect them (in such a case this bond has to be released by side effect).

There are also two kinds of production terms. The first kind consists in gluing the pattern of interest to the rhs of a rule on a site that is modified by the rule and then to apply the rule backward. The production term is then obtained as a product of the quantity of the connected pattern in the result of this operation. The second kind consists in taking the disjoint union between the pattern of interest and the lhs of the rule and then to connect them by a bond that will be released by side effect.

Chapter 6 Information flow

In this chapter, we show how to construct an abstract/reduced semantics thanks to an over-approximation of the information flow between the different regions of chemical species. The main idea is to detect and prove that some correlations between the states of some sites are useless. Then, we can safely abstract away these correlations by cutting chemical species into some smaller pattern components, that we call fragments.

The initial semantics and the reduced one are formally related by Abstract Interpretation.

Motivating example

Before introducing formally the framework, we focus on the case study that we have seen in Section 1.2.2. Let us recall it.

We consider a protein having three activation sites r, c, l, each of which can be activated 'p', or deactivated 'u'. Thus a chemical species is denoted as a triple of symbols among 'u'a n d' p', the first component denotes the state of the site l, the second one the state of the site c,a n dt h et h i r do n e the state of the site r. Initially, all the sites are deactivated. The evolution of the state of the proteins is described thanks to some chemical reactions. There is some hierarchical control between the states of the sites. The site c has to be activated first, at rate k 1 , thanks to the reaction in the Figure 6.1(a). Once the site c has been activated, the l site can get activated at rate k 2 , no matter the state of the site r is (see the Figure 6.1(b)); and the site r can get activated at rate k 3 , no matter the state of the site l is (see the Figure 6.1(c)). We describe the flow of information among the states of the sites of a protein in the Figure 6.1(d). Intuitively, the flow of information summarises the fact that the state of the site c may control the behaviour of We have seen in this example, that an over-approximation of the flow of information between the sites of chemical species, can be used to identify useless correlations, which can be used to discover appropriate change of variables.

Contact map and annotated contact map

Given a set of species V, the contact map (CM) associated to the set V is a summary of all the bindings found in any species in V. We can look at it as as y m bo l i cr e p r e s e n t a t i o no ft h es e to fa l lt h es pe c i e s . A contact map is formally defined in the following way. Definition 6.2.1 (Contact map). Given a signature Σ, an initial set of species V and a set of rules R, a contact map CM is a non-oriented graph where:

1. the nodes are the pairs pA, xqPA ˆS such that x P ΣpAq;

2. there is an edge between two nodes pA, xq and pB, yq if and only if there is a link between two sites pA, i, xq and pB, j, yq in at least one species in the original set V or in the right hand side of at least one rule in R, for two agent identifiers i, j P N Y N. We propose to annotate a contact map with an over-approximation of the flow of information between the different regions of chemical species. The main idea is to identify correlations between the states of the sites, which can be safely abstracted away, because they have no influence on the behaviour of the state of the other sites. This way, the so-obtained annotated contact map (aCM) will be used as a symbolic representation of the set of fragments of chemical species, the concentration of which will be the variables of our reduced system. Definition 6.2.2 (Annotated contact map). An annotated contact map (aCM) is given by a contact map and a binary (oriented) relation over its nodes. The relation may relate two pairs pA, xq and pB, yq if: 1. A " B and x ‰ y, 2. or there is an edge between pA, xq and pB, yq in the contact map.

In such case, we say that there is an arc in the aCM from the site x of A to the site y of B.

Fragments

Fragments are well chosen pattern components, which can be derived from an annotated contact map.

Definition 6.3.1 (Path in a pattern). A path in a pattern E is a finite sequence of site instances p :"pA k ,i k ,x k q 1 §k §n such that:

1. for any k between 1 and n ´2, pA k ,i k ,x k q‰pA k`2 ,i k`2 ,x k`2 q;

2. for any k between 1 and n ´1, either pA k ,i k q"pA k`1 ,i k`1 q and x k ‰ x k`1 , or the instances of the site pA k ,i k ,x k q and pA k`1 ,i k`1 ,x k`1 q are bound together in the pattern E.

In such a case, n is called the length of the path p, and for any k between 1 and n ´1, ppA k ,i k ,x k q, pA k`1 ,i k`1 ,x k`1 qq is called an arc in p.

Definition 6.3.2 (Compatible path).

A path p in a pattern E is compatible with the aCM, if and only if, for any arc ppA, i, xq, pA 1 ,i 1 ,x 1 qq in p, there is an arc from the node pA, xq and the pA 1 ,x 1 q in the aCM.

As stated by the two following lemmas, compatible paths can be composed and the image of a compatible path by an embedding is a compatible path. Lemma 6.3.3 (Path composition). If there exists two paths p 1 and p 2 in E, both compatible with the aCM and, respectively from a site instance pA, i, xq to a site instance pA 1 ,i 1 ,x 1 q, and from the site instance pA 1 ,i 1 ,x 1 q and a site instance pA",i",x"q, then there exists a path in E, compatible with the aCM, from the site instance pA, i, xq to the site instance pA",i",x"q.

Proof. We prove the Lemma 6.3.3 by induction over the length of p 1 . Let us write p 1 "p A k ,i k ,x k q 1 §k §n and p 2 "p A 1 k ,i 1 k ,x 1 k q 1 §k §n 1 . If n " 0o r n 1 " 0, then p 1 or p 2 is a path in E compatible with the aCM from the site instance pA, i, xq to the site instance pA",i",x"q; else if pA n´1 ,i n´1 ,x n´1 q‰ pA 1 2 ,i 1 2 ,x 1 2 q, then pA 1 ,i 1 ,x 1 q,...,pA n ,i n ,x n q, pA 1 2 ,i 1 2 ,x 1 2 q,...,pA 1 n 1 ,i 1 n 1 ,x 1 n 1 q is ap a t hi nE, compatible with the aCM; otherwise we apply the induction hypothesis with the paths pA k ,i k ,x k q 1 §k †n and pA 1 k ,i 1 k ,x 1 k q 1 †k §n 1 . Lemma 6.3.4 (Path image). Let φ be an embedding between two patterns E and E 1 and pA k ,i k ,x k q 1 §k §n be a path in E, compatible with the aCM. Then pA k , φpA k ,i k q,x k q 1 §k §n is a path in E 1 which is compatible with the aCM.

Proof. Let pA k ,i k ,x k q 1 §k §n be a path in E that is compatible with the aCM and let us consider pA k , φpA k ,i k q,x k q 1 §k §n . We need to show that for every k between 1 and n ´1, there is an arc from the site x k of the agent A k to the site x k`1 of the agent A k`1 . Since pA k ,i k ,x k q 1 §k §n is a path in E that is compatible with the aCM. For every k between 1 and n ´1, there is an arc in the aCM between the site pA k ,x k q and the site pA k`1 ,x k`1 q. Now we are ready to define the pattern components we were looking for: the fragments. We do it in two steps. Firstly, we define prefragments, as the patterns such that the arcs that are compatible with the aCM form a directed relation over their site instances. Then, we define fragments as the prefragments which are maximal with respect to the embedding ordering. Definition 6.3.5 (Prefragment). A prefragment is a pattern component E such that there is a site instance pA, i, xq in E, such that, for any site instance pA 1 ,i 1 ,x 1 q there is a path in E, compatible with the aCM, from pA 1 ,i 1 ,x 1 q to pA, i, xq. In such a case, the site instance pA, i, xq is called a target of the prefragment E. Definition 6.3.6 (Fragment). A fragment is a prefragment which is maximal for the embedding ordering. So a prefragment F is a fragment whenever for any prefragment F 1 such that there exists an embedding between F and F 1 , we have F " F 1 .

As we did for the set of species, we assume that there are no cycle in prefragments.

Example 6.3.7. We consider the aCM in Figure 6.5 and the pattern components that are given in Figure 6.6. We have annotated each pattern component with every path that is compatible with the aCM. Among these pattern

FRAGMENTS

111 components, only F 1 , F 2 , F 4 , F 5 , F 6 and F 7 are prefragments. Yet, we can notice that:

• F 1 can be embedded into F 2 ;

• F 4 can be embedded into F 7 ;

• F 6 can be embedded into F 7 .

So, F 1 , F 4 and F 6 are not fragments.

On the other site, the only way to refine F 2 is by adding the site c but what we would obtain would be F 3 , which is not a fragment (because it has not a unique target), thus F 2 is a fragment. The same way, the only manner to refine F 7 is by adding the site d, but also in this case the result, F 8 , is not a fragment (it does not have a target). So we can conclude that both F 2 and F 7 are fragments. Remark 6.3.8. The previous example illustrates precisely the main difference between the framework that is proposed in [START_REF] Vincent Danos | Abstracting the differential semantics of rule-based models: exact and automated model reduction[END_REF][START_REF] Feret | Internal coarse-graining of molecular systems[END_REF], and the one that is presented in this chapter. In this chapter, each annotated contact map generates an heterogenous set of fragments, in the sense that the agents of a fragment do not have to be cut in the same way. With the present framework, exactly one agent in the fragments that embed into a dimer, documents the state of one of the site among c and d, whereas in the framework proposed in [START_REF] Vincent Danos | Abstracting the differential semantics of rule-based models: exact and automated model reduction[END_REF][START_REF] Feret | Internal coarse-graining of molecular systems[END_REF], both agents document the state of one of the site among c and d. As a consequence, the reduced model that we obtain with the present framework is always smaller than the one that we obtain with the framework described in [START_REF] Vincent Danos | Abstracting the differential semantics of rule-based models: exact and automated model reduction[END_REF][START_REF] Feret | Internal coarse-graining of molecular systems[END_REF].

Given a pattern component E and a state ⇢ over V, we recall that the concentration rEs ⇢ of the pattern E in the state ⇢, is defined as:

rEs ⇢ " ÿ vPV cardprE, vsq cardprE, Esq ⇢pvq.
and that the corrected concentration pr Esq ⇢ of a pattern E is defined as rEs ⇢ ĉardprE, Esq. We define the set of abstract variables as the set of fragments of chemical species modulo isomorphisms. Formally, V 7 is a set of fragments, such that:

1. for each fragments F in V 7 , there exists v P V such that F embeds in v,a n d 2. for any pair pF 1 ,F 2 q of fragments in V 7 ,i fF 1 embeds into F 2 then F 1 " F 2 .

CHAPTER 6. INFORMATION FLOW

The set of concrete states V Ñ R over V and the set of (abstract) states V 7 Ñ R over V 7 are related via the abstraction function which is defined as: p⇢qpv 7 q"rv 7 s ⇢ .

The (pre)fragments and the abstraction function enjoy the following properties.

Proposition 6.3.9 (Orthogonal decomposition.). Let F be a prefragment.

The concentration of a prefragment F can be expressed as a linear combination with positive coefficients of the concentration of some fragments.

Proof. Let us prove the following equivalent property: pr Esq ⇢ can be expressed as a linear combination with positive coefficients of the corrected concentration of pr F i sq ⇢ of some fragments. The proof works iteratively. At each step, a prefragment E 1 will be replaced with a multi-set of more refined prefragments, while preserving the overall corrected concentration, until we obtain a multi-set of fragments. If E 1 does not embed into a species in V, we remove it. Otherwise E 1 has to be refined.

A pattern can be refined into a multi-set of patterns while preserving the overall correcting concentration, by using the following rewrite steps. We can refine the internal state of a site which misses one with any internal state in I, or refine a binding state '´' with each potential binding type (according to the CM). Moreover, a fresh site can be added in the interface of an agent A i with the binding state '?' if it belongs to Σ λpAq , and with no binding state otherwise. Lastly, if E 1 constains a site instance annotated with a binding type, one could replace it with a bond to an existing site (if its binding state allows it), to fresh site in existing agents, or to a site in a fresh agent.

We are left to show that, whenever a prefragment E 1 is not a fragment, then there always exists a rewrite step which replaces E 1 into a multi-set of prefragments. Only the steps which add a fresh site instance raise an issue. Thus, let us assume that no other rewrite step can apply. We consider an embedding φ between E 1 and a fragment F . We assume that there exists a target pA, i, xq in F , which has no antecedent by φ. Let us consider pA 1 ,i 1 ,x 1 q at a r g e ti nE 1 . Then we can consider a path in F compatible with the aCM from the site instance pA 1 , φpA 1 ,i 1 q,x 1 q to the site instance pA, i, xq. The first site in this path which has no antecedent by φ can be aded to E 1 and, by construction, it is a target of the result. Otherwise, there exists a site instance pA, i, xq in E 1 such that pA, i, xq is a target in E 1 and pA, φpA, iq,xq at a r g e ti nF and there exists a path in F compatible with the aCM from the site pA, φpA, iq,xq and a site having no antecedent by φ. The first site having no antecedent can be added to E 1 ,a n dpA, i, xq is still a target of the result.

Thus we have a rewriting strategies, where all intermediar steps are multiset of prefragments. The set of prefragments which can be embedded into chemical species in V is finite (since V is finite), which ensures the termination of our iteration. Proposition 6.3.10 (Divergence preservation). We have:

pV Ñ Rq ( pV 7 Ñ Rq.
Proof. By construction, is a linear function which maps any state over V to a state over V 7 . Let us prove that φ preserves the divergence of sequences. Let us consider a sequence p⇢ n q nPN of states over V such that the sequence p||⇢ n ||q nPN diverges. Since V is a finite set, there exists a variable v P V such that the sequence p⇢ n pvqq nPN diverges toward `8 (by definition, in a state ⇢, ⇢pvq • 0). Let us take an instance pA, i, xq of a site in v, we define ◆ as its internal state and λ as '✏' if the site is free, or as its binding type B@y otherwise. The pattern E :" A 1 px λ ◆ q is a prefragment. In given a mixture, the number of embeddings of E is greater than the number of embeddings of v. Moreover, by the Proposition 6.3.9, the number of embeddings of E in a mixture E 1 can be expressed as a linear combination with positive coefficients of the number of embeddings of some fragments F 1 ,...,F k in E 1 . As a consequence, for at least one of the fragments, let us say F j , the sequence p⇢ n pF j qq nPN diverges as well. Thus the sequence p|| p⇢ n q|| 7 q nPN diverges as well.

Flow analysis

In this section we define some criteria to ensure that the aCM is a sound over-approximation of the information flow.

Trivial rules

Some specific rules induce no flow of information. We say that a rule is trivial, if it has the following form:

A 1 pa B2@b q, B 2 pb A1@a q k Ñ A 1 paq, B 2 pbq.
Thus a trivial rule releases a bond without testing any other information. We could extend the class of trivial rules, but we do not do it for the sake of simplicity.

Side effects

We remind that a system of rules has side effects if it is possible to modify the state of the sites that are not documented in the left hand side of the rules. More precisely, in the two following cases:

1. when we remove an agent without checking that all its sites are free;

2. when we remove a bound denoted by a binding type or the symbol '´'.

In the first case a side effect is possible (may semantics), in the latter one a side effect is sure (must semantics).

So, given a rule r, MAYprq denotes the set of sites that may raise side effects when the rule r is applied whereas MUST prq denotes the set of sites that raise side effects whenever the rule r is applied. Definition 6.4.1 (Partner of a site). Let pA, i, xq be a site instance. We say that pA 1 ,x 1 q is a partner of pA, i, xq if there is an edge between the nodes pA, xq and pA 1 ,x 1 q in the contact map.

Valid annotation

In the following, we say that a rule r modifies a site instance s,i fs is a site instance in the lhs of the rule r, and if either s does not belong to the rhs of the rule r (that is to say that its agents have been removed by the rule r), or if it occurs in the rhs of the rule r but with a different state. Definition 6.4.2 (aCM). The annotated contact map (aCM) is valid with respect to a rule set R if it satisfies the following constraints.

Direct flow:

(a) every path in the lhs of a (non trivial) rule r that ends in a site instance which is modified by the rule r is compatible with the aCM;

(b) for every rule r and every site pA, i, xqPMAYprq, there is an arc in the aCM from the node pA, x 1 q to the node pA, xq, for any site x 1 P S such that the site instance pA, i, x 1 q occurs in the lhs of the rule r;

(c) for every rule r, every site pA, i, xqPMAYprqYMUST prq, and any potential partner pA 1 ,x 1 q of the site pA, xq in the CM, there is an arc from the site pA, xq to the site pA 1 ,x 1 q in the aCM.

2. Indirect flow: for any pattern component c in the lhs of a non trivial rule r, there exists a site instance pA, i, xq such that for any site instance pA 1 ,i 1 ,x 1 q in c, there is a path from x to pA, i, xq that is compatible with the aCM.

Intuitively, direct flows describe the flow of information between the sites that are tested (because they occur in the lhs of a rule) and the sites that are modified. Indirect flows handle with the pattern components which are not modified: the concentration of these patterns regulates the speed of rule application.

Reduced model

We recall the notations of Chapter 5.

We assume that the model is made of the following set of rules R:

r 1 :" c 1,1 ,...,c !p1q,1 Ñ p 1,1 ,...,p ✓p1q,1 k 1 r 2 :" c 1,2 ,...,c !p2q,2 Ñ p 1,2 ,...,p ✓p2q,2 k 2 ... :" ... r h :" c 1,h ,...,c !phq,h Ñ p 1,h ,...,p ✓phq,h k h
where for every rule r ◆ , ωpιq returns the number of components in the left hand side and θpιq returns the number of component in the right hand side. We denote by F the semantics function, which maps each state ρ : V Ñ R to the function of the concentration derivatives V Ñ R cardprP, P sq ˆFpρqpP q"

h ÿ ◆"1 ÿ M P -› Mp◆,P q !p◆q π χ"1 pr c χ,◆,F,M sq ⇢ ´h ÿ ◆"1 γ ◆ !p◆q ÿ j"1 ÿ M P › Ñ Mp◆,j,P q pr c j,◆ Y M P sq ⇢ !p◆q π χ"1 χ‰j pr c χ,◆ sq ⇢
where for every rule index ι, every position j, -› Ñ Mpι,j,Pq denotes the set of the potential extended gluings (e.g. see Definition 5.3.8) between the pattern component c j,◆ and the pattern P ;

--› Mpι,Pq is the set of the extended preconditions of the refinements of the rule rule ◆ according to the overlap between the rhs of the rule rule ◆ and the pattern P ;

-and for every M P -› Mpι,Pq, pc χ,◆,F,M q 1 §χ §!p◆q is the list of the pattern components in the extended precondition predpι,P,Mq.

Contribution of proper consumption

We already know, that the pattern components that occur in the lhs of a rule are all prefragments, thus we can express their concentration (and their corrected concentration) as a linear combination of the concentration of the fragments. Let us prove that if F is a fragment, ◆ a rule index, and j a position, and any way M P › Ñ Mp◆,j,Fq to glue the fragment F on the jth pattern component of the rule rule ◆ , then the (corrected) concentration pr c j,◆ Y M F sq of pattern component pc j,◆ Y M F q can also be expressed as the linear combination of the concentration of the other fragments.

Trivial rules

We assume that ◆ is the index of a trivial rule. By definition, the rule rule ◆ has the following form:

A 1 px B2@y q, B 2 py A1@x qÑA 1 pxq, B 2 pyq.

Hence, the number ωpιq of connected components in the lhs of the rule rule ◆ is equal to 1, and j is equal to 1 as well.

We consider pA ,BqP › Ñ Mpι,j,Fq an extended gluing between the pattern component c 1,◆ and the fragment F . The rule rule ◆ has no side effect. As a consequence, we have B "H. By Definition 5.3.8, it follows that A ‰H.

We consider two cases according to whether or not the set A is a singleton.

1. Let us assume that the set A is a singleton.

It follows that the (extended) gluing between c 1 and F is obtained (up to isomorphism) by replacing a binding type carried by a site instance s, by a link to a site in a fresh agent.

We wonder what are the different possibilities to refine the binding type of the site instance s in the fragment F . The site s might be bound to a site instance in F , but the so-refined pattern would contain a cycle, that is to say, since we have assumed that no species contains cycles, that its (corrected) concentration would be equal to 0. The only remaining case is the one where the site s is bound to a site in a fresh agent. In this case, the refined pattern is isomorphic to the pattern c 1,◆ Y A F .

We conclude that:

pr c 1,◆ Y pA ,Bq F sq " pr F sq . Let us write A "tp1,i 1 q, p2,i 2 qu.

In that case, either there is a link between the site instances pA, i 1 ,xq and pB, i 2 ,yq in the fragment F ,o rn o t .

(a) If there is a link between the site instances pA, i 1 ,xq and pB, i 2 ,yq in the fragment F , then c 1,◆ Y pA ,Bq F is isomorphic to the pattern component F .

(b) Otherwise, the pattern component c 1,◆ Y pA ,Bq F contains a cycle, that is to say, since we have assumed that no species contains cycles, that its (corrected) concentration is equal to 0.

In all case, we have been able to express the corrected concentration pr c 1,◆ Y pA ,Bq F sq as a linear combination of the corrected concentration of some fragments.

Non-trivial rules

We assume that ◆ is the index of a non trivial rule. We consider an extended gluing pA ,BqP › Ñ Mp◆,j,Fq, between the pattern component c j,◆ and ap r e f r a g m e n tF . Thanks to Constraint 2 of Definition 6.4.2, the pattern component c χ,◆ is ap r e f r a g m e n t ,f o re v e r yp o s i t i o nχ such that j ‰ χ. We are left to express the (corrected) concentration of the pattern component c j,◆ Y pA ,Bq F .

We consider the embedding ' F from the fragment F to the pattern component c j,◆ Y pA ,Bq F and φ j,◆ the embedding from the pattern component c j,◆ and the pattern component c j,◆ Y pA ,Bq F , that have been used to define the extended gluing c j,◆ Y pA ,Bq F .

c j,◆ Y pA ,Bq F F c j,◆ ⌘ 1 C C ' F -M [ [ φ j,◆
The pattern component F is a fragment, thus there exists a site instance pA t ,i t ,x t q in F that is a target. We consider two cases according to whether the set A is empty, or not.

1. We assume that the set A is not empty. By Definition 5.3.8, the set B is empty.

That is to say that: c j,◆ Y pA ,Bq F " c j,◆ Y A F . By Definition 5.3.5, for every site instance pA, i, xq in c j,◆ Y A F ,weknow that either there exists an agent identifier i 1 such that pA, i 1 ,xq is a site instance in F and i " ' F pA, i 1 q, or that there exists an agent identifier i 1 satisfying pA, i 1 ,xq is a site instance in c j,◆ and i " φ j,◆ pA, i 1 q.

We propose to show that the site instance pA t , ' F pA t ,i t q,x t q is a target in the pattern component c j,◆ Y A F .

Let pA s ,i s ,x s q be a site instance in the pattern component c j,◆ Y A F .

(a) We assume that there exists an agent identifier i 1 such that the triple pA s ,i 1 ,x s q is a site instance in F and i s " ' F pA, i 1 q. Since pA t ,i t ,x t q is a target in F , there is a path in the pattern component F from the site instance pA s ,i 1 s ,x s q to the site instance pA t ,i t ,x t q that is compatible with the aCM. By Lemma 6.3.4, there exists a path in the pattern component c j,◆ Y A F from the site instance pA s ,i s ,x s q to the site instance pA t , ' F pA t ,i t q,x t q that is compatible with the aCM.

(b) We assume that there exists an agent identifier i 1 such that the triple pA s ,i 1 ,x s q is a site instance in c j,◆ and i s " φ j,◆ pA, i 1 q. By Definition 5.3.8, there exists a site instance pA m ,i m ,x m q in c j,◆ and an agent identifier i 1 m such that: -pA m ,i 1 m ,x m q is a site instance in F ; -' F pA m ,i 1 m q"φ j,◆ pA m ,i m q; -the site instance pA m ,i m ,x m q is modified by the rule rule ◆ .

By Constraint 1a of Definition 6.4.2, there is a path in the pattern component c j,◆ from the site instance pA s ,i 1 ,x s q to the site instance pA m ,i m ,x m q that is compatible with the aCM. By Lemma 6.3.4, there exists a path in the pattern component c j,◆ Y A F from the site instance pA s ,i s ,x s q to the site instance pA m , φ j,◆ pA m ,i m q,x m q that is compatible with the aCM. By the previous case, we know that there is a path in the pattern component c j,◆ Y A F from the site instance pA m , ' F pA m ,i 1 m q,x m q to the site instance pA t , ' F pA t ,i t q,x t q that is compatible with the aCM.

Since ' F pA m ,i 1 m q"φ j,◆ pA m ,i m q, by Lemma 6.3.3, there exists a path in the pattern component c j,◆ Y A F from the site instance pA s ,i s ,x s q to the site instance pA t , ' F pA t ,i t q,x t q that is compatible with the aCM.

2. We assume that the set A is empty.

The set B is a singleton that we write:

ppA B 1 ,i B 1 ,x B 1 q, pA B 2 ,i B 2 ,x B 2 qq.
By Definition 5.3.5, we know that for any site instance pA, i, xq in c j,◆ Y pA ,Bq F , at least one of the following condition is satisfied:

-either there exists an agent identifier i 1 such that pA, i 1 ,xq is a site instance in F and i " ' F pA, i 1 q,

-or there exists an agent identifier i 1 such that pA, i 1 ,xq is a site instance in c j,◆ and i " φ j,◆ pA,

i 1 q, -or pA, i, xq"pA B 1 , φ j,◆ pA B 1 ,i B 1 q,x B 1 q.
Let us show that the site instance pA t , ' F pA t ,i t q,x t q is a target in the pattern component c j,◆ Y pA ,Bq F .

Let pA s ,i s ,x s q be a site instance in the pattern component c j,◆ Y pA ,Bq F .

(a) We assume that there exists an agent identifier i 1 such that the triple pA s ,i 1 ,x s q is a site instance in F and i s " ' F pA, i 1 q. Since pA t ,i t ,x t q is a target in F , there is a path in the pattern component F from the site instance pA s ,i 1 s ,x s q to the site instance pA t ,i t ,x t q that is compatible with the aCM. By Lemma 6.3.4, there exists a path in the pattern component c j,◆ Y pA ,Bq F from the site instance pA s ,i s ,x s q to the site instance pA t , ' F pA t ,i t q,x t q that is compatible with the aCM.

(b) We assume that pA s ,i s ,x s q"pA B 1 , φ j,◆ pA B 1 ,i B 1 q,x B 1 q.
By Constraint 1c of Definition 6.4.2, there is an arc in the aCM between the site pA s ,x s q and the site pA B 2 ,x B 2 q. As a consequence, there exists a path in the pattern component c j,◆ Y pA ,Bq F from the site instance pA s ,i s ,x s q to the site instance pA B 2 , ' F pA B 2 ,i B 2 q,x B 2 q that is compatible with the aCM. By the previous case, we already know that there exists a path in the pattern component c j,◆ Y pA ,Bq F from the site instance pA B 2 , ' F pA B 2 ,i 1 B 2 q,x B 2 q to the site instance pA t , ' F pA t ,i t q,x t q that is compatible with the aCM.

As a consequence, we have B "H. By Definition 5.4.2, it follows that A ‰H. We consider two cases according to whether or not the set A is a singleton.

1. Let us assume that the set A is a singleton.

It follows that the fragment F contains a site instance s that is free. Then the pattern component c 1,◆,F,M is obtained (up to isomorphism) by binding in F the site instance s to a link to a site in a fresh agent.

We denote as F 1 the pattern that is obtained by replacing, in the fragment F the binding state of the site instance s with the binding type that matches the link that is created by the rule.

Let us prove that the pattern F 1 is a prefragment.

-Indeed F and F 1 only differ by the binding state of s that is free in F and equipped with a binding type in F 1 . Thus, F and F 1 have the same set of agents, the same set of site instances, and the same set of links. it follows that any path in F is also a path in F 1 . Let t be a target in F . Let us show that t is also a target of F 1 . Let s 1 be a site instance in F 1 . Since t is a target in F , there is a path p "p A i k ,i k ,x k q 1 §k §n in F from the site s 1 to the the site t, that is compatible with the aCM. Thus, for any k between 1 and n ´1, there is an arc from the node pA i k ,x k q and the node pA i k`1 ,x k`1 q in the aCM. Since the path p is also a path in F 1 , we can conclude that the path p in F 1 is compatible with the aCM. We have proved that the site instance t is a target in F 1 . Thus F 1 is prefragment.

We wonder what are the different possibilities to refine the binding type of the site instance s in the prefragment F 1 . The site s might be bound to a site instance in F 1 , but the so-refined pattern would contain a cycle, that is to say, since we have assumed that no species contains cycles, that its (corrected) concentration would be equal to 0. The only remaining case is the one where the site s is bound to a site in a fresh agent. In this case, the refined pattern is isomorphic to the pattern c 1,◆,F,M .

REDUCED MODEL 123

We conclude that pr c 1,◆,F,M sq " pr F 1 sq .

2. Let us assume that the set A contains two elements.

Then the pattern component c 1,◆,F,M is obtained (up to isomorphism) by binding in F two site instances. As a consequence the pattern component c 1,◆,F,M has a cycle.

Since we have assumed that species has no cycle, we can conclude that the concentration of the pattern component c 1,◆,F,M is equal to 0.

In all case, we have been able to express the corrected concentration pr c 1,◆,F,M sq as a linear combination of the corrected concentration of some fragments.

Non-trivial rules

We assume that ◆ is the index of a non trivial rule. We denote by L Ñ R the rule rule ◆ We consider pA ,Bq an element of the set P -› Mp◆,Fq.

We consider ' F the embedding from the fragment F to the pattern component R Y A F and φ ◆ be the embedding from the pattern R to the pattern component R Y A F , that we have used to define the gluing between the fragment F and the rhs R of the rule rule ◆ .

R Y A F FR ⌘ 1 C C ' F -M [ [ φ ◆
Without any loss of generality, we assume that the pattern R Y A F matches the pattern R, that is to say that the injective substitution φ ◆ maps pairs pA, iq to the agent identifiers i.

The pattern component F is a fragment, thus there exists a site instance pA t ,i t ,x t q in F that is a target.

Let χ be a natural number 1 and ωpιq.

We want to prove that the pattern component c χ,◆,F,pA ,Bq is a prefragment.

1. We assume that the set A is not empty.

We denote as F ´1 the antecedent of F .

Formally, F ´1 is defined as the pattern that contains every agent instance pA, ' F pA, iqq such that pA, iq is an agent instance in F and the agent instance pA, ' F pA i qq has not been created by the application of the rule rule ◆ , every site instance pA, ' F pA, iq,xq such that pA, i, xq is a site instance in F and the agent instance pA, ' F pA i qq has not been created by the application of the rule rule ◆ , and every bond between the two site instances pA, ' F pA, iq,xq and pA 1 , ' F pA 1 ,i 1 q,x 1 q such that there is a bond between the site instance pA, i, xq and pA 1 ,i 1 ,x 1 q in F and the bond between the site instance pA, ' F pA, iq,xq and pA 1 , ' F pA 1 ,i 1 q,x 1 q has not been created by the rule rule ◆ .

We denote as F ´1 χ the pattern that is made of every pattern component of F ´1 that contains at least one agent instance pA, φ ◆ pA, iqq for a given site instance pA, iq in c χ,◆ .

Let us prove that any connected component F ´1 pc of F ´1 χ contains a site that has been modified by the rule rule ◆ .

-This is the case if F ´1 is connected (by assumption, since B "H, F and P overlaps on a site that is modified by the rule rule ◆ ).

-If F ´1 pc is disconnected, each connected component of it contains as i t et h eb i n d i n gs i t eo fw h i c hh a sc h a n g e d .

Then, we propose to prove both following intermediary results:

(a) Whenever a pattern component of F ´1 χ contains the site instance pA t , ' F pA t ,i t q,x t q, there exists a path in this pattern component from every site instance of this pattern component to the site instance pA t , ' F pA t ,i t q,x t q, that is compatible with the aCM.

(b) Whenever a pattern component F ´1 pc of F ´1 χ does not contain the site instance pA t , ' F pA t ,i t q,x t q, then it contains a site instance pA ' ,i ' ,x ' q such that the following properties are all satisfied:

• there exists an agent identifier i such that pA ' , i, x ' q is a site instance in F and i ' " ' F pA ' ,iq; • there exists an agent identifier i such that pA ' , i, x ' q is a site instance in c χ,◆ and i ' " φ ◆ pA ' ,iq; • for every site instance pA s ,i s ,x s q of F ´1 pc , there exists a path in the pattern component F ´1 pc from the site instance pA s ,i s ,x s q to the site instance pA ' ,i ' ,x ' q that is compatible with the aCM.

Let us prove these properties: χ that contains the site instance pA t , ' F pA t ,i t q,x t q. Let pA s ,i s ,x s q be a site instance in F ´1 o . Let i 1 be an agent identifier such that pA s ,i 1 ,x s q is a site instance in F and ' F pA s ,i 1 q"i s . Since the site instance pA t ,i t ,x t q is a target in F , there exists a path in the pattern component F from the site instance pA s ,i 1 ,x s q to the site instance pA t ,i t ,x t q that is compatible with the aCM. By Lemma 6.3.4, there exists a path p in the pattern P Y A F from the site instance pA s ,i s ,x s q, to the site instance pA t , ' F pA t ,i t q,x t q, that is compatible with the aCM. Since the pattern F is acyclic, and both site instances pA s ,i s ,x s q and pA t , ' F pA t ,i t q,x t q belong to the fragment F , it follows that the path p remains in the pattern F ´1 pc . Thus there exists a path in the pattern component F ´1 o from the site instance pA s ,i s ,x s q to the site instance pA t , ' F pA t ,i t q,x t q that is compatible with the aCM.

(b) Let F ´1 pc be a pattern component of F ´1 χ that does not contain the site instance pA t , ' F pA t ,i t q,x t q. Necessarily, the pattern component F ´1 pc has been disconnected from the rest of F . That is to say that it contains a site the binding state of which has changed. Let pA ' ,i ' ,x ' q be a site instance in F ´1 pc that has lost a bond. Since pA ' ,i ' ,x ' q is a site instance in F ´1 pc there exists an agent identifier i such that pA ' , i, x ' q is a site instance in F and i ' " ' F pA ' ,iq. It is not possible to create a bond in a rule, without having the two corresponding site instances in the lhs of this rule. As a consequence, there exists an agent identifier i 1 such that pA ' ,i 1 ,x ' q is a site instance in c χ,◆ and i ' " φ ◆ pA ' ,i 1 q. Since F is acyclic, and by definition of F ´1, there is a path in the pattern component F ´1 o from every site instance to the site instance pA ' ,i ' ,x ' q, that is compatible with the aCM.

Let pA s ,i s ,x s q be a site instance in the pattern component c χ,◆,F,pA ,Bq , one of the following property is satisfied:

(a) pA s ,i s ,x s q is a site instance in F ´1 χ ;

ii. We assume that pA s ,i s ,x s q"pA B 1 , φ ◆ pA B 1 ,i B 1 q,x B 1 q. By Constraint 1c of Definition 6.4.2, there is an arc in the aCM between the site pA s ,x s q and the site pA B 2 ,x B 2 q. As a consequence, there exists a path in the pattern component c χ,◆,F,pA ,Bq from the site instance pA s ,i s ,x s q to the site instance pA B 2 , ' F pA B 2 ,i B 2 q,x B 2 q that is compatible with the aCM. By the previous case, we already know that there exists a path in the pattern component c χ,◆,F,pA ,Bq from the site instance pA B 2 , ' F pA B 2 ,i 1 B 2 q,x B 2 q to the site instance pA t , ' F pA t ,i t q,x t q that is compatible with the aCM. By Lemma 6.3.3, we can conclude that there exists a path in the pattern component c χ,◆,F,pA ,Bq from the site instance pA s ,i s ,x s q to the site instance pA t , ' F pA t ,i t q,x t q that is compatible with the aCM.

iii. We assume that there exists an agent identifier i 1 such that the triple pA s ,i 1 ,x s q is a site instance in c j,◆ such that i s " φ ◆ pA, i 1 q.

• If pA B 1 ,i B 1 ,x B 1 qPMAYprule ◆ q.
The agent instance pA B 1 ,i B 1 q has at least one site instance (otherwise, the pattern component c j,◆ would have been made of a single agent with no site instance, which would be absurd since pA s ,i 1 ,x s q is a site instance in c j,◆ ). Let x w be a site name, such that the triple pA B 1 ,i B 1 ,x w q is a site instance in the pattern c j,◆ .

We have pA B 1 ,i B 1 ,x B 1 qPMAYprule ◆ q, so the agent instance pA B 1 ,i B 1 q is removed by the rule rule ◆ . As a consequence, the site pA B 1 ,i B 1 ,xw q is modified by the rule rule ◆ . By Constraint 1a of Definition 6.4.2, there is a path in the pattern component c j,◆ from the site instance pA s ,i 1 ,x s q to the site instance pA B 1 ,i B 1 ,x w q that is compatible with the aCM. By Lemma 6.3.4, there is a path in the pattern component c χ,◆,F,pA ,Bq from the site instance pA s ,i s ,x s q to the site instance pA B 1 , φ ◆ pA B 1 ,i B 1 q,x w q that is compatible with the aCM. By Constraint 1b of Definition 6.4.2, there is an arc between the site pA B 1 ,x w q and the site pA B 1 ,x B 1 q in the aCM. Thus, there is a path in the pattern component c χ,◆,F,pA ,Bq

Balance

We have provided, for any fragment F , an explicit definition of the proper production δ ‹ pF q of the fragment F and of the proper consumption δ ‹ pF q of the fragment F , as a polynomial expression of the concentration of the other fragments F 1 . We consider the function F 7 that maps each abstract state ⇢ 7 from V 7 to R, to the function mapping each fragment F to the value of the expression δ ‹ pF q´δ ‹ pF q. The function F 7 is well-defined. Proposition 6.5.1. We have ˝F " F 7 ˝ .

Proof. By construction of F 7 .

We can conclude with the soundness of our model reduction. Theorem 6.5.2. The tuple pV, F, V 7 , , F 7 q is an abstraction.

Conclusion

In this chapter, we have designed a static analysis of the flow of information among the sites of species. This abstraction is summarised in a contact map. This contact map is indeed a compact description of the set of all species, that is obtained by fusing every instance of a same agent type. We annotate this contact map, by inspecting the rule set, and detecting when the state of a site may have an influence on the behaviour of other sites. The result of our analysis can be used to define a set of self-consistent fragments, from which we can derive an exact model reduction of the initial system. This result is proved formally, with respect to the initial semantics of the model.

It is worth noting that we have never worked explicitly on the underlying reaction networks. Moreover, our flow analysis takes into account remote controls, when the sites of an agent control the behaviour of some other agents. This is mandatory to get a sound abstraction [START_REF] Nikolay | Domain-oriented reduction of rule-based networks models[END_REF]. We also manage side effects.

We also notice that our framework is a strict improvement of the model reduction that was proposed in [START_REF] Feret | Internal coarse-graining of molecular systems[END_REF], in the sense that each fragment in the framework of [START_REF] Feret | Internal coarse-graining of molecular systems[END_REF] is necessarily a prefragment in the present analysis, but not the converse. That is to say, that we get smaller fragments with the analysis that we have described in this chapter. In [START_REF] Feret | Internal coarse-graining of molecular systems[END_REF] is studied a set of 71 rules expanding into 18 051 984 143 555 729 567 species, reduced into 175 988 fragments. Given a Σ-graph G, we write A G for the set of its agents, type G for its typing function, S G for the set of its sites, L G for the set of its links and pk G for its internal states map. An example of Σ-graph is given in Figure 7.1.

Homomorphisms between Σ-graphs

Two Σ-graphs, G and G 1 , can be put in relation by structure-preserving functions from the agents of G to the agents of G 1 . Those functions are called homomorphisms. By structure-preserving we mean that:

1. agents of a specific type are mapped to agents of the same type; 2. if an agent exhibits a site, the site is present also in the image of that agent;

3. the state of sites is preserved;

7.1. CATEGORY OF SIGMA-GRAPHS 135 4. the image of a site corresponding to a link holds a higher (or equal) linking information.

The link information order is given by a subtyping relation § type ,thatisthe least reflexive relation § type such that for all A P A and x P Σ and i such that type G piq"A, we have:

´ §type pA, iq § type pn, iq.

Homomorphisms are formally defined as follows. In Figure 7.2, it is possible to observe some examples of Σ-graphs homomorphisms. There we have:

-ah o m o m o r p h i s mf r o mG 1 to G 2 : the agents Apx u , y u q and Apx u , y p q are mapped to the agent Apx u , y u|p q, whereas the agents Apx p , y u q and Apx p , y p q are mapped to the agent Apx p , y u|p q;

-ah o m o m o r p h i s mf r o mG 1 to G 3 : the agents Apx u , y u q and Apx p , y u q are mapped to the agent Apx u|p , y u q, whereas the agents Apx u , y p q and Apx p , y p q are mapped to the agent Apx u|p , y p q;

-ahomomorphismfromG 1 to G 4 : all the agents are mapped to the agent Apx u|p , y u|p q;

-ahomomorphismfromG 2 to G 4 : all the agents are mapped to the agent Apx u|p , y u|p q;

-ahomomorphismfromG 3 to G 4 : all the agents are mapped to the agent Apx u|p , y u|p q. We write u|p when the state of a site can be u or p but we ignore the exact value.

Given a homomorphism h we say that h is an embedding every time that h is injective. Generally, given two Σ-graphs G and H, it is possible to have more than one homomorphism between them. So the number of homomorphisms between G and H is denoted by rG, Hs. We say that h is an automorphism, whenever G " H and h is a bijection. As we can notice, the identity function is always an automorphism. Homomorphisms compose in the usual way. Moreover, whenever two homomorphisms f : G Ñ H and g : H Ñ G are such that their composition is the identity homomorphism over H, then f and g are called isomorphisms and G and H are said to be isomorphic. This is denoted by G « H.

In the following, all the constructions are defined up to isomorphisms. Isomorphisms (and automorphisms) are all embeddings.

Basic elements of Abstract Interpretation

Here we recall the main concepts of Abstract Interpretation. The interested reader can find more details in [START_REF] Cousot | Abstract interpretation and application to logic programs[END_REF].

Ordered sets

Let us start by reminding some general definitions. In this case, it is denoted by xP, Ñ, \, [, K, Jy.

A classical example of complete lattice is the power-set of any set S, xPpSq, Ñ, X, Y, H,Sy. Definition 7.2.4 (Sublattice). Let xP, Ñ, \, [y be a lattice. Let S be a subset of P and let Ñ S , \ S and [ S be the restriction to S of Ñ, \ and [, respectively.

Then xS, Ñ S , \ S , [ S y is a sublattice of xP, Ñ, \, [y if and only if for all x, y P S we have x \ y P S and x [ y P S.

Galois connections

Definition 7.2.5 (Galois connection). A Galois connection between two complete lattices xP, Ñ, \, [, K, Jy and xP 7 , Ñ 7 , \ 7 , [ 7 , K 7 , J 7 y is a pair of maps:

↵ P P Ñ P 7 , γ P P 7 Ñ P such that: @p P P : @p 7 P P 7 : ↵ppq Ñ 7 p 7 ô p Ñ γpp 7 q.

In which case we write:

xP, Ñ, \, [, K, Jy ´´´Ñ -´´↵ γ xP 7 , Ñ 7 , \ 7 , [ 7 , K 7 , J 7 y.
Galois connections enjoy several properties (the interested reader can find ag o o ds u m m a r yw i t ha l lr e f e r e n c e st om a t h e m a t i c a ll i t e r a t u r ei n[ 1 9 ] ) . F o r example, γ ˝↵ is extensive: @p P P : p Ñ γ ˝↵ppq (7.1)

since ↵ppq Ñ 7 ↵ppq by reflexivity, hence p Ñ γ ˝↵ppq by 7.2.5 with p 7 " ↵ppq.

If we abstract and than concretize we obtain something that is bigger than what we started from. This means that the loss of information in our process of abstraction is sound. The same way ↵ ˝γ is reductive: @p 7 P P 7 : ↵ ˝γpp 7 q Ñ 7 p 7 (7.2) since γpp 7 q Ñ γpp 7 q by reflexivity, hence ↵˝γpp 7 q Ñ 7 p 7 by 7.2.5 with p " γpp 7 q.

If we have an abstract element, we concretize and after we abstract it again, we obtain something that is equal, or smaller, than our starting point. That means that our abstraction is as precise as possible and we do not loose any information by the concretization process. It follows that:

1. ↵ is monotone: since p 1 Ñ p 2 implies p 1 Ñ γ ˝↵pp 2 q by 7.1 and transitivity whence ↵pp 1 q Ñ 7 ↵pp 2 q by 7.2.5;

2. γ is monotone: since p 7 1 Ñ 7 p 7 2 implies ↵ ˝γpp 7 1 q Ñ 7 p 7 2 by 7.2 and transitivity whence γpp 7 1 q Ñ γpp 7 2 q by 7.2.5.

↵ PxP, Ñ, \, [, K, Jy m ÑxP 7 , Ñ 7 , \ 7 , [ 7 , K 7 , J 7 y (7.3) γ PxP 7 , Ñ 7 , \ 7 , [ 7 , K 7 , J 7 y m ÑxP, Ñ, \, [, K, Jy (7.4)
The meaning of monotonicity is that the soundness of the approximation is preserved by ↵ and γ. Equations 7.1, 7.2, 7.3 and 7.4 imply 7.2.5, so an alternative definition of Galois connection can be given as: 7 ys and rγ PxP 7 , Ñ 7 , \ 7 , [ 7 , K 7 , J 7 yq m ÑxP, Ñ, \, [, K, Jy and r@p P P : p Ñ γ ˝↵ppqs and r@p 7 P P 7 : ↵ ˝γpp 7 q Ñ 7 p 7 s (7.5)

xP, Ñ, \, [, K, Jy ´´´Ñ -´´↵ γ xP 7 , Ñ 7 , \ 7 , [ 7 , K 7 , J 7 y ñ $ ' ' ' & ' ' ' % r↵ PxP, Ñ, \, [, K, Jy m ÑxP 7 , Ñ 7 , \ 7 , [ 7 , K 7 , J
We can observe that:

BASIC ELEMENTS OF ABSTRACT INTERPRETATION

139

P pÑq ´´´Ñ -´´↵ γ P 7 pÑ 7 q if and only if P 7 pÑ 7 ´1 q ´´´Ñ -´´γ ↵ P pÑ ´1q where the inverse Ñ ´1 of the partial order Ñ is Ö. Thus, any result can be interpreted dually by reversing the order.

For all p P P and p 7 P P 7 ,w eh a v e↵ ˝γpp 7 q Ñ 7 p 7 by 7.2, whence by monotony γ ˝↵ ˝γpp 7 q Ñ 7 γpp 7 q. Moreover, γpp 7 q Ñ 7 γ ˝↵ ˝γpp 7 q, by 7.1 when p is γpp 7 q. By antisymmetry, we conclude that: @p 7 P P 7 : γ ˝↵ ˝γpp 7 q"γpp 7 q.

(7.6)

The same way, we have ↵ ˝γ ˝↵ppq Ñ 1. ⇢ is monotone, i.e. @x, y P P, x Ñ y ñ ⇢pxq Ñ ⇢pyq; 2. ⇢ is extensive, i.e. @x P P, x Ñ ⇢pxq; 3. ⇢ is idempotent, i.e. @x P P, ⇢pxq"⇢p⇢pxqq. Idempotence can be interpreted as the fact that all the information is lost once for all during the abstraction process, so the result of two abstractions performed one after the other will be the same as if apply the abstraction just once.

Another consequence is that we do not need to consider an abstract and ac o n c r e t ed o m a i n ,b u tw ec a nu s et h ec o n c r e t ed o m a i na st h ea b s t r a c to n e after applying to it the upper closure operator γ ˝↵. Definition 7.2.8 (Moore family). Let pP, Ñq be a poset with a top element J. A Moore family is a subset M Ñ P such that:

-JPM -if X P PpM qztHu then [X exists in P and [X P M or equivalently -if X P PpM q then [X exists in P and [X P M that is to say M is closed under meet.

In particular, the use of Moore families is justified by the following: Proposition 7.2.9. Let xP, Ñ, \, [, K, Jy and xP 7 , Ñ 7 , \ 7 , [ 7 , K 7 , J 7 y be two complete lattices. If xP, Ñ, \, [, K, Jy ´´´Ñ -´´↵ γ xP 7 , Ñ 7 , \ 7 , [ 7 , K 7 , J 7 y then γ ˚pP 7 q is a Moore family (where γ ‹ pP 7 q"tγppq|p P P u).

Proof. See [START_REF] Cousot | Abstract interpretation and application to logic programs[END_REF].

The reader interested in this equivalent approach can have a look to [START_REF] Cousot | Systematic design of program analysis frameworks[END_REF]. In a Galois connection one function uniquely and absolutely determines the other:

Proposition 7.2.10. If xP, Ñ, \, [, K, Jy ´´´Ñ -´´↵ 1 γ 1 xP 7 , Ñ 7 , \ 7 , [ 7 , K 7 , J 7 y and xP, Ñ, \, [, K, Jy ´´´Ñ -´´↵ 2 γ 2 xP 7 , Ñ 7 , \ 7 , [ 7 , K 7 , J 7 y then p↵ 1 " ↵ 2 q if and only if pγ 1 " γ 2 q.
Proof. See [START_REF] Cousot | Abstract interpretation and application to logic programs[END_REF].

So providing that we are in a complete lattice, we can perform an Abstract Interpretation by defining the abstraction or, indifferently, the concretization function. The following method gives us the way to uniquely determine the adjoined function. For all p 7 P P 7 we have γpp 7 q" ó tp|↵ppq Ñ 7 p 7 u.

Proof. See [START_REF] Cousot | Abstract interpretation and application to logic programs[END_REF].

As a consequence, Galois connections between complete lattices preserve bounds.

Proposition 7.2.12. If xP, Ñ, \, [, K, Jy ´´´Ñ -´´↵ γ xP 7 , Ñ 7 , \ 7 , [ 7 , K 7 , J 7 y, then ↵ P P p_q a Ñ P 7 p_ 7 q preserves the least upper bounds and γ P P 7 p^7q a Ñ P p^q preserves the greatest upper bounds. Proof. See [START_REF] Cousot | Abstract interpretation and application to logic programs[END_REF].

Abstraction of relations among sites

Now, given a Σ-graph G, we want to consider a binary relation over its sites. This relation can be used, for instance, to abstract the flow of information among sites, as we will see in the following chapter.

Relations among sites

A way to represent a relation between sites of a Σ-graph is given by the so-called annotated Σ-graph. Definition 7.3.1 (Annotated Σ-graphs). An annotated Σ-graph G a is a pair pG, Ga q where G is a Σ-graph and Ga is a subset of tpi, xq, pi 1 ,x 1 q|i P A G , pi, xq, pi 1 ,x 1 qPS G uZpL G X S 2 G q. Ordered pairs of sites in tpn, iq, pn, i 1 q|n P A G , pn, iq, pn, i 1 qPS G u are called internal edges and are denoted as pn, iq _ G a pn, i 1 q, whereas ordered pairs in L G X S G 2 are called external edges and are denoted as pn, iq ^ G a pn 1 ,i 1 q. An ordered pair of sites can be connected by both an internal edge and an external edge. We omit the symbols _ and ^when they are not important.

Example 7.3.2. If we consider the Σ-graph G in Figure 7.1 and the following relation:

G a :"tpn, iq, pn, i 1 q|n P A G , pn, iq, pn, i 1 qPS G uZpL G X S 2 G q,
the corresponding annotated Σ-graph G a "pG, G a q is given in Figure 7.4. For every Σ-graph G,w ed e n o t ea sR G the relation over the sites of G, that is defined as follows: R G :"tpn, iq, pn, i

1 q|n P A G , pn, iq, pn, i 1 qPS G uZpL G X S 2 G q.
R G is the most complete relation over the sites of G. Moreover, the set }pR G q is the set of all the potential relations over the sites of G. It forms a complete lattice, for inclusion. The bottom element of }pR G q is the empty annotation, whereas the top element is the relation R G .

Let also consider another Σ-graph Ḡ. The set }pR Ḡq is a complete lattice as well. Now we want to build a correspondence between the relation R G on the sites of G and the relation R Ḡ on the sites of Ḡ. In particular we want to have a method to switch the level of resolution from the one of G to the one of Ḡ.

Approximation of relations among sites

Let G, Ḡ be two Σ-graphs. We define a function ↵ G,G 1 : PpR G qÑPpR Ḡq that takes an annotation on the graph G and returns an annotation on the graph Ḡ.

Definition 7.3.3 (Abstraction). Let G, Ḡ be two Σ-graphs and let r be a relation in

PpR G q. ↵ G, Ḡ " # R G Ñ R Ḡ r fi Ñtppφpiq,xq, pφpi 1 q,x 1 qq | φ P MpG, Ḡq, ppi, xq, pi 1 ,x 1 qq P ru.
The function ↵ G, Ḡ maps each relation in PpR G q of G to its best (smallest) abstract approximation in PpR Ḡq. Intuitively, every edge in an annotation of G is interpreted as a positive information: we want to keep this edge. Ḡ is another Σ-graph, hence it allows for distinguishing among the states of sites according to a different set of contexts. The abstraction reports every edge of the annotation G, in the annotation of Ḡ, in every compatible context. Compatibility between contexts is formalised by the means of a homomorphism.

G, Ḡ " # R Ḡ Ñ R G r fi Ñtppi, xq, pi 1 ,x 1 qq | @φ P MpG, Ḡq, pφpiq,xqr pφpi 1 q,x 1 qu
The function γ G, Ḡ maps each relation in PpR Ḡq to the biggest concrete relation in PpR G q corresponding to it. Intuitively, the annotation of Ḡ has to be understood negatively. In there is no edge between two sites of Ḡ, then we know that in this specific context there is no relation. Thus, the concretization collects everything that is known about the absence of relation.

xPpR G q, Ñ, H, R G , Y, Xy ´´´´´Ñ -´´´´↵ G, Ḡ γ G, Ḡ xPpR Ḡq, Ñ, H, R Ḡ, Y, Xy .
Proof. As we have seen in Definition 7.2.5, the pair p↵ G, Ḡ, γ G, Ḡq forms a Galois connection if, and only if, for all r P R G and r P R Ḡ we have: We consider ppi, xq, pi 1 ,x 1 qq P r and a morphism φ in MpG, Ḡq.

↵ G, Ḡprq Ñ r ô r Ñ γ G, Ḡpr q.
We know that φpi, xqr↵ G, Ḡprqsφpi 1 ,x 1 q.

So, since ↵ G, Ḡprq Ñ r,w eh a v et h a tφpi, xqrφpi 1 ,x 1 q.

So, by definition of γ G, Ḡ, ppi, xq, pi 1 ,x 1 qq P γ G, Ḡprq.S or Ñ γ G, Ḡpr q.

2. Let us prove that if r Ñ γ G, Ḡpr q then ↵ G, Ḡprq Ñ r.

Let us consider a morphism φ in MpG, Ḡq and a couple of sites ppi, xq, pi 1 ,x 1 qq such that φpiq" ī and φpi 1 q" ī1 and pi, xqrpi 1 ,x 1 q.

Since r Ñ γ G, Ḡpr q, we have that pi, xqγ G, Ḡprqpi 1 ,x 1 q.

By definition of γ G, Ḡ, we have: pφpiq,xqrpφpi 1 q,x 1 q.

So we get that: pp ī, xq, p ī1 , x1 qq P r.

Example 7.3.6. To see how both functions work, let us consider the example given by the dimer in Figure 7.5. We will not consider all the possible relationships between sites, but we will restrict our example to the ones showed in the sublattice C of Figure 7.6.

The sublattice C will be used both as the concrete and as the abstract domain, so ↵ : C Ñ C and γ : C Ñ C. The abstraction is showned in Figure 7.7 and the concretization in Figure 7.8.

Since the two functions, ↵ G, Ḡ and γ G, Ḡ, form a Galois connection they enjoy several properties. In particular, their compositions are both closure operators: γ G, Ḡ ˝↵G, Ḡ is the upper one (Definition 7.2.6), whereas ↵ G, Ḡ ˝γG, Ḡ is the lower (Definition 7.2.7). The upper closure γ G, Ḡ ˝↵G, Ḡ characterises the granularity of our abstraction. It consists in reporting every edge in the annotation of G in every other context that cannot be discriminated from the initial one in Ḡ. Two annotations of G having the same image by γ G, Ḡ ˝↵G, Ḡ describe the same information. In the case when G and Ḡ are equal, this amounts to propagate edges along every automorphism.

The lower closure ↵ G, Ḡ ˝γG, Ḡ allows to simplify the annotation of Ḡ. It propagates the information we have about the absence of edges that can be described at the level of resolution of G,in Ḡ. In the case when G and Ḡ are equal, this amounts to remove every edge between two sites, if such an edge is missing between the image of these sites by an automorphism. 146

CHAPTER 7. CONTEXT-SENSITIVE ABSTRACTIONS R E R E R E R E R E R E R E R E (r1) (r2) (r0) (r3) R E R E R E R E R E R E R E R E (r1) (r2) (r0) (r3)

ABSTRACTION OF RELATIONS AMONG SITES

147 Chapter 8

R E R E R E R E R E R E R E R E (r1) (r2) (r0) (r3) R E R E R E R E R E R E R E R E (r1) (r2) (r0) (r3)

Partitioned flow

In this chapter, we show how to use an arbitrary Σ-graph to summarise the potential flow of information between the sites of species in a context-sensitive way. Then we use this summary to derive a set of self-consistent fragments. This way, we can tune the resolution of our model reduction according to the contexts which can be distinguished in the Σ-graph (which is left as a parameter of our abstraction).

Case study

Before describing the framework formally, we introduce a case study. We consider one kind of protein P with three phosphorylation sites, called a, b, and c. Each site can be phosphorylated, or not, thus each instance of P can take 8 (as 2 3 )c o n fi g u r a t i o n s . W ec o n s i d e rt h a ta n ys i t ec a ng e tp h o s p h orylated or lose its phosphorylation, thus there are 24 chemical reactions (3 per configurations). Configurations are listed in Figure 8.1(a), reactions are drawed in Figure 8.1(b). The protein in the state P pa wa ,b w b ,c wc q is denoted as a triple pw a ,w b ,w c q of symbols among u and p. In general, the rate constant of phosphorylation (resp. dephosphorylation) can depend on the state of the other sites. Here we make the assumption that only the phosphorylation rate constant of the third site depends on the state of the two other sites, but we assume that the phosphorylation rate constant of the third site is the same in the configurations (u,u,u) and (u,p,u). Thus, our system is parameterised by 12 kinetic rates (e.g.. see Fig. 8.1(b)). The behaviour of the system is formalised by the means of the following system of differential equations, which describes the derivatives of the concentrations of each configuration of P : rpu, u, uqs 1 " k 2 rpp, u, uqs `k4 rpu, p, uqs `k8 rpu, u, pqs ´pk 1 `k3 `k5 qrpu, u, uqs rpu, u, pqs 1 " k 2 rpp, u, pqs `k4 rpu, p, pqs `k5 rpu, u, uqs ´pk 1 `k3 `k8 qrpu, u, pqs rpu, p, pqs 1 " k 2 rpp, p, pqs `k3 rpu, u, pqs `k5 rpu, p, uqs ´pk 1 `k4 `k8 qrpu, p, pqs rpu, p, uqs 1 " k 2 rpp, p, uqs `k3 rpu, u, uqs `k8 rpu, p, pqs ´pk 1 `k4 `k5 qrpu, p, uqs rpp, p, uqs 1 " k 1 rpu, p, uqs `k3 rpp, u, uqs `k8 rpp, p, pqs ´pk 2 `k4 `k7 qrpp, p, uqs rpp, p, pqs 1 " k 1 rpu, p, pqs `k3 rpp, u, pqs `k7 rpp, p, uqs ´pk 2 `k4 `k8 qrpp, p, pqs rpp, u, pqs 1 " k 1 rpu, u, pqs `k4 rpp, p, pqs `k6 rpp, u, uqs ´pk 2 `k3 `k8 qrpp, u, pqs rpp, u, uqs 1 " k 1 rpu, u, uqs `k4 rpp, p, uqs `k8 rpp, u, pqs ´pk 2 `k3 `k6 qrpp, u, uqs. Now, we wonder whether or not our model can be coarse-grained: we are looking for a set macro-variables which are defined as a linear combination of the variables of the initial systems (so called micro-variables) that are selfconsistent. That is to say that the derivatives of the macro-variables must be expressed as functions of only the macro-variables. In Chapter 6, we have introduced a framework for detecting self-consistent coarse-graining thanks to an over-approximation of the flow of information between the states of the sites of proteins. Indeed the flow of information can be summarised by annotating a contact map (which describes the different kinds of proteins, their sites, their potential phosphorylation states and their potential binding) with an oriented relation over the sites, which summarises how each site may influence the other ones: an arrow from a site s 1 to a site s 2 means that the capability of modifying the state of the site s 2 may change according to the state of the site s 1 .

The annotated contact map for our case study is given in Figure 8.1(d). This is a context-insensitive approximation since all the information about the sites of P is summarised in a single node, regardless the states of its sites, which prevents from providing distinct annotations for a given site depending on the state of the other sites. The arrow from the site a (resp. b)sitetothe site c comes from the fact that the phosphorilation rate constant of the site c may depend on the state of the site a (resp. b)( s i n c ek 6 may not be equal to the rate constant k 5 (resp. k 7 )). No other arrows are required, since the phosphorylation/dephosphorylation rates of both the sites a and b do not depend on the states of other sites (indeed, we can check on Figure 8.1(b) that the rates of the corresponding reactions are the same four by four). As ar e s u l t ,s i n c et h ebe h a v i o u ro ft h es i t ec site depends on the state of all the other sites, no coarse-graining can be found in this way.

Indeed, without further assumptions, the model cannot be coarse-grained by any means. But interestingly, if we set the rate constant k 1 equal to 0, we can abstract away the relation between the state of the sites b and c in the case when the site a is activated. This is formalised by the following differential equations: This coarse-graining can be discovered by tuning the context-sensitivity of the information flow analysis. Indeed, the behaviour of the protein P can be partitioned into two distinct modes. Whenever the site a is phosphorylated, the evolution of the state of the site c is controlled by the state of both sites a and b. But whenever the site a is not phosphorylated, the evolution of the state of the site c is not controlled by the state of the site b anymore (this can be checked in Figure 8.1(b) where the phosphorylation (resp. unphosphorylation) rate constant of the site c is the same whatever the protein is in the state pu, u, uq or pu, p, uq (resp. pu, u, pq or pu, p, pq)).

This accurate approximation of the flow of information is out of the reach of context-insensitive analysis. Thus we propose to use arbitrary Σ-graphs where different annotations can be written according to the state of well chosen sites, unlike the contact map. An example Σ-graph is given in Figure 8.1(e). We notice that two nodes are used to describe the protein P , according to whether or not the site a is phosphorylated. Then, we can annotate our Σgraph with context-sensitive information about the flow of information and obtain the plain arrows in Figure 8.1(e). Interestingly, in the left pattern component, there is no flow of information from any site into the site b and no flow of information from the site b into the site c. As a consequence, the fragments of proteins that contain the sites a and c, and the ones that only contain the site b are good candidates as macro-variables. Yet, since in the right pattern component there is a potential flow of information from the sites a and b into the site c, any micro-variable where the site a is phosphorylated CHAPTER 8. PARTITIONED FLOW has to be preserved. Thus, we find again the set of macro-variables " rp?, u, ?qs, rp?, p, ?qs, rpu, ?,uqs, rpu, ?,pqs, rpp, p, uqs, rpp, p, pqs, rpp, u, pqs, rpp, u, uqs * , which is self-consistent, as we have shown previously.

Then we may wonder why this coarse-graining is not self-consistent when the phosphorylation reaction of the site a is not knocked out. This is because configurations of the form pu, ?, ?q can now be transformed into configurations of the form pp, ?, ?q. Then, so as to express the concentration of the configurations of the form pp, ?, ?q which are produced this way, we need to express the configurations of the form pu, ?, ?q with at least the same finegrained level of description. This is captured by the right-gluing construction in [START_REF] Harmer | Intrinsic information carriers in combinatorial dynamical systems[END_REF]. In the present framework, it is necessary to duplicate the arrow from the site b and the site c, from the right pattern component into the left one. The resulting arrow, drawn in dotted in Figure 8.1(e), prevents any coarse-graining.

Between the catalogue of species (Figure 8.1(a)) and the contact map (Figure 8.1(c)), we have a lot of intermediary representations. We show some of them in Figure 8.2.

In the following, we see how to abstract the flow of information at an arbitrary grain of description and we prove that it always provides a sound set of fragments.

Context-sensitive model reduction

As we have previously seen for the case of contact maps, an annotated Σgraph can be interpreted as a symbolic representation of a set of patterns, called prefragments. Unlike in the context-insensitive case, we have no efficient ways to make the distinction between fragments and prefragments. Thus we characterize prefragments only, and we define a fragment as a prefragment the concentration of which cannot be expressed as a linear combination of the concentration of some other prefragments.

Prefragments

As we mentioned before, a special kind of Σ-graphs can be used to describe patterns. These are the so called site graphs that are formally defined as follows: Definition 8.2.1 (Site graph). A site graph G is a Σ-graph such that:

1. the set A G is finite; 2. the link relation L G is irreflexive; 3. for any site s P S G , ps, xqPL G and ps, yqPL G implies x " y; 4. for any site pi, xqPS G such that x P Σ ◆ , the set pk G psq contains at most one element.

We can observe that site graphs have no link that immediately loops back to the same site and have at most one link from any site.

We can specialise the concept of site graphs further, and obtain a characterisation of mixtures. Definition 8.2.2 (Mixture). A mixture is a site graph that additionally satisfies:

1. L Ñ pS G Yt✏uq 2 ; 2. S G "tpi, xq|i P A G and x P Σ ag´st ptypepiqqu;

3. for any pi, xqPS G such that x P Σ λ ptype G piqq, there exists s 1 P Ext such that ppi, xq,s 1 qPL G ;

4. for any pi, xqPS G such that x P Σ ◆ , the set pk G pi, xq is a singleton.

We can notice that, in addition to site graphs, mixtures specify the states of all their sites and have neither external links, nor binding types.

As an abuse of notation, we make no difference between a pattern and a site graph, which allows us to use homomorphisms from patterns to Σ-graphs.

We can now safely define the notion of prefragments, in our contextsensitive framework: given an annotated Σ-graph G a , a site graph P is a prefragment if we get a directed relation over its sites when we annotate it by the meet of the inverse image of the annotation of G a by any homomorphism between P and G a . Definition 8.2.3. Let G a be an annotated Σ-graph and let P be site graph. We define the canonical annotation of P by the annotated Σ-graph G a as follows:

-for any pi, xq, pi 1 ,x 1 qPS P and any w Pt _ , ^u, pi, xq ˝ P,Ga pi 1 ,x 1 q if and only if for all homomorphisms h : P Ñ G, pφpiq,xq ˝ Ga phpi 1 q,x 1 q. We remind (see Definition 8.2.9) that the symbol ^denotes internal edges, whereas the symbol _ denotes external edges.

We notice that annotating a site graph P according to an annotated Σ-graph G a amounts to apply the concretization γ P,G to G a .

In Figure 8.3 an example of canonical annotation is showed. Specifically, Figure 8.3(a) shows (by the dotted arrow) all the homomorphisms from a site graph to an annotated Σ-graph; Figure 8.3(b) shows how the pattern is annotated accordingly.

Another example is given in Figure 8.4. There the canonical annotation is the empty one. Definition 8.2.4 (Prefragment). Given an annotated Σ-graph G a , we say that a site graph P is a prefragment for G a if and only if the set of sites S P and the transitive and reflexive closure of the relation P,Ga form a directed set (i.e. for any s 1 ,s 2 P S P , there exists s P S P such that s 1 ‹ P,Ga s and s 2 ‹ P,Ga s). We can observe that prefragments are connected. Moreover, since the set S P is finite, a site graph P is a prefragment if and only if there exists a site s ' P S P such that for every site s P S P , s ‹ P,Ga s ' . In such a case, we say that the site s ' is a target of the prefragment (s ' may be not unique).

Flow analysis

Now we want to see in which way we should annotate a Σ-graph in order to have a self consistent change of variables. For this purpose, we introduce the concept of summary graph. Definition 8.2.5 (summary graph). A summary graph G is a Σ-graph with this three properties:

1. L Ñ pS Yt%uq 2 ; 2. for every species V P V, there exists a homomorphism h : V Ñ G;

3. for every homomorphism h : P Ñ G from a connected site graph P to G, there exists a species V P V, an embedding φ : P ãÑ V and a homomorphism h 1 : V Ñ G such that h " h 1 φ.

Roughly speaking, summary graphs are used to abstract information about the potential overlaps between the left and right hand sides of rules and connected site graphs, such that the common region contains sites that are

CONTEXT-SENSITIVE MODEL REDUCTION

159 modified by the rules. This will allow us to express the proper consumption and the proper production of these site graphs. The set of summary graphs is exactly the smallest set of Σ-graphs that contains the disjoint union of the family of species and that is stable by disjoint union and folding of agent nodes (folding of agent nodes can be formalised as the application of a regular epimorphism). It follows that the disjoint union of all species is a summary graph (the most concrete one), and the contact map is also a summary graph (the most abstract one). Now we study the factors that we need to consider in order to annotate the summary graph in a way that will allow us to derive a sound and complete set of fragments.

First of all, let us introduce some notion.

Definition 8.2.6 (Path in a site graph). Let P be a site graph. We call a path in P a sequence of steps pi 1 ,x 1 q ˝1 P J ¨¨¨˝n ´1 P J pi n ,x n q in S P , such that ppi k ,x k q, pi k`1 ,x k`1 qq P L P for every k between 1 and n ´1 that satisfies ˝k "_. Definition 8.2.7 (Alternated path). A path pi 1 ,x 1 q ˝1 P J ¨¨¨˝n ´1 P J pi n ,x n q is said to be alternated if for any integer j between 1 and k ´1: ˝j "_if and only if ˝j`1 "^. Lemma 8.2.8. Let G a be an annotated summary graph. Let φ : P Ñ P 1 be a homomorphism between two site graphs P and P 1 . Let pi 1 ,x 1 q, pi 1 ,x 2 qPS P be two sites such that pi 1 ,x 1 q ‹ P,Ga pi 2 ,x 2 q then pφpi 1 q,x 1 q ‹ P 1 ,Ga pφpi 2 q,x 2 q. Proof. Let pi, xq, pi 1 ,x 1 qPS P be two site instances in P and w Pt_, ^u such that pi, xq ˝ P,Ga pi 1 ,x 1 q. Let h be a homorphism between P 1 and G. By composition, hφ is a homorphism between P and G.

Since pi, xq ˝ P,Ga pi 1 ,x 1 q, it follows, by Definition 8.2.3 that:

phpφpiqq,xq ˝ Ga phpφpi 1 qq,x 1 q.
Thus, by Definition 8.2.3, pφpiq,xq ˝ P,Ga pφpi 1 q,x 1 q. It follows, by induction, that : pφpi 1 q,x 1 q ‹ P 1 ,Ga pφpi 2 q,x 2 q. Now we have all the elements we need to describe the requirements that an annotated summary graph should have in order to be able to induce a self-consistent change of variables. Definition 8.2.9. Let G a be an annotated summary graph. We say that G a is compatible with a model if, and only if, the following constraints are satisfied:

1. Direct flow:

For every non trivial rule r : L Ñ R, for every homomorphism h from the lhs L of the rule r, to the Σ-graph G, (a) for every arc pi, xq ˝ L J pi 1 ,x 1 q that occurs in an alternated path in L, that ends in a site instance which is modified by the rule r, we have: phpiq,xq ˝ Ga phpi 1 q,x 1 q (b) for every site instance pA, i, xqPMAYprq, for every site site name x 1 such that the pair pi, x 1 q denotes a site instance in L, we have: phpiq,x 1 q ^ Ga phpiq,xq; (c) for every site instance pA, i, xqPMAYprqYMUST prq such that pA, i, xqPMAYprq, for every site instance pi 1 ,x 1 qPS G such that pphpiq,xq, pi 1 ,x 1 qq P L G , we have: phpiq,xq _ Ga pi 1 ,x 1 q; (d) for every site instance pA, i, xqPMUST prq such that the binding state of the site instance pA, i, xq in L is the symbol '´', for every site instance pi 1 ,x 1 qPS G such that pphpiq,xq, pi 1 ,x 1 qq P L G , we have: phpiq,xq _ Ga pi 1 ,x 1 q; (e) for every site instance pA, i, xqPMUST prq such that the binding state of the site instance pA, i, xq in L is a binding state that we denote as A 1 @x 1 , and for every site instance pi 2 ,x 2 qPS G such that type G pi 2 q"A 1 , x 2 " x 1 , and pphpiq,xq, pi 2 ,x 2 qq P L G , we have: phpiq,x 1 q _ Ga pi 2 ,x 2 q;

2. Indirect flow:

For every non trivial rule r : L Ñ R, for every pattern component c in the lhs L of the rule r, there exists a site instance pi, xq in c such that, for every site instance pi 1 ,x 1 q in c, we have: pi 1 ,x 1 q L,Ga pi, xq.

Backward compatibility:

For every rule (trivial or not) r, for every ground refinement R L Ñ R R of the rule r, for every homomorphism h L from R L to G, for every homorphism h R from R R to G, for every two paths:

p "pi 1 ,x 1 q ˝1 R LJ ... ˝n´1 R LJ pi n ,x n q and: p 1 "pi 1 1 ,x 1 1 q ˝1 1 R LJ ... ˝1 n 1 ´1 R LJ pi 1 n 1 ,x 1 n 1 q such that:
pi n ,x n q"pi 1 n 1 ,x n 1 q; -there exists k between 1 and n such that the site instance:

ptype R L pi k q,i k ,x k q is modified by the reaction R L Ñ R R ;
-for every arc pi, xq ˝ R LJ pi 1 ,x 1 q that occur either in the path p or in the path p 1 , the three following conditions are satisfied:

i. ptype R R piq, i, xq and ptype R R pi 1 q,i 1 ,x 1 q are site instances in R R ; ii. pi, xq ˝ R RJ pi 1 ,x 1 q; iii. ph R piq,xq ˝ R R ,Ga ph R pi 1 q,x 1 q;
for every arc pi, xq ˝ R LJ pi 1 ,x 1 q occuring in p or p 1 , we have:

ph L piq,xq ˝ Ga ph L pi 1 q,x 1 q.
Let us give some intuitions about Definition 8.2.9. Direct flow (constraint 1) is obtained by annotating the image of every alternating path between a site that is tested and a site that is modified (constraint 1a), by every homomorphism between the lhs of a rule and the summary graph G (constraint 1a). These paths are prolongated in order to take into account potential side effects (constraints 1b, 1c, 1d, and 1e). Considering paths allows us to deal with distance control, that is to say agents which test the state of some sites, without modifying the states of any sites. Moreover, only considering alternating paths avoids spurious flows within agents.

Indirect flows (constraint 2) ensure that any pattern component in the lhs of a rule is a prefragment, and this even if it contains no modified site.

Annotating a summary graph so that it copes with direct and indirect flows, could be seen as an abstraction. Let us consider U the disjoint union of all the lhs of rules. Let us ignore side effects for the sake of simplicity. Firstly, we annotate U with every alternated path from a site that is tested to asitethatismodifiedinthelhsofarule. Then,w ecompletetheannotation of U so that each connected component contains a target. The constraints 1 and 2 ensures that G a contains at least the annotation of ↵ U,G .

Lastly, backward compatibility (constraint 3 ensures that prefragments that overlap with the lhs of rules are always more refined than the ones that overlap with the rhs. This comes from the fact that a prefragment that overlaps with a rhs of a rule on a modified site s ' , contains at least one target t. Then we consider another site instance s in the prefragment. The path p denotes a path between the site s ' and the target t, whereas the path p 1 denotes a path between the site s and the target t. Thus we copy these paths at any place in the annotated summary graph G a which matches both with ap o t e n t i a la n t e c e d e n to ft h ep r e f r a g m e n ta n dt h ec o n t e x to fa p p l i c a t i o no f at least one reaction.

It is worth noting that Constraint 3 of Definition 8.2.9 can be overapproximated, so as to avoid having to refer to ground reactions. Instead, it is enough to explore only the refinements of the rules, that describes the paths of interest, and some contextual information which can be tuned by ap a r a m e t r i cs t r a t e g y( s u c ha sr e fi n i n gt h ea g e n t sa td i s t a n c el e s st h a nk from the gluing between the rhs of the rule and the two paths of interest). We would get more annotations in the Σ-graph G, but the soundness of our approach would still hold.

Example 8.2.10. Let us have a look to Figure 8.5. The set of fragments will depend on our choice for the summary graph. If we perform the fragmentation from summary graph [START_REF] Abadi | Secrecy by typing in security protocols[END_REF], which corresponds to the catalogue of species, we obtain the following fragments: F 1 " P pa p ,b u ,c u q, F 2 " P pa p ,b p ,c u q, F 3 " P pa u ,c u q, F 4 " P pa u q, F 5 " P pa p q, F 6 " P pb u q, F 7 " P pb p q, F 8 " P pc p q.

If we start from summary graph (2), we obtain:

F 1 " P pa u ,b u ,c u q, F 2 " P pa u ,b p ,c u q, F 3 " P pa p ,b u ,c u q, F 4
" P pa p ,b p ,c u q, F 5 " P pa u q, F 6 " P pa p q, F 7 " P pb u q, F 8 " P pb p q, F 9 " P pc p q.

If we start from summary graph (3) we obtain the same fragmentation then in the concrete case [START_REF] Abadi | Secrecy by typing in security protocols[END_REF]. F 1 " P pa p ,b u ,c u q, F 2 " P pa p ,b u ,c p q, F 3 " P pa p ,b p ,c u q, F 4 " P pa p ,b p ,c p q, F 5 " P pa u ,c u q, F 6 " P pa u ,c p q, F 7 " P pb u q, F 8 " P pb p q.

If we start from summary graph (5) we obtain the same fragmentation then with the summary graph (2). If we start from summary graph (6):

F 1 " P pa u ,c u q, F 2 " P pa u ,c p q, F 3 " P pa p ,b u ,c u q, F 4 " P pa p ,b p ,c u q, F 5 " P pa p ,b u ,c p q, F 6 " P pb p ,b p ,c p q, F 7 " P pb u q, F 8 " P pb p q.

If we start from summary graph (7):

F 1 " P pa u ,b u ,c u q, F 2 " P pa u ,b u ,c p q, F 3 " P pa u ,b p ,c u q, F 4 " P pa u ,b p ,c p q, F 5 " P pa p ,b u ,c u q, F 6 " P pa p ,b u ,c p q, F 7 " P pa p ,b p ,c u q, F 8 " P pa p ,b p ,c p q.

That is exactly our catalogue of species. Again, if we start the fragmentation from the summary graph [START_REF] Buchholz | Exact and ordinary lumpability in finite markov chains[END_REF], that corresponds to the contact map, we obtain the full set of species.

Reduced model

We recall the notations of Chapter 5.

REDUCED MODEL 165

We assume that the model is made of the following set of rules R: r 1 :" c 1,1 ,...,c !p1q,1 Ñ p 1,1 ,...,p ✓p1q,1 k 1 r 2 :" c 1,2 ,...,c !p2q,2 Ñ p 1,2 ,...,p ✓p2q,2 k 2 ... :" ... r h :" c 1,h ,...,c !phq,h Ñ p 1,h ,...,p ✓phq,h k h where for every rule r ◆ , ωpιq returns the number of components in the left hand side and θpιq returns the number of component in the right hand side.

We denote by F the semantics function, which maps each state ρ : V Ñ R to the function of the concentration derivatives V Ñ R cardprP, P sq ˆFpρqpP q" --› Mpι,Pq is the set of the extended preconditions of the refinements of the rule rule ◆ according to the overlap between the rhs of the rule rule ◆ and the pattern P ; -and for every M P -› Mpι,Pq, pc χ,◆,F,M q 1 §χ §!p◆q is the list of the pattern components in the extended precondition predpι,P,Mq.

Contribution of proper consumption

We already know, that the pattern components that occur in the lhs of a rule are all prefragments. Let us prove that if F is a prefragment, ι ar u l ei n d e x , and j ap o s i t i o n ,a n da n yw a yM P › Ñ Mpι,j,Fq to glue the prefragment F on the j-th pattern component of the rule rule ◆ , then the corrected concentration pr c j,◆ Y M F sq of pattern component pc j,◆ Y M F q is either equal to 0 or to the corrected concentration of a prefragment.

In all case, the corrected concentration pr c 1,◆ Y pA ,Bq F sq is either equal to 0, or to the corrected concentration of a prefragment.

Non-trivial rules We assume that ◆ is the index of a non trivial rule. We consider pA ,BqP › Ñ Mp◆,j,Fq an extended gluing between the pattern component c j,◆ . Thanks to Constraint 2 of Definition 8.2.9, for every position χ such that j ‰ χ, the pattern component c χ,◆ is a prefragment. We are left to express the (corrected) concentration of the pattern component c j,◆ Y pA ,Bq F .

We consider ' F the embedding from the prefragment F to the pattern component c j,◆ Y pA ,Bq F and φ j,◆ be the embedding from the pattern component c j,◆ and the pattern component c j,◆ Y pA ,Bq F , that have been used to define the extended gluing c j,◆ Y pA ,Bq F .

c j,◆ Y pA ,Bq F F c j,◆ ⌘ 1 C C ' F -M [ [ φ j,◆
The pattern component F is a prefragment, thus there exists a site instance pA t ,i t ,x t q in F that is a target. We consider two cases according to whether the set A is empty, or not.

1. We assume that the set A is not empty. By Definition 5.3.8, the set B is empty.

That is to say that: c j,◆ Y pA ,Bq F " c j,◆ Y A F . By Definition 5.3.5, for every site instance pA, i, xq in c j,◆ Y A F ,w e know that either there exists an agent identifier i 1 such that pA, i 1 ,xq is a site instance in F and i " ' F pi 1 q, or that there exists an agent identifier i 1 such that pA, i 1 ,xq is a site instance in c j,◆ and i " φ j,◆ pi 1 q.

We propose to show that the site instance pA t , ' F pi t q,x t q is a target in the pattern component c j,◆ Y A F .

Let pA s ,i s ,x s q be a site instance in the pattern component c j,◆ Y A F .

(a) We assume that there exists an agent identifier i 1 such that the triple pA s ,i 1 ,x s q is a site instance in F and i s " ' F pi 1 q.

Since pA t ,i t ,x t q is a target in F , we have: pi 1 s ,x s q ‹ F,Ga pi t ,x t q.

By Lemma 8.2.8, we have: pi s ,x s q ‹ c j,◆ Y A F,Ga p' F pi t q,x t q.

(b) We assume that there exists an agent identifier i 1 such that the triple pA s ,i 1 ,x s q is a site instance in c j,◆ and i s " φ j,◆ pi 1 q. By Definition 5.3.8, there exists a site instance pA m ,i m ,x m q in c j,◆ and an agent identifier i 1 m such that: -pA m ,i 1 m ,x m q is a site instance in F ; -' F pi 1 m q"φ j,◆ pi m q; -the site instance pA m ,i m ,x m q is modified by the rule rule ◆ .

By Constraint 1 of Definition 8.2.9, we have: pA s ,i 1 ,x s q ‹ c j,◆ ,Ga pA m ,i m ,x m q.

By Lemma 8.2.8, it follows that: pA s ,i s ,x s q ‹ c j,◆ Y A F,Ga pA m , φ j,◆ pi m q,x m q.

By the previous case, we know that:

pA m , ' F pi 1 m q,x m q ‹ c j,◆ Y A F,Ga pA t , ' F pi t q,x t q.

Since ' F pi 1 m q"φ j,◆ pi m q, we can conclude that:

pA s ,i s ,x s q ‹ c j,◆ Y A F,Ga pA t , ' F pi t q,x t q.

2. We assume that the set A is empty.

The set B is a singleton that we write ppA B 1 ,i B 1 ,x B 1 q, pA B 2 ,i B 2 ,x B 2 qq.

By Definition 5.3.5, we know that for any site instance pA, i, xq in c j,◆ Y pA ,Bq F , at least one of the following condition is satisfied:

-either there exists an agent identifier i 1 such that pA, i 1 ,xq is a site instance in F and i " ' F pi 1 q, -or there exists an agent identifier i 1 such that pA, i 1 ,xq is a site instance in c j,◆ and i " φ j,◆ pi 1 q, -or pA, i, xq"pA B 1 , φ j,◆ pi B 1 q,x B 1 q.

Let us show that the site instance pA t , ' F pi t q,x t q is a target in the pattern component c j,◆ Y pA ,Bq F .

Let pA s ,i s ,x s q be a site instance in the pattern component c j,◆ Y pA ,Bq F .

(a) We assume that there exists an agent identifier i 1 such that the triple pA s ,i 1 ,x s q is a site instance in F and i s " ' F pi 1 q. Since pA t ,i t ,x t q is a target in F , we have:

pA s ,i 1 s ,x s q ‹ F,Ga pA t ,i t ,x t q.

By Lemma 8.2.8, it follows that:

pA s ,i s ,x s q ‹ c j,◆ Y pA ,Bq F,Ga pA t , ' F pi t q,x t q.

(b) We assume that pA s ,i s ,x s q"pA B 1 , φ j,◆ pi B 1 q,x B 1 q. By Constraint 1c of Definition 8.2.9 and thanks to Lemma 8.2.8, we have:

pA s ,i s ,x s q ‹ c j,◆ Y pA ,Bq F,Ga pA B 2 , ' F pi B 2 q,x B 2 q.

By the previous case, we know that:

pA B 2 , ' F pi 1 B 2 q,x B 2 q ‹ c j,◆ Y pA ,Bq F,Ga pA t , ' F pi t q,x t q.

Thus, we can conclude that:

pA s ,i s ,x s q ‹ c j,◆ Y pA ,Bq F,Ga pA t , ' F pi t q,x t q.

(c) We assume that there exists an agent identifier i 1 such that the triple pA s ,i 1 ,x s q is a site instance in c j,◆ such that i s " φ j,◆ pi 1 q.

• If pA B 1 ,i B 1 ,x B 1 qPMAYprule ◆ q.

The agent instance pA B 1 ,i B 1 q has at least one site instance (otherwise, the pattern component c j,◆ would have been made of a single agent with no site instance, which would be absurd since pA s ,i 1 ,x s q is a site instance in c j,◆ ). Let x w be a site name, such that the triple pA B 1 ,i B 1 ,x w q is a site instance in the pattern c j,◆ .

We have pA B 1 ,i B 1 ,x B 1 qPMAYprule ◆ q, so the agent instance pA B 1 ,i B 1 q is removed by the rule rule ◆ . As a consequence, the site pA B 1 ,i B 1 ,xw q is modified by the rule rule ◆ .

By Constraint 1 of Definition 8.2.9, we have: pA s ,i 1 ,x s q ‹ c j,◆ ,Ga pA B 1 ,i B 1 ,x w q.

By Lemma 8.2.8, it follows that:

pA s ,i s ,x s q ‹ c j,◆ Y pA ,Bq F,Ga pA B 1 , φ j,◆ pi B 1 q,x w q.

By Constraint 1b of Definition 8.2.9 and Lemma 8.2.8, we have:

pA B 1 , φ j,◆ pi B 1 q,x w q ‹ c j,◆ Y pA ,Bq F,Ga pA B 1 , φ j,◆ pi B 1 q,x B 1 q.

Thus, we have:

pA B 1 , φ j,◆ pi B 1 q,x B 1 q ‹ c j,◆ Y pA ,Bq F,Ga pA t , ' F pi t q,x t q.

Thus, we can conclude that:

pA s ,i s ,x s q ‹ c j,◆ Y pA ,Bq F,Ga pA t , ' F pi t q,x t q.

• If the site instance pA B 1 ,i B 1 ,x B 1 qPMUST prule ◆ q.

The site instance pA B 1 ,i B 1 ,x B 1 q is modified by the rule rule ◆ . By Constraint 1 of Definition 8.2.9, we have: pA s ,i 1 ,x s q ‹ c j,◆ ,Ga pA B 1 ,i B 1 ,x B 1 q.

By Lemma 8.2.8, we can conclude that:

pA s ,i s ,x s q ‹ c j,◆ Y pA ,Bq F,Ga pA B 1 , φ j,◆ pi B 1 q,x B 1 q.

By the previous case, we know that:

pA B 1 , φ j,◆ pi B 1 q,x B 1 q ‹ c j,◆ Y pA ,Bq F,Ga pA t , ' F pi t q,x t q.

Thus, we can conclude that:

pA s ,i s ,x s q ‹ c j,◆ Y pA ,Bq F,Ga pA t , ' F pi t q,x t q.

As a consequence, the site instance pA t , ' F pi t q,x t q is a target for the pattern component c j,◆ Y A F . That is to say that the pattern component c j,◆ Y A F is a prefragment.

Contribution of proper production

Let us prove that for every rule index ◆, every prefragment F , every way M P -› Mp◆,Fq of producing the prefragment F with the rule rule ◆ , for every position χ, the (corrected) concentration pr c χ,◆,F,M sq of the χ-th pattern component of the corresponding refinement of the rule rule ◆ , is equal to 0 or to the corrected concentration of a prefragment.

Trivial rules

Let ◆ be the index of a trivial rule and F be a prefragment. By definition, the rule rule ◆ has the following form:

A 1 px B2@y q, B 2 py A1@x qÑA 1 pxq, B 2 pyq.

Hence, the number ωpιq of pattern components in the lhs of the rule rule ◆ is equal to 1. We consider a pair pA ,BqP -› Mpι,Fq.

The rule rule ◆ has no side effect. As a consequence, we have B "H. By Definition 5.4.2, it follows that A ‰H. We consider two cases according to whether or not the set A is a singleton.

1. Let us assume that the set A is a singleton. We denote A "p p A m 1 ,i m 1 ,s m 1 q, pA m 2 ,i m 2 ,s m 2 qq It follows that the prefragment F contains a site instance s that is free. Then the pattern component c 1,◆,F,M is obtained (up to isomorphism) by binding in F the site instance s to a link to a fresh agent.

We denote as F 1 the pattern that is obtained by replacing, in the prefragment F the binding state of the site instance s with the binding type that matches the link that is created by the rule.

Let us prove that the pattern F 1 is a prefragment.

-The pattern component F is a prefragment.

Thus there exists a target pA t ,i t ,x t q. Let h `be a homomorphism between F 1 and G.

The only difference between the pattern components F 1 and c 1,◆,F,M is that a binding type in F 1 is replaced with a bond to a fresh agent.

-This is the case if F ´1 is connected (by assumption, since B "H, F and P overlaps on a site that is modified by the rule rule ◆ ).

-If F ´1 pc is disconnected, each connected component of it contains as i t et h eb i n d i n gs i t eo fw h i c hh a sc h a n g e d .

Then, we propose to prove both following intermediary results:

(a) Whenever a pattern component of F ´1 χ contains the site instance pA t , ' F pi t q,x t q, for every site instance pA s ,i s ,t s q of this pattern component, we have: pi s ,t s q ‹ c χ,◆,F,pA ,Bq ,Ga p' F pi t q,x t q.

(b) Whenever a pattern component F ´1 pc of F ´1 χ does not contain the site instance pA t , ' F pi t q,x t q, then it contains a site instance pA ' ,i ' ,x ' q such that the following properties are all satisfied:

• there exists an agent identifier i such that pA ' , i, x ' q is a site instance in F and i ' " ' F piq; • there exists an agent identifier i such that pA ' , i, x ' q is a site instance in c χ,◆ and i ' " φ ◆ piq; • for every site instance pA s ,i s ,x s q of F ´1 pc , we have: pi s ,x s q ‹ c χ,◆,F,pA ,Bq ,Ga pi ' ,x ' q.

Let us prove these properties:

(a) Let F ´1 pc be a pattern component of F ´1 χ that contains the site instance pA t , ' F pi t q,x t q. Let pA s ,i s ,x s q be a site instance in F ´1 pc . Let i 1 be an agent identifier such that pA s ,i 1 ,x s q is a site instance in F and ' F pi 1 q"i s . Since the site instance pA t ,i t ,x t q is a target in F , we have: pi 1 ,x s q ‹ F,Ga pi t ,x t q.

Let us prove that: pi s ,x s q ‹ c χ,◆,F,pA ,Bq ,Ga p' F pi t q,x t q.

-The pattern component F is a prefragment. Let h `be a homomorphism between c χ,◆,F,pA ,Bq and G.

(b) Let F ´1 pc be a pattern component of F ´1 χ that does not contain the site instance pA t , ' F pi t q,x t q. Necessarily, the pattern component F ´1 pc has been disconnected from the rest of F . That is to say that it contains a site the binding state of which has changed. Let pA 't ,i 't ,x 't q be a site instance in F ´1 pc that has lost a bond. Since pA 't ,i 't ,x 't q is a site instance in F ´1 pc there exists an agent identifier i 1 't such that pA 't ,i 1 't ,x 't q is a site instance in F and i 't " ' F pi 1 't q. It is not possible to create a bond in a rule, without having the two corresponding site instances in the lhs of this rule. As a consequence, there exists an agent identifier i 2 't such that pA 't ,i 2 't ,x 't q is a site instance in c χ,◆ and i 't " φ ◆ pi 2 't q. Let pA 's q,i 's ,x 's q asiteinstanceinF ´1 pc ,andi 1 s be an agent identifier such that pA 's ,i 1 s ,x 's q is a site instance in F and i 's " ' F pi 1 s q. Since F is acyclic, there is path: pi 's ,x 's q ‹ F,Ga pi 't ,x 't q.

that only passes through sites pi, xq such that the site instance ptype F piq, ' F piq,xq belongs to the pattern component F ´1 pc . By Constraint 3 of Definition 8.2.9 (we skip some steps, since the reasoning is very similar to the previous ones), we can conclude that:

pA 's ,i 's ,x 's q ‹ c χ,◆,F,pA ,Bq ,Ga pA 't ,i 't ,x 't q.

Let pA s ,i s ,x s q be a site instance in the pattern component c χ,◆,F,pA ,Bq , one of the following property is satisfied:

(a) pA s ,i s ,x s q is a site instance in F ´1 χ ; (b) there exists an agent identifier i 1 s such that pA s ,i 1 s ,x s q is c χ,◆ and i s " φ ◆ pi 1 s q.

We consider several cases according to whether the pattern component c χ,◆,F,pA ,Bq contains the site instance pA t , ' F pi t q,x t q,o rn o t ,a n d according to whether or not it has been modified by the rule rule ◆ .

(a) We assume that the pattern component c χ,◆,F,pA ,Bq contains the site instance pA t , ' F pi t q,x t q.

Balance

We have provided, for any prefragment F , an explicit definition of the proper production δ ‹ pF q of the prefragment F and of the proper consumption δ ‹ F of the prefragment F , as a polynomial expression of the concentration of the other prefragments F 1 . We consider the function F 7 that maps each abstract state ⇢ 7 from V 7 to R, to the value of the expression δ ‹ pF q´δ ‹ pF q. The function F 7 is well-defined. We can conclude with the soundness of our model reduction.

Theorem 8.3.2. The tuple pV, F, V 7 , , F 7 q is an abstraction.

Conclusion

In this Chapter, we have provided a context-sensitive abstraction of the flow of information between the sites of species. The level of resolution can be specified by the choice of a summary graph, which allows to distinguish less or more contexts. Each level of resolution provides its own fragmentation which is proved to be self-consistent.

Two canonic cases could be considered. If we take the summary graph as the contact map of the model. We get the model reduction that is proposed in Chapter 6. If we take the summary graph as the disjoint union of all the species, we get a framework that is similar to the one in [START_REF] Harmer | Intrinsic information carriers in combinatorial dynamical systems[END_REF] (additionnaly, our framework deals with side effects, and it has a better approximation of the flow of information both in the case of trivial rules and in the case of rules that may test that a site is bound, without specifying explicitly to which site).

When the summary graph is finite, our analysis of the flow of information always terminates and provides a finite symbolic representation of the variables of the reduced system. It is worth noting that in Kappa, deciding whether the set of species is finite or not, is undecidable [START_REF] Kreyßig | Chemical organisation theory beyond classical models: Discrete dynamics and rule-based models[END_REF].

Chapter 9 Conclusion 9.1 Contributions

In this thesis, we propose a general framework to reduce the differential semantics of biological models expressed in rule-based languages. We present two different analyses, that are performed at the level of rules. So we never need to execute the original model. Moreover we supply a general method to combine these model reductions. The results are proved to be correct by Abstract Interpretation.

The first analysis we propose is based on symmetries between sites. We formally define the notion of symmetries at the level of interaction sites, then we lift this definition to the level of the operational semantics. We show that two symmetric sites induce an equivalence relation over the species of the model and that this equivalence relation itself induces a bisimulation over the states of the system. This defines a model reduction. In fact, a system with symmetries is equivalent to a reduced system where the states are lumped according to their equivalence classes.

The second method we propose tracks the information flow between different regions of chemical species. Our analysis detects, for each site, which parts of the system influence its behaviour. This information is used to cut the molecular species in smaller pieces and to write a new system, by abstracting away the correlations that do not control the behaviour of any site. Our framework extends and improves the one presented in [START_REF] Vincent Danos | Abstracting the differential semantics of rule-based models: exact and automated model reduction[END_REF][START_REF] Feret | Internal coarse-graining of molecular systems[END_REF], where the species are cut just according to their type.

We introduce a hierarchy of representation both for species and the description of the flow of information among their sites. We show how every grain of resolution in the hierarchy can be used to obtain a self-consistent change of variables. We provide some criteria to ensure the soundness of the 184 CHAPTER 9. CONCLUSION annotation. These criteria concern the flow of information and the backward compatibility. Information flow captures the information that flows from sites that are tested to sites that are modified, whereas the backward compatibility ensures that, for every reaction, the abstraction of the reactants is at least as refined as the abstraction of its products. These criteria assure that we are able to express properly the consumption and the production of fragments in terms of other fragments. The context insensitive analyses computed from a contact map is just a particular case in the hierarchy. Specifically, the most abstract one. Interestingly, we notice that each annotated contact map already satisfies the backward compatibility criterion, thus there is not need to impose constraints for it. It could be interesting to investigate about other specific classes of representation that would enjoy other useful algebraic properties.

Our framework is a strict improvement of the one in [START_REF] Feret | Internal coarse-graining of molecular systems[END_REF], that has been successfully used to reduce a large section of the EGFR system. There, it is considered a set of 71 rules expanding into 18 051 984 143 555 729 567 species, reduced into 175 988 fragments.

Model reduction plays a role at several levels. It supplies a more compact representation, facilitating reasoning about inspected systems. Moreover, by changing the point of view, it assists in finding new understandings. On the computational side, it reconnects the system to the realm of feasible ODEs. Finally, it can be used as a starting point for other kind of anlyses: for example a reduction based on tropicalization [START_REF] Radulescu | Model reduction of biochemical reactions networks by tropical analysis methods[END_REF][START_REF] Sommer-Simpson | Hybrid reductions of computational models of ion channels coupled to cellular biochemistry[END_REF].

Future works 9.2.1 Dealing with cycles

In our framework, we have assumed that both species and fragments have no cycle.

Let us consider a small example to understand the difficulties which arise with species that exhibits cycles. We consider the set of species in Figure 9.1 and the following rule:

A ÑH.

We wonder the quantity of the pattern Bpx! ,y! q that is consumed by the rule. In order to properly compute this quantity, we should consider both the patterns where just the site x is bound and the patterns where x and y are bound, paying attention to not overcount. This can be expressed as an alternated sum. The same kind of attention should be used when we want to compute the production of patterns.

FUTURE WORKS

Tuning the context-sensitivity of the analysis

We showed that summary graphs can be used to tune the context sensitivity of the analysis. Our framework is generic and is correct whichever summary graph is chosen. Yet the choice of the summary graph is left as a parameter of our abstraction, and we provide no criterion to choose between all the possibilities. One strategy would consist in computing a transition system for each kind of site to abstract each qualitative behaviour. Then we could zoom in the accuracy of the analysis by distinguishing contexts according to the states of the transition system.

The method we proposed allows the user to select any trade-off between context-insensitive and fully context-sensitive abstractions of the information flow. We plan to study methods to change the context during computation.

Contextual symmetries

In this thesis, we proposed a contextual analysis for the flow of information between the sites of species. We wonder if it possible to develop a contextual analyses also to discover sites that exhibit a symmetric behaviour just in a given context and if this can be used to reduce further a model.

To understand better the idea of sites that exhibit a symmetric behaviour in a given context we can have a look at Figure 9.2, that shows a protein A

Figure 1 . 1 :

 11 Figure 1.1: The original system is split into two independents subsystems.

Figure 1 . 2 :

 12 Figure 1.2: The original system is split into two independents subsystems.

Figure 1 . 3 :

 13 Figure 1.3: A model with symmetric sites.

CHAPTER 1 .

 1 INTRODUCTION P `Xru, u, usØXrp, u, us P `Xru, u, psØXrp, u, ps P `Xru, p, usØXrp, p, us P `Xru, p, psØXrp, p, ps (a) Phosphorylation and dephosphorylation of the first site. P `Xru, u, usØXru, p, us P `Xru, u, psØXru, p, ps P `Xrp, u, usØXrp, p, us P `Xrp, u, psØXrp, p, ps (b) Phosphorylation and dephosphorylation of the second site. P `Xru, u, usØXru, u, ps P `Xru, p, usØXru, p, ps P `Xrp, u, usØXrp, u, ps P `Xrp, p, usØXrp, p, ps (c) Phosphorylation and dephosphorylation of the third site.

Figure 1 . 4 :

 14 Figure 1.4: Chemical reactions for m " 2a n dn " 1.

P

  `Xru, u, usØXrp, u, us P `Xru, u, psØXrp, u, ps (a) Phosphorylation and dephosphorylation of the first site. P `Xrp, u, usØXrp, p, us P `Xrp, u, psØXrp, p, ps (b) Phosphorylation and dephosphorylation of the second site. P `Xru, u, usØXru, u, ps P `Xrp, u, usØXrp, u, ps P `Xrp, p, usØXrp, p, ps (c) Phosphorylation and dephosphorylation of the third site.

Figure 1 . 5 :

 15 Figure 1.5: Simplified chemical reactions for m " 2a n dn " 1.

Figure 2 . 1 :

 21 Figure 2.1: Chemical reactions.

Figure 2 . 2 :

 22 Figure 2.2: Simplified chemical reactions.

36 CHAPTERFigure 3 . 1 :

 3631 Figure 3.1: Set of species.

Figure 3 . 2 :

 32 Figure 3.2: Graphical representation of the rules in the example.

  When the second site of B is free. When the second site of B is bound.

Figure 3 . 3 :

 33 Figure 3.3: Reactions for binding the first site of B.

2

 2

  (

Figure 3 . 5 :

 35 Figure 3.5: Two agents.

Figure 3 . 6 :

 36 Figure 3.6: A species.

Figure 3 . 7 :

 37 Figure 3.7: Example of a pattern that can be embedded in a species.

Figure 3 . 10 :

 310 Figure 3.10: Agent replacement.

CHAPTER 3 .

 3 KAPPAIn such a case we write: E pr,E,φq ›Ñ freshpcleanpErE r s φ qq Example 3.3.12. Let us consider the following example.

Figure 3 .

 3 Figure 3.11: Mixture E of the example.

Figure 3 . 12 :

 312 Figure 3.12: Application of the rule to the mixture E.

Figure 4 . 1 :

 41 Figure 4.1: Chemical reactions for first case study.

Figure 4 . 2 :

 42 Figure 4.2: Simplified chemical reactions for first case study.

Figure 4 . 3 :

 43 Figure 4.3: Chemical reactions for the second case study.

Figure 4 . 4 :

 44 Figure 4.4: Transposition of binding types.

3 .

 3 the site x belongs to Σ λ pAq if and only if the site y belongs to the set Σ λ pAq.

Figure 4 . 5 :

 45 Figure 4.5: Transposition of states.

Figure 5 . 1 :

 51 Figure 5.1: A common region and a gluing.

  Gluing between the lhs of the rule and the pattern.

  Refinement of the rule.

Figure 5 . 2 :

 52 Figure 5.2: Consumption of a pattern.

100 CHAPTER 5 .

 5 PRODUCTION/CONSUMPTION OF A PATTERN

  Gluing between the rhs of the rule and the pattern.

Figure 5 . 4 :

 54 Figure 5.4: Production of a pattern.

Figure 6 . 3 :

 63 Figure 6.3: A set of species.

6. 2 .Figure 6 . 4 :

 264 Figure 6.4: Contact map for the set of species in 6.3.

Figure 6 .

 6 Figure 6.4 shows the contact map associated to the set of species Figure 6.3.We propose to annotate a contact map with an over-approximation of the flow of information between the different regions of chemical species. The main idea is to identify correlations between the states of the sites, which can be safely abstracted away, because they have no influence on the behaviour of the state of the other sites. This way, the so-obtained annotated contact map (aCM) will be used as a symbolic representation of the set of fragments of chemical species, the concentration of which will be the variables of our reduced system.

Figure 6 . 5 :

 65 Figure 6.5: An annotated contact map.

Figure 6 . 6 :

 66 Figure 6.6: Some annotated pattern components.

6. 5 . REDUCED MODEL 117 2 .

 52 Let us assume that the set A contains two elements.

  Let F ´1 o be the pattern component of F ´1

Figure 7

 7 Figure 7.1: A Σ-graph.

1 Figure 7 . 2 :

 172 Figure 7.2: Σ-graphs morphisms.

Proposition 7 . 2 . 11 .

 7211 If xP, Ñ, \, [, K, Jy ´´´Ñ -´´↵ γ xP 7 , Ñ 7 , \ 7 , [ 7 , K 7 , J 7 y then, for all p P P , ↵ppq is equal to the greatest lower bound ó 7 tp 7 |p Ñ γpp 7 qu of the inverse image by γ of the set of upper bounds of p.

Figure 7 . 3 :Figure 7 . 4 :

 7374 Figure 7.3: Example of annotated Σ-graphs.

Definition 7 . 3 . 4 (

 734 Concretization). Let G and Ḡ be two Σ-graph and let r be a relation in PpRḠq.

  γ

Theorem 7 . 3 . 5 .

 735 Let G, Ḡ be two Σ-graphs and let R G be the relation defined in 7.3.1. So

Figure 7 . 5 :

 75 Figure 7.5: A dimer.

Figure 7 . 6 :

 76 Figure 7.6: Lattice C.

Figure 7 .

 7 [START_REF] Buchholz | Bisimulation relations for weighted automata[END_REF] shows the result of their application to the lattice in Figure7.6. The red arrows correspond to ↵ G, Ḡ ˝γG, Ḡ; the blue ones correspond to γ G, Ḡ ˝↵G, Ḡ.

Figure 7 . 7 :

 77 Figure 7.7: Abstraction. The dotted arrows represent the function ↵.

Figure 7 . 8 :Figure 7 . 9 :

 7879 Figure 7.8: Concretization. The dotted arrows represent the function γ.

4 k 1 /

 41 / pp, p, uq

  Context-sensitive abstraction of the flow of information. The dotted arrow represents a dependency that can be dropped if the rate constant k 1 is zero.

Figure 8 . 1 :

 81 Figure 8.1: Case study

Figure 8 . 2 :

 82 Figure 8.2: Hierarchy of Σ-graphs.

  Canonical annotation of the site graph.

Figure 8 . 3 :

 83 Figure 8.3: Example of canonical annotation of a site graph by an annotated Σ-graph.

  Canonical annotation of the site graph.

Figure 8 . 4 :

 84 Figure 8.4: Example of canonical annotation by an annotated Σ-graph.

  Figure 8.5:

  j,P q pr c j,◆ Y M P sq ⇢ !p◆q π χ"1 χ‰j pr c χ,◆ sq ⇢where for every rule index ι, every position j, -› Ñ Mpι,j,Pq denotes the set of the potential extended gluings (e.g. seeDefinition 5.3.8) between the pattern component c j,◆ and the pattern P ;

Proposition 8 . 3 . 1 .

 831 We have ˝F " F 7 ˝ .Proof. By construction of F 7 .

Figure 9 . 1 :

 91 Figure 9.1: A set of species.

  R ph,1q,1 ,...,R ph,1q,!phq Ñ P ph,1q,1 ,...,P ph,1q,✓ph,1q ... :" ... react ph,⌫phqq :" R ph,⌫phqq,1 ,...,R ph,⌫phqq,!phq Ñ P ph,⌫phqq,1 ,...,P ph,⌫phqq,✓ph,⌫phqq

	...	:" ...
	...	:" ...
	...	:" ...
	react ph,1q	:"

  jq is an agent in X if and only if the pair ppA, iq, pA, jqq belongs to the set A ; 2. the agent A Φpi,jq in X documents the site x if and only if the site instance pA, i, xq is documented in Z 1 and the site instance pA, j, xq is documented in Z 2 ; 3. the site x of the agent A Φpi,jq is in the state w in X if and only if: (a) either pA, i, xq is in the state w in Z 1 and pA, j, xq is in the state w in Z 2 , (b) or w " ✏ and pA, i, xq in Z 1 and pA, j, xq in Z 2 have a different internal state. 4. For every binding state λ in t✏, ´, ?uYtN @l | N P A,n P Σ λ pAqu, the site x of the agent A Φpi,jq has the binding state λ in X if and only if: (a) pA, i, xq has the binding state λ in Z 1 and pA, j, xq has the binding state λ in Z 2 ,

(b) or pA, i, xq in Z 1 and pA, j, xq in Z 2 have a different binding state and λ "?;

  Definition 7.1.2. A homomorphism of Σ-graphs h : G Ñ H is a (total) function on agents h : A G Ñ A H such that: 1. type G piq"type H phpiqq for all i P A G ; 2. if pi, xqPS G then phpiq,xqPS H ; 3. pk G pi, xq Ñ pk H phpiq,xq for every pi, xqPS G such that x P Σ ◆ ptype G piqq; 4. pphpiq,xq, phpi 1 q,x 1 qq P L H for all ppi, xq, pi 1 ,x 1 qq P L G X S 2 G ; 5. there exists s 1 P S H Y Ext such that pphpiq,xq,s 1 qPL H and s § H s 1 for all ppi, xq,sqPL G such that s P Ext.

  Definition 7.2.1 (Partially ordered set). A partially ordered set (or poset) xP, Ñy is a non empty set P with a partial order Ñ, that is a reflexive, antisymmetric, and transitive binary relation. If it exists, the greatest lower bound (or glb) of a set P is denoted by d P . In a similar way, if the least upper bound (or lub) of P exists, it is denoted by ó P . If they exist, we denote by K the least element and J the greatest element. Definition 7.2.2 (Lattice). A lattice xP, Ñ, \, [y is a poset where each pair of elements a, b P P has a least upper bound, denoted by a \ b, and a lower upper bound, denoted by a [ b. Definition 7.2.3 (Complete lattice). A lattice xP, Ñ, \, [y is said to be complete if any set P 1 Ñ P has a greatest lower bound and a least upper bound.

  7 ↵ppq for all p P P . Moreover 7.1 implies that for all p P P we have p Ñ γ ˝↵ppq,a n d ,b ym o n o t o n yw eh a v e ↵ppq Ñ 7 ↵ ˝γ ˝↵ppq. By antisymmetry, we conclude that: By recalling the definitions of closure operators (upper and lower), we can observe that a Galois connection defines a couple of closure operators. ↵ ˝γ is the lower closure operator and γ ˝↵ is the upper one. Definition 7.2.6 (Upper closure operator). Let xP, Ñ, \, [, K, Jy be a complete lattice. An operator ⇢ of P is said to be an upper closure operator if and only if:

	@p P P : ↵ ˝γ ˝↵ppq"↵ppq.	(7.7)

  Definition 7.2.7 (Lower closure operator). Let xP, Ñ, \, [, K, Jy be a complete lattice. An operator ⇢ of P is said to be an lower closure operator if and only if:

	1. ⇢ is monotone;
	2. ⇢ is reductive, i.e. @x P P, ⇢pxq Ñ x;
	3. ⇢ is idempotent.
	So, an immediate consequence is
	P pÑq ´´´Ñ -´´↵ γ	P 7 pÑ 7 qù ñγ ˝↵ is a upper closure operator	(7.8)
	and
	P pÑq ´´´Ñ -´´↵

γ P 7 pÑ 7 qù ñ↵ ˝γ is an lower closure operator.

(7.9)

  rp?, u, ?qs 1 " k 4 rp?, p, ?qs ´k3 rp?, u, ?qs rp?, p, ?qs 1 " k 3 rp?, u, ?qs ´k4 rp?, p, ?qs rpu, ?,pqs 1 " k 2 prpp, u, pqs `rpp, p, pqsq `k5 rpu, ?,uqs ´k8 rpu, ?,pqs rpu, ?,uqs 1 " k 2 prpp, u, uqs `rpp, p, uqsq `k8 rpu, ?,pqs ´k5 rpu, ?,uqs rpp, p, uqs 1 " k 3 rpp, u, uqs `k8 rpp, p, pqs ´pk 2 `k4 `k7 qrpp, p, uqs rpp, p, pqs 1 " k 3 rpp, u, pqs `k7 rpp, p, uqs ´pk 2 `k4 `k8 qrpp, p, pqs rpp, u, pqs 1 " k 4 rpp, p, pqs `k6 rpp, u, uqs ´pk 2 `k3 `k8 qrpp, u, pqs rpp, u, uqs 1 " k 4 rpp, p, uqs `k8 rpp, u, pqs ´pk 2 `k3 `k6 qrpp, u, uqs, where the macro-variables are intentionally defined as fragments of configurations (question marks denote sites which have been cut away), and extensionally as linear combinations of the configurations which contain these fragments:

rp?, u, ?qs " rpu, u, uqs `rpu, u, pqs `rpp, u, uqs `rpp, u, pqs rp?, p, ?qs " rpu, p, uqs `rpu, p, pqs `rpp, p, uqs `rpp, p, pqs rpu, ?,uqs " rpu, u, uqs `rpu, p, uqs rpu, ?,pqs " rpu, u, pqs `rpu, p, pqs.

We show, by induction over the definition of the semantics, that each symmetry between sites induce a bisimulation. Thus symmetries can be used to reduce the dimension of models.

CHAPTER 5. PRODUCTION/CONSUMPTION OF A PATTERNWe have made this computation under the assumption that there are no cycles in species. This computation can be extended to the general case but, in such a case, the consumption and the production of the pattern of interest have to be expressed with respect to the quantity of more complex patterns.

This system of differential ordinary equations can be described as an autonomous system pV, Fq where:

-V :"tA, B, C, AB, BC, ABCu;

CHAPTER 5. PRODUCTION/CONSUMPTION OF A PATTERN 3. for every pair ps, s 1 qPB, if the site s (resp. s 1 ) is a site instance in the pattern P , then the binding state of the site instance s (resp. s 1 ) is not a site address (that is to say that its binding state belongs to the set: t✏, ´, ?uYtA@x | A P A,x P Σ λ pAqu).

We define the pattern P Ò B as the pattern that is obtained by performing the following transformation on the pattern P :

1. for every pair ppA, i, xq, pA 1 ,i 1 ,x 1 qq P B, if the pattern P contains the site instance pA, i, xq (resp. pA 1 ,i 1 ,x 1 q), then the binding state of the site instance pA, i, xq (resp. pA 1 ,i 1 ,x 1 q) is removed;

2. for every pair ppA, i, xq, pA 1 ,i 1 ,x 1 qq P B, if the pattern P has no agent A i (resp. A i 1 ), then we add the agent A i (resp. pA i 1 q) in the pattern P with an empty interface;

3. for every pair ppA, i, xq, pA 1 ,i 1 ,x 1 qq P B, if the pattern P has no site instance pA, i, xq (resp. pA 1 ,i 1 ,x 2 ) then this site instance is added;

4. for every pair ppA, i, xq, pA 1 ,i 1 ,x 1 qq P B, a bond is created between the site instance pA, i, xq and the site instance pA 1 ,i 1 ,x 1 q.

Now we have all the ingredients to define the different positions for a pattern to be consumed. Definition 5.3.8. Let ◆ be the index of a rule. Let j be the index of a connected pattern in the lhs of the rule rule ◆ . Let P be a pattern.

We define the set › Ñ Mp◆,j,Pq as the set of the pairs pA ,Bq where:

-A is a pairing between c ◆,j and P , we denote as γ `and γ P the corresponding embeddings respectively from c ◆,j to c ◆,j Y A P and from P to c ◆,j Y A P ; -B is a set of pairs of sites instances.

such that the following properties are satisfied:

1. if A ‰H, then B "H;

2. if A "H, then B is a singleton;

3. for every pair ppA, i, xq,s 1 qPB, there exists a site instance pA 1 ,i 1 ,x 1 q in MAYprule ◆ qYMUST prule ◆ q, such that:

• A " A 1 and x " x 1 ; Definition 5.4.2 (extended precondition). Let ◆ be the index of a rule. We denote the rule rule ◆ as L ◆ Ñ R ◆ . Let P be a pattern. We define the set -› Mp◆,Pq as the set of the pairs pA ,Bq where:

• A is a pairing between R ◆ and P ;

we denote as γ r and γ P the corresponding embeddings respectively from R ◆ to R ◆ Y A P and from P to R ◆ Y A P , since the gluing R ◆ Y A P is defined up to isomorphism, we may assume without any loss of generality that R ◆ Y A P |ù R ◆ (that is to say that γ r maps pA, iq to i, for any agent instance pA, iq in R ◆ );

• B is a set of pairs of sites instances.

such that the following properties are satisfied:

1. if A ‰H, then B "H;

2. if A "H, then B is a singleton;

3. for every pair ppA, i, xq,s 1 qPB, there exists a site instance pA 1 ,i 1 ,x 1 q in MAYprule ◆ qYMUST prule ◆ q, such that:

(a) A " A 1 and x " x 1 ;

(b) the agent pA 1 ,i 1 q belongs to L ◆ ;

(c) pA, i, xq"pA, γ r pA 1 ,i 1 q,x 1 q;

4. for every pair ps, pA, i, xqq P B, there exists no site instance pA 1 ,i 1 ,x 1 q in R ◆ such that pA, i, xq"pA 1 , γ r pA 1 ,i 1 q,xq;

5. for every pair ppA, i, xq, pA 1 ,i 1 ,x 1 qq P B, there exists a site instance pA 2 ,i 2 ,x 2 q in the pattern P such that:

(c) the binding state of the site instance pA 2 ,i 2 ,x 2 q in the pattern P is either equal to '✏' or '?';

6. A is equal to the set of the pairs ppA, iq, pA 1 ,i 1 qq such that pA, iq is an agent instance in R ◆ , pA 1 ,i 1 q is an agent instance in P , A " A 1 and γ r pA, iq"γ P pA 1 ,i 1 q;

7. the pattern prL ◆ ,R ◆ spR ◆ Y A P qqÒ B has exactly ωpιq pattern components. the states of the sites l and r, but that the states of the sites l and r do not control the behaviour of the states of the other sites.

The differential semantics of this model is the solution of the system of ODEs which is given in the Figure 6.1(e), where the concentration of the protein in the state px l ,x c ,x r q is denoted by rx l ,x c ,x r s. Since the state of the site l does not control the evolution of the state of the site r, and conversely, we can abstract away the correlation between the states of the sites l and r. To do this, we cut the chemical species into fragments, each fragment documenting either the sites l and c, or the sites c and r.

Such a fragmentation defines a linear change of variables. Indeed we can define the concentration of a fragment, as the linear combination of the concentration of the chemical species in which this fragment occurs. For instance, the concentration of the fragment which documents the sites l and c, and where both these sites are activated is equal to the sum of the concentrations of the chemical species pp, p, uq and pp, p, pq. Applying this change of variables, we get the reduced system which is given in the Figure 6.1(f). We notice that the number of variables in the two systems is the same, because of the simplicity of the example. In practice, abstracting away a correlation

CHAPTER 6. INFORMATION FLOW

By Lemma 6.3.3, we can conclude that there exists a path in the pattern component c j,◆ Y pA ,Bq F from the site instance pA s ,i s ,x s q to the site instance pA t , ' F pA t ,i t q,x t q that is compatible with the aCM.

(c) We assume that there exists an agent identifier i 1 such that the triple pA s ,i 1 ,x s q is a site instance in c j,◆ and i s " φ j,◆ pA, i 1 q.

The agent instance pA B 1 ,i B 1 q has at least one site instance (otherwise, the pattern component c j,◆ would have been made of a single agent with no site instance, which would be absurd since pA s ,i 1 ,x s q is a site instance in c j,◆ ). Let x w be a site name, such that the triple pA B 1 ,i B 1 ,x w q is a site instance in the pattern c j,◆ .

We have pA B 1 ,i B 1 ,x B 1 qPMAYprule ◆ q, so the agent instance pA B 1 ,i B 1 q is removed by the rule rule ◆ . As a consequence, the site pA B 1 ,i B 1 ,x w q is modified by the rule rule ◆ . By Constraint 1a of Definition 6.4.2, there is a path in the pattern component c j,◆ from the site instance pA s ,i 1 ,x s q to the site instance pA B 1 ,i B 1 ,x w q that is compatible with the aCM. By Lemma 6.3.4, there is a path in the pattern component c j,◆ Y pA ,Bq F from the site instance pA s ,i s ,x s q to the site instance pA B 1 , φ j,◆ pA B 1 ,i B 1 q,x w q that is compatible with the aCM. By Constraint 1b of Definition 6.4.2, there is an arc between the site pA B 1 ,x w q and the site pA B 1 ,x B 1 q in the aCM. As a consequence, there is a path in the pattern component c j,◆ Y pA ,Bq F from the site instance pA B 1 , φ j,◆ pA B 1 ,i B 1 q,x w q to the site instance pA B 1 , φ j,◆ pA B 1 ,i B 1 q,x B 1 q that is compatible with the aCM. By the previous case, we know that there exists a path in the pattern component c j,◆ Y pA ,Bq F from the site instance pA B 1 , φ j,◆ pA B 1 ,i B 1 q,x B 1 q to the site instance pA t , ' F pA t ,i t q,x t q that is compatible with the aCM. By Lemma 6.3.3, there exists a path in the pattern component c j,◆ Y pA ,Bq F from the site instance pA s ,i s ,x s q to the site instance pA t , ' F pA t ,i t q,x t q that is compatible with the aCM.

The site instance pA B 1 ,i B 1 ,x B 1 q is modified by the rule rule ◆ . By Constraint 1a of Definition 6.4.2, there is a path in the 6.5. REDUCED MODEL 121 pattern component c j,◆ from the site instance pA s ,i 1 ,x s q to the site instance pA B 1 ,i B 1 ,x B 1 q that is compatible with the aCM. By Lemma 6.3.4, we can conclude there is a path in the pattern component c j,◆ Y pA ,Bq F from the site instance pA s ,i s ,x s q to the site instance pA B 1 , φ j,◆ pA B 1 ,i B 1 q,x B 1 q that is compatible with the aCM. By the previous case, we know that there exists a path in the pattern component c j,◆ Y pA ,Bq F from the site instance pA B 1 , φ j,◆ pA B 1 ,i B 1 q,x B 1 q to the site instance pA t , ' F pA t ,i t q,x t q that is compatible with the aCM. By Lemma 6.3.3, there exists a path in the pattern component c j,◆ Y pA ,Bq F from the site instance pA s ,i s ,x s q to the site instance pA t , ' F pA t ,i t q,x t q that is compatible with the aCM.

As a consequence, the site instance pA t , ' F pA t ,i t q,x t q is a target for the pattern component

In all cases, we have expressed the corrected concentration of the pattern component c j,◆ Y A F as a linear combination of the (corrected) concentration of some fragments.

Contribution of proper production

Let us prove that for every rule index ◆, every fragment F , every way M P -› Mp◆,Fq of producing the fragment F with the rule rule ◆ , we can express, for every position χ, the (corrected) concentration pr c χ,◆,F,M sq of the χ-th pattern component of the corresponding refinement of the rule rule ◆ as a linear combination of the corrected concentration of some fragments.

Trivial rules

Let ◆ be the index of a trivial rule and F be a fragment. By definition, the rule rule ◆ has the following form:

Hence, the number ωpιq of pattern components in the lhs of the rule rule ◆ is equal to 1.

We consider a pair pA ,Bq in the set -› Mpι,Fq.

The rule rule ◆ has no side effect. CHAPTER 6. INFORMATION FLOW (b) there exists an agent identifier i 1 s such that pA s ,i 1 s ,x s q is c χ,◆ and i s " φ ◆ pA s ,i 1 s q.

We consider several cases according to whether the pattern component c χ,◆,F,pA ,Bq contains the site instance pA t , ' F pA t ,i t q,x t q, or not, and according to whether or not it has been modified by the rule rule ◆ .

(a) We assume that the pattern component c χ,◆,F,pA ,Bq contains the site instance pA t , ' F pA t ,i t q,x t q. We will prove that there is a path in the pattern component c χ,◆,F,pA ,Bq from the site instance pA s ,i s ,x s q to the site instance pA t , ' F pA t ,i t q,x t q that is compatible with the aCM.

i. If the site instance pA s ,i s ,x s q belongs to a pattern component of F ´1 χ that contains the site instance pA t , ' F pA t ,i t q,x t q, there is a path in the pattern component c χ,◆,F,pA ,Bq from the site instance pA s ,i s ,x s q to the site instance pA t , ' F pA t ,i t q,x t q that is compatible with the aCM. ii. If there exists an agent identifier i such that pA s , i, x s q is a site instance of c χ,◆ and i s " φ ◆ pA s ,iq.

There exists a site instance pA m ,i m ,x m q in c χ,◆,F,pA ,Bq satisfying the following constraints: A. there exists an agent identifier i m 1 such that the site instance pA m ,i m 1 ,x m q belongs to the pattern component c χ,◆ and i m " ' ◆ pA m ,i m 1 q; B. the pattern component of F ´1 χ that contains the site instance pA t , ' F pA t ,i t q,x t q also contains the the site instance pA m ,i m ,x m q; C. the site pA m ,i m 1 ,x m q is modified by the rule rule ◆ . Then, by Constraint 1a of Definition 6.4.2, there exists a path in the pattern component c χ,◆ from the site instance pA s , i, x s q to the site instance pA m ,i m 1 ,x m q that is compatible with the aCM. By Lemma 6.3.4, there exists a path in the pattern component c χ,◆,F,pA ,Bq from the site instance pA s ,i s ,x s q to the site instance pA m ,i m ,x m q that is compatible with the aCM. By Lemma 6.3.3, and the precedent case, there is a path in the pattern component c χ,◆,F,pA ,Bq from the site instance pA s ,i s ,x s q to the site instance pA t , ' F pA t ,i t q,x t q,x t q that is compatible with the aCM.

REDUCED MODEL

127

iii. If pA s ,i s ,x s q belongs to a pattern component of F ´1 χ that does not contain the site instance pA t , ' F pA t ,i t q,x t q. Then, there exists a site pA m ,i m ,x m q in c χ,◆ such that there exists a path in the pattern component c χ,◆,F,pA ,Bq from the site instance pA s ,i s ,x s q to the site instance pA m , φ ◆ pA m ,i m q,x m q that is compatible with the aCM. By Lemma 6.3.3, and the precedent case, there is a path in the pattern component c χ,◆,F,pA ,Bq from the site instance pA s ,i s ,x s q to the site instance pA t , ' F pA t ,i t q,x t q,x t q that is compatible with the aCM.

Thus, the pattern component c χ,◆,F,pA ,Bq is a prefragment.

(b) We assume that: c χ,◆,F,pA ,Bq " c χ,◆ .

Then, by Constraint 2 of Definition 6.4.2, c χ,◆,F,pA ,Bq is a prefragment.

(c) We assume that c χ,◆,F,pA ,Bq ‰ c χ,◆ and that the pattern component c χ,◆,F,pA ,Bq does not contain the site instance pA t , ' F pA t ,i t q,x t q.

Let pA m ,i m ,x m q be a site instance in c χ,◆ that has been modified by the rule rule ◆ . We will prove that there is a path in the pattern component c χ,◆,F,pA ,Bq from the site instance pA s ,i s ,x s q to the site instance pA m , φ ◆ pA m ,i m q,x m q that is compatible with the aCM.

i. If there exists an agent identifier i such that pA s , i, x s q is a site instance of c χ,◆ and i s " φ ◆ pA s ,iq. By Constraint 1a of Definition 6.4.2, there exists a path in the pattern component c χ,◆ from the site instance pA s , i, x s q to the site instance pA m ,i m 1 ,x m q that is compatible with the aCM. By Lemma 6.3.4, there exists a path in the pattern component c χ,◆,F,pA ,Bq from the site instance pA s ,i s ,x s q to the site instance pA m , φ ◆ pA m ,i m q,x m q that is compatible with the aCM. ii. If pA s ,i s ,x s q belongs to a pattern component of F ´1 χ . There exists a site pA ' ,i ' ,x ' q in c χ,◆ such that there exists a path in the pattern component c χ,◆,F,pA ,Bq from the site instance pA s ,i s ,x s q to the site instance pA ' , φ ◆ pA ' ,i ' q,x ' q that is compatible with the aCM. By Lemma 6.3.3, and the precedent case, we conclude that there is a path in the pattern component c χ,◆,F,pA ,Bq from the site instance pA s ,i s ,x s q to the site instance pA m , φ ◆ pA m ,i m q,x m q that is compatible with the aCM.

CHAPTER 6. INFORMATION FLOW

Thus, the pattern component c χ,◆,F,pA ,Bq is a prefragment.

2. We assume that the set A is empty.

The set B is a singleton that we write ppA

Let χ be a natural number between 1 and ωpιq.

(a) If the pattern component c χ,◆ does not contain the agent instance pA B 1 ,i B 1 q.

Then we have c χ,◆,F,pA ,Bq " c χ,◆ . By Constraint 2 of Definition 6.4.2, the pattern component c χ,◆ is ap r e f r a g m e n t . Thus, c χ,◆,F,pA ,Bq " c χ,◆ . We can conclude that pr c χ,◆,F,pA ,Bq sq " pr c χ,◆ sq .

(that is to say, the disjoint union between c χ,◆ and F , to which we have added a bond between the site instance pA

We want to prove that the site pA t , ϕ F pA t ,i t q,x t q is a target in the pattern component c χ,◆,F,pA ,Bq . Let pA s ,i s ,x s q be a site instance in c χ,◆,F,pA ,Bq .

i. We assume that there exists an agent identifier i 1 such that the triple pA s ,i 1 ,x s q is a site instance in F and i s " ϕ F pA, i 1 q.

We denote as F 1 the pattern component that is obtained by replacing the binding state of the site instance pA B 2 ,i B 2 ,x B 2 q with '?'. Since pA t ,i t ,x t q is a target in F , there is a path in the pattern component F from the site instance pA s ,i 1 s ,x s q to the site instance pA t ,i t ,x t q that is compatible with the aCM. Since F and F 1 only differ by the state of a site, there is ap a t hi nt h ep a t t e r nc o m p o n e n tF 1 from the site instance pA s ,i 1 s ,x s q to the site instance pA t ,i t ,x t q that is compatible with the aCM. We notice that the injective substitution ϕ F induces an embedding between F 1 and c χ,◆,F,pA ,Bq . By Lemma 6.3.4, there exists a path in the pattern component c χ,◆,F,pA ,Bq from the site instance pA s ,i s ,x s q to the site instance pA t , ϕ F pA t ,i t q,x t q that is compatible with the aCM.

CHAPTER 6. INFORMATION FLOW

from the site instance pA B 1 , φ ◆ pA B 1 ,i B 1 q,x w q to the site instance pA B 1 , φ ◆ pA B 1 ,i B 1 q,x B 1 q that is compatible with the aCM. By the previous case, we already know that there exists a path in the pattern component c χ,◆,F,pA ,Bq from the site instance pA B 1 , φ ◆ pA B 1 ,i B 1 q,x B 1 q to the site instance pA t , ' F pA t ,i t q,x t q that is compatible with the aCM. By Lemma 6.3.3, there exists a path in the pattern component c χ,◆,F,pA ,Bq from the site instance pA s ,i s ,x s q to the site instance pA t , ' F pA t ,i t q,x t q that is compatible with the aCM.

The site instance pA B 1 ,i B 1 ,x B 1 q is modified by the rule rule ◆ . By Constraint 1a of Definition 6.4.2, there is a path in the pattern component c j,◆ from the site instance pA s ,i 1 ,x s q to the site instance pA B 1 ,i B 1 ,x B 1 q that is compatible with the aCM. By Lemma 6.3.4, we can conclude there is a path in the pattern component c χ,◆,F,pA ,Bq from the site instance pA s ,i s ,x s q to the site instance pA B 1 , φ ◆ pA B 1 ,i B 1 q,x B 1 q that is compatible with the aCM. By the previous case, we already know that there exists a path in the pattern component c χ,◆,F,pA ,Bq from the site instance pA B 1 , φ ◆ pA B 1 ,i B 1 q,x B 1 q to the site instance pA t , ' F pA t ,i t q,x t q that is compatible with the aCM. By Lemma 6.3.3, there exists a path in the pattern component c χ,◆,F,pA ,Bq from the site instance pA s ,i s ,x s q to the site instance pA t , ' F pA t ,i t q,x t q that is compatible with the aCM.

As a consequence, the site instance pA t , ' F pA t ,i t q,x t q is a target for the pattern component c χ,◆,F,pA ,Bq . That is to say that the pattern component c χ,◆,F,pA ,Bq is a prefragment In all cases, we have expressed the (corrected) concentration of the pattern component c χ,◆,F,pA ,Bq as a linear combination of the (corrected) concentration of some fragments.

CHAPTER 6. INFORMATION FLOW

In the following chapters, we show that we can tune arbitrarily the accuracy of our analysis, by distinguishing the flow of information according to some contextual information.

Chapter 7

Context-sensitive abstractions

In the previous chapter, we have used contact maps to abstract the flow of information between sites of species. This abstraction is context-insensitive: we can either say that the state of a site may influence another site, or that the state of a site will never influence another site. In this chapter, we wonder whether it is possible or not to enhance the context-sensitivity of this approach.

For this purpose we introduce the notion of Σ-graph [START_REF] Vincent Danos | Graphs, rewriting and pathway reconstruction for rule-based models[END_REF]. Σ-graph can be used to denote mixtures, patterns, contact maps. They can be unfolded/folded to describe/abstract away some particular contexts. This is a convenient tool to describe types and properties about species.

Category of Σ-graphs

Σ-graphs

Let us give the definition of a Σ-graph.

Firstly, we introduce the set Ext as:

Ext :"t✏, ´u Y tpA, sq|A P A,s P Σ λ pAqu to describe some linking states.

Starting from a signature Σ we can define the concept of Σ-graph.

where:

1. A G is a set of agents;

CHAPTER 8. PARTITIONED FLOW

Trivial rules We assume that ◆ is the index of a trivial rule. By definition, the rule rule ◆ has the following form:

A 1 px B2@y q, B 2 py A1@x qÑA 1 pxq, B 2 pyq.

Hence, the number ωpιq of pattern components in the lhs of the rule rule ◆ is equal to 1, and j is equal to 1 as well.

We consider pA ,BqP › Ñ Mpι,j,Fq an extended gluing between the pattern component c 1,◆ and the prefragment F . The rule rule ◆ has no side effect. As a consequence, we have B "H. By Definition 5.3.8, it follows that A ‰H.

We consider two cases according to whether or not the set A is a singleton.

1. Let us assume that the set A is a singleton.

It follows that the (extended) gluing between c 1 and F is obtained (up to isomorphism) by replacing a binding type carried by a site instance s, by a link to a fresh agent.

We wonder what are the different possibilities to refine the binding type of the site instance s in the prefragment F . The site s might be bound to a site instance in F , but the so-refined pattern would contain a cycle, that is to say, since we have assumed that no species contains cycles, that its (corrected) concentration would be equal to 0. The only remaining case, is the one where the site s is bound to a site in a fresh agent. In this case, the refined pattern is isomorphic to the pattern c 1,◆ Y A F .

We conclude that:

pr c 1,◆ Y pA ,Bq F sq " pr F sq .

Let us assume that the set A contains two elements.

Let us write A "tp1,i 1 q, p2,i 2 qu.

In that case, either there is a link between the site instances pA, i 1 ,xq and pB, i 2 ,yq in the prefragment F ,o rn o t .

(a) If there is a link between the site instances pA, i 1 ,xq and pB, i 2 ,yq in the prefragment F , then c 1,◆ Y pA ,Bq F is isomorphic to the pattern component F .

(b) Otherwise, the pattern component c 1,◆ Y pA ,Bq F contains a cycle, that is to say, since we have assumed that no species contains cycles, that its (corrected) concentration is equal to 0.

CHAPTER 8. PARTITIONED FLOW

Since a summary graph contains only free sites and explicit bounds, we can deduce that h `can be extended into an homomorphism h 1 from c 1,◆,F,M to G. We denote as ' F an embedding between F 1 and c 1,◆,F,M such that:

By Constraint 3 of Definition 8.2.5, there exists a species V P V, an embedding φ from c 1,◆,F,M to V and an homomorphism h 2

The embedding φ defines R L Ñ R R a ground refinement of the rule. By constraint 2 of Definition 8.2.5, there exists a homomorphism h R between R R and G.

Let pA s ,i s ,x s q be a site instance in F 1 . Since pA t ,i t ,x t q is a target in F , there exist two paths:

pi 1 ,x 1 q"pi m 2 ,x m 2 q; -pi n ,x n q"pi t ,x t q; -pi 1 1 ,x 1 1 q"pi s ,x s q; -pi 1 n 1 ,x n 1 q"pi t ,x t q. It follows that the rule rule ◆ , the ground refinement R L Ñ R R , the homomorphisms h 2 `and h R , and both paths:

satisfies the assumptions in Constraint 3 of Definition 8.2.9. Thus, for k between 1 and n 1 , we have:

It follows that:

Then:

We have proved that:

for every homomorphism h `from F 1 to G.

That is to say that:

By Constraint 3 of Definition 8.2.9, the pattern F 1 is a prefragment.

We wonder what are the different possibilities to refine the binding type of the site instance s in the prefragment F 1 . The site s might be bound to a site instance in F , but the so-refined pattern would contain a cycle, that is to say, since we have assumed that no species contains cycles, that its (corrected) concentration would be equal to 0. The only remaining case, is the one where the site s is bound to a site in a fresh agent. In this case, the refined pattern is isomorphic to the pattern c 1,◆,F,M .

We conclude that pr c 1,◆,F,M sq " pr F 1 sq .

Let us assume that the set A contains two elements.

Then the pattern component c 1,◆,F,M is obtained (up to isomorphism) by binding in F two site instances. As a consequence the pattern component c 1,◆,F,M has a cycle.

Since we have assumed that species has no cycle, we can conclude that the concentration of the pattern component c 1,◆,F,M is equal to 0.

In all case, the corrected concentration pr c 1,◆,F,M sq is equal to 0, or to the corrected concentration of a prefragment.

CHAPTER 8. PARTITIONED FLOW

Non-trivial rules

We assume that ◆ is the index of a non trivial rule. We denote by L Ñ R the rule rule ◆ We consider pA ,Bq an element of the set P -› Mp◆,Fq.

We consider ' F the embedding from the prefragment F to the pattern component R Y A F and φ ◆ be the embedding from the pattern R to the pattern component R Y A F , that we have used to define the gluing between the fragment F and the rhs R of the rule rule ◆ .

Without any loss of generality, we assume that the pattern R Y A F matches the pattern R, that is to say that the injective substitution φ ◆ maps pairs pA, iq to the agent identifiers i.

The pattern component F is a prefragment, thus there exists a site instance pA t ,i t ,x t q in F that is a target.

Let χ be a natural number 1 and ωpιq.

We want to prove that the pattern component c χ,◆,F,pA ,Bq is a prefragment.

1. We assume that the set A is not empty.

We denote as F ´1 the antecedent of F .

Formally, F ´1 is defined as the pattern that contains every agent instance pA, ϕ F piqq such that pA, iq is an agent instance in F and the agent instance pA, ϕ F piqq has not been created by the application of the rule rule ◆ , every site instance pA, ϕ F piq,xq such that pA, i, xq is a site instance in F and the agent instance pA, ϕ F piqq has not been created by the application of the rule rule ◆ , and every bond between the two site instances pA, ϕ F piq,xq and pA 1 , ϕ F pi 1 q,x 1 q such that there is ab o n db e t w e e nt h es i t ei n s t a n c epA, i, xq and pA 1 ,i 1 ,x 1 q in F and the bond between the site instance pA, ϕ F piq,xq and pA 1 , ϕ F pi 1 q,x 1 q has not been created by the rule rule ◆ .

We denote as F ´1 χ the pattern that is made of every pattern component of F ´1 that contains at least one agent instance pA, φ ◆ piqq for a given site instance pA, iq in c χ,◆ .

Let us prove that any connected component F ´1 pc of F ´1 χ contains a site that has been modified by the rule rule ◆ .

CHAPTER 8. PARTITIONED FLOW

By Constraint 3 of Definition 8.2.5, there exists a species V P V, an embedding φ from c 1,◆,F,M to V and an homomorphism

The embedding φ defines R L Ñ R R a ground refinement of the rule. By constraint 2 of Definition 8.2.5, there exists a homomorphism h R between R R and G.

Let pA m ,i m ,x m q be a site instance in F ´1 pc that has been modified by the rule rule ◆ . Since pA t ,i t ,x t q is a target in F , there exist two paths:

pi 1 ,x 1 q"pi m ,x m q; -pi n ,x n q"pi t ,x t q; -pi 1 1 ,x 1 1 q"pi 1 ,x s q; -pi 1 n 1 ,x n 1 q"pi t ,x t q. It follows that the rule rule ◆ , the ground refinement R L Ñ R R , the homomorphisms h 1 `and h R , and both paths:

R LJ pφp' F pi 1 n 1 qq,x 1 n 1 q satisfies the assumptions in Constraint 3 of Definition 8.2.9. Thus, for k between 1 and n 1 , we have:

We have proved that: ph `pi s q,x s q ˝ ‹ Ga ph `p' F pi t q,x t q, for every homomorphism h `from c χ,◆,F,pA ,Bq to G. Thus, we can conclude that: pi s ,x s q ‹ c χ,◆,F,pA ,Bq ,Ga p' F pi t q,x t q.

CHAPTER 8. PARTITIONED FLOW

We will prove that: pi s ,x s q ‹ c χ,◆,F,pA ,Bq ,Ga p' F pi t q,x t q.

i. We have already proved it if the site instance pA s ,i s ,x s q belongs to a pattern component of F ´1 χ that contains the site instance pA t , ' F pi t q,x t q. ii. If there exists an agent identifier i such that pA s , i, x s q is a site instance of c χ,◆ and i s " φ ◆ piq.

There exists a site instance pA m ,i m ,x m q in c χ,◆,F,pA ,Bq satisfying the following constraints: A. there exists an agent identifier i m 1 such that the site instance pA m ,i m 1 ,x m q belongs to the pattern component c χ,◆ and i m " ' ◆ pi m 1 q; B. the pattern component of F ´1 χ that contains the site instance pA t , ' F pi t q,x t q also contains the the site instance pA m ,i m ,x m q; C. the site pA m ,i m 1 ,x m q is modified by the rule rule ◆ . Then, by Constraint 1 of Definition 8.2.9, it follows that: pi, x s q ‹ cχ,◆,Ga pi m 1 ,x m q.

By Lemma 8.2.8, we get that: pi s ,x s q ‹ c χ,◆,F,pA ,Bq ,Ga pi m ,x m q.

Thus, from the precedent case, we can conclude that: pi s ,x s q ‹ c χ,◆,F,pA ,Bq ,Ga p' F pi t q,x t q.

iii. If pA s ,i s ,x s q belongs to a pattern component of F ´1 χ that does not contain the site instance pA t , ' F pi t q,x t q. Then, there exists a site pA m ,i m ,x m q in c χ,◆ such that: pi s ,x s q ‹ c χ,◆,F,pA ,Bq ,Ga pφ ◆ pi m q,x m q.

Thus, from the precedent case, we can conclude that: pi s ,x s q ‹ c χ,◆,F,pA ,Bq ,Ga p' F pi t q,x t q.

Thus, the pattern component c χ,◆,F,pA ,Bq is a prefragment. (c) We assume that c χ,◆,F,pA ,Bq ‰ c χ,◆ and that the pattern component c χ,◆,F,pA ,Bq does not contain the site instance pA t , ' F pi t q,x t q.

Let pA m ,i m ,x m q be a site instance in c χ,◆ that has been modified by the rule rule ◆ . We will prove that:

pi s ,x s q ‹ c χ,◆,F,pA ,Bq ,Ga pφ ◆ pi m q,x m q.

i. If there exists an agent identifier i such that pA s , i, x s q is a site instance of c χ,◆ and i s " φ ◆ piq.

By Constraint 1 of Definition 8.2.9, we have: pi, x s q ‹ cχ,◆,Ga pi m 1 ,x m q. By Lemma 8.2.8, it follows that: pi s ,x s q ‹ c χ,◆,F,pA ,Bq ,Ga pφ ◆ pi m q,x m q.

ii. If pA s ,i s ,x s q belongs to a pattern component of F ´1 χ . There exists a site pA ' ,i ' ,x ' q in c χ,◆ such that: pi s ,x s q ‹ c χ,◆,F,pA ,Bq ,Ga pφ ◆ pi ' q,x ' q. Thus, from the precedent case, we can conclude that: pi s ,x s q ‹ c χ,◆,F,pA ,Bq ,Ga pφ ◆ pi m q,x m q. Thus, the pattern component c χ,◆,F,pA ,Bq is a prefragment.

2. We assume that the set A is empty.

The set B is a singleton that we write ppA

Let χ be a natural number between 1 and ωpιq. Then we have c χ,◆,F,pA ,Bq " c χ,◆ . By Constraint 2 of Definition 8.2.9, the pattern component c χ,◆ is ap r e f r a g m e n t . Thus, c χ,◆,F,pA ,Bq " c χ,◆ . We can conclude that pr c χ,◆,F,pA ,Bq sq " pr c χ,◆ sq .

(b) If the pattern component c χ,◆ contains the agent instance pA B 1 ,i B 1 q.

The pattern component c χ,◆,F,pA ,Bq is equal up to isomorphism to the pattern component pc χ,◆ Y H F qÒ tpA B 1 ,i B 1 q,pA B 2 ,i B 2 qu (that is to say, the disjoint union between c χ,◆ and F , to which we have added a bond between the site instance pA B 1 ,i B 1 ,x B 1 q and the site instance pA B 2 ,i B 2 ,x B 2 q.

We want to prove that the site pA t , ' F pi t q,x t q is a target in the pattern component pr c χ,◆,F,pA ,Bq sq . Let pA s ,i s ,x s q be a site instance in c χ,◆,F,pA ,Bq .

i. We assume that there exists an agent identifier i 1 such that the triple pA s ,i 1 ,x s q is a site instance in F and i s " ' F pi 1 q. Since pA t ,i t ,x t q is a target in F , we have:

By Constraint 3 of Definition 8.2.9 (we skip some steps, since the reasoning is very similar to the previous ones), we can conclude that: pi s ,x s q ‹ c χ,◆,F,pA ,Bq ,Ga p' F pi t q,x t q.

ii. We assume that pA s ,i s ,x s q"pA B 1 , φ ◆ pi B 1 q,x B 1 q. By Constraint 1c of Definition 8.2.9, we have: pi s ,x s q ‹ c χ,◆,F,pA ,Bq ,Ga p' F pi B 2 q,x B 2 q.

By the previous case, we know that:

p' F pi 1 B 2 q,x B 2 q ‹ c χ,◆,F,pA ,Bq ,Ga p' F pi t q,x t q.

By Lemma 6.3.3, we can conclude that: pi s ,x s q ‹ c χ,◆,F,pA ,Bq ,Ga p' F pi t q,x t q.

iii. We assume that there exists an agent identifier i 1 such that the triple pA s ,i 1 ,x s q is a site instance in c j,◆ such that i s " φ ◆ pi 1 q.

The agent instance pA B 1 ,i B 1 q has at least one site instance (otherwise, the pattern component c j,◆ would have been made of a single agent with no site instance, which would be absurd since pA s ,i 1 ,x s q is a site instance in c j,◆ ).

REDUCED MODEL

181 Let x w be a site name, such that the triple pA B 1 ,i B 1 ,x w q is a site instance in the pattern c j,◆ .

We have pA B 1 ,i B 1 ,x B 1 qPMAYprule ◆ q, so the agent instance pA B 1 ,i B 1 q is removed by the rule rule ◆ . As a consequence, the site pA B 1 ,i B 1 ,xw q is modified by the rule rule ◆ . By Constraint 1 of Definition 8.2.9, we have: pi 1 ,x s q ‹ c j,◆ ,Ga pi B 1 ,x w q. By Lemma 8.2.8, it follows that: pi s ,x s q ‹ c χ,◆,F,pA ,Bq ,Ga pφ ◆ pi B 1 q,x w q. By Constraint 1b of Definition 8.2.9, we have:

c χ,◆,F,pA ,Bq ,Ga pφ ◆ pi B 1 q,x B 1 q. By the previous case, we know that: pφ ◆ pi B 1 q,x B 1 q ‹ c χ,◆,F,pA ,Bq ,Ga p' F pi t q,x t q. Thus, we can conclude that:

The site instance pA B 1 ,i B 1 ,x B 1 q is modified by the rule rule ◆ . By Constraint 1 of Definition 8.2.9, we have: pi 1 ,x s q ‹ c j,◆ ,Ga pi B 1 ,x B 1 q. By Lemma 8.2.8, it follows that: pi s ,x s q ‹ c χ,◆,F,pA ,Bq ,Ga pφ ◆ pi B 1 q,x B 1 q. By the previous case, we know that: pφ ◆ pi B 1 q,x B 1 q ‹ c χ,◆,F,pA ,Bq ,Ga p' F pi t q,x t q. Thus, we can conclude that: pi s ,x s q ‹ c χ,◆,F,pA ,Bq ,Ga p' F pi t q,x t q. As a consequence, the site instance pA t , ' F pi t q,x t q is a target ifor the pattern component c χ,◆,F,pA ,Bq . That is to say that the pattern component c χ,◆,F,pA ,Bq is a prefragment. In all cases, the corrected concentration of the pattern component c χ,◆,F,pA ,Bq is equal to 0, or to the corrected concentration of a prefragment.

Résumé

Le comportement d'une cellule dépend de sa capacité à recevoir, propager et intégrer des signaux, constituant ainsi des voies de signalisations. Les protéines s'associent entre elles sur des sites de liaisons, puis modifient leur structure spatiale, ce qui put cacher ou révéler r leurs autres sites de liaisons.

E n r a i s o n , d u g r a n d n o m b r e d e d i f f é r e n t s complexes bio-moléculaires, nous ne pouvons pas écrire ou générer les systèmes d'ODEs sous-jacents. Les langages de réécritures de graphes à sites offrent un bon moyen de décrire ces systèmes. Néanmoins la complexité combinatoire resurgit lorsque l'on veut calculer le comportement de ces systèmes, ce qui justifie l'utilisation d'abstractions.

Nous proposons deux méthodes pour réduire la taille de ces modèles. Elles utilisent respectivement la présence de symétries parmi certains sites et le manque de corrélation entre différentes parties du système. Des sites qui ont la même capacité d'interaction sont liés par une relation de symétrie, qui induit une bisimulation. L'analyse du flot d'information détecte les parties du système qui influencent le comportement de chaque site. Ceci nous autorise à couper les espèces moléculaires en petits morceaux pour écrire un nouveau système. Enfin, nous montrons comment raffiner cette analyse pour tenir compte d'information contextuelle.

Les deux méthodes peuvent être combinées. La solution analytique du modèle réduit est la projection exacte de la solution originelle. Le calcul du modèle réduit se fait au niveau des règles, en évitant l'exécution du modèle initial.

Mots Clés

Voies de signalisation, interprétation abstraite, modélisation par règles de réécritures, réduction de modèles, bisimulations, flot d'information.

Abstract

The behaviour of a cell is driven by its capability to receive, propagate and communicate signals. Proteins can bind together on some binding sites. Posttranslational modifications can reveal or hide some sites, so new interactions can be allowed or existing ones can be inhibited.

D u e t o t h e h u g e n u m b e r o f d i f f e r e n t b i omolecular complexes, we can no longer derive or integrate ODE models. A compact way to describe these systems is supplied by rulebased languages. However combinatorial complexity raises again when one attempt to describe formally the behaviour of the models. This motivates the use of abstractions.

W e p r o p o s e t w o m e t h o d s t o r e d u c e t h e s i z e of the models, that exploit respectively the presence of symmetries between sites and the lack of correlation between different parts of the system. Symmetries relates pairs of sites having the same capability of interactions. We show that this induces a bisimulation which can be used to reduce the size of the original model. The information flow analysis detects, for each site, which parts of the system influence its behaviour. This allows us to cut the molecular species in smaller pieces and to write a new system. Moreover we show how to tune the context sensitivity of this analysis.