Regulating Synchronous Data Exchange to Meet Control Flow and Data Specifications
Abstract
When multiple software components interact via method calls, we may want to ensure that the order of invoked methods and the arguments provided adhere to some specification. The classic problem associated with interface automata checks for the existence of a mediator whose intention is to act as a buffer in between method invocations so that invocations do not go unanswered. We extend the base model underlying interface automata, enabling them to exchange integer values - one automaton generates an integer value and outputs it by firing a generating transition and another automaton receives the value by synchronously firing a receiving transition. Transitions in the automata can have guards with linear order constraints on the exchanged values, influencing which methods can or can not be invoked later. So the generated values influence the sequences of invocations that are enabled. We specify desirable properties of the sequence of method calls and the arguments passed to them using an extension of Linear Temporal Logic (LTL). We consider the interoperability problem, which is to check if it is possible to generate integer values in such a way that all enabled sequences satisfy the given specification.
We show that the interoperability problem is undecidable in general, even when there are only two participating automata. We show decidability in the case where guards on generating transitions can only have equality constraints on the exchanged value (but receiving transitions can continue to have linear order constraints). We model this problem as a game between two players, one trying to generate integer values such that violating sequences are disabled while the other player tries to dig out violating sequences that are enabled. Interoperability is equivalent to the first player having a winning strategy. We solve this game via a finite abstraction, which results in a symbolic game. We then show that winning strategies for the symbolic game can be translated to winning strategies for the original game over integers.
Keywords and phrases:
Distributed Systems, Interface Automata, Registers, Parity GamesFunding:
M. Praveen: This author is partially supported by the Infosys foundation.Copyright and License:
2012 ACM Subject Classification:
Theory of computation Logic and verification ; Theory of computation Modal and temporal logics ; Theory of computation Verification by model checkingEditors:
C. Aiswarya, Ruta Mehta, and Subhajit RoySeries and Publisher:
Leibniz International Proceedings in Informatics, Schloss Dagstuhl – Leibniz-Zentrum für Informatik
1 Introduction
There are many models for formalizing multiple software components interacting with each other. E.g. in [11], smart contracts are modeled using interface automata [5]. The classic question for interface automata is to check if there exists a mediator (that can buffer method calls among the participants) such that there are no unanswered method calls [5, 10]. In [1], smart contracts are modeled in the Behavior Interaction Priority (BIP) framework, which are finite state machines (FSMs) interacting via ports. The smart contracts in [1] are part of a supply chain for crude oil, and the goal is to model check properties such as “once the point-of-sale receives the oil batches from a vendor, the payment must be triggered”. This is a typical temporal property saying one event must be followed by another.
FSMs in the BIP framework can exchange data in the form of arguments passed to method calls. We work with a model that also allows exchange of data (for example, an integer indicating the amount to be paid), but using synchronized transitions as in interface automata. In [1], control flow can be influenced by conditions such as “if the production at a vendor site is more than a specified limit, send an alert”. We model these using guards on transitions, which comprise of linear order constraints on the data exchanged. The value that is exchanged thus influences which branches can be taken by the control flow. The interoperability problem is to check if the values can be generated in such a way that the control flow remains within a specified set. The set is specified by Constraint Linear Temporal Logic (CLTL), an extension of LTL that can check linear order constraints on data values. In the above supply chain example, this can check if there exists a value for the daily production limit such that vendor and point-of-sale work together ensuring that there is always enough inventory.
We benefit from game theoretic foundations of interface automata. To tackle the interoperability problem, we design a game between two players, system and spoiler. system tries to choose values of the exchanged data (restricted to integers here) so that branches of control flow that can potentially violate the specification are disabled. spoiler tries to pick out branches in the enabled part of control flow that can potentially violate the specification. If system has a winning strategy, it provides integer values that will ensure that the specification is always met in all enabled branches of the control flow.
One difficulty that needs to be overcome is that branches in which the game can proceed depends on choices system makes from an infinite domain (integers). We handle this by designing an abstraction that reduces the game to a finite one, while still maintaining enough information about existence of winning strategies. The high level idea of using abstraction to reduce infinite domains to finite ones is a known technique [7, 3, 2, 8]. But designing the abstraction must be done carefully so that peculiarities of the original model are correctly reflected in the resulting finite symbolic model. Our first contribution is coming up with a model that is expressive enough to specify interesting properties. An example is given in Section 4. Our second contribution is designing an abstraction [definition 19] such that the resulting finite symbolic model meets two goals. First, it is equivalent to the original model wrt the existence of winning strategies [Lemma 24]. Second, it can be solved by adapting known techniques [[3], Lemma 23].
Suppose the participants do not know each other’s configurations and we need to check if they can still generate values based on the imperfect information they have. It turns out that if each participant sends integer values regularly, they can communicate their configuration information by encoding it in the integers they generate, thus communicating their configuration information to other participants and reducing it to the perfect information case. This trick will fail in other cases. It would be interesting to identify interesting fragments of the other cases where the interoperability problem makes sense.
Related work.
In [10, 14], interface automata are extended with registers to handle data like we do here. But there, data values can be compared only for equality and its negation while we have linear order. Also, [10, 14] only consider specific safety properties; we allow properties expressible in CLTL. In [8], synthesis problem for specifications given as register automata over linearly ordered data domains (including ) are studied. They prove decidability for the existence of a winning strategy for one-sided games, where one of the players operates over a finite alphabet and the other manipulates data. The concrete game which we use to model the interoperability problem here is similar to such a one-sided game as even over there, one of the players can only choose from a domain while the other can choose integer values. Also, we use techniques similar to theirs in order to deal with abstraction of the register values by tracking constraints between them and checking for the feasibility of such constraint sequences. However, synchronization between register automata is the central theme of our model and specification is based on a logic. In [8], register automata are used as specification mechanisms. Our techniques involve a combination of qualititative and quantitative specifications. Energy games [6, 4] provide a foundation for many such models.
2 Preliminaries
Let be the set of integers and be the set of non-negative integers. We denote by the number ceiled at : if and otherwise. For integers , we denote by the set .
We recall here the definitions of constraint systems and Constraint LTL (CLTL) from [7] with some slight modifications. A constraint system is of the form , where is a non-empty set called the domain. Each is a predicate symbol of arity , with being its interpretation. For the sake of this paper, it suffices to describe CLTL formulas over constraint systems of the form where is an infinite domain, is a total linear order over and is the equality relation.
Let be a finite set of variables, and be a finite set of actions. A term is of the form , where is a variable and . A constraint is of the form or , where are terms. The syntax of CLTL is given by the following grammar, where and is a constraint as defined above.
Let denote the set of all mappings of the form . The semantics of CLTL is defined with respect to infinite sequences over (also called concrete models in the following).
Given a concrete model , the th position of satisfies the atomic formula (written as ) if . Also, given and , the th position of a concrete model satisfies the constraint (resp. ) (written as (resp. )) if and only if and (resp. ) hold. The semantics is extended to the rest of the syntax similar to the usual propositional LTL. We use the standard abbreviations (resp. ) to mean that is true at some position (resp. all positions) in the future. The -length of a term is . We say that a formula is of -length if it uses terms of -length at most . The formula will be true in the first position of a concrete model if, in all positions, the value of is less than the value of in the next position and if the action holds infinitely often in the concrete model. In the rest of this paper when we refer to CLTL formulas, we shall restrict ourselves to CLTL formulas over the constraint system using just one variable . The models for such formulas with just one variable can simply be thought of as sequences of the form where .
3 Interface Automata with Data
We work with a model based on interface automata [5, 10]. We extend it so that integer values can be exchanged and stored.
Definition 1 (Finite State Register Machines (FSRMs)).
A finite state register machine where:
-
is a finite set of states, is the initial state and is a finite set of registers,
-
is a set of external transitions, where is the power set of and is the set of all formulas (guards) of the form where and is a formal parameter.
-
is the set of hidden transitions.
We write to refer to the set of states, registers, external and hidden transitions of a particular FSRM . An -valuation is a mapping from to . Given an -valuation , an integer value and a guard , denotes that the formula with each occurrence of replaced by and each occurrence of replaced by , evaluates to true.
Definition 2 (Semantics of Finite State Register Machines).
The semantics of a finite state register machine is a transition system defined as follows.
-
is the set of configurations,
-
is the initial configuration,
-
iff such that and for each , if and otherwise.
-
iff .
In words, an external transition goes from configuration to storing the integer value in registers belonging to , provided is enabled in : and the new integer value should satisfy the guard . Hidden transitions change states without changing register valuations. We refer to the pair or as a step .
Definition 3 (Traces of Finite State Register Machines).
Given a finite state register machine , we define a trace of to be a finite or infinite sequence of alternating configurations and steps: where , , , and is a step for all . We denote the set of all traces of as .
A set of FSRMs can be composed. An output transition of one FSRM can synchronize with an input transition of another FSRM. To control which transitions can synchronize, we label them with a letter from a finite set of actions, along with one of the symbols . Transitions labeled with (resp. ) are intended to be output (input) transitions. Two transitions can synchronize if they are labelled with the same action, one of them is additionally labeled with and the other one is additionally labeled with .
Definition 4 (Interface Register Transition System).
An interface register transition system where is a tuple of finite state register machines, is a finite set of actions and is a labelling function. The notation stands for the union of the sets of external transitions of all the FSRMs in .
Definition 5 (Semantics of Interface Register Transition System).
The semantics of an interface register transition system is a transition system defined as follows:
-
1.
A configuration is a function such that for all .
-
2.
is the initial configuration mapping all FSRMs to their initial states and all registers to .
-
3.
iff the following conditions are met: , , , , , , , and is obtained from by changing from to and changing from to .
-
4.
iff the following conditions are met: , , , and is obtained from by changing from to . Additionally, for any transition with , can not be fired in the configuration with the value .
-
5.
iff the following conditions are met: , and is obtained from by changing from to .
In the transition mentioned in point 3 above, output transition and input transition from different FSRMs synchronize by exchanging the integer value . In the transition of point 4, only an output transition from an FSRM fires and we think of the environment as receiving the value, provided none of the transitions in can fire to receive the value . In the transition in point 5, a hidden transition in FSRM fires. We refer to tuples and as steps.
Definition 6 (Traces of Interface Register Transition System).
Given an interface register transition system , we define a trace (or a finite trace) of to be a finite alternating sequence of configurations and steps: where , , , and is a step for all . We denote the set of all finite traces of as . An infinite trace of is similarly defined to be an infinite alternating sequence of configurations and steps. We denote the set of all infinite traces of as .
For a step or , its projection to actions and values is . For a step with a hidden transition , , the empty sequence. We extend to traces as . We say that a trace satisfies a CLTL formula (denoted as ) if there are infinitely many external transitions fired along and .
Two traces that differ only in hidden transitions can not be distinguished by CLTL formulas. We formalize this next.
Definition 7 (Hidden transitions invariance).
Suppose a finite trace is of the form . Bypassing the step based on the hidden transition will result in the sequence . Let be obtained from by bypassing all hidden transitions occurring in . We say two traces are equivalent wrt hidden transitions (written as ) if .
A step can only be taken if the current configuration along with the new value satisfies the guards in the transitions . Choosing certain values can thus help in avoiding traces that violate a given CLTL specification. We denote by the set of transitions .
Definition 8 (Regulator).
Given an interface register transition system , a regulator is a function .
An infinite trace conforms to a regulator if the following is true: for every prefix of the form or , . We say that an interface register transition system is interoperable satisfying a CLTL formula if there is a regulator such that all traces that conform to satisfy .
In order to handle maximal finite traces, we add gadgets to the interface register transition system. For every action , we add a sink state . For an existing state , suppose are the guards on the input transitions from labelled with . We add an input transition from to labelled with the action and the guard . This new transition is enabled if and only if none of the existing input transitions labelled by are enabled. On , we have a self-loop with an output transition labelled with a new action . On every existing state in all the FSRMs, we add self-loops with an input transition labelled with . This way, a maximal finite play is artificially extended to an infinite one by padding . This can be easily identified in the CLTL specification and handled accordingly (like disallowing such actions as needed for the undecidability proof in appendix A).
In general, the interoperability problem for interface register transition system is undecidable. Given a 2-counter machine, we construct an interface register transition system with just two FSRMs such that the runs of the 2-counter machine are simulated by the traces of . It is an adaptation of similar undecidability proofs for games involving numbers, in which one player simulates a two counter machine and the other player catches mistakes if any during the simulation. For example, if the player simulating an incrementing transition increments by more than 1, it can be caught by the other player by checking that there is a value between the previous and incremented value. The details of the proof of undecidability can be found in appendix A.
4 Modeling Example
In this section, we provide an example of modeling an e-commerce system with the aim of checking whether a client and a server can be made to work with each other by regulating the interaction appropriately. The example is for most parts copied from a similar example given in [10]; we add a feature to it motivating the introduction of linear order constraints in the guards of the FSRMs, which are absent in [10]. For modeling this example, we assume Interface Register Transition Systems can exchange multiple integer values in one transition. Our results can be easily extended to handle this extension.
The example models a typical online store; one FSRM for the client and one for the server. Suppose the client starts by sending a message containing its and it expects to receive an id of a new order. A schematic of the FSRM modeling the client is shown below in Figure 1.
In the figure, an edge label such as means that it is a transition labeled with the action and the symbol (to indicate that it is a output action) and sends an integer value stored in the register named . The client then orders a number of items via the action, at the end of which it provides the payment information via the action. Some edge labels in the figure are a quite long, so we have used shorthands such as . These shorthands are expanded as below.
Then the client expects all items together with the quantities to be confirmed by the customer service. The client also accepts rebuttals from the customer service in case the number of items ordered is outside the minimum and maximum range allowed, via the message. This is a feature we have added here beyond what is described in [10], in order to demonstrate the utility of linear order constraints. The edge label above implements this feature by using a guard to test that the quantity is indeed out of range. In practice, e-commerce systems would allow the client to revise the order, but for the sake of simplicity here, we just move ahead by dropping those items that are out of range. It blocks in case that it does not receive the right confirmation for the remaining items. Then it announces that it is ready to close the order and expects to receive the result of the payment transaction.
The client service expects to receive the client’s id, then it sends a confirmation and sends an id of a new order, together with a client verification. It is then prepared to repeat a loop in which it 1) receives an order of an item, 2) receives a quantity, 3) confirms the quantity or rejects as out of range and sends minimum and maximum quantity allowed. After that, it receives payment information, arranges payment via a third party service (invisible to the client and not modeled here), and sends the result of the payment transaction.
The client and customer service are not directly interoperable, since the client sends all items before accepting responses but the customer service sends responses for each item before accepting the next item. They can however still interoperate via a mediator that buffers the item orders and communicates with the two parties as expected. As done in [10], we restrict ourselves to the case where the number of items per order is bounded by a constant , which becomes a parameter of the interoperability problem. The specification will say that every item is either acknowledged or out of range and that the order is closed and the result of the payment transaction is provided to the client. This can be easily specified in CLTL.
5 Modelling interoperability as a game
In the simulation of the two counter machine briefly mentioned at the end of Section 4 (details of which can be found in appendix A), we check that counter increments and decrements are done correctly using guards on output transitions, which ensure that the generated value is strictly between two previously generated values. It turns out that if we restrict guards on output transitions to prevent such checks, interoperability problem is decidable. Specifically, let guards on output transitions be those of the form . From now on, we shall call this the restricted syntax. The new value being generated (represented symbolically by in guards) can only be tested for equality (, as opposed to in general) with register values. In other words, the restricted guards can check if the generated value is actually there in one of the registers, which is a natural test one may want to do. With guards on output transitions obeying this restricted syntax, the interoperability problem is decidable. As a first step towards proving decidability, we informally describe a game formulation of the interoperability problem.
The game is played between system and spoiler, on the transition system which is the semantics of the given interface register transition system. spoiler’s goal is to pick out a trace that violates the given CLTL specification. system tries to prevent this by choosing values of the generated integers such that some transitions are disabled, thus restricting the choices available to spoiler in the next move. The game begins at the initial configuration and spoiler chooses an output transition labeled with some action enabled at the current configuration. system chooses a value based on the history of the play so far. spoiler chooses a transition enabled at some FSRM. The game moves to the updated configuration as per semantics. The game continues with the next round as before. system wins the play if the infinite trace generated by the play satisfies the CLTL specification. The existence of a winning strategy for system in this game is equivalent to the existence of a regulator.
To formally prove the above equivalence, we first formalize the game itself. A round ends with spoiler choosing an input transition that is enabled at the current configuration. The next round begins wth spoiler choosing an output transition that is enabled at the current configuration. We will combine these two moves of the spoiler and make it into a position of another game, which we call the concrete game. We denote by the set of transitions .
Definition 9 (Concrete game).
Given an interface register transition system , we associate with it a concrete game. The initial positions are of the form , where is any configuration that can be reached from the initial configuration with a finite sequence of hidden transitions and is any output transition enabled at . The set of other positions is . The set of system moves is .
The concrete game starts at an initial position . From any position , or , system makes a move by choosing a value . spoiler can respond by moving to any position (resp. ) provided the following conditions are satisfied:
-
Output transition and input transition are labeled with the same action, say (resp. is labeled with and there is no input transition enabled at the configuration to receive the value ),
-
(resp. ), is reachable from by a sequence of hidden transitions and is an output transition enabled in .
The game then continues as before from the new position. A play is an infinite sequence of alternating positions and moves: such that successive positions satisfy the conditions above. Histories are finite prefixes of plays, ending at positions. With every play , we can naturally associate an infinite sequence of actions and values . system wins a play if satisfies the CLTL formula specified in the interoperability problem. Let denote the set of all histories.
Definition 10 (Strategies).
A system strategy is a function .
A play conforms to the strategy if for all , . We say that is a winning strategy for system if all plays conforming to it are won by system.
Proposition 11 (Interoperability and concrete game).
Let be an interface register transition system such that guards on all the output transitions obey the restricted syntax and let be a CLTL formula. is interoperable satisfying if and only if system has a winning strategy in the corresponding concrete game.
Proof.
A regulator is a function . A strategy is a function . The result follows from the observation that there is a natural one-to-one correspondence between and .
6 Symbolic interoperability game
In this section we prove that the interoperability problem for CLTL specifications is decidable when the guards on output transitions obey the restricted syntax.
We shall prove this by checking if system has a winning strategy in the associated concrete game. This is in turn checked by designing a finite parity game that is equivalent to the concrete game with respect to system having a winning strategy. We use positional determinacy of finite parity games to show this equivalence. In the rest of this section we elaborate on this.
In the concrete game, data exchanged between FSRMs come from , an infinite set. We will have to simulate this in a game that can only use letters from a finite alphabet, for which we shall construct a symbolic abstraction.
We introduce the notion of partial frames and frames. We use frames (resp. partial frames) to capture the total pre-order (resp. not necessarily total pre-order) induced by the configurations and the data values along consecutive positions in the concrete game. While a partial -frame captures the pre-order induced by the configurations and data values appearing in the last rounds of the concrete game upto the latest position of the spoiler, an -frame extends this to a total pre-order which includes the integer value generated by system in its successive move as well.
The models of CLTL are infinite sequences over infinite alphabets. Frames, introduced in [7], abstract them to finite alphabets. Conceptually, frames and symbolic models as we will define here are almost the same as introduced in [7], where the authors used these notions to solve the satisfiability problem for CLTL. Also, in [3], the authors use the notion of frames and partial frames in CLTL games to solve the single-sided realizability problem and the notions we use here are again, quite similar.
Given an interface register transition system and a CLTL formula over and a single variable , we first define the notion of -variables and -terms.
The set of -variables . An -term is of the form , where and . For , we denote by the set of all -terms of the form , where .
Definition 12 (Frames, [7], [3, Definition 3]).
Given a number , an -frame is a pair where and is a total pre-order 111a reflexive and transitive relation such that for all , either or on the set of terms .
In the notation -frame, is intended to denote the size of the frame – the number of successive positions about which information is captured. The current position and the previous positions are considered, for which the terms in are needed. We denote by and the strict order and equivalence relation induced by iff and and iff and .
We will deal with symbolic models that constitute sequences of frames. An -frame will capture information about the first positions of a model.
An -frame meant for positions to may be followed by another -frame meant for positions to . The two frames must be consistent about the positions to that they share. The following definition formalizes this requirement.
Definition 13 (One-step compatibility, [7], [3, Definition 4]).
For , an -frame and an -frame , the pair is one-step compatible if for all terms , iff . For and -frames , the pair is one-step compatible if for all terms , iff
Fix a number and consider formulas of -length . A symbolic model is a sequence of frames such that for all , is an -frame and is one-step compatible. CLTL formulas can be interpreted on symbolic models, using symbolic semantics as explained next. To check if the th position of symbolically satisfies the atomic formula , we check whether is of the form for some pre-order , and to check if the th position of symbolically satisfies the atomic constraint (where are terms), we check whether holds according to the total pre-order in the th frame . In formal notation, this is written as if holds. The symbolic satisfaction relation is extended to all CLTL formulas of -length by induction on the structure of the formula, as done for propositional LTL. To check whether in this symbolic semantics, we only need to check , the th frame in , unlike the CLTL semantics, where we may need to check other positions also. In this sense, the symbolic semantics lets us treat CLTL formulas as if they were formulas in propositional LTL and employ techniques that have been developed for propositional LTL. But to complete that task, we need a way to go back and forth between symbolic and concrete models.
Given a concrete model , we associate with it a symbolic model as follows. Imagine we are looking at the concrete model through a narrow aperture that only allows us to view positions of the concrete model, and we can slide the aperture to view different portions. The th frame of will capture information about the portion of the concrete model visible when the right tip of the aperture is at position of the concrete model (so the left tip will be at ). Formally, the total pre-order of the th frame is the one induced by the valuations along the positions to of the concrete model. The action occurring in the first component of each position of the symbolic model will be the same as the action appearing in the first component of the corresponding position of the concrete model .
Lemma 14 ([7, Lemma 3.1], [3, Lemma 5]).
Let be a CLTL formula of -length . Let be a concrete model and let . Then iff .
The symbolic model induces an order on as follows. Consider such that contains an -frame for some and let be such that and . We say (resp. ) if (resp. ). In other words, for the variables and positions captured in the frame , is same as the total pre-order over that frame. Now we define to be the transitive closure of and to be the transitive closure of . is now a partial order over .
For every concrete model, there is an associated symbolic model, but the converse is not true. We say that a symbolic model admits a concrete model if there exists a concrete model such that . In particular, it is easy to see that if there are infinite chains of the form that we shall define below in a symbolic model then it does not admit a concrete model.
Definition 15 (Infinite chains, [7, Condition ]).
A symbolic model is said to have infinite chains if there exist two infinite sequences and and two variables satisfying one of the following conditions:
or
If a symbolic model has an infinite chain as above, the integer values associated with will all be distinct from each other and will be inside the interval from to , which is impossible. Hence, absence of infinite chains is a necessary condition for a symbolic model to admit concrete models. We shall see later that this is also a sufficient condition for a subset of symbolic models
We next define partial frames and compatibility between a partial frame and a frame.
Definition 16 (Partial frames and compatibility).
For , a partial -frame is a pair where and is a total pre-order on the set of terms . For , an -frame and a partial -frame , the pair is one-step compatible if for all , iff . For , an -frame and a partial -frame , the pair is one-step compatible if for all , iff , and the pair is one-step compatible if and for all iff .
Figure 2 illustrates -frames, partial -frames and one-step compatibility graphically. Observe here that the pairs and are both one-step compatible. Note that the figure does not indicate some of the edges in the 3-frame and partial 3-frame which can be inferred using transitivity.
We now begin defining the symbolic game. We first define the notion of a symbolic configuration. A pair where is any -frame for some , is called a symbolic configuration (denoted by ). We call a partial symbolic configuration (denoted by ) where is any partial -frame for some . Given a transition , a tuple of states and a -frame , we say is enabled at if the action label of is same as the first component of , and the frame satisfies the guard , or in other words, holds if and holds if . We next define the notions of symbolic updates and symbolic steps which we shall use to design the rules of the finite parity game simulating the concrete game.
Definition 17 (Symbolic update).
Given an -frame , and an update (or resp. a pair of updates with ) we define the updated partial -frame to be such that is one-step compatible, for all , , for all and for all , for all (resp. for a pair of updates, we update the register variables of both and and the remaining variables are equal to their previous values).
Definition 18 (Symbolic step).
Given a symbolic configuration , a partial symbolic configuration , an action and a pair of output and input transitions , where , is some -frame and is a partial -frame, we define a symbolic step iff the following conditions are met: , , are enabled at , , , , and is obtained by updating with the updates and . We can define the symbolic step in a similar manner.
We know that any LTL formula can be converted to an equivalent non-deterministic Büchi automaton with an exponential number of states in the size of in EXPTIME [15]. Now, every non-deterministic Büchi automaton with states can be converted to a deterministic parity automaton [9, Chapter 1] with number of states exponential in and number of colours polynomial in [13, Theorem 3.10]. Using these results, it is easy to see that given a CLTL formula , we can construct a deterministic parity automaton with set of states and with number of colours , accepting the set of all sequences of frames that symbolically satisfy , such that is double exponential in the size of and is exponential in the size of .
In order to construct a winning strategy for system in the concrete game using a winning strategy for system in the symbolic parity game that we shall construct, we also need to ensure that every sequence of frames resulting from a play of the game conforming to the winning strategy admits integer labellings for every variable in each of the frames. As done in [7] and [3], it is possible to construct a Büchi automaton of size polynomial in the size of the formula and hence a deterministic parity automaton of size exponential in the size of that checks for the absence of infinite chains in a symbolic model satisfying . We shall use and to define the parity winning condition of the symbolic game and we will see later that this ensures the existence of winning strategies with integer labellings for the sequence of frames along every play conforming to certain type of winning strategies.
Definition 19 (Symbolic game).
Given an interface register transition system and a CLTL formula over and a single variable with -length , we associate with it a symbolic game. Let denote the set of all -frames for and denote the set of all partial -frames for . Let be a deterministic parity automaton accepting the set of all sequences of frames that symbolically satisfy and do not contain infinite chains, with being the set of states, being the initial state and being the number of colours. We define a parity game with initial positions . Here, is the tuple of initial states of each of the FSRMs in , is the partial -frame where all register variables are equal and is some output transition whose source state is a current state in . The set of other spoiler positions is . The set of system positions is (. Position receives the same colour as that of the initial state in and positions , , and receive the same colour as that of state in
We denote the set of spoiler positions by and set of system positions by The symbolic game starts at an initial position . From any position , or , system makes a move by choosing a position , or where is the -frame with all register variables and the variable equal to each other and is a frame such that is one-step compatible and is such that satisfies the guard appearing in .
spoiler can respond by moving to any position (resp. ) provided the following conditions are satisfied:
-
There is a symbolic step from to on or as defined in 18 and is reachable from by a sequence of hidden transitions. Formally, (resp. ).
-
Transition is enabled at the partial symbolic configuration
-
There is a transition from to on reading the frame in the deterministic parity automaton .
The game then continues as before from the new position. A play is an infinite sequence of alternating spoiler and system positions: such that successive positions satisfy the conditions above. Histories are finite prefixes of plays, ending at spoiler positions. system wins a play of the game if the parity condition is satisfied by the play. Let denote the set of all histories. Given a play , let be the projection of the play to the underlying sequence of frames contained in each system position.
Definition 20 (Strategies).
A strategy for system in the symbolic game is a function .
Definition 21 (Positional Strategies).
A positional strategy for system in the symbolic game is a function .
A play conforms to the strategy (resp. positional strategy) if for all , (resp. ). We say that a strategy/positional strategy is a winning strategy for system if all plays conforming to it are won by system. We abuse notation and say for and to mean where is the frame contained in position .
We associate a finitely branching infinite tree with a positional strategy . Let be the collection of all plays that conform to strategy and let be the collection of all finite prefixes of plays in ending in a spoiler position. Now let denote the projection of such histories to just the sequence of spoiler positions. Now we define a tree associated with positional strategy as given by . For every node in , its set of children corresponds to the set of spoiler moves possible for the system move . For a node , the subtree rooted at is such that for all , . A tree is called regular if the set is finite, i.e., there are only finitely many subtrees up to isomorphism. Two nodes are said to be isomorphic if . It is easy to verify that the tree associated with a positional winning strategy is a regular tree.
Given an infinite path of the tree , we associate with it, a symbolic model , which is the infinite sequence of frames obtained from the labels of the nodes along that path.
We now give an automata-theoretic characterization for trees that are labellable. Using the fact that the trees associated with positional strategies are regular and using results from [3], we get that such trees are labellable if and only if the symbolic model associated with each infinite path of the tree does not have any infinite chain. Recall that the automaton we defined earlier, checks for absence of infinite chains in a symbolic model and therefore, we get the following lemma:
Lemma 22 ([3, Lemma 23]).
The tree associated with a positional strategy is labellable iff the symbolic model associated with every infinite path of is recognized by the deterministic parity automaton .
Now, we know that if a positional strategy is winning, then the sequence of frames along every play conforming to the strategy must not have any infinite chains, hence no path in the tree associated with this strategy should have any infinite chains. Using Lemma 22, we then get that:
Lemma 23.
The tree associated with a positional winning strategy is labellable.
We now extend the map to go from histories (resp. plays ) of the concrete game to histories (resp. plays ) of the symbolic game. We define a function as follows: equals where is the partial -frame induced by the configurations and the integer values and is the -frame induced by the configurations and the integer values , is the tuple of states in configuration and is the state of DPA on reading the sequence of frames for all . is defined over plays of the concrete game in a similar manner. We now use all the above definitions and lemmas to establish the equivalence between the concrete and the symbolic games.
Lemma 24 (Equivalence between concrete and symbolic games).
system has a winning strategy in the concrete game if and only if system has a winning strategy in the symbolic game
Proof.
() Suppose system has a winning strategy in the CLTL game. We will construct a winning strategy for system in the symbolic game. Any history of length is of the form and it is clear that . Therefore, we define last position of .
We assume inductively that the strategy has been defined for all histories in the symbolic game of length and that there exists a history of length in the concrete game such that . Now, consider a history generated after rounds of the game. By induction hypothesis, there exists a history of length of the form such that . Let [The proof fails at this step if we allow the guards on the output transitions to use the full syntax instead of the restricted syntax. See note at the end of the proof]. Now, let . Thus, we now have such that and therefore, last position of .
Let be any infinite play in the parity game that system plays according to the strategy derived from . By the inductive definition, there exists a play in the concrete game played according to the strategy such that . Now, since is a winning strategy for the concrete game, must be winning for system in the concrete game, or in other words the concrete model underlying must satisfy the CLTL formula . Therefore, by Lemma 14, the infinite sequence of frames along must satisfy symbolically and since it admits an integer labelling it cannot have infinite chains. Therefore, satisfies the parity winning condition of or in other words, is a winning strategy for system in the symbolic game.
() We know that if there is a winning strategy in a parity game then there must also be a positional winning strategy. Let be such a positional winning strategy for system in the parity (symbolic) game and let be the tree associated with . By Lemma 23, we know that admits a labelling function given by for all such that for every infinite sequence . Now suppose for all (all must have the same label as they are equal wrt ). We construct a new label function given by for all and all . Clearly, is also a valid labelling function satisfying for every infinite sequence . We will use this to inductively construct a winning strategy for the system in the concrete game.
Consider a history of length in the concrete game. We define . This labelling also respects the fact that the inital values of all the register variables are in the concrete game and assigns values accordingly. Now consider any play played according to strategy . Clearly, by Lemma 14, the underlying concrete model as the symbolic model satisfies the formula symbolically as is the infinite frame sequence along the play which is winning for the symbolic game and therefore satisfies the parity winning condition. Thus, or in other words, is winning for system and therefore, is indeed a winning strategy for system in the concrete game.
As noted in the proof, the last output transition may not actually be enabled at configuration of the concrete game if the guard on necessitates the newly generated value to be strictly between two consecutive integer values in (notice that such a guard is used in the undecidability proof for simulating a counter increment, see Appendix A). The guard on can indeed impose this condition if the guards on output transitions are allowed to use the full syntax instead of the restricted syntax.
We know that checking for the existence of a winning strategy of a player in a finite parity game is decidable. Thus, using Proposition 11, Lemma 24 and the decidability of parity games, we have the following main result:
Theorem 25 (Decidability of Interoperability).
Let be an interface register transition system such that guards on all the output transitions obey the restricted syntax and let be a CLTL formula. The problem of checking whether is interoperable satisfying is decidable.
7 Discussion and Future Work
The deterministic parity automaton that checks for bounded chains and symbolic satisfiability has size doubly exponential with respect to the size of the formula as already discussed before. The number of frames and partial frames is exponential in the number of registers of transition system . Therefore, the size of the parity game graph is polynomial in the number of states and transitions in and exponential in the number of registers. As we saw earlier, the number of colours is exponential in the size of the formula. The interoperability problem for the decidable fragment can therefore be decided in . This gives us a 2EXPTIME upper bound for the interoperability problem.
We want to point out here that while it may seem that technically many of the ideas are similar those used in solving the realizability problem for CLTL in [3], the main difference is that we are addressing a problem about a transition system whereas in CLTL realizability, there is only a formula and no transition system. It is actually possible to encode the transition system as a CLTL formula. Using such an encoding, it is indeed possible to reduce the interoperability problem to the single-sided realizability problem for CLTL. But we know that single-sided realizability for CLTL over the integers is 2EXPTIME-complete. Hence, the upper bound we get will be doubly exponential in the size of the transition system. Based on the discussion above, the approach we have taken gives us a better upper bound in terms of the size of the transition system.
In this paper, we allow only integer values to be exchanged between finite state register machines. But one can also consider models where rational or real values could be exchanged. It turns out that the interoperability problem for interface register transition systems which exchange values coming from some dense, open domain is in fact decidable for the general syntax. For dense and open domains it turns out that satisfiability of any guard is guaranteed by its symbolic satisfiability ([7], [3]) (unlike in the case of integers, where it is not possible to satisfy a guard that demands that the newly generated value be between two registers whose values happen to be consecutive). Therefore, the equivalence established by Lemma 14 would hold even for the general syntax. Also, we do not need to check for the absence of unbounded chains for dense, open domains and therefore, we get decidability for the general syntax by reducing it to a parity game with in fact, a simpler parity winning condition.
We defined frames and partial frames to be total orders over the set of terms. But there could be pairs of variables that might never be compared. So, in principle, it is possible to try to avoid total orders and check if frames can be defined as partial orders. It would be interesting to see if this leads to better efficiency.
References
- [1] Sarra Alqahtani, Xinchi He, Rose Gamble, and Mauricio Papa. Formal verification of functional requirements for smart contract compositions in supply chain management systems. In Proceedings of the 53rd Hawaii International Conference on System Sciences, 2020. doi:10.24251/HICSS.2020.650.
- [2] Ashwin Bhaskar and M Praveen. Constraint ltl with remote access. In 43rd IARCS Annual Conference on Foundations of Software Technology and Theoretical Computer Science (FSTTCS 2023), pages 41:1–41:21. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2023. doi:10.4230/LIPIcs.FSTTCS.2023.41.
- [3] Ashwin Bhaskar and M Praveen. Realizability problem for constraint ltl. Information and Computation, 296:105126, 2024. doi:10.1016/J.IC.2023.105126.
- [4] Krishnendu Chatterjee and Laurent Doyen. Energy parity games. Theoretical Computer Science, 458:49–60, 2012. doi:10.1016/J.TCS.2012.07.038.
- [5] Luca De Alfaro and Thomas A Henzinger. Interface automata. ACM SIGSOFT Software Engineering Notes, 26(5):109–120, 2001. doi:10.1145/503209.503226.
- [6] Aldric Degorre, Laurent Doyen, Raffaella Gentilini, Jean-François Raskin, and Szymon Toruńczyk. Energy and mean-payoff games with imperfect information. In International Workshop on Computer Science Logic, pages 260–274. Springer, 2010. doi:10.1007/978-3-642-15205-4_22.
- [7] Stéphane Demri and Deepak D’Souza. An automata-theoretic approach to constraint LTL. Information and Computation, 205(3):380–415, 2007. doi:10.1016/j.ic.2006.09.006.
- [8] Léo Exibard, Emmanuel Filiot, and Ayrat Khalimov. Church synthesis on register automata over linearly ordered data domains. Formal Methods in System Design, 61(2):290–337, 2022. doi:10.1007/S10703-023-00435-W.
- [9] Erich Gradel and Wolfgang Thomas. Automata, logics, and infinite games: a guide to current research, volume 2500. Springer Science & Business Media, 2002.
- [10] Lukáš Holík, Malte Isberner, and Bengt Jonsson. Mediator synthesis in a component algebra with data. In Correct System Design: Symposium in Honor of Ernst-Rüdiger Olderog on the Occasion of His 60th Birthday, Oldenburg, Germany, September 8-9, 2015, Proceedings, pages 238–259. Springer, 2015. doi:10.1007/978-3-319-23506-6_16.
- [11] Gabor Madl, Luis Bathen, German Flores, and Divyesh Jadav. Formal verification of smart contracts using interface automata. In 2019 IEEE International Conference on Blockchain (Blockchain), pages 556–563. IEEE, 2019.
- [12] Marvin L Minsky. Recursive unsolvability of post’s problem of" tag" and other topics in theory of turing machines. Annals of Mathematics, 74(3):437–455, 1961.
- [13] Nir Piterman. From nondeterministic büchi and streett automata to deterministic parity automata. Logical Methods in Computer Science, 3, 2007. doi:10.2168/LMCS-3(3:5)2007.
- [14] Ayleen Schinko, Walter Vogler, Johannes Gareis, N Tri Nguyen, and Gerald Lüttgen. Interface automata for shared memory. Acta Informatica, 59(5):521–556, 2022. doi:10.1007/S00236-021-00408-8.
- [15] Moshe Y Vardi and Pierre Wolper. An automata-theoretic approach to automatic program verification. In Proceedings of the First Symposium on Logic in Computer Science, pages 322–331. IEEE Computer Society, 1986.
Appendix A Proof of undecidability stated in Section 3
An -counter machine is a tuple where is a finite set of states, is an initial state, are counters and is a finite set of instructions of the form “” or “” where and . A configuration of the machine is described by a tuple where and is the content of the counter . The possible computation steps are defined as follows:
-
1.
if there is an instruction . This is called an incrementing transition.
-
2.
if there is an instruction and . This is called a zero testing transition.
-
3.
if there is an instruction and . This is called a decrementing transition.
A counter machine is deterministic if for every state , there is at most one instruction of the form or where and . This ensures that for every configuration there exists at most one configuration so that . For our undecidability results we will use deterministic 2-counter machines (i.e., ), henceforward just “counter machines”. Given a counter machine and two of its states , the reachability problem is to determine if there is a sequence of transitions of the -counter machine starting from the configuration and ending at the configuration for some . It is known that the reachability problem for deterministic -counter machines is undecidable [12]. To simplify our undecidability results we further assume, without any loss of generality, that there exists an instruction .
Given a counter machine, we design an instance of the interoperability problem for an interface register transition system consisting of just two FSRMs and such that the counter machine reaches the halting configuration iff the answer to the interoperability problem for is a “yes”. Let be the set of transitions of the counter machine. We construct an interface register transition system whose set of actions where are special actions. The FSRM consists of states of the counter machine and has three registers . The first register is intended to carry the value and the last two are intended to carry the two counter values.
For every incrementing transition of the counter machine from to , has an output transition labeled with action from to . It has the guard (syntactic sugar for )), where is the counter incremented by . The value generated is stored the register . This ensures that the value generated by while executing this transition is strictly greater than the current value of . But we need more work to ensure that the value generated by is exactly one more than the current value of . We will describe later how to achieve this using the other FSRM .
For every decrementing or zero testing transition of the counter machine from to , has an output transition labeled with action from to . It has the guard , where is the counter decremented or tested for zero by . The generated value is stored in the register .
The FSRM consists of states , (where is the set of states of the counter machine), and four registers . The first register is intended to store the value , the next two are intended to store the two counter values and the last one is intended to store the value generated by to be used to detecting simulation errors.
For every incrementing transition of the counter machine from to , has an input transition labeled with action from to . The received value is stored in the register , where is the counter incremented by . There is also an input transition labeled from to , which stores the received value in . From , there is an output transition labeled with a special action (for “error”) to the state , with the guard . This forces to generate a value that is strictly between the old value of and the new value generated for that counter. If this transition is enabled, it means generated a value that is more than one plus the old value of the counter , which is an error. To let the FSRMs continue to operate infinitely, we add an output transition from to itself labeled with a special action (for “dummy”) and an output transition from to itself labeled .
For every zero testing transition of the counter machine from to , has an input transition labeled with action from to . The received value is stored in , where is the counter that is tested for zero by . There is also an input transition labeled from to , which stores the received value in . From , there is an output transition labeled with the action with the guard . This means that either the new counter value generated by is non-zero or the old value of was non-zero, both of which are errors. We add an output transition from to itself labeled with the action .
For every decrementing transition of the counter machine from to , has an input transition labeled with action from to . The received value is stored in , where is the counter that is decremented by . There is also an input transition labeled from to , which stores the received value in . From , there is an output transition labeled with the action with the guard . This forces to check that the value generated by was less than the old value of minus one, which is an error. We add an output transition from to itself labeled with the action . At every state in , we add a transition to itself labeled with the action and another transition to itself labeled with the action . Now, adding gadgets to both these FSRMs as described at the end of Section 3 (to avoid finite traces) gives us a set of extra actions .
We now construct a CLTL formula (basically just an LTL formula over the set of actions in this case) that excludes all strings that either containing or the suffix for some . Among the remaining, it includes those which have at least one occurrence of or one occurrence of a transition that leads to the halting state .
Lemma 26.
The halting state is reachable in the counter machine iff the interface register transition system constructed above is interoperable satisfying .
Proof.
If the halting state is reachable, we can construct a distributed regulator that updates the counter values exactly as the counter machine does. The only traces that respect this regulator are those which faithfully simulate the counter machine and those which execute dummy transitions. Both of these satisfy the formula .
If the interface register transition system is interoperable, consider a distributed regulator that makes it interoperable. If this regulator provides wrong values of the counter at any point during simulation, some trace respecting the regulator will execute some error transition, which does not satisfy , a contradiction. Hence, the regulator provides correct counter values. The traces that respect such a regulator are those that execute dummy transitions and the trace that faithfully simulates the counter machine. For this trace to satisfy , some transition leading to the halting state needs to be included, so the counter machine halts.
