Weighted propositional configuration logics: A specification language for architectures with quantitative features
Paulina Paraponiari, George Rahonis

TL;DR
This paper presents a weighted propositional configuration logic over commutative semirings designed as a specification language for software architectures with quantitative features, including normal form construction and formula equivalence decidability.
Contribution
It introduces a novel weighted logic for architecture specifications, providing normal forms and decidability results for formulas involving quantitative features.
Findings
Normal form construction is efficient
Decidability of formula equivalence is established
Application to well-known architectures with quantitative traits
Abstract
We introduce and investigate a weighted propositional configuration logic over commutative semirings. Our logic is intended to serve as a specification language for software architectures with quantitative features. We prove an efficient construction of full normal forms and decidability of equivalence of formulas in this logic. We illustrate the motivation of this work by describing well-known architectures equipped with quantitative characteristics using formulas in our logic.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Weighted propositional configuration logics: A specification language for architectures with quantitative features
Paulina Paraponiaria, George Rahonis*b,*111Corresponding author
Department of Mathematics
Aristotle University of Thessaloniki
54124 Thessaloniki, Greece
a[email protected], b[email protected]
Abstract
We introduce and investigate a weighted propositional configuration logic over commutative semirings. Our logic is intended to serve as a specification language for software architectures with quantitative features. We prove an efficient construction of full normal forms and decidability of equivalence of formulas in this logic. We illustrate the motivation of this work by describing well-known architectures equipped with quantitative characteristics using formulas in our logic.
Keywords: Software architectures, Propositional configuration logic, Weighted propositional configuration logic
1 Introduction
Architecture is a critical issue in design and development of complex software systems. Whenever the construction of a software system is based on a “good” architecture, then the system satisfies most of its functional and quality requirements. But what are the characteristics of a “good” architecture and how can one design it? Despite the huge progress on software architecture, over almost three decades, the field remains relatively immature (cf. [8] for a detailed presentation of the progress of software architecture). Several fundamental matters still remain open, for instance the distinction between architectures and their properties. To address these issues there is a need of a formal treatment of architectures. The very recent work of [12] contributes towards this direction by studying the relation among architectures and architecture styles. An architecture consists of a fixed number of components connected in a concrete topology. An architecture style describes a family of “similar” architectures, i.e., architectures with the same types of components and topologies. The authors of [12] introduced the propositional configuration logic (PCL for short) which was proved sufficient to describe architectures: the meaning of every PCL formula is a configuration set, which intuitively represents permissible component connections, and every architecture can be represented by a configuration set on the collection of its components. The first-order and second-order extensions of PCL described perfectly the concept of architecture styles. Therefore, PCL and its first- and second-order extensions constitute logics for the specification of architecture styles and hence, an important contribution to rigorous systems design (cf. [16]).
In this paper we extend the work of [12] in a quantitative setup, and specifically we introduce and investigate a weighted PCL (wPCL for short) over a commutative semiring . Our work is motivated as follows. Propositional configuration logic of [12] describes in a strict mathematical way qualitative features of architectures. Nevertheless, in several practical applications also quantitative characteristics of architectures are required: the costs of the interactions among the components of an architecture, the time needed, the probability of the implementation of a concrete interaction, etc. For instance, the development of IoT and cloud applications based on the well-known Publish/Subscribe architecture [15, 13, 17] requires quantitative characteristics of the architecture. Therefore, a specification language for the study of weighted architectures is needed and our wPCL is intended to play this role. wPCL consists of the PCL of [12] which is interpreted in the same way, and a copy of it which is interpreted quantitatively. This formulation has the advantage that practitioners can use the PCL exactly as they are used to, and the copy of it for the quantitative interpretation. The semantics of wPCL formulas are polynomials with values in the semiring . The semantics of the unweighted PCL formulas take only the values and [math] corresponding to and , respectively. Weighted logics have been considered so far in other set-ups (cf. for instance [5]).
The main contributions of our work are the following.
- i)
In our first main result, we prove that for every wPCL formula we can effectively construct, in doubly exponential time, an equivalent one in full normal form which is unique up to the equivalence relation. Computation of full normal forms can be done in an automatic way using the Maude system, following a method similar to the one for PCL in [12].
- ii)
The second main result of our work states the decidability of equivalence of wPCL formulas. Because of (i), two wPCL formulas are equivalent iff they have the same full normal form hence, we do not need to check equality for all possible models.
- iii)
We introduce a notion of soundness (for the first time for weighted logics over semirings, according to our best knowledge), and as a third main result of the paper we show that wPCL is sound.
- iv)
We succeed to describe in a strict logical way several well-known software architectures with additional quantitative characteristics, which are motivated by real applications.
A preliminary version of this paper appeared in [14].
2 Preliminaries
A semiring * *consists of a set two binary operations and and two constant elements [math] and such that is a commutative monoid, is a monoid, multiplication distributes over addition , and for every . If the monoid is commutative, then the semiring is called commutative. The semiring is denoted simply by if the operations and the constant elements are understood. The result of the empty product as usual equals to . The semiring is called (additively) idempotent if for every . The following algebraic structures are well-known semirings. The semiring of natural numbers, the Boolean semiring , the tropical or min-plus semiring where , the arctical or max-plus semiring , the Viterbi semiring used in probability theory, and every bounded distributive lattice with the operations and .
Let be a set. A formal series (or simply series) over and is a mapping . The support of is the set . A series with finite support is also called a polynomial. We denote by the class of all polynomials over and . Let and . The sum , the products with scalars and , and the* Hadamard product* are defined elementwise, respectively by for every .
Throughout the paper will denote a commutative semiring.
3 Weighted propositional interaction logic
In this section, we introduce the weighted propositional interaction logic. For this, we need to recall the propositional interaction logic [12] first.
Let be a nonempty finite set of ports. We let , where denotes the power set of . Every set is called an interaction. The syntax of propositional interaction logic (PIL for short) formulas over is given by the grammar
[TABLE]
where . As usual, we set for every PIL formula and . Then, the conjunction of two PIL formulas is defined by . A PIL formula of the form with , and or with for every , is called a monomial. We shall simply denote a monomial by .
Let be a PIL formula and an interaction. We define the satisfaction relation by induction on the structure of as follows:
,
- -
iff ,
- -
iff ,
- -
iff or .
It should be clear that for every . For every interaction we define its characteristic monomial . Then, for every we trivially get iff .
Throughout the paper will denote a nonempty finite set of ports.
Definition 1
The syntax of formulas of the weighted PIL (wPIL for short) over and is given by the grammar
[TABLE]
where and denotes a PIL formula over .
We denote by the set of all wPIL formulas over and . Next, we represent the semantics of formulas as polynomials 222Since is finite, the domain of is finite and in turn its support is also finite.. For the semantics of PIL formulas we use the satisfaction relation as defined above. In this way, we ensure that the semantics of PIL formulas gets only the values [math] and .
Definition 2
Let . The semantics of is a polynomial where for every the value is defined inductively on the structure of as follows:
**
- -
\left\|\phi\right\|(a)=\left\{\begin{array}[c]{rl}1&\textnormal{ if }a\models_{i}\phi\\ 0&\textnormal{ otherwise}\end{array},\right.**
- -
**
- -
**
The reader should note that the semantics of the wPIL formulas and , where is a PIL formula, are different. Indeed assume that is such that . Then, by our definition above, we get whereas . Next we present an example of a wPIL formula.
Example 3
We recall from [12] the Master/Slave architecture for two masters and two slaves with ports and , respectively (Figure 1). The monomial for every defines the binary interaction between the ports and . For every we consider a value and the wPIL formula . Hence, can be considered, according to the underlying semiring, as the “cost” for the implementation of the interaction . For instance if is the Viterbi semiring, then the value represents the probability of the implementation of the interaction between the ports and .
4 Weighted propositional configuration logic
In this section, we introduce and investigate the weighted propositional configuration logic. Firstly, we recall the configuration logic from [12]. More precisely, the syntax of *propositional configuration logic *(PCL for short) formulas over is given by the grammar
[TABLE]
where denotes a PIL formula over . The operators , , and are called *complementation, union, *and coalescing, respectively. We define also the intersection and implication operators, respectively as follows:
To avoid any confusion, every PCL formula which is a PIL formula will be called an interaction formula. We let . For every PCL formula and we define the satisfaction relation inductively on the structure of as follows:
- -
iff for every
- -
iff
- -
iff or
- -
iff there exist such that , and and
Trivially, we get
-
iff and and
-
iff or
We define the closure of every PCL formula by
- ,
and the disjunction of two PCL formulas and by
- .
Two PCL formulas are called equivalent, and we denote it by whenever iff for every . A PCL formula is called downward-closed if implies for every , and is called -closed if and implies .
In the subsequent Propositions 4-(i) we recall from [12] properties of PCL formulas that will be needed in the sequel. We refer the reader to [12] for further properties of PCL formulas.
Proposition 4
A PCL formula is -closed and downward-closed iff it is an interaction formula.
Proposition 5
Let be interaction formulas. Then
- i)
.
- ii)
.
Due to Proposition 5(ii) we denote, in the sequel, both conjunction and intersection operations of PCL formulas with the same symbol .
Proposition 6
- (i)
The operators , , satisfy the usual axioms of propositional logic.
- (ii)
The coalescing operation is associative, commutative, and has as an absorbing element.
Next we introduce our weighted PCL.
Definition 7
The syntax of formulas of the weighted PCL (wPCL for short) over and is given by the grammar
[TABLE]
where , denotes a PCL formula over , and denotes the coalescing operator among wPCL formulas.
Again, as for PCL formulas, to avoid any confusion, every wPCL formula which is a wPIL formula will be called a weighted interaction formula. We denote by the set of all wPCL formulas over and . We represent the semantics of formulas as polynomials . For the semantics of PCL formulas we use the satisfaction relation as defined previously.
Definition 8
Let . The semantics of is a polynomial where for every the value is defined inductively as follows:
**
- -
\left\|f\right\|(\gamma)=\left\{\begin{array}[c]{rl}1&\textnormal{ if }\gamma\models f\\ 0&\textnormal{ otherwise}\end{array},\right.**
- -
**
- -
**
- -
**
where denotes the disjoint union of the sets and .
Since the semantics of every wPCL formula is defined on , the sets and in are nonempty. Two wPCL formulas are called equivalent, and we write , whenever . The *closure * of every wPCL formula is determined by:
- .
Lemma 9
Let . Then
[TABLE]
for every .
Proof. We compute
[TABLE]
for every , where the fourth equality holds since and are disjoint.
Remark 10
The reader should notice the difference in the definition of semantics among coalescing in PCL, taken from [12], and coalescing in wPCL. Though is not required to be a partition of for coalescing in PCL, it is used like that in all considered software architectures [12]. More precisely, let us assume that is a subformula of a PCL formula over representing an architecture. This means that describes the topology of a part of the architecture and the topology of another part of the architecture. The two parts may have common components but not the same connections (interactions). Hence, if , then a subset of satisfies and its complement (according to ) satisfies . Therefore, our definition of coalescing in wPCL does not decrease its usefulness to the description of architectures. On the other hand, our definition intents also to the truth of Lemma 9 which is important for the description of architectures with quantitative characteristics, as it is the corresponding result in PCL (cf. Statement after Definition 4.22 in [12]).
Example 11** (Example 3 continued)**
The four possible configurations of the Master/Slave architecture for two masters and two slaves with ports and , respectively (Figure 1), are given by the PCL formula We consider the wPCL formula
[TABLE]
Then for we get
[TABLE]
Let for instance and . Then the value
[TABLE]
is the minimum “cost” among all the implementations of the Master/Slave architecture.
In the sequel, we state several properties of our wPCL formulas.
Proposition 12
Let . Then
- (i)
**
- (ii)
**
- (iii)
**
- (iv)
**
Proof. We prove only (i) and (iv), the other two statements are straightforward. Let . Then
[TABLE]
and hence , as required.
Next
[TABLE]
and we are done.
We aim to show that does not distribute, in general, over . For this, we consider the semiring of natural numbers, the set of ports and the formulas with and . We let . Then
[TABLE]
whereas
[TABLE]
Hence . Nevertheless, this is not the case whenever is a PIL formula. More precisely, we state the subsequent proposition.
Proposition 13
Let be a PIL formula over and . Then
[TABLE]
Proof. For every we have
[TABLE]
We distinguish two cases.
- •
. Then by definition, which, by Proposition 4, implies that , and hence for every . Therefore, we get
[TABLE]
- •
. Hence , i.e., there is an such that . This in turn implies that for every with . Therefore, we get
[TABLE]
and
[TABLE]
i.e.,
[TABLE]
and this concludes our proof.
Proposition 14
Let . Then
- (i)
**
If in addition is idempotent, then
- (ii)
**
- (iii)
**
Proof. For every we have
(i)
[TABLE]
(ii)
[TABLE]
where the third equality holds since is idempotent333For instance, if , then the product occurs only once in the left-hand side of the third equality, but two times in the right-hand side one..
(iii)
[TABLE]
where the third equality holds by the idempotency property of .
In the subsequent examples, we present wPCL formulas describing well-known architectures equipped with quantitative features.
Example 15** (Weighted Star architecture)**
Star architecture is a software architecture relating components of the same type. More precisely, given a set of components one of them is considered as the central component and is connected to every other component through a binary interaction. No other interactions are permitted.
Next, we build a wPCL formula representing the Star architecture with five components. We assume that every component has a single port and let and . For simplicity we call every component by its port name. Let us consider firstly that is the central component. The architecture is illustrated in Figure 2. We denote by the weight of the binary interaction between and for every . The wPIL formula characterizing this interaction, for every , is given by . Since interacts with all the other ports, the Star architecture is described by the subsequent wPCL formula:
[TABLE]
Now, we consider the case where every component in the architecture can be the central one, hence we get five versions of the Star architecture with five components. By assuming that the weight of every interaction refers to the cost of its implementation, we should like to compute which version of the Star architecture has the minimum cost and which one has the maximum cost. Therefore, we consider for every the corresponding architecture with being the central component. We denote by the weight of the binary interaction between the central component and the component with . The wPCL formula characterizing this interaction is given by . Therefore, the wPCL formula
[TABLE]
describes the binary interactions of the central component with the rest of all the other components. We conclude to the next wPCL formula which describes the five alternative versions of the Star architecture, derived by five components, and the total cost:
[TABLE]
Hence, for (resp. ) and we get the architecture with the minimum (resp. maximum) cost.
Example 16** (Weighted Pipes and Filters architecture)**
The Pipes and Filters architecture (cf. [9]) involves two types of components, the pipes and the filters denoted respectively, by the letters and . Every component has two ports and , and every component has also two ports and (Figure 3). Every (resp. ) port of a filter is connected to a (resp. ) port of a single pipe. The port of any pipe can be connected to at most one filter port .
In our example, we develop a wPCL formula characterizing the Pipes and Filters architecture for four pipes and three filters. For this, we let and denote the three filter components by with ports and for , respectively. Similarly, we let and denote the four pipe components by with ports and for , respectively. Hence, the set of all ports is determined by . For every and we shall denote by the weight of the interaction among the ports and . Similarly, for every and the weight of the interaction between the ports and is denoted by The wPCL formula that formalizes the interactions between input ports of filters and output ports of pipes with the corresponding weights is
[TABLE]
whereas the wPCL formula
[TABLE]
describes the interactions and their weights among output ports of filters and input ports of pipes. Furthermore, we need to ensure that the output of a pipe can be connected to at most one input of a filter, and that the pipes can be connected only with filters and vice-versa. These requirements are satisfied respectively, by the following PCL formulas:
[TABLE]
We conclude to the wPCL formula
[TABLE]
for the weighted Pipes and Filters architecture for four pipes and three filters.
Example 17** (Weighted Publish/Subscribe architecture)**
Publish/Subscribe* is a software architecture, relating publishers who send messages, and receivers called subscribers (cf. for instance [7, 11]). The main characteristics of this architecture are as follows. The publishers characterize messages according to classes/topics but they do not know whether there is any subscriber who is interested in a concrete topic. Subscribers, on the other hand, express their interest in one or more topics and receive all messages published to the topics to which they subscribe. All subscribers which are subscribed to a topic will receive the same messages in case such messages exist (Figure 4). A main problem in Publish/Subscribe architecture refers to the priority according to which a topic receives messages from the publishers as well as the priority according to which a subscriber receives messages from several topics (cf. for instance [2, 3, 18]). Recent applications in IoT framework as well as in cloud platforms incorporate Publish/Subscribe architecture (cf. for instance [13, 15, 17]).*
In the sequel, we develop a wPCL formula for the Publish/Subscribe architecture where, according to the semiring used, the weights represent in a natural way the aforementioned priorities. More precisely, we assign weights, describing priorities, to interactions among publishers and topics, and to interactions among topics and subscribers. We consider three types of components namely, publishers, topics, and subscribers denoted by the letters , respectively. Component has one port , has two ports and , and has the port .
In our example we assume two publisher components with ports respectively, four subscriber components with ports respectively, and three topic components with sets of ports , , and respectively. Therefore, the set of all ports is given by . For every , , and we denote by the weight of the interaction among and , i.e., the priority that the subscriber assigns to the receivement of a message from , and by the weight of the interaction among and , i.e., the priority that the topic assigns to the receivement of a message from . The PIL formula for the interaction between a publisher and a topic , for every and , is given by and the wPIL formula characterizing this interaction with its corresponding weight is determined by Hence, the wPCL formula
[TABLE]
for , describes the weighted interactions of the topic with the publishers and and thus
[TABLE]
refers to the weighted part of the Publish/Subscribe architecture among the concrete topic and the publishers and .
Next we build wPCL formulas for the description of the interactions among subscribers and topics. More precisely, for every and , the PIL formula describes the interaction between the subscriber and the topic , and the wPIL formula formalizes this interaction with its corresponding weight. Then, the wPCL formula
[TABLE]
characterizes the weighted interactions of subscriber with topics , , and .
Finally, for every , we consider the wPCL formula
[TABLE]
which describes the behavior of subscriber with publishers and topics .
For instance, let us consider the subscriber , the set of interactions
[TABLE]
and . Then, the value represents the maximum priority with which the subscriber will receive a message. Similarly, for , the value corresponds to the minimum priority with which receives a message, whereas if is the Viterbi semiring, it assigns the maximum probability for the receivement of the topics by .
5 A full normal form for wPCL formulas
In the present section, we show that for every wPCL formula over and we can effectively compute an equivalent formula of a special form. For this, we will use a corresponding result from [12], namely for every PCL formula over we can effectively construct a unique equivalent PCL formula of the form 444This trivial case is not considered in [12] but we refer to this in order to show the correspondence with wPCL formulas for . or which is called *full normal form *(cf. Theorem 4.43. in [12]). The index sets and , for every , are finite and ’s are full monomials, i.e., monomials of the form with and . Here we firstly prove that the worst case run time for the construction of the full normal form is doubly exponential, whereas the best case is exponential. Then we show that we can effectively build a unique full normal form for every wPCL formula . Uniqueness is up to the equivalence relation, and interestingly our algorithm requires the same time complexity as the corresponding one in the boolean case. Then we will use our translation result to show that the equivalence problem for wPCL formulas is decidable.
We start with the subsequent theorem which states the complexity of the construction of full normal forms for PCL formulas.
Theorem 18
Let be a set of ports. Then, for every PCL formula over we can effectively construct, in doubly exponential time, an equivalent PCL formula in full normal form. The best run time for the construction of is exponential. Furthermore, is unique up to equivalence relation.
Proof. The construction of and its uniqueness has been proved in Theorem 4.43. in [12]. Therefore, we only deal with the complexity result. For this we recall, from [12], the transformations applied to for the construction of . More precisely, firstly the following rewriting rules are applied for the construction of a PCL formula in normal form which is equivalent to :
[TABLE]
[TABLE]
[TABLE]
Then, every non-full monomial in is transformed into a disjunction of full monomials. This is done in exponential time, since all the subsets of the set are computed. Then using the rewriting rule
[TABLE]
every disjunction of full monomials is transformed into a union of coalesced full monomials. Trivially, the application of the last rewriting rule on the derived disjunctions of full monomials needs again exponential time. Therefore, the application of the above rewriting rules requires at most doubly exponential time. This implies that the worst case run time for the computation of is doubly exponential. On the other hand, if every monomial in above is already full, then obviously the best run time for the computation of is exponential, and this concludes our proof.
Next we introduce the notion of full normal form for wPCL formulas.
Definition 19
*A wPCL formula is said to be in *full normal form if either
- •
* with , or*
- •
there are finite index sets and for every , for every , and full monomials for every and such that .
By our definition above, for every full normal form we can construct an equivalent one satisfying the following statements:
- i)
implies for every , , and
- ii)
implies for every .
Indeed, for the first one, if for some , then since are interaction formulas, by Proposition 5(i), we can replace the coalescing with . For (ii), let us assume that for some . Then, we can replace the sum with the equivalent one . Hence, in the sequel, we assume that every full normal form satisfies Statements (i) and (ii).
We intend to show that for every wPCL formula we can effectively construct an equivalent wPCL formula in full normal form. Moreover, will be unique up to the equivalence relation555Since wPCL formulas are defined syntactically, we get for instance whereas .. We shall need a sequence of preliminary results. All index sets occurring in the sequel are finite.
Lemma 20
Let and . Then
[TABLE]
Proof. For every we have
[TABLE]
where the first equivalence holds by commutativity of .
Lemma 21
Let be an index set and a full monomial for every . Then, there exists a unique such that for every we have if and otherwise.
Proof. For every , , there exists a unique interaction such that . Then, it is straightforward to show that satisfies our claim.
Proposition 22
Let be a formula over . Then there exist finite index sets and for every , and full monomials for every and such that
[TABLE]
Proof. By Theorem 4.43. in [12] there exists a unique full normal form such that where are full monomials. Using similar arguments as the ones after Definition 19 we can assume, without any loss, that the full normal form satisfies Statements (i) and (ii). By Lemma 21, for every there exists a unique such that for every we have if and otherwise. Then we have
[TABLE]
for every , where the last but one equality holds by Statement (ii). Hence we get and we are done.
Lemma 23
Let be full monomials for every and . Then
[TABLE]
Proof. By Lemma 21 there exist such that for every we have if and otherwise, and if and otherwise. Therefore, for every we get
[TABLE]
which concludes our claim.
Lemma 24
Let be full monomials for every and . If for some and , then
[TABLE]
Proof. By Lemma 21 there exist such that for every we have if and otherwise, and if and otherwise. Therefore, if , then by definition of the coalescing operator on wPCL formulas, we get
[TABLE]
for every , and this concludes our claim.
Theorem 25
Let be a commutative semiring and a set of ports. Then, for every wPCL formula we can effectively construct an equivalent wPCL formula in full normal form which is unique up to the equivalence relation. The worst case run time for the construction algorithm is doubly exponential and the best case is exponential.
Proof. We prove our theorem by induction on the structure of wPCL formulas over and . If with , then we have nothing to prove. Though, we shall need to use instead the equivalent full normal form where is the set of all full monomials over such that for every if , then . Next let be a PCL formula. Then, we conclude our claim by Proposition 22.
Assume now that and let and be their equivalent full normal forms, respectively.
Let firstly and assume that not both of , are constants in . We consider the formula . If for every and , then we set . If this is not the case, let us assume that for some and . Then we have
[TABLE]
We continue in the same way, and we conclude to a full normal form , which, by construction, it is equivalent to .
If and with , then we let .
Next let and assume that neither nor is a constant in . We set
and we have
[TABLE]
where the second equivalence follows by the distributivity property of .
Now, we translate to an equivalent full normal form as follows. By Lemma 23, for every , , we get if , and otherwise. Hence, in the first case we replace by , whereas in the second case by [math]. Obviously, is the required full normal form.
If (resp. ) with , then we set (resp. . If and with , then we let .
Finally let . We set
where and are defined for every and respectively, as follows. If for every and , then we set and , otherwise we let . Then we get
[TABLE]
where the first equivalence holds by definition of () and () and Lemma 24. The second equivalence follows by Lemma 20, and the third and fourth ones by Proposition 12(iv). By definition of for every and for every , we conclude that is the required full normal form satisfying Statements (i) and (ii).
Therefore, we have shown that for every we can construct an equivalent in full normal form. The uniqueness of , up to equivalence, is derived in a straightforward way using Statements (i) and (ii). It remains to prove our claim for the time complexity of the above presented algorithm for the construction of . We should note that the input of the algorithm consists of the set of ports and the wPCL formula . If with , and is involved in an or operation, then we use the full normal form . The computation of requires a doubly exponential time since we compute firstly the set all full monomials over and then all nonempty subsets of . If is a PCL formula, then we conclude our claim by Theorem 18 and Proposition 22. Next, by preserving the notations from the first part of our proof, for the induction steps for , , and operations, we note that the construction of by and is polynomial in every case.
Next we show that the equivalence problem for wPCL formulas is decidable in doubly exponential time.
Theorem 26
Let be a commutative semiring and a set of ports. Then, for every the equality is decidable in doubly exponential time.
Proof. By Theorem 25 we can effectively construct, in doubly exponential time, wPCL formulas in full normal form such that and . Let us assume that and which moreover satisfy Statements (i) and (ii). Then, by Statement (ii) we get that iff the following requirements (1)-(3) hold:
,
- 2)
, and
-
3)
-
a)
if , then for every and such that ,
- or
- b)
if , then we get where , ’s () are pairwise disjoint, and () is the set of all in such that . Similarly, we get where , ’s () are pairwise disjoint, and () is the set of all in such that . Then for every and such that .
By Lemma 21 the decidability of equivalences in (3a) is reduced to decidabilty of equality of sets of interactions corresponding to full monomials, whereas the decidabilitty of equivalences in (3b) is reduced to the decidability of equality of sets whose elements are sets of interactions corresponding to full monomials. All the aforementioned full monomials, and hence their corresponding interaction sets, have been computed in the process of the construction of full normal forms and (cf. the proof of Theorem 25). Therefore, the decidability for the required equalities and equivalences in (1)-(3) above requires at most polynomial time, and our proof is completed.
In the last part of this section, we wish to show that wPCL is sound. For this, we need firstly to introduce the notion of soundness in the setting of wPCL. According to our best knowledge soundness has been defined only for multi-valued logics, with values in the bounded distributive lattice with the usual and operations (cf. [10]). Let and with . We say that proves and write if is derived from the formulas in , using the axioms of PCL (cf. page 17 in [12]) and the equivalences of Propositions 12 and 13. Furthermore, we write iff for every such that , then . Then, we say that wPCL is sound if implies . In particular, if are PCL formulas over , then we write if is derived from formulas in using the axioms of PCL (cf. page 17 in [12]). Similarly, we write if for every we get whenever for every .
Theorem 27
Let be a commutative semiring and a set of ports. Then the wPCL over and is sound.
Proof. If is a set of PCL formulas and a PCL formula over , then implies holds true since PCL is sound (cf. [12]). If is a set of wPCL formulas and a wPCL formula in such that , then we get by Definition 8 and Propositions 12 and 13. Therefore, wPCL is sound, and we are done.
Discussion
- a)
In our definition of interactions (cf. page 3) over a set of ports we excluded, following [12], the empty interaction as well as the empty set of interactions. Though the empty interaction adds no value in single architectures, it plays an important role in architectural composition (cf. for instance [1, 4]). More precisely, the empty set of interactions represents in a strict mathematical way the case where two architectures cannot be composed. It represents also a deadlock state of a component-based system. Nevertheless, we consider no empty interactions in wPCL because of the following reason. Our wPCL is based on PCL of [12] where the authors also consider no empty interactions. Clearly the empty interaction satifies only the PIL formula . By adding the empty interaction in PCL of [12] several properties do not hold any more. For instance the equivalences (Proposition 4.4 in [12]) for and (Proposition 4.27(2) in [12]) for and . Specifically, the first one is used in the computation of the full normal form of a PCL formula (for instance in proof of Proposition 4.19 and in turn in proof of Proposition 4.35 in [12]). We conjecture that one can rebuilt the theory of PCL and of our wPCL by considering the empty interaction, but of course this is beyond the scope of this paper.
- b)
In Theorem 25 we proved that for every wPCL formula we can effectively construct an equivalent one in full normal form, i.e., . Furthermore, we used this result to prove decidability of equivalence of wPCL formulas. However our method arises the following question: Why should one follow the technical constructions of Theorem 25 and not consider the “obvious” construction of full formal form as . As we have shown in Theorem 25 the worst case run time for the computation of is doubly exponential. On the other hand, the construction of requires “always” doubly exponential time since it computes all . From the application point of view it is desirable to compute full normal forms in an automatic way [12], and for this, the above difference for the time needed for and is of great importance. Following the methodology of [12], we developed a code in Maude 2.7.1 rewriting system [19] for the computation of full normal forms of weighted Master/Slave and Publish/Subscribe architectures. The left diagram in Figure 5 presents the time needed for the construction of full normal forms of these architectures for several numbers of components. The right one shows the time needed to compute for several numbers of . One can easily see that the time required to compute for is greater than the the time required to compute the full normal form of weighted Master/Slave architecture with 6 Masters and 6 Slaves (i.e., 12 ports in total), and it is the same with the time needed to compute the full normal of weighted Publish/Subscribe architecture with 5 Subscribers, 4 Publishers and 3 Topics (i.e., 12 ports in total). Our code run on a 64-bit Linux machine with a 2.10 GHz Intel i3-2310M CPU and 1 Gb memory limit.
Conclusion
We introduced a wPCL over a set of ports and a commutative semiring and investigated several properties of the class of polynomials obtained as semantics of this logic. For some of that properties we required our semiring to be idempotent. In our wPCL we slightly modified the coalescing operation in comparison to its boolean counterpart. Definitely, this modification is not an essential restriction since every architecture described in the boolean setup is described as well in our weighted setup, as we showed in our examples. We proved that for every wPCL formula we can effectively construct, in doubly exponential time, an equivalent one in full normal form. This result implied the decidability of the equivalence problem for wPCL formulas. We defined a notion of soundness for wPCL and proved that it is sound. It should be noted that though PCL is proved to be complete [12], for wPCL trivially this is not the case, at least with our definitions of and . It is an open problem whether we can develop the theory of this paper by relaxing the commutativity property of the semiring and thus obtaining our results for a larger class of semirings. Furthermore, it should be very interesting to investigate the wPCL over more general weight structures which can describe further properties like average, limit inferior, limit superior, and discounting (cf. for instance [6]). Work on progress investigates the first- and second-order levels of weighted configuration logics which are motivated by applications to architecture styles with quantitative characteristics.
Acknowledgements. We should like to express our gratitude to Joseph Sifakis, Simon Bliudze, and Anastasia Mavridou for useful discussions and clarifications on [12]. We are also grateful to two anonymous reviewers for pointing out a mistake and fruitful suggestions which helped us to improve the presentation of the paper.
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1[1] P. Attie, E. Baranov, S. Bliutze, M. Jaber, J. Sifakis, A general framework for architecture composability, Form. Asp. Comput. 28(2016) 207–231. doi:10.1007/s 00165-015-0349-8
- 2[2] R. Baldoni, S. Bonomi, M. Platania, L. Querzoni, Dynamic message ordering for topic-based Publish/Subscribe systems, in: Proceedings of 26th International Parallel and Distributed Processing Symposium, IEEE (2012) pp. 909–920. doi:10.1109/IPDPS.2012.86
- 3[3] L. Baresi, C. Ghezzi, L. Mottola, On accurate verification of publish-subscribe architectures, in: Proceedings of ICSE 2007, IEEE pp.199-208. doi: 10.1109/ICSE.2007.57
- 4[4] M. Bozga, R. Iosif, J. Sifakis, Local reasoning about parametric and reconfigurable component-based systems. 2019. hal-02267423
- 5[5] M. Droste, W. Kuich, H. Vogler (Eds) (2009) Handbook of Weighted Automata . EATCS Monographs in Theoretical Computer Science, Springer-Verlag, Berlin Heidelberg. doi:10.1007/978-3-642-01492-5
- 6[6] M. Droste, I. Meinecke, Weighted automata and weighted MSO logics for average and long-time behaviors, Inform. and Comput. 220–221(2012) 44–59. doi:10.1016/j.ic.2012.10.001
- 7[7] P. Eugster, P. Felber, R. Guerraoui, A.-M. Kermarrec, The many faces of Publish/Subscribe, ACM Computing Surveys 35(2)(2003) 114–131. doi:10.1145/857076.857078
- 8[8] D. Garlan, Software architecture: a travelogue, in: Proceedings of FOSE 2014, ACM (2014) 29–39. doi:10.1145/2593882.2593886
