=Paper=
{{Paper
|id=Vol-2951/paper16
|storemode=property
|title=Cause-Effect Structures Behaving like Reaction Systems
|pdfUrl=https://ceur-ws.org/Vol-2951/paper16.pdf
|volume=Vol-2951
|authors=Ludwik Czaja
|dblpUrl=https://dblp.org/rec/conf/csp/Czaja21
}}
==Cause-Effect Structures Behaving like Reaction Systems==
Cause-Effect Structures Behaving like Reaction Systems Ludwik Czaja1,2 1 Vistula University, Warsaw, Poland 2 Institute of Informatics, The University of Warsaw, Poland Abstract Cause-effect (c-e) structures, a net-like algebraic formalism for describing and analysing systems, pri- marily parallel, may be adapted to work as Reaction Systems. This is acquired by a simple modification of the c-e structuresβ semantics Keywords cause-effect structure, reaction system, quasi semiring 1. Summary of elementary cause-effect structures Cause-effect structures (c-e) are objects of an algebraic calculus called a quasi-semiring1 , for describing and analysing systems built up as nets. Among a number of similarities to Petri nets, the noticeable is graphic presentation of systemsβ dynamics. The complete presentation of c-e structures is in [Cza 2019]. Definition 1.1 (set F [X], quasi-semiring of formal polynomials) Let X be a non-empty enumerable set. Its elements, called nodes, are counterparts of places in Petri nets. π β / X is a symbol called neutral. It plays role of neutral element for operations on terms, called formal polynomials over X. The names of nodes, symbol π, operators +, β, called addition and multiplication, and parentheses are symbols out of which formal polynomials are formed. A nodeβs name and π is a formal polynomial; if πΎ and πΏ are formal polynomials, then (πΎ + πΏ) and (πΎ β πΏ) are too. Their set is denoted by F [X]. Assume stronger binding of β than +, which allows for dropping some parentheses. Addition and multiplication of formal polynomials is defined as follows: πΎ β πΏ = (πΎ + πΏ), πΎ β πΏ = (πΎ β πΏ). To simplify notation, let us use + and β instead of β and β. It is required that the system β¨F [X], +, β, πβ© obeys the following equality axioms for all πΎ, πΏ, π β F [X], π₯ β X: (+) π+πΎ =πΎ +π =πΎ (β) πβπΎ =πΎ βπ =πΎ 29th International Workshop on Concurrency, Specification and Programming (CS&Pβ21) " lczaja@mimuw.edu.pl (L. Czaja) 0000-0003-4675-816X (L. Czaja) Β© 2021 Copyright for this paper by its authors. Use permitted under Creative Commons License Attribution 4.0 International (CC BY 4.0). CEUR CEUR Workshop Proceedings (CEUR-WS.org) Workshop Proceedings http://ceur-ws.org ISSN 1613-0073 1 This calculus differs from the standard semiring by restricted distributivity law: π Β· (π + π) = π Β· π + π Β· π satisfied provided that π ΜΈ= π if and only if π ΜΈ= π where π is a neutral element for both operations (simultaneity and nondeterministic choice). Hence the preposition "quasi". Note that due to the conditional distributivity, the calculus neither reduces to the single element π, nor makes both operations coincide. (++) πΎ + πΎ = πΎ (ββ) π₯ β π₯ = π₯ (+++) πΎ + πΏ = πΏ + πΎ (β β β) πΎ β πΏ = πΏ β πΎ (++++) πΎ + (πΏ + π ) = (πΎ + πΏ) + π (β β ββ) πΎ β (πΏ β π ) = (πΎ β πΏ) β π (+β) If πΏ ΜΈ= π β π ΜΈ= π then πΎ β (πΏ + π ) = πΎ β πΏ + πΎ β π Algebraic system which obeys these axioms will be referred to as a quasi-semiring of formal polynomials. β‘ Definition 1.2 (cause-effect structure, carrier, set CE[X]) A cause-effect structure (c-e structure) over X is a pair π = β¨πΆ, πΈβ© of total functions: πΆ: X β F [X] (cause function; nodes occuring in πΆ(π₯) are causes of π₯) πΈ: X β F [X] (effect function; nodes occuring in πΈ(π₯) are effects of π₯) such that π₯ occurs in the formal polynomial πΆ(π¦) iff π¦ occurs in πΈ(π₯). Carrier of π is the set πππ(π ) = {π₯ β X : πΆ(π₯) ΜΈ= π β¨ πΈ(π₯) ΜΈ= π}. π is of finite carrier iff |πππ(π )| < β (|...| denotes cardinality). The set of all c-e structures over X is denoted by CE[X]. Since X is fixed, we write just CE. β‘ πΆ and πΈ are total, thus each c-e structure comprises all nodes from X, also the isolated ones - those from outside of its carrier. In presenting c-e structures graphically, only their carriers are drawn. A representation of a c-e structure π = β¨πΆ, πΈβ© as a set of annotated nodes is πΆ(π₯) {π₯πΈ(π₯) : π₯ β πππ(π )}. π is also presented as a directed graph with πππ(π ) as set of vertices πΆ(π₯) labelled with objects of the form π₯πΈ(π₯) (π₯ β πππ(π )); there is an edge from π₯ to π¦ iff π¦ occurs in the polynomial πΈ(π₯). Fig. 1 (a) and (b) depict two graphical presentations of the same c-e structure with carrier {π, π, π, π, π, π, π, β}; in (a) the encircled nodes comprise groups making products in formal polynomials in (b), where the sums of the products create families of the groups. This c-e structure is the set {πππ , πππ , πππ , πππ , ππ+πΒ·π+πΒ·π π Β·π+β , πππ , πππ , βππ }. Sometimes the empty subscript/superscript π by node names is omitted. Figure 1: (a) Predecessors and successors of the node π, grouped into families: {{π}, {π, π}, {π, π}} and {{π, π}, {β}}. (b) Notation by means of polynomials; the arrows are redun- dant: used only for graphic presentation of c-e structures. Definition 1.3 (addition and multiplication, monomial c-e structure) For c-e structures π = β¨πΆπ , πΈπ β©, π = β¨πΆπ , πΈπ β© define: π + π = β¨πΆπ +π , πΈπ +π β© = β¨πΆπ + πΆπ , πΈπ + πΈπ β© where (πΆπ + πΆπ )(π₯) = πΆπ (π₯) + πΆπ (π₯) and similarly for πΈ π β π = (πΆπ βπ , πΈπ βπ ) = (πΆπ β πΆπ , πΈπ β πΈπ ) where (πΆπ β πΆπ )(π₯) = πΆπ (π₯) β πΆπ (π₯) and similarly for πΈ (The same symbols "+" and "β" are used for operations on c-e structures and formal polynomials). π is a monomial c-e structure iff each polynomial πΆπ (π₯) and πΈπ (π₯) is a monomial, i.e. does not comprise non-reducible (relative to equations in Definition 1.1) operation β+β. β‘ Apart from the representation of c-e structures as a set πΆ(π₯) {π₯πΈ(π₯) : π₯ β πππ(π )}, their linear notation is used as the so-called "arrow-expressions": {π₯ππ¦ , π¦ππ₯ } is an arrow, denoted as π₯ β π¦ and, consequently, {π₯ππ¦ , π¦ππ₯ } β {π¦π§π , π§ππ¦ }β{π§π’π , π’π§π }..... = {π₯ππ¦ , π¦π§π₯ , π§π’π¦ , π’π§.... .....} is a chain, denoted as π₯ β π¦ β π§ β π’.... . Bidirectional arrow π₯ β π¦ denotes π₯ β π¦ β π₯ (equivalent to π¦ β π₯ β π¦), that is, the close cycle {π₯π¦π¦ , π¦π₯π₯ }. Chains and arrows in particular, may be combined into βarrow expressionsβ representing some c-e structures. For instance c-e structure {πππ₯+π¦ , πππ₯βπ¦ , π₯πβπ π , π¦π } may be written as πβπ (π β π₯ + π β π¦) β (π β π₯) β (π β π¦). The set CE with addition, multiplication and a distinguished element denoted also by π and understood as the empty c-e structure (π, π), where π is a constant function π(π₯) = π for all π₯ β X, makes an algebraic system similar to that in Definition 1.1, the quasi-semiring of c-e structures. Therefore the Proposition 1.1: Proposition 1.1 The system β¨CE[X], +, β, πβ© obeys the following equations for all π, π, π β CE[X], π₯, π¦ β X: (+) π+π =π +π =π (β) πβπ =π βπ =π (++) π +π =π (ββ) (π₯ β π¦) β (π₯ β π¦) = π₯ β π¦ (+++) π + π = π + π (β β β) π β π = π β π (++++) π + (π + π ) = (π + π ) + π (β β ββ) π β (π β π ) = (π β π ) β π (+β) If πΆπ (π₯) ΜΈ= π β πΆπ (π₯) ΜΈ= π and πΈπ (π₯) ΜΈ= π β πΈπ (π₯) ΜΈ= π then π β (π + π ) = π β π + π β π β‘ Definition 1.4 (partial order β€; substructure, set SUB[π ], firing component, set FC, pre-set and post-set) For π, π β CE let π β€ π β π = π + π ; β€ is a partial order in CE. If π β€ π then π is a substructure of π ; SUB[π ]= {π : π β€ π } is the set of all substructures of π . For π΄ βCE: π β π΄ is minimal (wrt β€) in π΄ iff βπ β π΄: (π β€ π β π = π ). A minimal in CEβ{π} c-e structure π = β¨πΆπ , πΈπ β© is a firing component iff π is a monomial c-e structure and πΆπ (π₯) = π β πΈπ (π₯) ΜΈ= π for any π₯ β πππ(π). The set of all firing components is denoted by FC, thus the set of all firing components of π βCE is FC[π ] = SUB[π ] β© FC. Let for π β FC and πΊ β FC: β π = {π₯ β πππ(π) : πΆ π (π₯) = π} (pre-set or causes of π) πβ = {π₯ β πππ(π) : πΈπ (π₯) = π} (post-set or effects of π) β πβ = β π βͺ πβ βπΊ = (pre-set or causes of πΊ) βοΈ β π πβπΊ πΊβ = πβ (post-set or effects of πΊ) βοΈ πβπΊ β πΊβ = β πΊ βͺ πΊβ β‘ Thus, the firing component is a connected graph, due to the required minimality. Elements of the pre-set are its causes and elements of the post-set are its effects. Definition 1.5 (salvo - pairwise detached firing components; family FCS) Firing components π and π are detached if and only if β πβ β© β π β = β . Any set πΊ βFC of pairwise detached firing components is called their salvo. The family of salvos is denoted by FCS. So, if πΊ βFC[π ] then FCS[π ] β 2FC[π ] for a c-e structure π , denotes a collection of salvos in π . The intention is that firing components in a salvo are capable of acting ("firing") simultaneously. This notion will be used in definition of parallel semantics of c-e structures.β‘ Definition 1.6 (state of elementary c-e structures) A state is a subset of the set of nodes: π β X. The set of all states: S = 2X . A node π₯ is active in the state π iff π₯ β π and passive otherwise. As in case of Petri nets, we say βπ₯ holds a tokenβ when π₯ is active. Obviously, the state might be defined equivalently as a two-valued function π : X β{0, 1}. β‘ Definition 1.7 (sequential and parallel semantics of elementary c-e structures) Sequential. For π βFC[π ] , π β S, let [[π]] β S Γ S be a binary relation defined as: (π , π‘) β [[π]] iff β π β π β§ πβ β© π = β β§ π‘βοΈ= (π ββ π) βͺ πβ (π transforms state π into π‘). Semantics [[π ]] of π βCE is: [[π ]] = [[π]]. [[π ]]* is its reflexive and transitive πβFC [π ] closure, that is (π , π‘) β [[π ]]* if and only if π = π‘ or there exists a sequence of states π 0 , π 1 , ..., π π with π = π 0 , π‘ = π π and (π π , π π+1 ) β [[π ]] for π = 0, 1, ..., π β 1. State π‘ is reachable from π in semantics [[ ]] and the sequence π 0 , π 1 , ..., π π is a computation performed by π . Parallel. For a salvo πΊ βFCS[π ], πΊ ΜΈ= β , relations [[πΊ]] and [[π ]]πππ are defined in the same way as [[π]] and [[π ]] in the sequential case but with π replaced with πΊ and FC[π ] replaced with FCS[π ]. Closure [[π ]]*πππ , reachability and computation are defined as in the sequential case. β‘ Note that [[π ]] = β iff FC[π ] = β . Behaviour of elementary c-e structures may be thought of as a token game: if each node in a firing componentβs pre-set holds a token and none in its post-set does, then remove tokens from the pre-set and put them in the post-set. This is illustrated in Fig. 2. Properties inferred from above definitions are proved in [Cza 2019]. Figure 2: Example of activity (successive transformations) of elementary c-e structure. Its linear nota- tion as an "arrow expression" is the following: (π β π) + (π β π) β (π β π) + (π β π) + (π β π) + (π β π) + (π β π) + (π β π). 2. Summary of extended cause-effect structures The structure of extended c-e structures, their firing component in particular, is the same as in Definitions 1.1 - 1.4. The extensions consist in redefining the state, treating the pre and post sets of firing components as multisets, and redefining semantics. It is assumed that with a given c-e structure π βCE[X] (i.e. already constructed by operations introduced in Definition 1.3) and the set of its firing components FC[π ] = SUB[π ]β©FC, some additional information is associated. The following extensions of elementary c-e structures with this information will be obtained: multi-valued nodes, capacity of nodes and coefficients of monomials in polynomials annotating nodes (counterparts of weight of arrows in Petri nets), in particular a coefficient π which represents inhibiting. To this end, a notation for multisets is convenient: let N be the set of natural numbers including 0 and Nπ = N βͺ {π}, where the value π means infinity, that is π > π for each π β N. A multiset over a base set π is a (total) function π : π β Nπ . If the set {π₯: π (π₯) ΜΈ= 0} is finite then the linear-form notation is adopted for multisets , e.g. π π π π π π is denoted by 2 β π + 3 β π + π + π β π. A multiset is zero π (π) 2 0 3 1 π O, when O(π₯) = 0 for all π₯. Addition, subtraction and multiplication on multisets is defined: (π +π)(π₯) = π (π₯)+π(π₯), (π βπ)(π₯) = π (π₯)βπ(π₯) for π (π₯) β₯ π(π₯), (π Β·π)(π₯) = π (π₯)Β·π(π₯), comparison of multisets: π β€ π iff π (π₯) β€ π(π₯) for all π₯. Assume the customary arithmetic of π: π + π = π, π β π = π, π + π = π and additionally 0 β π = 0. Definition 2.1 (state of extended c-e structures) A state of extended c-e structure π is a total function π : πππ(π ) β N, thus a multiset over πππ(π ). The set of all states of π is denoted by S. β‘ Definition 2.2. (weights of monomials and capacity of nodes) For a c-e structure π = β¨πΆ, πΈβ© and its firing component π βFC[π ], let with the pre-set β π and post-set πβ of π, some multisets β π: β π β Nπ and πβ : πβ β Nπ be given as additional information. The value β π(π₯) is a weight (or multiplicity) of monomial πΈπ (π₯) and the value πβ (π₯) - a weight (or multiplicity) of monomial πΆπ (π₯). For πΈπ (π₯) = π or πΆπ (π₯) = π assume respectively β π(π₯) = 0 or πβ (π₯) = 0 and additionally let β π(π₯) = 0 for π₯ β / βπ and π (π₯) = 0 for π₯ β β / π . Let πππ(π ) be a total function πππ(π ) : πππ(π ) β Nπ β{0}, β assigning a capacity to nodes in the set πππ(π ). A c-e structure endowed with such information is a c-e structure-with-weighted monomials and capacity of nodes. Note that this definition extends directly from the firing components onto their salvos. Indeed, For any non-empty salvo πΊ βFCS[π ] and any π₯ β β πΊβ there exists exactly one firing component π β πΊ, with π₯ β β πβ (because firing components in πΊ are pairwise detached). Thus one may define β πΊ = β π and πΊβ = πβ . It should also be noticed that weights of cause or effect monomials in identical firing components appearing in different c-e structures, may be different. β‘ An effect monomial πΈπ (π) of a node π β β π, with weight β π(π), is denoted by β π(π)βπΈπ (π). Similarly for a cause monomial πΆπ (π₯) of a node π₯ β πβ with weight πβ (π₯): πβ (π₯) β πΆπ (π₯). The coefficient representing weights will be abandoned if they are 1. Definition 2.3 (inhibitors) For a firing component π βFC[π ], let ππβ[π] = {π₯ β β π : β π(π₯) = π}, thus a set of nodes in the pre-set of π, whose effect monomials πΈπ (π₯) are of weight π. The nodes in ππβ[π] will play role of inhibiting nodes of firing component π. In accordance with the note in Definition 1.5 (pairwise detached firing components in salvos), the concept of inhibiting nodes extends directly onto the salvos: ππβ[πΊ] = {π₯ β β πΊ : β πΊ(π₯) = π} where πΊ βFCS[π ]. The inhibiting nodes will be called inhibitors. β‘ Definition 2.4. (enabled firing components and enabled salvos) For a firing component π βFC[π ] and state π let us define the formula: πππππππ[π](π ) if and only if: βπ₯ β ππβ[π] : π (π₯) = 0β§ βπ₯ β β πβππβ[π] : π (π₯) > 0 β§ β π(π₯) β€ π (π₯) β€ πππ(π )(π₯)β§ βπ₯ β πβ : πβ (π₯) + π (π₯) β€ πππ(π )(π₯) So, π is enabled in the state π iff none of inhibiting nodes π₯ β β π contains a token and each remaining node in β π contains, with no fewer tokens than is the weight of its effect monomial πΈπ (π₯) and no more than capacity of each π₯ β β π. Moreover, none of π₯ β πβ holds more tokens than their number when increased by the weight of the cause monomial πΆπ (π₯), exceeds capacity of π₯. Evidently, for a salvo πΊ βFCS[π ], the formula πππππππ[πΊ](π ) is defined as above by replacing π with πΊ and FC[π ] with FCS[π ]. β‘ Definition 2.5. (Sequential and parallel semantics of extended c-e structures) Sequential. For π βFC[π ] , let [[π]] β S Γ S be a binary relation defined as: (π , π‘) β [[π]] iff πππππππ[π](π ) β§ π‘ = (π β β π) βοΈ + π β€ πππ(π ) (π transforms β state π into π‘). Semantics [[π ]] of π βCE is [[π ]] = [[π]]. Closure [[π ]] and reachability and * πβFC[π ] computation are defined as in Definition 1.7. Parallel. For a salvo πΊ βFCS[π ], πΊ ΜΈ= β , the relations [[πΊ]] and [[π ]]πππ are defined in the same way as [[π]] and [[π ]] in the sequential case, but with π replaced with πΊ and FC[π ] replaced with FCS[π ]. Closure [[π ]]*πππ , reachability and computation are defined as in the sequential case. β‘ An example of using inhibitor is in Fig. 3. The weight of one effect (i.e. subscript) monomial π β π§ of the node π is π, thus traversing arrow from π to π§ would require infinite number of tokens at π , which is impossible. Thus, π is the inhibiting node in firing component π0 and ordinary - in firing component π1 . In accordance with aforesaid notation of multisets, the weighted monomials are denoted by π€ β π , where π€ is the weight of π - an unweighted monomial. The weight is skipped if π€ = 1. The corresponding arrows are dashed in the figures if π€ = π. In all graphic presentations of c-e structures, nodes of unbounded capacity π, for storing data (sets of tokens), will be drawn as bigger circles with double edge. Remaining nodes, the "control", are of capacity 1 and drawn as smaller circles. Figure 3: Construction of c-e structure π0 + π1 implementing "test zero". A token at the node π starts testing contents of π ; on termination, the token appears at π§ (zero) if π is empty and at π (not zero) otherwise. The tested node π plays two roles: inhibiting in π0 and ordinary in π1 . Capacity of π is infinite, whereas of remaining nodes is 1. The empty subscript/superscript π is skipped. In the Petri net counterpart, the inhibiting arrow enters the left transition. 3. Basic notions of reaction systems This outline of reaction systems [Ehr 2007], [Ehr 2017] is limited to the primary definitions, not their extensions, generalizations and properties established in this theory. The outline serves only as a reference base for the next section concerned with a translation of reaction systems into a version of cause-effect structures. That is why the original (in the literature) denotation of certain constituents of reaction systems, has been somewhat changed, in order to avoid naming collision with the cause-effect structures. But the new presentation is completely equivalent to original and only tailored to the purpose of the next section. The reaction systems will be referred to as RE. The reaction systems as well as cause-effect structures, though devised to describe interactions or cooperation in a network of active objects, both are certain models of computing - in the broadest meaning of this word. Reaction systems are very inspiring new model of computing, if "computing" is to encompass interaction, not only "number crunching". That is why a certain attempt to translate the reaction systems into c-e structures is undertaken, though for a price of modifying semantics of the latter, but retaining their structure. There have been also other endeavours to relate reaction systems with some formal models, for instance [Kle 2011], [Dut 2018], [Bar 2018], [Gor 2018]. Definition 3.1 (reaction system) A reaction system π΄ is created of two sets: π΄ = (B, R) where B is a set called a background (intended to comprise the so-called entities), R is a set of reactions, each reaction π β R created of three sets π = (π π , πΌπ , ππ ) where π π β B is a set of reactants, πΌπ β B is a set of inhibitors with π π β© πΌπ = β and ππ β B is a set of products. The initial state of the system π΄ is a set S0 β B. β‘ In the literature, all the sets in Definition 3.1 are required to be finite. Though the concept of "entity" has not been formally adopted in the definitions, for the purpose of this section it will be understood as an object associated in a given state with an element of the background, likewise a "token", an abstract object, of intuitive, informal status in the c-e structures or Petri nets. Hence, the set phrase "entity present in..." in writings on the reaction systems. Since the notion of "state" of reaction systems is analogous to that in elementary Petri nets (and elementary c-e structures), meaning of the word "entity" may be thought of as an element of state. Definition 3.2 (state and enabled reactions) A state S of reaction system π΄ is a subset of its background: S β B. The intention is that S be the set of those backgroundβs members, which comprise entities. A reaction π = (π π , πΌπ , ππ ) is enabled in a state S iff π π β S and πΌπ β© S = β . β‘ Definition 3.3 (semantics of reaction systems - change of state) The result of a reaction π in a state S is the set ππ if π is enabled at S and the empty set β otherwise. This result is denoted by πππ π (S). The result of the reaction system π΄ in a state S is the union of all its reactions in this state: βοΈ πππ π΄ (S) = πππ π (S) πβR β‘ Note that on completion (if it exists) of reaction system work, the entities in the difference of sets Sβπππ π΄ (S) disappear. Note also two features differing the reaction systems from cause-effect structures (or Petri nets): the lack of conflicts and possible absorption of reactants by products. These features will be taken into account in definition of semantics of reaction c-e structures in the next section. Example 3.1 (test zero) The "test zero" task (Fig. 3) may be realized in the reaction system π΄ = (B, R) with B ={π, π§, π, π }, R ={π1, π2} where π1 = ({π}, {π }, {π§}), π2 = ({π, π }, β , {π}). Result of this systemβs work depends on the initial state S0 (i.e. what the environment supplies): if S0 = {π, π } then the result is {π} ("not zero" - presence of entity at π ), if S0 = {π} then the result is {π§} ("zero" - absence of entity at π ). Reactant π initiates work of the system, while π is tested for presence/absence of entity. Evolution of the system π΄ = ({π, π§, π, π }, {π1, π2}) with initial state {π, π } is the following: πππ π1 ({π, π }) = β (because {π} β {π, π } and {π } β© {π, π } = ΜΈ β ) πππ π2 ({π, π }) = {π} (because {π, π } β {π, π } and β β© {π, π } = β ) thus πππ π΄ ({π, π }) = πππ π1 ({π, π }) βͺ πππ π2 ({π, π }) = {π} ("not zero") Evolution of the system π΄ with initial state {π} is the following: πππ π1 ({π}) = {π§} (because {π} β {π} and {π } β© {π} = β ) πππ π2 ({π}) = β (because {π, π } β {π} and β β© {π} = β ) thus πππ π΄ ({π}) = πππ π1 ({π}) βͺ πππ π2 ({π}) = {π§} ("zero") More complex example of evolution of a reaction system, that is its consecutive state changes, is in section 4. 4. Cause-effect structures working similarly to reaction systems The objective is to build a system structurally identical with c-e structures but working like reaction systems. Let us call them "reaction c-e structures" and denote by RECE. The evident counterparts of some objects in reaction c-e structures and reaction systems are the following: nodesββelements of background, firing componentsββreactions, causes in a firing componentββreactants in a reaction, effects in a firing componentββproducts in a reaction, inhibitors in a firing componentββinhibitors in a reaction, tokensββentities. The state of reaction c-e structures is a restriction of the state introduced in Definition 2.1 with added "π" to the range (codomain). Definition 4.1 (state) A state of reaction c-e structure π is a total function π : πππ(π ) β {0,1,π}. The set of all states of π is denoted by S. In the following, symbols 0 and 1 will be treated as logical values of false and true respectively and operations of propositional calculus on them will be applied. Moreover, operations β¨, β§ on π, are defined as: 0 β¨ π = π β¨ 0 = π, 0 β§ π = π β§ 0 = 0, 1 β¨ π = π β¨ 1 = π, 1 β§ π = π β§ 1 = 1, π β¨ π = π β§ π = π, Β¬π = 0. As formerly, π will be used for inhibiting actions. Interpretation of 0 and 1 as false and true is justified by absorption property of entities in reaction systems and will be made formal in Definition 4.6. β‘ The lack of conflicts requires introducing for reaction c-e structures concept called here "volley", to differ it from "salvo" for c-e structures introduced in Definition 1.5. Definition 4.2 (weights of monomials and inconsistent firing components) Given a c-e structure π = β¨πΆ, πΈβ© and its firing component π βFC[π ], let along with the pre-set β π and post-set πβ of π, some functions β π: β π β {0,1,π} and πβ : πβ β {0,1,π} be given as additional information. The value β π(π₯) is called a weight of monomial πΈ (π₯) and the value πβ (π₯) - a weight of monomial π πΆπ (π₯). For πΈπ (π₯) = π or πΆπ (π₯) = π assume respectively β π(π₯) = 0 or πβ (π₯) = 0. Additionally, β π(π₯) = 0 for π₯ β / β π and πβ (π₯) = 0 for π₯ β / πβ . As formerly, π is interpreted as a "disable signal" and used for defining inhibiting nodes. Firing components π and π are inconsistent if for a certain π₯ β β πβ β© β π β , weights β π(π₯) and β π (π₯) or πβ (π₯) and π β (π₯) are different: β π(π₯) ΜΈ= β π (π₯) or πβ (π₯) ΜΈ= π β (π₯). Note that detached π and π (Definition 1.5) are not inconsistent. β‘ Remark. Inconsistency of firing components must be avoided so that to obtain free of conflicts behaviour of the reaction c-e structures. The inconsistency is exemplified by the following c-e structure: π = {π₯0βπ¦+π§ , π¦ π₯ , π§ π₯ } containing two firing components: π = {π₯0βπ¦ , π¦ π₯ }, π = {π₯π§ π§ π₯ }, thus β π(π₯) = 0, β π (π₯) = 1. In the initial state π with π (π₯) = 1, π (π¦) = π (π§) = 0 the parallel execution of the set of firing components πΊ = {π, π } yields undetermined state of node π₯: it might be either 1 or 0. π is a direct translation of the reaction system ({π₯, π¦, π§}, {π, π }, {π₯}) with π = ({π₯}, β , {π₯, π¦}), π = ({π₯}, β , {π§}), which performs state transformation {π₯} β {π₯, π¦, π§}. The same transformation of state is performed by the reaction c-e structure π = {π₯0βπ¦+0βπ§ , π¦ π₯ , π§ π₯ }, leading to π‘(π₯) = π‘(π¦) = π‘(π§) = 1. Definition 4.3 (volley - simultaneous firing, family FCV, extension of weight functions) Any set πΊ βFC without inconsistent firing components is called their volley. The family of volleys is denoted by FCV. So, if πΊ βFC[π ] then FCV [π ] β 2FC[π ] for a c-e structure π , denotes a collection of volleys in π . The pre-set β πΊ and post-set πΊβ of a volley πΊ are defined as in Definition 1.4. Extension of the weight functions β π and πβ onto the volley πΊ are defined as follows: β π(π₯) for arbitrary π if it belongs to πΊ {οΈ β πΊ(π₯) = 0 else πβ (π₯) for arbitrary π if it belongs to πΊ {οΈ πΊβ (π₯) = 0 else This is a correct definition, since for any firing components π and π in πΊ: β π(π₯) = β π (π₯) if π₯ β β πΊ and πβ (π₯) = π β (π₯) if π₯ β πΊβ . Functions β πΊ and πΊβ will be used in definition of reaction c-e structures semantics. β‘ Definition 4.4 (inhibitors) As in Definition 2.3, for a firing component π βFC[π ], the set ππβ[π] = {π₯ β β π : β π(π₯) = π} comprises all nodes in the pre-set of π, whose effect monomials πΈπ (π₯) are of weight π. This also extends onto the volleys: ππβ[πΊ] = {π₯ β β πΊ : β πΊ(π₯) = π} where πΊ βFCV [π ]. β‘ Definition 4.5 (enabled firing components and enabled volleys) For a firing component π β FC[π ] and state π let the formula πππππππ[π](s) be defined as: βπ₯ β ππβ[π] : π (π₯) = 0 β§ βπ₯ β β πβππβ[π] : π (π₯) = 1 For a volley πΊ βFCV [π ], the formula πππππππ[πΊ](π ) is defined as above by replacing π with πΊ and FC[π ] with FCV [π ]. In the "token game" metaphor, π (or πΊ) is enabled in the state π iff none of inhibiting nodes π₯ β β π (or π₯ β β πΊ) contains a token and each remaining node contains. As formerly, the inhibiting nodes will be called inhibitors. β‘ Definition 4.6 (semantics [[ ]] of reaction c-e structures) For a volley πΊ βFCV [π ], πΊ ΜΈ= β let [[πΊ]] β S Γ S be a binary relation defined as: (π , π‘) β [[πΊ]] iff πππππππ[πΊ](π ) β§ βπ₯ β πππ(π ) : π‘(π₯) = (π (π₯) β§ Β¬β πΊ(π₯))βοΈβ¨ πΊβ (π₯) (say: πΊ transforms state π into π‘). Semantics [[π ]] of π βRECE is [[πΊ]], for any πΊβFCV [π ] maximal volley πΊ, i.e. if πΊ β πΊβ² βFCV [π ] and (π , π‘) β [[πΊβ² ]] then πΊ = πΊβ² . Closure [[π ]]* and reachability and computation are defined as in Definition 1.7. β‘ In Definition 4.6, if π₯ β β πΊ then β πΊ(π₯) ΜΈ= π, because the volley πΊ is enabled in the state π thus β πΊ(π₯) is 0 or 1. If π₯ β / β πΊβ then β πΊ(π₯) = 0 and πΊβ (π₯) = 0 hence Β¬β πΊ(π₯) = 1, thus π‘(π₯) = π (π₯) (strictly, "=" means equivalence). Evidently, formula (π (π₯) β§ Β¬β πΊ(π₯)) β¨ πΊβ (π₯) is equivalent to (π (π₯) β β πΊ(π₯)) β πΊβ (π₯). Note also that description of semantics by means of this propositional formula is justified by the property of reaction systems: presence of token ("entity") at a node absorbs another token arriving in this node. Another property of reaction systems, the lack of conflicts between different reactions, takes place in reaction c-e structures due to the lack of inconsistent firing components in πΊ βFCV [π ]. Example 4.1 (reaction c-e structure assembling a chemical molecule) A description of creating some chemical molecules presents the reaction system π΄ = ({πΆ, π», π, π, π, π, π, π, π}, {π1, π2, π3, π4, π5, π6}), starting with initial state {πΆ, π», π} and with reactions defined as follows: π1 = ({πΆ, π»}, β , {π }) π contains molecule πΆπ» (methylidyne) π2 = ({π, πΆ, π»}, β , {π }) π contains molecule πΆ2 π»2 (acetylene) π3 = ({π, π»}, β , {π }) π contains molecule πΆ2 π»3 (ethylenyl) π4 = ({π, π»}, β , {π}) π contains molecule πΆ2 π»4 (ethylene) π5 = ({π, π», π}, β , {π }) π contains molecule πΆ2 π»5 π (ethoxide) π6 = ({π, π»}, β , {π}) π contains molecule πΆ2 π»5 ππ» (ethanol) A diagram of the final result, that is the ethanol molecule, is in Fig. 4 and a certain translation of this reaction system into a reaction c-e structure is depicted in Fig. 5. Successive steps of the reaction system evolution are the following: πππ π1 ({πΆ, π», π}) = {π } (since {πΆ, π»} β {πΆ, π», π} and β β© {πΆ, π», π} = β ) πππ π2 ({πΆ, π», π}) = πππ π3 ({πΆ, π», π}) = πππ π4 ({πΆ, π», π}) = πππ π5 ({πΆ, π», π}) = πππ π6 ({πΆ, π», π}) = β thus πππ π΄ ({πΆ, π», π}) = {π } πππ π1 ({πΆ, π», π, π }) = {π } (since {πΆ, π»} β {πΆ, π», π, π } and β β© {πΆ, π», π, π } = β ) πππ π2 ({πΆ, π», π, π }) = {π } (since {πΆ, π», π } β {πΆ, π», π, π } and β β© {πΆ, π», π, π } = β ) πππ π3 ({πΆ, π», π, π }) = πππ π4 ({πΆ, π», π }) = πππ π5 ({πΆ, π», π, π }) = πππ π6 ({πΆ, π», π, π }) = β thus πππ π΄ ({πΆ, π», π, π }) = {π, π } πππ π1 ({πΆ, π», π, π, π }) = {π } (since {πΆ, π»} β {πΆ, π», π, π, π } and β β© {πΆ, π», π, π, π } = β ) πππ π2 ({πΆ, π», π, π, π }) = {π } (since {πΆ, π», π } β {πΆ, π», π, π, π } and β β© {πΆ, π», π, π, π } = β ) πππ π3 ({πΆ, π», π, π, π }) = {π } (since {π», π } β {πΆ, π», π, π, π } and β β© {πΆ, π», π, π, π } = β ) πππ π4 ({πΆ, π», π, π, π }) = πππ π5 ({πΆ, π», π, π, π }) = πππ π6 ({πΆ, π», π, π, π }) = β thus πππ π΄ ({πΆ, π», π, π, π }) = {π, π, π } πππ π1 ({πΆ, π», π, π, π, π }) = {π } (since {πΆ, π»} β {πΆ, π», π, π, π, π } and β β©{πΆ, π», π, π, π, π } = β ) πππ π2 ({πΆ, π», π, π, π, π }) = {π } (since {πΆ, π», π } β {πΆ, π», π, π, π, π } and β β© {πΆ, π», π, π, π, π } = β ) πππ π3 ({πΆ, π», π, π, π, π }) = {π } (since {π», π } β {πΆ, π», π, π, π, π } and β β©{πΆ, π», π, π, π, π } = β ) πππ π4 ({πΆ, π», π, π, π, π }) = {π} (since {π», π } β {πΆ, π», π, π, π, π } and β β©{πΆ, π», π, π, π, π } = β ) πππ π5 ({πΆ, π», π, π, π, π }) = πππ π6 ({πΆ, π», π, π, π, π }) = β thus πππ π΄ ({πΆ, π», π, π, π, π }) = {π, π, π, π} πππ π1 ({πΆ, π», π, π, π, π, π}) = {π } (since {πΆ, π»} β {πΆ, π», π, π, π, π, π} and β β© {πΆ, π», π, π, π, π, π} = β ) πππ π2 ({πΆ, π», π, π, π, π, π}) = {π } (since {πΆ, π», π } β {πΆ, π», π, π, π, π, π} and β β© {πΆ, π», π, π, π, π, π} = β ) πππ π3 ({πΆ, π», π, π, π, π, π}) = {π } (since {π», π } β {πΆ, π», π, π, π, π, π} and β β© {πΆ, π», π, π, π, π, π} = β ) πππ π4 ({πΆ, π», π, π, π, π, π}) = {π} (since {π», π } β {πΆ, π», π, π, π, π, π} and β β© {πΆ, π», π, π, π, π, π} = β ) πππ π5 ({πΆ, π», π, π, π, π, π}) = {π } (since {π», π, π} β {πΆ, π», π, π, π, π, π} and β β© {πΆ, π», π, π, π, π, π} = β ) πππ π6 ({πΆ, π», π, π, π, π, π}) = β ) thus πππ π΄ ({πΆ, π», π, π, π, π, π}) = {π, π, π, π, π } πππ π1 ({πΆ, π», π, π, π, π, π, π }) = {π } (since {πΆ, π»} β {πΆ, π», π, π, π, π, π, π } and β β© {πΆ, π», π, π, π, π, π, π } = β ) πππ π2 ({πΆ, π», π, π, π, π, π, π }) = {π } (since {πΆ, π», π } β {πΆ, π», π, π, π, π, π, π } and β β© {πΆ, π», π, π, π, π, π, π } = β ) πππ π3 ({πΆ, π», π, π, π, π, π, π }) = {π } (since {π», π } β {πΆ, π», π, π, π, π, π, π } and β β© {πΆ, π», π, π, π, π, π, π } = β ) πππ π4 ({πΆ, π», π, π, π, π, π, π }) = {π} (since {π», π } β {πΆ, π», π, π, π, π, π, π } and β β© {πΆ, π», π, π, π, π, π, π } = β ) πππ π5 ({πΆ, π», π, π, π, π, π, π }) = {π } (since {π», π, π} β {πΆ, π», π, π, π, π, π, π } and β β© {πΆ, π», π, π, π, π, π, π } = β ) πππ π6 ({πΆ, π», π, π, π, π, π, π }) = {π} (since {π», π } β {πΆ, π», π, π, π, π, π, π } and β β© {πΆ, π», π, π, π, π, π, π } = β ) thus πππ π΄ ({πΆ, π», π, π, π, π, π, π }) = {π, π, π, π, π, π} Figure 4: Diagram of ethanol. C, H, O - symbols of Carbon, Hydrogen and Oxygen atoms. Figure 5: A c-e structure with initial state π (πΆ) = π (π») = π (π) = 1 (and empty remaining nodes) imitating behaviour of reaction system π΄ specified in Example 4.1. Regarding it as a translation of π΄, note that nodes π1, π2, β1, β2, β3, β4, β5, β6 are some "artifacts" of this fairly liberal translation and have no counterparts in π΄. Intuitively, they might be seen as holding single atoms of elements πΆ and π». References [Bar 2018] Barbutti R., Bove P., Gori R., Levi F., Milazzo P., Simulating Gene Regulatory Networks using Reaction Systems, Proceedings of Concurrency, Specification and Programming 2018, pp. 119-132 [Cza 2019] Czaja L. Cause-Effect Structures. An Algebra of Nets with Examples of Application, Lecture Notes in Networks and Systems 45, Springer 2019 [Dut 2018] Dutta S., Jankowski A., Rozenberg G., Skowron A., Linking Reaction Systems with Rough Sets. Fundamenta Informaticae 165(3-4): 283-302 (2019) [Ehr 2007] Ehrenfeucht A., Rozenberg G.: Reaction systems. Fundamenta Informaticae 75 (2007), pp. 263-280 [Ehr 2017] Ehrenfeucht A, Petre I., Rozenberg G., Reaction Systems: A Model of Computation Inspired by the Functioning of the Living Cell, in: The Role of Theory in Computer Science, Essays Dedicated to Janusz Brzozowski, edited by Stavros Konstantinidis, Nelma Moreira, RogΓ©rio Reis and Jeffrey Shallit, World Scientific 2017, pp.1-32 [Gor 2018] Gori R., Gruska D., Milazzo P., Hidden States in Reaction Systems, Proceedings of Concurrency, Specification and Programming 2018, pp. 133-144 [Kle 2011] Kleijn J., Kountny M., Rozenberg G., Modelling Reaction Systems with Petri Nets, in: Proc. of the International Workshop on Biological Processes & Petri Nets (BioPPN 2011), pp. 36β52