• No results found

4.3 Modular Systems

4.3.3 Fixpoint Semantics for Modular Systems

In Section 6.1, we mentioned that one of the motivating factors behind the development of modular systems was their broad applicability to model the steady state analysis and the transient state anal-ysis of complex systems. In Section 4.3.2, we defined the intended models of a modular system.

However, in order to analyze steady and/or transient states of a system in terms of its modular rep-resentation, we should first have a natural definition of the state of a modular system as well as the necessary means to view a modular system as an operator on this state. In this section, we introduce a new semantics for modular systems called fixpoint semantics. As we see in this section, while our fixpoint semantics is very closely related to our model-theoretical semantics, it views modular systems in an intrinsically different way as operators on some states.

The the operational view that we introduce in this section enables us to obtain interesting results about our modular systems such as approximability of a sub-class of modular systems. Moreover, the concept of time naturally arises from our operational view towards modular systems. We will briefly review this concept in the end of this section and discuss the close relation between our concept of time in modular systems and the transient state analysis in an engineering system. The full treatment of this concept would be the subject of a future research.

Before defining the fixpoint semantics of modular systems, we first define the concept of a state of a modular system. Then, to each modular system, we associate an operator that operators on a state of a modular system. Next, as we will see later on, our fixpoint semantics would be simply defined as the fixpoints of that operator.

Definition 4.10 (State of a Modular Systems) Let M ∈ MS(σ, ε) be a modular system. Then a state of the modular system M is simply a τ -structure such that (σ ∪ ε) ⊆ τ .

Now, let us associate with a modular system an operator on states of that modular system as follows:

Definition 4.11 (Operational View on Modular Systems) Let M ∈ MS(σ, ε) be a modular sys-tem and letτ -structure B1be a state ofM . Now, we say that a τ -structure B2is a result of applying (non-deterministic) operator M on B1, denoted as eitherB1JM KB2 orB2 ∈JM K(B1) and defined as follows:

Base Case, Primitive Modules: B1JM KB2 if and only ifB2|σ∪ε ∈ M , and, B2|(τ \ε)= B1|(τ \ε)2,

2In particular, it means thatB1andB2should have the same domain.

Projection: If M := π(σ∪ε)(M0) (with M0 ∈ MS(σ0, ε0)) then B1JM KB2 if and only if(σ0∪ ε0

Intuitively, the operator associated with a modular system M takes a structure B and generates B0by changing interpretations of the expansion vocabulary such that the result is a structure in M . This goal is attained through an operational means with a very natural meaning for each connective in our modular framework. For example, the meaning of connective is a sequential composition of the two modular systems. Also, connective ∪ gives a non-deterministic choice on which modular system to execute and the feedback operator defines a loop. Among different cases of Definition 4.11, the two cases of projection and feedback are the most complex ones. Figures 4.2 and 4.3 illustrate the internal operations of these two operators.

Definition 4.11 gives an alternative semantics to a combined modular system. Unlike Definition 4.7 that treated modular systems as sets of structures, in Definition 4.11, modular systems are viewed as non-deterministic operators mapping structures to structures. Now that we have this operational view on modular systems, we can define the fixpoint semantics of a modular system simply as the fixpoint of their corresponding operator.

B1 expand B01 apply M0 B20 project B3

Figure 4.2: Module M := πτ(M0) operates by (a) expanding vocabulary of input B1, (b) applying M0 to expanded input, and, (c) projecting the result of application of M0.

B1 B01

B02

B11

B21

B1i

B2i

Bn1 B2

copy applyM 0

R:=S applyM 0

R:=S applyM 0

R:=S

copy

Figure 4.3: Module M := M0[R = S] operates by repeatedly applying M0 on the given structure and copying interpretation of S into interpretation of R until it reaches a fixpoint of M0.

Definition 4.12 (Fixpoint Semantics of Modular Systems) Let M ∈ MS(σ, ε) be a modular sys-tem andB be a τ -structure (with τ ⊇ (σ ∪ ε)). We say that B is a fixpoint of M if and only if B ∈JM K(B) (or, equivalently but with a different notation: BJM KB).

The following theorem shows that fixpoint semantics of modular systems coincides with the model-theoretic definition of a modular system:

Theorem 4.1 (Fixpoint Semantics = Model-theoretical Semantics) Let M be a modular system.

Then, for everyτ -structure B:

B ∈JM K(B) ⇐⇒ B|vocab(M )∈ M.

The most important consequence of Theorem 4.1 is that all the results obtained when modules are viewed as operators, remain valid when modules are viewed as sets of structures (and vice versa).

Thus, in this chapter, we may use either of these semantics.

Remark 4.2 Notice that both our model-theoretic semantics for modular system and our fixpoint semantics for modular systems are defined so that they do not put any finiteness restriction on the domains of structures. Thus, our modular system framework readily supports working on modules with infinite structures.

σ M

τ ε τ

B1 B2

Figure 4.4: Module M ∈ MS(σ, ε) maps a τ -structure B1(with τ ⊇ (σ ∪ ε)) to a τ -structure B2by changing the interpretation of vocabulary symbols in ε according to the models of M (so that the σ part and the new ε part, together, form a model of M ). Interpretation of all other symbols, including those in σ, stays the same.

The theorem that follows shows another important correspondence between our fixpoint seman-tics and our model-theoretical semanseman-tics.

Theorem 4.2 (Dual View on Modular Systems) Let M ∈ MS(σ, ε) and also let B1andB2be two τ -structures such that B1JM KB2. Now, defineB to be a (σ ∪ ε)-structure such that: (1) dom(B) = dom(B1) = dom(B2), (2) B|σ = B1|σ, and, (3)B|ε= B2|ε. Then,B ∈ M .

The importance of Theorem 4.2 is to show how a modular system changes its state. This is also illustrated by Fiqure 4.4. Figure 4.4 shows that a modular system M ∈ MS(σ, ε) changes only the ε interpretations of the state and everything else (including σ) remains unchanged. This is similar to how frame axioms keep fluents that are not affected by actions unchanged in sequent calculus.

Structural Operational Semantics.

We have just introduced operational view on modular systems and the corresponding fixpoint se-mantics of modular systems. Now, we want to define the operational sese-mantics of modular systems that is closely related to the operational view we developed above.

In this part, as in the operational view on modular systems, the vocabulary of structures include both the input and output vocabularies of M , i.e., σ ∪ ε ⊆ τ . Below, we give a structural operational semantics for the algebra of modular systems. The semantics is structural because, for example, the meaning of the sequential composition, M1  M2, is defined through the meaning of M1 and the meaning of M2. We start by defining the rules of structural operational semantics for modular systems.

Primitive modules.: If M ∈ MS(σ, ε) is a primitive module, then the only possible structural operational rule for M is as follows:

(M, B1) −→ B2

true if B2|(σ∪ε)∈ M and B2|(τ \ε)= B1|(τ \ε).

Projection.: The only possible structural operational rule for modular system πν(M ) is as follows:

ν(M ), B1) −→ B2

(M, B10) −→ B20 if B10|ν = B1|ν and B20|ν = B2|ν.

Composition.: The only possible structural operational rule for modular system M1  M2 is as follows:

(M1 M2, B1) −→ B2

(M1, B1) −→ B0 and (M2, B0) −→ B2.

Union.: For modular system M1∪ M2, there exist two possible structural operational rules:

(M1∪ M2, B1) −→ B2 (M1, B1) −→ B2

, (M1∪ M2, B1) −→ B2 (M2, B1) −→ B2

.

Feedback.: For modular system M [R = S], there are also two structural operational rules that follow:

(M [R = S], B) −→ B

(M, B) −→ B , (M [R = S], B1) −→ B2

(M, B1) −→ B0and (M [R = S], B0[R := S]) −→ B2, where B0[R := S] is a τ -structure B00that agrees with B0on both its domain and the interpretations of all symbols in τ except R. Also, the interpretation of R in B00is a copy of the interpretation of S in B0.

Definition 4.13 (Derivability) For a well-defined modular system M , we say that (M, B1) −→ B2 is derivable if we can apply the rules of the structural operational semantics starting from this expression and arriving totrue.

Theorem 4.3 (Structural Operational Semantics = Operational View) Let M ∈ MS(σ, ε) be a well-formed modular system. Then, for allτ -structures B1andB2(withτ ⊇ (σ ∪ ε)):

B2∈JM K(B1) if and only if (M, B1) −→ B2 is derivable.

Theorem 4.3 shows that, indeed, the operator we define for each modular system M (through our operational view on modular systems) precisely corresponds to the meaning of modular system M according to structural operational semantics. Note that both structural operational semantics

and our operational view on modular systems give a closer correspondence to the inner working of a modular system than the model-theoretical semantics. This is because, our model-theoretical semantics considers only the fixpoints of the operator associated to a modular system while our operational view (and our operational semantics) define the operator itself and can thus be used to talk about both the transient states of a modular system as well as its steady states (fixpoints).

Further study of the transient states of modular systems is the subject of future research.