Skip to main content
Springer Nature - PMC COVID-19 Collection logoLink to Springer Nature - PMC COVID-19 Collection
. 2020 May 31;12150:276–294. doi: 10.1007/978-3-030-51372-6_16

Optimistic and Pessimistic On-the-fly Analysis for Metric Temporal Graph Logic

Sven Schneider ‡,, Lucas Sakizloglou , Maria Maximova , Holger Giese
Editors: Fabio Gadducci8, Timo Kehrer9
PMCID: PMC7314715

Abstract

The nonpropositional Metric Temporal Graph Logic (MTGL) specifies the behavior of timed dynamic systems given by timed graph sequences (TGSs), which contain typed attributed graphs representing system states and the elapsed time between states. MTGL satisfaction can be analyzed for finite TGSs by translating its satisfaction problem to the satisfaction problem of nested graph conditions using a folding operation (aggregating a TGS into a graph with history) and a reduction operation (translating an MTGL condition into a nested graph condition).

In this paper, we introduce an analysis procedure for MTGL to allow for an on-the-fly analysis of finite/infinite TGSs. To this end, we introduce a further (optimistic) reduction of MTGL conditions, which leads to violations during the on-the-fly analysis only when non-satisfaction is guaranteed in the future whereas the former (pessimistic) reduction leads to violations when satisfaction is not guaranteed in the future. We motivate the relevance of our analysis procedure, which uses both reduction operations, by means of a running example. Finally, we discuss prototypical support in the tool AutoGraph.

Keywords: Graph logic with binding, Nonpropositional metric temporal logic, Runtime monitoring, Three-valued logic

Introduction

The challenges for developing embedded real-time systems with a high degree of parallelism, data dependencies, and timing constraints that must adhere to a given specification are manifold. The formal verification of such systems given by formal models is often intractable and, moreover, such formal models cannot be obtained for systems with unpredictable behaviors such as human-in-the-loop systems. Model-based testing and runtime monitoring are two standard model-driven approaches supporting the engineering of such systems.

In this paper, we check the conformance of a timed graph sequence (TGS), given by a sequence of states where time elapses between the states, against a formal specification. TGSs can be (a) generated using timed graph transformation [3, 7, 17] or can be (b) returned incrementally by a monitor. While offline analysis procedures suffice for finite TGSs, infinite TGSs require an on-the-fly conformance analysis to determine violations as early and as precise as possible.

As a running example, we consider an operating system as an advanced embedded real-time system in which tasks are executed by handlers computing results. For such an operating system, we require the following property Inline graphic.

P:

Whenever a task T is created in a system S, S must have a handler H applicable to T (based on a common id). Moreover, within 10 timeunits, H must produce a result R with value Inline graphic and, during the computation of R, no other handler Inline graphic applicable to T (based on a common id) may exist in S.

For specifying desired system behavior such as the property Inline graphic from above, we employ an extension of the Metric Temporal Graph Logic (MTGL) [8]. This logic permits to concisely express (a) state properties to specify single graphs in a TGS and (b) sequence properties relating graphs at different timepoints in a TGS by their attributes and inner structure. For state properties, MTGL subsumes the graph logic GL of nested graph conditions [9], which is as expressive as first-order logic on graphs. For sequence properties, MTGL has metric temporal operators that refer to matches of graph patterns in graphs in a TGS as first-class citizens. Due to these operators, MTGL is more expressive compared to metric temporal logics such as MTL  [12] only relying on atomic propositions since MTGL allows to keep track of an unbounded number of elements. For example, for the property Inline graphic, we must separately track tasks T and Inline graphic for which corresponding results R and Inline graphic must be created before the corresponding deadline expires.

The main contributions of this paper are as follows. Firstly, we integrate the metric-exists-new operator as a first-class citizen into MTGL, which was not explicitly done in [8]. It matches graph patterns as early as possible to fix a timepoint from which a deadline can be started as in our running example when a new task is matched. Secondly, we formally integrate attribute quantification into MTGL and GL. Thirdly, we develop an on-the-fly checking procedure, which takes a formal MTGL specification and considers a TGS incrementally returning a lower (optimistic) and an upper (pessimistic) bound of the set of true violations, which determine a ground truth of violations that would be obtained ideally. The optimistic lower bound does not contain all true violations to handle TGSs that are continued in a way leading to satisfaction in the future whereas the pessimistic upper bound contains additional false violations to handle TGSs that are continued in a way not leading to satisfaction in the future. Returning the optimistic bound in addition to the pessimistic bound as computed in [8] results essentially in a three valued logic1 where an intervention (e.g. by a user) may depend on whether a pessimistic violation is also an optimistic violation.

In Sect. 2, we recall symbolic graphs and the logic GL of nested graph conditions. In Sect. 3, we extend MTGL by integrating the operator metric-exists-new. We present our on-the-fly analysis procedure and discuss its prototypical tool support by AutoGraph in Sect. 4. Finally, we discuss related work in Sect. 5 and conclude the paper with a summary and remarks on future work in Sect. 6.

Symbolic Graphs and Graph Logic

We now recall typed attributed graphs and nested graph conditions used for representing system states and properties on these states, respectively.

We use symbolic graphs (see e.g. [1820, 24]), called graphs subsequently, to encode typed attributed graphs. Symbolic graphs are an adaptation of E-Graphs  [5] where nodes and edges of a graph G are connected to (sorted) variables Inline graphic instead of data nodes representing actual values. To specify the possible values of variables, graphs are equipped with an attribute constraint (AC) Inline graphic over the variables Inline graphic (e.g. Inline graphic, Inline graphic, and Inline graphic).

An AC Inline graphic is constructed using variables from a set X and the usual operators for the sorts Inline graphic, Inline graphic, Inline graphic, and Inline graphic, which range over the set Inline graphic of all values. Satisfaction of an AC Inline graphic by a valuation Inline graphic is denoted by Inline graphic.2 If an AC Inline graphic is satisfiable or tautological, we write Inline graphic or Inline graphic, respectively.

In the following, we consider graphs that are typed over a type graph Inline graphic using a typing morphism Inline graphic. Type graphs restrict attributed graphs to an admitted subclass Inline graphic. The empty graph is denoted by Inline graphic. For our running example, we employ the type graph Inline graphic from Fig. 1a. Examples of graphs that are typed over Inline graphic are given in Fig. 3b.

Fig. 1.

Fig. 1.

The type graph Inline graphic of our running example, two morphisms, and a GC

Fig. 3.

Fig. 3.

The MTGC Inline graphic and the TGS Inline graphic from our running example

Morphisms Inline graphic between graphs Inline graphic and Inline graphic are defined as usual (see e.g. [24] for a formal definition) and consist of mappings between the components of Inline graphic and Inline graphic. In the remainder of this paper, we only use morphisms Inline graphic for which all mappings are injective.

Moreover, we distinguish between two kinds of morphisms Inline graphic. Firstly, restrictive (mono)morphisms Inline graphic must ensure that the AC of Inline graphic is more restrictive compared to the AC of Inline graphic. This means that each valuation that satisfies the AC of Inline graphic also satisfies the f-translated AC of Inline graphic (i.e., Inline graphic where Inline graphic is the mapping contained in f between the variables of Inline graphic and Inline graphic). Secondly, consistent morphisms Inline graphic must ensure that the AC of Inline graphic is compatible with the AC of Inline graphic. This means that there is at least one valuation that satisfies the AC of Inline graphic as well as the f-translated AC of Inline graphic (i.e., Inline graphic). See Fig. 1b for examples of restrictive and consistent morphisms. The initial (mono)morphism Inline graphic for graph G is restrictive and, when the AC of G is satisfiable, also consistent.

The graph logic GL over nested graph conditions (GCs) can be used to specify graphs. GL features propositional connectives and the operator Inline graphic (called Inline graphic) to extend given matches of graph patterns (given by graphs) in a graph (called host graph) with a satisfiable AC. Technically, the Inline graphic operator describes the extension of a graph pattern H using a restrictive monomorphism Inline graphic. See Fig. 1c for an example of a GC. For improved readability, we visualize restrictive monomorphisms Inline graphic occurring in GCs by omitting graph elements from H not connected to graph elements in Inline graphic.

Definition 1

(Nested Graph Conditions (GCs)). If H is a graph and Inline graphic is a restrictive monomorphism, then Inline graphic is a nested graph condition (GC) over H, written Inline graphic, as follows.

graphic file with name M58.gif

We also make use of the operators false Inline graphic, disjunction Inline graphic, and universal quantification Inline graphic, which can be derived from the operators above.

The semantics of GL is given by the satisfaction relation below, which deviates from [24] by using (a) variable valuations Inline graphic and (b) consistent instead of restrictive matches Inline graphic. Most notably, the GC Inline graphic is satisfied by a match m and a valuation Inline graphic when they can be extended to a match Inline graphic and a valuation Inline graphic that are consistent with f. To ensure that the valuation Inline graphic is used consistently when evaluating ACs occurring in graphs in Inline graphic, we require that the consistency condition is satisfied by Inline graphic (i.e., Inline graphic) using a valuation compatible with Inline graphic. Finally, as in [9, 24], a graph G satisfies a GC defined over Inline graphic when the initial morphism Inline graphic and the empty valuation Inline graphic satisfy the GC.

Definition 2

(Satisfaction of GCs). If Inline graphic is a GC, Inline graphic is a consistent morphism, and Inline graphic is a valuation, then m satisfies Inline graphic via Inline graphic, written Inline graphic, if an item applies.

  • Inline graphic.

  • Inline graphic and Inline graphic.

  • Inline graphic, Inline graphic, and Inline graphic.

  • Inline graphic and there are Inline graphic and Inline graphic s.t. Inline graphic, Inline graphic, Inline graphic, and Inline graphic.3

If Inline graphic, Inline graphic, Inline graphic, and Inline graphic, then Inline graphic.

This novel adaptation of the satisfaction relation (informally handled in [8]) allows to express quantification over attribute values as required for our on-the-fly analysis procedure in Sect. 4. For example, we can state that “for each Inline graphic satisfying Inline graphic there is a variable Inline graphic with the value of x” using the GC Inline graphic in Fig. 2a, which is satisfied by the graph G from Fig. 2b containing a matchable copy of x. In our implementation in the tool AutoGraph, we operationalize the satisfaction check by constructing the AC from Fig. 2c incorporating all possible matches for the variable y for which satisfiability then implies that G satisfies Inline graphic.

Fig. 2.

Fig. 2.

Satisfaction of GCs by graphs

Metric Temporal Graph Logic

The Metric Temporal Graph Logic (MTGL) over metric temporal graph conditions (MTGCs) [8] extends GL with two metric temporal operators. In particular, (a) the until operator Inline graphic is well-known from MTL  [12] and (b) the formal integration of the metric-exists-new operator Inline graphic allows to match graph patterns at a future timepoint (restricted by an interval) when the match is first available.

Definition 3

(Metric Temporal Graph Conditions (MTGCs)). If H is a graph, Inline graphic is a restrictive monomorphism, and I is an interval over Inline graphic, then Inline graphic is a metric temporal graph condition (MTGC) over H, written Inline graphic, as follows.

graphic file with name M101.gif

The derived operator metric-forall-new Inline graphic is the dual operator to Inline graphic. Also, operators such as eventually and globally can be derived using the operator Inline graphic.

The integration of graph pattern matching of GCs (for state properties) and the two metric temporal operators (for sequence properties) allows for the formalization of properties where a match into a graph (established using the operators Inline graphic or Inline graphic) is preserved/extended over multiple timed steps of the system (using the operator Inline graphic) and where the duration of these timed steps can be specified using intervals. For our running example, see Fig. 3a for a formalization of the property P introduced in Sect. 1 in the form of an MTGC Inline graphic.

The semantics of MTGL is defined over Timed Graph Sequences (TGSs) [8] (e.g. Inline graphic in Fig. 3b), which describe a single (possibly infinite) evolution of a system in terms of its visited states and the durations between these states. A TGS Inline graphic starting in a graph G (written Inline graphic or Inline graphic when Inline graphic is finite) is a sequence of timed spans Inline graphic where Inline graphic is the relative time at which the successor state Inline graphic is reached from Inline graphic and where Inline graphic and r describe the deletion and addition of graph elements as usual. We also assume the reversal operation Inline graphic, the concatenation operation Inline graphic, the prefix relation Inline graphic, the length operation Inline graphic (which counts the timed spans), the duration operation Inline graphic (which sums the durations Inline graphic of all timed spans), the projection operation Inline graphic to the graph at timepoint t, and the slicing operation Inline graphic delivering the TGS between timepoints Inline graphic and Inline graphic. For well-definedness of the slicing operation (and the satisfaction relation of MTGL later on), we require that Inline graphic implies Inline graphic ruling out Zeno TGSs.

For the semantics of MTGL, we define that a match m (also called binding) is propagated over a single timed span Inline graphic by adapting it according to the renaming given by Inline graphic and r. However, the propagation operation is partial when graph elements matched by m are not preserved across the timed span.

Definition 4

(Operation Inline graphic ). If Inline graphic, Inline graphic are consistent morphisms, Inline graphic is a timed span, and there is a consistent morphism Inline graphic s.t. Inline graphic and Inline graphic, then Inline graphic is obtained by propagation of m over Inline graphic, written Inline graphic. Also, we extend the operation Inline graphic to finite TGSs as expected.

The semantics of MTGL is given by the satisfaction relation below, which is defined as for GL for the operators conjunction, negation, and exists and uses a current observation timepoint t (which does not exceed the duration of the TGS) in addition to a consistent match Inline graphic and a valuation Inline graphic. Note that the target of the match m is adapted (via propagation over timed spans from TGS Inline graphic) and the current timepoint t is modified (according to the provided intervals) only in the cases of the metric-exists-new and until operators. For these two metric temporal operators, we provide further informal explanations below. Finally, a TGS satisfies an MTGC defined over Inline graphic when the TGS, the initial observation timepoint 0, the initial morphism Inline graphic representing an empty binding, and the empty valuation Inline graphic satisfy the MTGC.

Definition 5

(Satisfaction of MTGCs by TGSs). If Inline graphic is an MTGC, Inline graphic is a TGS, Inline graphic is a timepoint before the end of Inline graphic, Inline graphic is a consistent morphism into the graph at timepoint t, and Inline graphic is a valuation, then Inline graphic, if an item applies.

  • Inline graphic.

  • Inline graphic and Inline graphic.

  • Inline graphic, Inline graphic, and Inline graphic.

  • Inline graphic and there are Inline graphic and Inline graphic s.t. Inline graphic, Inline graphic, Inline graphic, and Inline graphic.

  • Inline graphic and there are Inline graphic, Inline graphic, and Inline graphic s.t.

    • there is Inline graphic s.t. Inline graphic, Inline graphic, Inline graphic, Inline graphic, and
    • for each Inline graphic there is no Inline graphic.
  • Inline graphic and there is Inline graphic s.t.

    • there is Inline graphic s.t. Inline graphic and
    • for each Inline graphic there is Inline graphic s.t. Inline graphic.

If Inline graphic, Inline graphic, Inline graphic, and Inline graphic, then Inline graphic.

For the metric-exists-new operator, we state that there is some timepoint Inline graphic in the future that is compatible with the given interval I where the propagated match Inline graphic can be extended to a match Inline graphic such that (first item) this extension is compatible with f as required for the case of exists and (second item) the extended match Inline graphic cannot be propagated to any timepoint in the strict past. For the until operator, we state (first item) that Inline graphic is eventually satisfied for some timepoint Inline graphic in the future that is compatible with the given interval I and (second item) that Inline graphic is permanently satisfied for all timepoints between the current observation timepoint t and the timepoint Inline graphic except for Inline graphic.

For our running example, see Fig. 3b for a TGS Inline graphic, which does not satisfy the MTGC Inline graphic from Fig. 3a. In this TGS, we find a fresh match of a task on a system at timepoint Inline graphic (after step 2). Moreover, we find immediately a (unique) handler for this task (based on the common id 123) such that there is no second handler for that task (with common id) until we find at timepoint Inline graphic a result with the successful attribute value ok obtained by the handler. However, this result is not obtained within the specified interval of at most 10 timeunits, which corresponds to the global time interval Inline graphic in this case.

On-the-fly Analysis for MTGL

We now present an on-the-fly analysis procedure for checking MTGCs against finite and infinite TGSs as our main contribution. For this aim, we build upon [8] where an operation Inline graphic for translating an MTGC Inline graphic into a GC Inline graphic and an operation Inline graphic for translating a finite TGS Inline graphic into a so-called graph with history (GH) G were presented. These two operations ensured that Inline graphic iff Inline graphic, which allows for an efficient check of MTGL satisfaction for finite TGSs by checking GL satisfaction for finite GHs instead. Note that the problem of checking MTGL satisfaction (as for other metric temporal logics) becomes particularly difficult when instances of until operators are nested.

When considering a TGS Inline graphic in an on-the-fly scenario where timed spans are added one-by-one, we cannot simply apply the procedure from [8] to all prefixes of Inline graphic because the MTGL satisfaction relation is inherently pessimistic not returning the desirable results. For example, the MTGC Inline graphic from Fig. 3a would be violated by the TGS Inline graphic from Fig. 3b not only at timepoint 21 when the violation of the deadline is detected (as discussed before) but also at timepoint 6 since the prefix of length 2 of Inline graphic does not contain any node of type Result. Note that we would indeed expect a violation at timepoint 6 already when the prefix of length 2 of Inline graphic would be the entire TGS to be considered. As a ground truth of violations that would ideally be returned by our procedure, we define true violations later on in Definition 12 where also all subsequent behavior given by the timed spans in the TGS, which is not available to the on-the-fly procedure, is also taken into account.

For our on-the-fly analysis procedure (see Fig. 4 for an overview), we employ extensions/adaptations of the operations Inline graphic and Inline graphic from [8]. As inputs, we consider an MTGC Inline graphic and a finite/infinite TGS Inline graphic that is incrementally considered. If the given TGS Inline graphic is finite, it may include a node of type Terminated in its last graph to denote that it is not going to be continued (see Fig. 3b). Firstly, we employ a modification of the operation Inline graphic (see Definition 9) to obtain for Inline graphic (via a parameter Inline graphic), in addition to the pessimistic GC Inline graphic as in [8], a second optimistic GC Inline graphic. Note that we apply the operation Inline graphic offline (once for each mode) before considering the timed spans of the TGS for increased efficiency. Secondly, we split the operation Inline graphic into two operations Inline graphic and Inline graphic to allow for an incremental rather than a batch folding of a TGS. That is, Inline graphic produces a first GH from the start graph of the TGS and Inline graphic modifies a given GH Inline graphic into a GH Inline graphic for each timed span from the TGS as soon as that timed span is available. The sequence of GHs constructed in this way results in a GH TGS Inline graphic that corresponds to the prefix of the TGS available so far. Thirdly, we check for the conformance of each Inline graphic with Inline graphic and Inline graphic as soon as Inline graphic is available by separately applying the GL satisfaction relation to Inline graphic and Inline graphic as well as to Inline graphic and Inline graphic. Each determined non-satisfaction is a violation for which we add the global time of its occurrence (which is given by the sum of all Inline graphic so far) to the resulting sets of pessimistic and optimistic violations.

Fig. 4.

Fig. 4.

Overview of the on-the-fly analysis procedure

The operations Inline graphic and Inline graphic ensure that each GH resulting from folding a TGS contains for each node/edge occurring in the TGS the timepoints of its creation and (if it was deleted) its deletion using additional Inline graphic and Inline graphic attributes. For our running example, the type graph Inline graphic from Fig. 1a contains these Inline graphic and Inline graphic attributes already and the GH eventually obtained for the entire finite terminated TGS Inline graphic from Fig. 3b is given in Fig. 5c.

Fig. 5.

Fig. 5.

The results of reducing the MTGC Inline graphic from Fig. 3a and the result of incrementally folding the entire TGS Inline graphic from Fig. 3b

The operation Inline graphic returns GCs that encode the satisfaction checks for MTGL operators according to Definition 5 using ACs. These ACs make use of (a) the Inline graphic and Inline graphic attributes as added to the GH to control the matching of elements, (b) additional variables for quantifying over observation timepoints as in Definition 5, and (c) a variable Inline graphic storing the current global time (i.e., the duration of the considered TGS prefix Inline graphic). As for the variable Inline graphic in Fig. 2, the additional quantified variables and the variable Inline graphic for the current global time are required to be contained in the GHs. The operation Inline graphic returns for this purpose, besides the GC, also a graph Inline graphic containing these additional variables including the distinguished global time variable Inline graphic. For our running example, the graph Inline graphic is given in Fig. 5b where all variables are associated with :Encoding nodes to decrease the number of matches via the Inline graphic attributes that need to be considered when we check whether a GH subsuming Inline graphic satisfies the obtained GC. Note that the construction of :Encoding nodes is omitted later in Definition 9 to ease presentation. While Inline graphic is a subgraph of each constructed GH, we add the AC Inline graphic to the current GH assigning the current global time to the variable Inline graphic just before checking GL satisfaction whenever a new GH has been constructed during the on-the-fly analysis.

We now define the operations used in the on-the-fly analysis procedure. The predicate Inline graphic identifies a unique global time variable Inline graphic in a GH G (subsuming the graph Inline graphic obtained from folding) and the operation Inline graphic adds the AC that assigns the current global time to the Inline graphic into the graph G.

Definition 6

(Predicate Inline graphic and Operation Inline graphic ). If G is a GH with a variable x of sort Inline graphic, then G is a graph with global time variable x, written Inline graphic. If, additionally, Inline graphic is a global timepoint and Inline graphic is the graph obtained from G by adding the AC Inline graphic, then Inline graphic is the time-assigned version of G for the timepoint t, written Inline graphic.

For incrementally folding a TGS starting in a graph H into a GH, we use in the first step the following operation Inline graphic, which joins the graphs Inline graphic and H as well as adds Inline graphic attributes to all nodes and edges originating from H.

Definition 7

(Operation Inline graphic ). If Inline graphic is the componentwise disjoint union of the graphs Inline graphic and H where the attributes Inline graphic and Inline graphic are added to each node and edge Inline graphic originating from H, then Inline graphic.

The operation Inline graphic adapts a GH G reached at global timepoint t to a GH Inline graphic by incorporating the changes described by a timed span Inline graphic. Firstly, Inline graphic attributes of nodes and edges deleted by Inline graphic are updated to the new global timepoint Inline graphic. Secondly, Inline graphic attributes with new global timepoint Inline graphic and Inline graphic attributes with default value Inline graphic are added to all nodes and edges created by r.

Definition 8

(Operation Inline graphic ). If G is a graph, Inline graphic is the current global timepoint, Inline graphic is a timed span, and Inline graphic is a graph constructed from G by (a) changing the attribute Inline graphic to Inline graphic for each node or edge Inline graphic, (b) renaming each node and edge Inline graphic according to Inline graphic, (c) renaming each node and edge Inline graphic according to r, (d) adding each node and edge Inline graphic, and (e) adding the attributes Inline graphic and Inline graphic to each node and edge Inline graphic, then Inline graphic.

The operations Inline graphic and Inline graphic preserve the predicate Inline graphic implying that the variable Inline graphic for the current global time can still be identified and used after the folding steps during the on-the-fly analysis. Moreover, the operation Inline graphic induces a timed span between the GHs G and Inline graphic leading to a GH TGS as discussed above. For our running example, the result of applying Inline graphic and then incrementally Inline graphic to the TGS Inline graphic from Fig. 3b leads to the graph Inline graphic in Fig. 5c where the elements of the graph Inline graphic from Fig. 5b are omitted for brevity. Since no elements are deleted in Inline graphic, all elements in Inline graphic have Inline graphic attributes of value Inline graphic.

We apply the operation Inline graphic, which is equipped with a Inline graphic parameter, to separately construct the GCs Inline graphic and Inline graphic for a given MTGC Inline graphic. The following definition of Inline graphic extends the definition in [8] by additionally covering the optimistic reduction for Inline graphic and explicitly integrating the formal reduction for the MTGL operator metric-exists-new introduced in Definition 3.

Definition 9

(Operation Inline graphic ). If Inline graphic is an MTGC and Inline graphic is the chosen mode for reduction, then Inline graphic where the graph Inline graphic contains the variable Inline graphic and an additional variable Inline graphic for the initial observation timepoint 0. The employed recursive operation Inline graphic is homomorphic for Inline graphic, Inline graphic, and Inline graphic and adds Inline graphic and Inline graphic attributes to all nodes and edges in the resulting GC. For the remaining operators, Inline graphic is defined as follows where the formal parameter Inline graphic corresponds to the variable t in Definition 5 capturing the timepoint at which the MTGC provided to Inline graphic is checked for satisfaction.

  • Inline graphic where Inline graphic additionally requires Inline graphic 4 ensuring that Inline graphic is matchable at timepoint Inline graphic.

  • Inline graphic where Inline graphic additionally requires a variable Inline graphic satisfying Inline graphic 5 ensuring that Inline graphic is matchable at timepoint Inline graphic but not earlier.

  • Inline graphic with
    • Inline graphic where Inline graphic additionally requires a variable Inline graphic satisfying Inline graphic ensuring that Inline graphic is a future timepoint where Inline graphic is satisfied and Inline graphic additionally requires a variable Inline graphic satisfying Inline graphic for checking that Inline graphic is satisfied until timepoint Inline graphic.
    • Inline graphic for Inline graphic disabling the optimistic check.
    • Inline graphic for Inline graphic where Inline graphic additionally requires a :Terminated node disabling the optimistic check when the TGS corresponding to the GH against which the resulting GC is checked is known to have ended, Inline graphic additionally requires a variable Inline graphic satisfying Inline graphic ensuring that there is still a timepoint in the strict future at which Inline graphic could be satisfied, and Inline graphic additionally requires a variable Inline graphic satisfying Inline graphic for checking that Inline graphic was satisfied at least until the current global time Inline graphic.

The returned graph Inline graphic contains all additional variables used in the reduction.6

For our running example, the result of the reduction of the MTGC Inline graphic from Fig. 3a is given in Fig. 5a for both reduction modes. The first line requires that the initial observation timepoint Inline graphic is 0 and that the variable Inline graphic is matched into the GH thereby binding it to the current global time. The second line (a) attempts to match T, Inline graphic, and S for some observation timepoint Inline graphic in the future of Inline graphic such that the matched elements are alive at timepoint Inline graphic and not all of them are alive at any earlier timepoint (encoding the metric-forall-new operator) and (b) then checks whether a suitable handler with the same id exists at timepoint Inline graphic. The third line (for Inline graphic) tries to determine some timepoint Inline graphic in the future of Inline graphic restricted by the given interval Inline graphic of the until operator where (a) a result with value ok can be matched and where (b) at all timepoints Inline graphic no second handler with the same id can be matched. The fourth line (for Inline graphic) checks whether the TGS has not terminated already (which disables the optimistic checking), whether there is still some time left for the right-hand side condition of the until operator to become satisfied, and whether the left-hand side condition of the until operator was satisfied at all timepoints Inline graphic since Inline graphic and up-to the current global time.

The theorem on soundness of Inline graphic from [8] is now adapted for the included operator metric-exists-new and extended to cover also the optimistic mode.

Theorem 1

(Soundness of Inline graphic ). If Inline graphic is an MTGC, Inline graphic is a finite TGS starting in H and ending in Inline graphic, Inline graphic is the result of pessimistic reduction, Inline graphic is the result of optimistic reduction, and G is obtained from Inline graphic and Inline graphic using Inline graphic and the iterated application of Inline graphic, then (a) Inline graphic iff Inline graphic and (b) Inline graphic only if Inline graphic.

Proof Idea

Straightforward inductions on Inline graphic and Inline graphic along the lines of [8].   Inline graphic

The reverse direction of the item (b) in the theorem above does not hold for the MTGC Inline graphic even though non-satisfaction in the future is guaranteed. Moreover, no other reduction can achieve the equivalence for item (b) since satisfiability is undecidable for GCs and hence also for MTGCs implying that guaranteed non-satisfiability as for Inline graphic cannot always be determined. However, we may simplify generated GCs using the sound and refutationally complete procedure from [24] for checking GL satisfiability. For example, the GC obtained by reducing the MTGC Inline graphic from above can be simplified to Inline graphic using this approach.

The following two operations Inline graphic and Inline graphic rely on the operations Inline graphic and Inline graphic, respectively, and are used in our on-the-fly analysis procedure, which is given in pseudo code in Procedure 1. To simplify presentation, Procedure 1 describes the on-the-fly analysis using only one of both modes requiring that two instances of Procedure 1 are executed concurrently to cover the optimistic and the pessimistic mode. Procedure 1 maintains during its execution a triple (GtV) consisting of the current GH G, the current global time t, and the set of computed violations V. The operation Inline graphic constructs the first triple (GtV) by applying Inline graphic and by inserting the initial timepoint 0 into the set of violations when the resulting GH G does not satisfy the GC Inline graphic.

Definition 10

(Operation Inline graphic ). If Inline graphic was returned by an application of the operation Inline graphic, Inline graphic is a finite TGS starting in graph H, G is the GH obtained using Inline graphic, and if Inline graphic then Inline graphic else Inline graphic, then Inline graphic.

graphic file with name 495607_1_En_16_Fige_HTML.jpg

The operation Inline graphic modifies a triple (GtV) to a triple Inline graphic according to a timed span Inline graphic by modifying the GH G to a GH Inline graphic, by increasing the global time t to Inline graphic, and by inserting the global time Inline graphic into the set of violations V when Inline graphic does not satisfy the GC Inline graphic.

Definition 11

(Operation Inline graphic ). If Inline graphic was returned by an application of the operation Inline graphic, Inline graphic is a timed span, Inline graphic is the global time before Inline graphic, G is a GH with time-storing variable Inline graphic satisfying Inline graphic, Inline graphic is a set of violations computed until the timepoint t, Inline graphic is the global time after Inline graphic, Inline graphic is the modification of the GH G according to Inline graphic, and if Inline graphic then Inline graphic else Inline graphic implements the conditional addition of a violation Inline graphic to the set of violations V, then the triple (tGV) is modified to the triple Inline graphic according to the timed span Inline graphic, written Inline graphic.

Moreover, we extend the operation Inline graphic to finite TGSs using its iterated application starting with the triple obtained using Inline graphic.

For our running example, Procedure 1 returns the sets Inline graphic and Inline graphic of violations for the pessimistic and the optimistic mode, respectively. Note that the given MTGC  is violated at each timepoint in Inline graphic, i.e., the violation is detected with a delay of about 5 timeunits. However, we believe that assuming a sufficiently high timed span rate (checking for violations permanently in a hot loop) mitigates this problem of delayed detection. Also, we assume a user-provided policy for deciding whether timepoints are recorded as violations when employed solvers such as Z3 are unable to decide the satisfaction problem in time.

Subsequently, we formally evaluate Procedure 1 by comparing the violations printed by it with a ground truth of violations that would be returned ideally. This ground truth is defined by the operation Inline graphic delivering the set of true violations of an MTGC Inline graphic in a TGS Inline graphic for a maximum checking index n. This set of true violations contains the durations of all prefixes Inline graphic of the TGS Inline graphic where the MTGC Inline graphic is not satisfied subsequently by any continuation Inline graphic that is a prefix of Inline graphic. Observe that a precise detection of violations thereby requires the knowledge of future steps, which is unavailable in the context of our proposed on-the-fly analysis approach.

Definition 12

(Operation Inline graphic ). If Inline graphic is an MTGC, Inline graphic is a TGS, Inline graphic is a maximum checking index, and Inline graphic, then Inline graphic.

To enable a comparison of Procedure 1 with the set of true violations, we now introduce the operation Inline graphic, which gathers the optimistic and pessimistic violations printed by Procedure 1 up to a given index n.

Definition 13

(Operation Inline graphic ). If Inline graphic is the reduction obtained using the operation Inline graphic, Inline graphic is a TGS of length at least Inline graphic starting in graph H, Inline graphic is the prefix of length n of Inline graphic, Inline graphic is the first triple for the on-the-fly analysis, and Inline graphic computes the violations Inline graphic using the on-the-fly analysis on the prefix Inline graphic, then Inline graphic.

Based on the presented definitions, we introduce our main result stating that the optimistic and the pessimistic on-the-fly analysis carried out using Procedure 1 (and formalized using the operation Inline graphic) determines under- and over-approximations of the set of true violations, respectively. That is, optimistic violations must be true violations and pessimistic violations may be true violations.

Theorem 2

(Approximate Detection of True Violations using Optimistic and Pessimistic On-the-fly Analysis). If Inline graphic is an MTGC, Inline graphic is a TGS, Inline graphic is a maximum checking index, and Inline graphic, then

  • Inline graphic and

  • Inline graphic.

Proof Idea

The first item holds using Theorem 1 since every violation of the GC  Inline graphic obtained using reduction for Inline graphic ensures that the future evolution used in the operation Inline graphic is also guaranteed to violate the MTGC Inline graphic as the violation cannot be undone in any continuation. The second item holds using Theorem 1 because (via contraposition) when the GC Inline graphic obtained using reduction for Inline graphic is not violated, this means that the considered TGS prefix Inline graphic satisfies the MTGC Inline graphic and therefore at least the empty continuation Inline graphic satisfies Inline graphic as well implying that the current global timepoint is no true violation.   Inline graphic

For our running example from Fig. 3 where the TGS Inline graphic has length 3, we observe that Inline graphic. This means that the optimistic on-the-fly analysis detects only one true violation at global timepoint 21 but the pessimistic on-the-fly analysis returns additionally a second violation at global timepoint 6 indicating that the MTGC  Inline graphic may not be satisfied by all continuations, which indeed is the case for the TGS  Inline graphic. When changing Inline graphic to 1 in Fig. 3b, the pessimistic on-the-fly analysis still generates the violation at global timepoint 6 but 6 is no true violation since the result R is then generated in time.

Based on Theorem 2, we obtain, as mentioned in Sect. 1, a three-valued interpretation of MTGL when using Procedure 1 (formalized using the operation Inline graphic) to generate optimistic and pessimistic violations. In this interpretation, the absence of a pessimistic violation t guarantees satisfaction, each optimistic violation t guarantees nonsatisfaction, and a pessimistic violation t that is no optimistic violation is an indifferent judgement on satisfaction.

Definition 14

(Three-valued Interpretation of MTGL). If Inline graphic is an MTGC, Inline graphic is a TGS of length at least Inline graphic, and Inline graphic is the prefix of length n of Inline graphic, then Inline graphic if Inline graphic, Inline graphic if Inline graphic, and Inline graphic otherwise.

From a practical point of view, Procedure 1 solves the satisfaction problem for three kinds of TGSs. Firstly, non-terminating systems can be analyzed throughout their entire runtime in an on-the-fly manner. Secondly, finite slices of TGSs generated by long-running systems can be analyzed in an offline manner producing pessimistic but no optimistic violations for cases where the ongoing evolution of the system may be admissible. Lastly, terminating systems where a Terminated node is added by the last timed span can be analyzed where pessimistic and optimistic violations coincide after the last step.

However, for formal specifications given by complex MTGCs, we intend to equip violations given by timepoints with human-readable explanations. For this purpose, we may use partial MTGC satisfaction trees following GC satisfaction trees from [25]. We expect that this would also permit an analysis of the causal dependencies among violations and their origins. For our running example, the violation at timepoint 21 has the pessimistic violation at timepoint 6 as an origin because the problematic task T connected to system S was freshly matched at timepoint 6 leading to the violated deadline at timepoint 21.

We implemented Procedure 1 in the tool AutoGraph  [24], which supports GL and MTGL and relies on the constraint solver Z3  [16] for checking the satisfiability of ACs. For a high level of confidence, we applied extensive testing of the implemented functionality for diverse and deeply nested MTGCs also covering our running example. Overall, the implementation is promising and demonstrates the feasibility of our approach.

Related Work

Verification approaches for graph transformation systems are incomplete due to their expressiveness. For example, logics such as CTL and PTCTL can be applied to entire state spaces [6, 15] but have limited support for sequence properties relying on atomic propositions. Similarly, invariant verification [4, 23] as an example of static analysis considers graph sequences but only state invariants.

On-the-fly analysis of dynamic systems is used (before deployment) in testing and (after deployment) in specification-based monitoring using specifications given by temporal logics, automata with quantification, and rule-based systems [1]. These approaches are difficult to compare due to highly domain-specific requirements regarding expressiveness, efficiency, and usability. Logic-based approaches e.g. [11, 14] often lack support for key features of MTGL such as data elements, bindings, or metric bounds in temporal operators. A notable exception is the Metric First-Order Temporal Logic (MFOTL) [2], supported by the tool MonPoly, that represents a system state as a set of relations, supports the binding of elements and uses a point based rather than an interval based semantics as MTGL. Note that the encoding of MTGCs in MFOTL is highly technical and error-prone (similarly, the logic of nested graph conditions [9] is advantageous compared to FOL on graphs in graph centered scenarios). Finally, MonPoly imposes syntactic limitations on MFOTL conditions to ensure that provided conditions are satisfied/violated by a finite future.

Logics such as MTGL and MFOTL can be directly applied in the context of runtime monitoring [1, 13]. A roadmap towards such an application using an extended subset of MTGL is presented in an informal way in [21, 22].

Conclusion and Future Work

We introduced an on-the-fly analysis procedure for the satisfaction of MTGCs by infinite TGSs (generated by non-terminating systems) and finite TGSs (generated by terminating systems or representing prefixes of infinite TGSs). The analysis procedure results in a three-valued interpretation of MTGL where unavoidable non-satisfaction is detected via optimistic violations and where potential non-satisfaction in the future is detected via pessimistic violations as soon as possible. The two sets of violations approximate the ground truth given by the set of true violations, which can only be determined by offline analysis for finite terminated TGSs. The on-the-fly analysis procedure including both sets of violations is supported by our extension of the tool AutoGraph.

In the future, we will (a) integrate the since operator into MTGL and the proposed analysis procedure, (b) improve applicability of our approach using more detailed violations, (c) improve the optimistic reduction by simplifying the reduced MTGC using the constraint solver approach from [24], (d) employ incremental GC checking to improve the on-the-fly checking performance, and (e) compare our approach to other tools such as MonPoly w.r.t. efficiency.

Footnotes

1

At each timepoint during the on-the-fly analysis, we return either no violation, only a pessimistic violation, or a pessimistic and an optimistic violation.

2

The solver Z3  [16] has support for checking satisfiability of ACs but is known to return indefinite results because satisfiability is undecidable for ACs of unrestricted form. While Z3 always succeeds for our running example, we handle this special case in our prototypical implementation by providing warnings to the user.

3

The partial function Inline graphic obtained as the reversal of the injective function Inline graphic does not replace variables in Inline graphic that are not mapped to by Inline graphic. For simplicity, we assume that G and Inline graphic have disjoint sets of variables.

4

  Inline graphic is an AC based on Inline graphic and Inline graphic attributes stating that all nodes and edges in H are created and not yet deleted at timepoint x.

5

  Inline graphic is an AC stating that the highest Inline graphic attribute value in H is x.

6

Note that the predicate Inline graphic is satisfied by construction.

Funded by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) - 241885098, 148420506, 158230677.

Contributor Information

Fabio Gadducci, Email: gadducci@di.unipi.it.

Timo Kehrer, Email: timo.kehrer@informatik.hu-berlin.de.

Sven Schneider, Email: sven.schneider@hpi.de.

Lucas Sakizloglou, Email: lucas.sakizloglou@hpi.de.

Maria Maximova, Email: maria.maximova@hpi.de.

Holger Giese, Email: holger.giese@hpi.de.

References

  • 1.Bartocci E, Deshmukh J, Donzé A, Fainekos G, Maler O, Ničković D, Sankaranarayanan S. Specification-based monitoring of cyber-physical systems: a survey on theory, tools and applications. In: Bartocci E, Falcone Y, editors. Lectures on Runtime Verification; Cham: Springer; 2018. pp. 135–175. [Google Scholar]
  • 2.Basin DA, Klaedtke F, Müller S, Zalinescu E. Monitoring metric first-order temporal properties. J. ACM. 2015;62(2):15:1–15:45. doi: 10.1145/2699444. [DOI] [Google Scholar]
  • 3.Becker, B., Giese, H.: On safe service-oriented real-time coordination for autonomous vehicles. In: ISORC 2008, pp. 203–210. IEEE Computer Society (2008). 10.1109/ISORC.2008.13
  • 4.Dyck J, Giese H. k-inductive invariant checking for graph transformation systems. In: de Lara J, Plump D, editors. Graph Transformation; Cham: Springer; 2017. pp. 142–158. [Google Scholar]
  • 5.Ehrig H, Ehrig K, Prange U, Taentzer G. Fundamentals of Algebraic Graph Transformation. Heidelberg: Springer; 2006. [Google Scholar]
  • 6.Ghamarian AH, de Mol M, Rensink A, Zambon E, Zimakova M. Modelling and analysis using GROOVE. STTT. 2012;14(1):15–40. doi: 10.1007/s10009-011-0186-x. [DOI] [Google Scholar]
  • 7.Giese H. Modeling and verification of cooperative self-adaptive mechatronic systems. In: Kordon F, Sztipanovits J, editors. Reliable Systems on Unreliable Networked Platforms; Heidelberg: Springer; 2007. pp. 258–280. [Google Scholar]
  • 8.Giese, H., Maximova, M., Sakizloglou, L., Schneider, S.: Metric temporal graph logic over typed attributed graphs. In: Hähnle and van der Aalst [10], pp. 282–298 (2019). 10.1007/978-3-030-16722-6_16
  • 9.Habel A, Pennemann K. Correctness of high-level transformation systems relative to nested conditions. Math. Struct. Comput. Sci. 2009;19(2):245–296. doi: 10.1017/S0960129508007202. [DOI] [Google Scholar]
  • 10.Hähnle R, van der Aalst W, editors. Fundamental Approaches to Software Engineering; Cham: Springer; 2019. [Google Scholar]
  • 11.Havelund K, Peled D. Runtime verification: from propositional to first-order temporal logic. In: Colombo C, Leucker M, editors. Runtime Verification; Cham: Springer; 2018. pp. 90–112. [Google Scholar]
  • 12.Koymans R. Specifying real-time properties with metric temporal logic. Real-Time Syst. 1990;2(4):255–299. doi: 10.1007/BF01995674. [DOI] [Google Scholar]
  • 13.Leucker M, Schallhart C. A brief account of runtime verification. J. Log. Algebr. Program. 2009;78(5):293–303. doi: 10.1016/j.jlap.2008.08.004. [DOI] [Google Scholar]
  • 14.Maler O, Nickovic D. Monitoring temporal properties of continuous signals. In: Lakhnech Y, Yovine S, editors. Formal Techniques, Modelling and Analysis of Timed and Fault-Tolerant Systems; Heidelberg: Springer; 2004. pp. 152–166. [Google Scholar]
  • 15.Maximova M, Giese H, Krause C. Probabilistic timed graph transformation systems. J. Log. Algebr. Meth. Program. 2018;101:110–131. doi: 10.1016/j.jlamp.2018.09.003. [DOI] [Google Scholar]
  • 16.Microsoft Corporation: Z3. https://github.com/Z3Prover/z3
  • 17.Neumann, S.: Modellierung und Verifikation zeitbehafteter Graphtransformationssysteme mittels Groove. Master’s thesis, University of Paderborn (2007)
  • 18.Orejas F. Symbolic graphs for attributed graph constraints. J. Symb. Comput. 2011;46(3):294–315. doi: 10.1016/j.jsc.2010.09.009. [DOI] [Google Scholar]
  • 19.Orejas, F., Lambers, L.: Symbolic attributed graphs for attributed graph transformation. ECEASST 30 (2010). http://journal.ub.tu-berlin.de/index.php/eceasst/article/view/405
  • 20.Orejas F, Lambers L. Lazy graph transformation. Fundam. Inf. 2012;118(1–2):65–96. doi: 10.3233/FI-2012-706. [DOI] [Google Scholar]
  • 21.Sakizloglou, L., Ghahremani, S., Brand, T., Barkowsky, M., Giese, H.: Towards highly scalable runtime models with history. In: SEAMS 2020. IEEE Computer Society (2020). (to appear)
  • 22.Sakizloglou, L., Ghahremani, S., Brand, T., Barkowsky, M., Giese, H.: Towards highly scalable runtime models with history. Technical Report (2020). arxiv: 2004.03727
  • 23.Schneider, S., Dyck, J., Giese, H.: Formal verification of invariants for attributed graph transformation systems based on nested attributed graph conditions. In: Gadducci, F., Kehrer, T. (eds.) ICGT 2020, LNCS. Springer, Heidelberg (2020). (to appear)
  • 24.Schneider S, Lambers L, Orejas F. Automated reasoning for attributed graph properties. STTT. 2018;20(6):705–737. doi: 10.1007/s10009-018-0496-3. [DOI] [Google Scholar]
  • 25.Schneider, S., Lambers, L., Orejas, F.: A logic-based incremental approach to graph repair. In: Hähnle and van der Aalst [10], pp. 151–167 (2019). 10.1007/978-3-030-16722-6_9

Articles from Graph Transformation are provided here courtesy of Nature Publishing Group

RESOURCES