<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>A Rewriting Based Monitoring Algorithm for TPTL?</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Ming Chai</string-name>
          <email>ming.chai@informatik.hu-berlin.de</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Bernd-Holger Schlingloff</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Humboldt University Berlin</institution>
          ,
          <addr-line>Berlin D-10099</addr-line>
          ,
          <country country="DE">Germany</country>
        </aff>
      </contrib-group>
      <fpage>61</fpage>
      <lpage>72</lpage>
      <abstract>
        <p>In this paper, we present a rewriting based monitoring algorithm for time propositional temporal logic (TPTL), which is a classic time extension of linear temporal logic (LTL). TPTL has been shown to be more expressive than other real-time extensions of LTL, e.g., metric temporal logic (MTL). We first describe the syntax and semantics of TPTL on finite time-traces. Using Maude, which is an executable environment for various logics, we give rewriting clauses to check whether a finite time-trace satisfies a TPTL formula. We use our algorithm to test a concrete example from the European Train Control System (ETCS), and evaluate it on several benchmarks. The results show the feasibility of our approach.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>
        Runtime verification is proposed for checking whether a run of a system satisfies
or violates a given correctness property [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. It is seen as a lightweight verification
technique when compared to model checking and testing. Runtime verification
is able to avoid the following problems of model checking: i) when checking a
high complexity system, model checking could suffer from the so-called state
explosion problem; ii) when checking a black-box system, a model of the system
may not be available for model checking; iii) the object of model checking is a
model of the system, not the system itself.
      </p>
      <p>Runtime verification is performed by using a monitor. This is a device or
a piece of software that reads a behavior of the system under monitoring and
gives a certain verdict (true or false) as the result. A behavior of the system is
presented by its trace, which is an observable execution sequence of the system.
Unlike model checking, runtime verification does not check all executions of
the underlying system, but a finite trace. Hence it does not suffer from the
state explosion problem when dealing with a large system. Furthermore, runtime
verification does not need a model of the system. Therefore, it is well suited to
check black-box systems. Finally, the checking object of runtime verification is
the system itself. Thus, the possibility of introducing additional errors in the
modeling is excluded.</p>
      <p>
        One of the most interesting problems in runtime verification is how to build
a monitor from a high level specification. Havelund et al. [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] propose a formula
rewriting based runtime verification approach, constituting part of a project
named Java PathExplorer (JPAX). Their work aims at monitoring Java
programs and has been used in Mars Exploration Rover missions. Feng et al. [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]
propose an MOP framework for software development and analysis, in which
the satisfaction/violation of properties can be detected by executing the code.
Barringer et al. [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] propose a rule-based system for trace analysis RuleR. They
also propose the LOGSCOPE system, which is an extension of RuleR with a
simple, user-friendly temporal logic. d’Amorim et al. present a modified Büchi
automata, which is used for monitoring a system [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ].
      </p>
      <p>
        For checking time-relevant properties, real-time logics have been introduced
into runtime verification. Bauer et al. [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] work on TLTL based runtime
verification for monitoring real-time properties. They define TLTL by introducing two
operators (Ba 2 I) and (Ca 2 I) with a being an event, and I being a time
interval. They build a monitor for a TLTL property, and use event-clock automata
to detect whether a trace is accepted or rejected.
      </p>
      <p>
        Metric temporal logic (MTL) [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] is a well studied real-time logic. It is obtained
by extending standard LTL with a time bounded temporal operator U[a; b], where
a; b are natural numbers. Several MTL based monitoring approaches have been
proposed. Thati et al. [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] propose a formula rewriting based monitoring
algorithm for MTL. Nickovic et al. propose monitoring algorithms for a restricted
version of MTL, named MITL. Basin et al. [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] propose a monitoring algorithm
for metric first-order logic. Their approach can cope with variables ranging over
infinite domains. They also develop algorithms for MTL with discrete events and
continuous states [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ].
      </p>
      <p>
        Alur et al. [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ] propose a “more temporal” real-time logic, named time
propositional temporal logic (TPTL). It is obtained from LTL by introducing a freeze
quantifier “ x:”. A TPTL formula can “reset” a formula clock at some point by
assigning variables in the formula to the time value when the formula is evaluated.
The expressiveness of TPTL and MTL is studied in [
        <xref ref-type="bibr" rid="ref12 ref13">12, 13</xref>
        ]. It has been proven
that TPTL is strictly more expressive than MTL. Although the verification and
model checking problem for TPTL has been studied intensely, the number of
TPTL based runtime verification approaches is quite limited. One example is
Kristoffersen et al. [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ], who give a monitoring algorithm for LTLt, which also
extends LTL by a freeze quantifier. The difference between TPTL and LTLt is
that the latter needs an extra clock variable r for expressing time.
      </p>
      <p>In this paper, we propose a formula rewriting based runtime verification
approach for TPTL. The monitor consists of a TPTL formula and a formula
rewriting algorithm, where the formula is generated from a high level
specification. The monitor receives a time-trace, which is generated from the underlying
system. It detects failures through checking whether this time-trace violates the
formula. The process is shown in Fig. 1. Our algorithm is developed directly
based on the syntax and semantics of TPTL.</p>
      <p>
        Our algorithm is based on Maude [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ], which is a high performance system for
model checking, theorem proving, and programming. It can be used for runtime
verification implementation. We use the Maude rewriting logic, in the style of
the LTL rewriting program proposed by Havelund [
        <xref ref-type="bibr" rid="ref16">16</xref>
        ]. Additionally, we present
a case study of a concrete example in the railway domain. We translate several
properties contained in the specifications of a signaling system to TPTL
formulae, and abstract some executions of the system to time-traces. Then we monitor
these time-traces in Maude. The results show that our approach is feasible for
monitoring time-traces.
      </p>
      <p>The rest part of the paper is organized as follows. Section 2 introduces the
definition of TPTL, including the syntax and semantics. Section 3 presents the
Maude-based program for TPTL based monitor. Section 4 shows a case study
with a concrete example from the railway domain. Section 5 contains the
conclusion and future work.
2</p>
    </sec>
    <sec id="sec-2">
      <title>Preliminaries</title>
      <p>2.1</p>
      <sec id="sec-2-1">
        <title>Time-events and Time-traces</title>
        <p>
          Given a (finite) set of atomic propositions AP and a (finite) alphabet = 2AP ,
an event is defined as any single element of , i.e. e = fp1, ; pmg with p1,
; pm 2 AP . If e is a singleton, we omit the curly brackets in the denotation.
If we denote the set of natural numbers by N 0 and t 2 N 0, then a time-event
is defined as a pair te = (e; t) from the set N 0. The natural number t
in a time-event te is a discrete time stamp, to identify the time of the event
emitted by a running real-time system. Given a time-event te = (e; t), we define
Event(te) , e and T ime(te) , t. A time-trace is defined as a (possibly infinite)
sequence of time-events, i. e. tt = (te [0], te [
          <xref ref-type="bibr" rid="ref1">1</xref>
          ], ; te [n]), where for each i &lt; n
with i 2 N 0, it holds that T ime (te [i]) &lt; T ime (te [i+1]) (strict monotonicity).
The length of tt is denoted by jttj.
        </p>
      </sec>
      <sec id="sec-2-2">
        <title>Syntax and Semantics of TPTL</title>
        <p>LTL is a widely-accepted logic for specifying properties of infinite traces. TPTL is
an extension of LTL to express real-time properties. It contains a freeze quantifier
“x:”, which assigns the time value when the formula is evaluated to the variable
x. A TPTL formula x: '(x) is satisfied by a time-trace tt iff '(time(tt[0])) is
satisfied by tt. For instance, a TPTL formula
(
x: (Request !</p>
        <p>y: (Ack ^ y &lt; 5 + x)))
expresses the property “whenever an event Request occurs, then the
acknowledgment event Ack must occur within 5 time units”. This formula is satisfied, e.g.,
by the time-trace ( , (Request, 7), , (Ack, 11), ), since 11 &lt; 5 + 7. More
precisely, TPTL is defined as follows.</p>
        <p>Definition 1. (Syntax for TPTL) Given the finite set AP of atomic
propositions and a set V of free variables, the terms and formulae ' of TPTL are
inductively formed according to the following grammar, where x 2 V , r 2 N 0,
p 2 AP and 2 f , &lt;, =, &gt;, g:</p>
        <p>::= x + r j r
' ::= ? j p j ('1 ! '2 ) j ('1 U '2) j 1 2 j x: '.</p>
        <p>The following shorthands are used in TPTL as in LTL: ' stands for &gt; U ',
' stands for : :', and ' stands for ? U '.</p>
        <p>Assume that E is a function E : V ! N 0 for assigning free variables in N 0
(time value) such that E (x + r) = E (x) + r and E (r) = r. Given a variable x and
a natural number r, we denote E [x := r] for the evaluation E 0 such that E 0(x) =
r, and E 0(y) = E (y) for all y 2 V nfxg. In runtime verification, the time-traces
to be checked are finite. Hence, we give TPTL finite semantics as follows.
Definition 2. (Semantics for TPTL) Let tt be a finite trace with i 2 N 0
being a position, p a proposition, and '1 and '2 any TPTL formulae. The
satisfaction relation (tt, i, E ) j= ' is defined inductively as follows:
(tt, i, E ) 2 ?;
(tt, i, E ) j= p iff p 2 Event(tt[i]);
(tt, i, E ) j= ('1 ! '2) iff (tt, i, E ) j= '1 implies (tt, i, E ) j= '2;
(tt, i, E ) j= ('1 U '2) iff there exists i &lt; j &lt; jttj with (tt, j, E ) j= '2 and
for all i &lt; j0 &lt; j it holds that (tt, j0, E ) j= '1;
(tt, i, E ) j= 1 2 iff E ( 1) E ( 2);
(tt, i, E ) j= x: ' iff (tt, i, E [x := T ime(tt[i])]) j= '.</p>
        <p>
          As is proven in [
          <xref ref-type="bibr" rid="ref13">13</xref>
          ], TPTL is strictly more expressive than MTL. The property
“whenever an a-event occurs, then a b-event will occur in the future and, later a
c-event will occur within 3 time units” can be expressed by a TPTL formula as:
x: (a ! (b ^ y: (c ^ y &lt; x + 3))). This property cannot be expressed in
MTL.
        </p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>The Rewriting Algorithm for TPTL in Maude</title>
      <p>
        Subsequently, we develop an algorithm for checking whether a finite time-trace
satisfies a TPTL formula. More specifically, when checking the satisfaction
relation between a finite time-trace and a TPTL formula, the formula is continuously
transformed to another formula by consuming the first time-event in the
timetrace. This procedure processes iteratively, until the last time-event is consumed.
It will output a boolean value in B =ftrue; f alseg. Our algorithm is implemented
in Maude, which provides an executable environment for various logics. Here we
informally describe some of Maude’s features which are related to the algorithm,
more details can be found in the manual [
        <xref ref-type="bibr" rid="ref17">17</xref>
        ].
3.1
      </p>
      <sec id="sec-3-1">
        <title>Basic Rewriting Operators and Logic Connectives</title>
        <p>In Maude, we use the functional modules following the pattern</p>
        <p>fmod &lt;name&gt; is &lt;body&gt; emdfm.</p>
        <p>The body of a functional module consists of a collection of declarations, of which
we will use sorts (sort and sorts), subsorts (subsort and subsorts), operations
(op and ops), variables (var and vars) and equations (eq).</p>
        <p>We first need to define all necessary data types involved in the program,
including atomic proposition (Atom), event (Event), time-event (T imeEvent),
time-trace (T imeT race) and free variable (FreeV). These types are defined
according to their definition shown above. The following Maude program defines
operators “__”, “_:-_ ”, “_,_” and “_ of _” for generating an event, a
timeevent, a time-trace and a free variable, respectively. Every operator has a priority
feature, which is declared through “[prec n]” with n 2 N 0.</p>
        <p>op __ : Atom Event -&gt; Event [prec 23] .
op _:-_ : Event Nat -&gt; TimeEvent [prec 23] .
op _,_ : TimeEvent TimeTrace -&gt; TimeTrace [prec 25] .
op _ of _ : Nat Atom -&gt; FreeV [prec 23]. //receive a Nat
(stands for the value of the variable) and an Atom
(stands for the name of the variable), and generate a
FreeV as the result.</p>
        <p>op nil : -&gt; Event . //an emptyset is an event
We also define Atom to be a subsort of Event, T imeEvent to be a subsort of
T imeT race, and FreeV and N at to be subsorts of Atom.</p>
        <p>Based on the syntax and semantics of TPTL described above, we define
several operators, “_{_}”, “_{_}0” and “_j=_”, for checking whether a
timetrace satisfies a formula. The operator “_{_}” receives a formula and an event.
It yields the formula &gt;/? depending on whether the event satisfies the formula
or not. The operator “_{_}0” is defined on basis of “_{_}” for checking the
satisfaction relation between a time-event and a formula. A time-event te satisfies
a formula ' iff '{Event(te)} returns &gt;. By extending “_{_}0”, the operator
“_j=_” is defined for checking whether a time-trace satisfies a formula. This
operator receives a time-trace and a formula, and generates a boolean value in
B. Given a formula ' and a time-trace (te, tt) consisting of a time-event te and
its suffix tt, then (te, tt) j= ' returns true/false iff '{te}0 returns &gt;/? as the
result.</p>
        <p>
          The calculation rules of logic connectives ! (implication), ^ (and), _ (or),
++ (exclusive or), ! (negation) and $ (equivalence) are declared as usual [
          <xref ref-type="bibr" rid="ref16">16</xref>
          ].
        </p>
        <p>In our program, the comparison operators ( ; &lt;, =, &gt; and ) and the
primitive operator (+) in TPTL are denoted by 0; &lt;0, =0, &gt;0, 0 and +0 respectively,
to distinguish the original definition of these operators in Maude. See &lt; as an
example of comparison operators, the declaration for &lt;0 is shown as follows.
vars R R’ N N’ : Nat .
vars A A’ : Atom .
op _&lt;’_ : Formula Formula -&gt; Formula [prec 40] .
ceq R &lt;’ R’ = true if R &lt; R’ .
ceq R &lt;’ R’ = false if R &gt; R’ or R == R’ .
ceq ( N of A ) &lt;’ R = true if N &lt; R .
ceq ( N of A ) &lt;’ R = false if N &gt; R or N == R .
ceq ( N of A ) &lt;’ ( N’ of A’ ) = true if N &lt; N’ .</p>
        <p>ceq ( N of A ) &lt;’ ( N’ of A’ ) = false if N &gt; N’ or N == N’ .
3.2</p>
      </sec>
      <sec id="sec-3-2">
        <title>Temporal Operators and Freeze Quantifiers</title>
        <p>In this part we describe the Maude program for temporal operators and freeze
quantifiers in TPTL. Let TE be a time-event, TT be a time-trace, X and Y be
formulae, and U’ be an operator, which receives two formulae and generates a
formula. The rewriting rules for the temporal operator U is presented as follows.
eq TE |= X U Y = false .
eq TE, TT |= X U Y = TT |= X U’ Y .
eq TE, TT |= X U’ Y = TE, TT |= Y or TE, TT |= X and TT |= X</p>
        <p>U’ Y .</p>
        <p>eq TE |= X U’ Y = TE |= Y .</p>
        <p>In Maude, we denote the formula x: ' by (R of x) @ ' with x 2 AP being
the name of the quantifier, R 2 N 0 being the value of the quantifier, and '
being a TPTL formula. In addition, we define an operator “ @@” for assigning
free variables in '. The rewriting process of tt j= (R of x) @ ' is separated into
two steps as follows.
1. The variable x of x: ' is set to the time when the formula is evaluated. Hence,
the formula (R of x) @ ' is rewritten to another formula ((T ime(tt[0]) of x)
@@ '), where (T ime(tt[0]) is the initial time value from the given time-trace;
2. The operator @@ assigns all occurrences of variable x in ' to the value
(T ime(tt[0]), and proceeds with the tt j= ' checking process. The Maude
program is as follows.
/* the value of a freeze quantifier (R of A) equals to
T, which is the time of the first time-event in the
time-trace */
eq E :- T, TT |= (R of A) @ X = E :- T , TT |= ((T of A )
@@ X) .
eq E :- T |= (R of A) @ X = E :- T |= ( T of A ) @@ X .
ceq (M of A) @@ (M’ of A’) = (M of A’ ) if A == A’ . // a
FreeV (M’ of A’) is assigned to the value of the freeze
quantifier (M of A) if they have the same name
ceq (M of A) @@ (M’ of A’) = (M’ of A’ ) if A =/= A’ . //
a FreeV (M’ of A’) is not assigned to the value of the
freeze quantifier (M of A) if they have different names
/* the value assignment rule for an algebraic formula. */
ceq (N of A) @@ (N’ of A’ +’ R) = N + R if A == A’ .
ceq (N of A) @@ (N’ of A’ +’ R) = (N’ of A’ +’ R) if A =/=</p>
        <p>A’ .</p>
        <p>In addition, we introduce the following equivalences into the program for the
operator @@. These equivalences are declared in the module FREE-QUAN, where
N , N 0, M and M 0 are natural numbers; A, A0, B and B0 are atomic propositions;
E is an event; and X, Y , true and f alse are formulae.
4</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>Case Study: the RBC/RBC Handover Process</title>
      <p>
        In this section, we apply our TPTL runtime verification implementation to a
concrete example from the European Train Control System (ETCS). ETCS is
a signaling, control and train protection system that is replacing the national,
incompatible safety systems within Europe. ETCS consists of the on-board
subsystem (composed of ERTMS/ETCS on-board equipment, the on-board part of
the GSM-R radio system and specific transmission modules for existing national
train control systems), and the track-side sub-system (composed of balise,
lineside electronic unit, GSM-R, radio block center (RBC), euroloop and radio infill
unit) [
        <xref ref-type="bibr" rid="ref18">18</xref>
        ]. In ETCS, the RBC is responsible for providing movement
authorities to allow the safe movement of trains. A movement authority is generated
by computing messages to be sent to the trains, where the messages are on the
basis of information received from external track-side systems and information
exchanged with the on-board sub-system. A route is divided into several RBC
supervision areas. Here we consider the RBC/RBC handover specification. When
a train approaches the border of an RBC supervision area, an RBC/RBC
handover process takes place (see Fig. 2). The RBC/RBC handover specification
specifies how a train moves from one RBC supervision area to an adjacent one.
      </p>
      <p>
        We consider properties on basis of the two different specifications: FIS for
the RBC/RBC Handover [
        <xref ref-type="bibr" rid="ref19">19</xref>
        ] and RBC-RBC Safe Communication Interface [
        <xref ref-type="bibr" rid="ref20">20</xref>
        ].
An execution of the system refers to the following properties in the FIS for the
RBC/RBC Handover.
      </p>
      <p>– Property 1: “the handing over RBC is responsible to send information about
an approaching train to the accepting RBC area (i.e. pre-announcement)”
(4.2.2.1);
– Property 2: “the handing over RBC must send Acknowledgment after
receiving route related information” (5.2.2.5);
– Property 3: “if the Acknowledgment for route related information is missing,
the accepting RBC must send route related information again” (5.2.3.5).
Based on the specification of the Safe Communication Interface, we assume that
the time to take into account an incoming message and produce an answer is
between 30 and 60 time units. We also assume that the tolerance window for
the messages transition time is between 0 and 50 time units. Table 1 shows the
abbreviations used in our case.</p>
      <p>Let Mess be any message. We write “ sendMess” for the Mess which is sent
by a component, and “ recvMess” for the Mess which is received by a component.
The above properties can be expressed by the following TPTL formulae.
Abbreviation Definition
HOVcond Handover condition detected
PreANN Pre-announcement
RRI Route related information
Ackn Acknowledgment
AcknMissing The Acknowledgement is missed
RRIReq Route related information request
MAReq Movement authority request
PosRep Position report
Ann Announcement
TOR Taking Over Responsibility
BPSRE Position report: “Border passed by safe rear end”</p>
      <p>BPFE Position report: “Border passed by max safe front end”
– Property 1: '1 = x:(sendPreANN ! y: (recvPreANN ^ (y x + 50))).
– Property 2: '2 = x:(recvRRI ! y:(sendAckn ^ (y x + 30) ^ (y
x + 60))).
– Property 3: After an RRI message is sent by the accepting RBC, three time
intervals must be considered: the transition time of RRI (0 &lt; r1 50), the
time for producing acknowledgment (30 r2 60) and the transition time
of the message acknowledgment (0 &lt; r3 50). Hence, if the accepting RBC
does not receive the acknowledgment between 30 and 160 (= 50 + 60 +
50) time units after sending an RRI, an AcknMissing message should occur.
The accepting RBC should resend an RRI after the AcknMissing message
occurs, within 50 time units. Now property 3 can be expressed by the TPTL
formula '3, :
'32 =
'3 ='31 ^ '32.
'31 = (x:(sendRRI ! y:(recvAckn ^ (y x + 160) ^ (y
++ x:(sendRRI ! y:(AcknMissing ^ (y &gt; x + 160))));
x:(AcknMissing ! y:(sendRRI ^ (y &lt; x + 50)));
x + 30)))</p>
      <p>We assume that the handing over RBC and the accepting RBC have a
synchronized clock, beginning at time 0. An example of RBC/RBC handover
process is given in the FIS for the RBC/RBC Handover specification. Based on
the RBC-RBC Safe Communication Interface specification, we design a
potential time stamp for each event, get an example of real-time executions of this
process, shown in Fig. 3. A corresponding time-trace is as follows.</p>
      <p>tt1 = (sendPreANN, 0), (sendRRIReq, 20), (recvPreANN, 35),
({sendRRIReq, recvRRIReq}, 50), (sendRRI, 90), (recvRRIReq, 97), (recvRRI, 115),
(sendAckn, 157), (sendRRI, 180), (recvAckn, 191), (AcknMissing, 350), (sendRRI,
360), (recvRRI, 373), (sendAckn, 403), (recvAckn, 437), (recvMAReq, 492),
(sendRRIReq, 536), (recvRRIReq, 542), (sendRRI, 583), (recvRRI, 592), (send
Ackn, 639), (recvAckn, 652), (recvBPFE, 700), (sendTOR, 738), (sendAnn, 741),
(recvAnn, 752), (recvTOR, 759), (recvCBPRE, 800).</p>
      <p>The calculation results of tt1 j= '1, tt1 j= '2 and tt1 j= '3 in Maude are all
true. It means that this execution satisfies all the three properties.</p>
      <p>Time-trace tt2 represents an execution in which some errors occur: i) the
accepting RBC receives the pre-announcement 60 time units after it is sent; ii)
the handing over RBC does not send the acknowledgment after reception of an
RRI; iii) when missing the acknowledgment of an RRI, the accepting RBC does
not resend it.</p>
      <p>tt2 = (sendPreANN, 0), (sendRRIReq, 20), (recvPreANN, 60),
({sendRRIReq, recvRRIReq}, 65), (sendRRI, 90), (recvRRIReq, 97), (recvRRI, 115),
(sendRRI, 180), (recvMAReq, 492), (sendRRIReq, 536), (recvRRIReq, 542),
(sendRRI, 583), (recvRRI, 592), (sendAckn, 639), (recvAckn, 652), (recvBPFE,
700), (sendTOR, 738), (sendAnn, 741), (recvAnn, 752), (recvTOR, 759), (recv
CBPRE, 800).</p>
      <p>The calculation results of tt2 j= '1, tt2 j= '2 and tt2 j= '3 are all false, which
means that this execution of the system violates the properties.</p>
      <p>We repeated similar experiments several times with difference traces. The
checking efficiency is shown in Fig. 4. The case study shows that our TPTL
based runtime verification implementation is feasible to detect failures in the
executions of a system.
In this paper, we have proposed a runtime verification method for TPTL. We
developed a formula rewriting based algorithm, and implemented the algorithm
in Maude. This makes it possible to check the satisfaction relation between a
long time-trace and a complex TPTL formula automatically. Furthermore, we
have presented a case study with a concrete example from the railway domain.
The results show the feasibility of our implementation.</p>
      <p>There are several interesting topics for future work. Firstly, as is well known,
LTL with two truth values gives misleading results when checking finite traces.
For this reason, we want to develop a three-valued TPTL, introducing a third
truth value “ inconclusive”. This truth value means the satisfaction relation
between a time-trace and a TPTL formula is decided by the potential suffix of
the given initial fragment of the time-trace. Secondly, the clock reset principle
in a TPTL formula x:' is to freeze the variable x in ' when the formula is
evaluated. This makes TPTL unintuitive in the cases when a property contains
a “clock-reset” condition. Hence an extension of TPTL with modifying the freeze
quantifier “ x:” to “ :” is worth to be studied, where is any formula. Last but
not least, to solve the difficulty of writing formal specifications in runtime
verification, we are going to study specification techniques. The long-term goal is
to develop a methodology to semi-automatically translate system specifications
from the railway domain into temporal formulae.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Leucker</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Schallhart</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          :
          <article-title>A Brief Account of Runtime Verification</article-title>
          .
          <source>Journal of Logic and Algebraic Programming</source>
          <volume>78</volume>
          ,
          <fpage>293</fpage>
          -
          <lpage>303</lpage>
          (
          <year>2009</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Havelund</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Roşu</surname>
          </string-name>
          , G.:
          <article-title>Monitoring Java Programs with Java PathExplorer</article-title>
          .
          <source>Electronic Notes in Theoretical Computer Science</source>
          <volume>55</volume>
          ,
          <fpage>200</fpage>
          -
          <lpage>217</lpage>
          (
          <year>2001</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Chen</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          and
          <string-name>
            <surname>G. Roşu.</surname>
          </string-name>
          :
          <article-title>Mop: an efficient and generic runtime verification framework</article-title>
          .
          <source>ACM SIGPLAN Notices</source>
          , pp.
          <fpage>569</fpage>
          -
          <lpage>588</lpage>
          (
          <year>2007</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Barringer</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Havelund</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rydeheard</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Groce</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>Rule Systems for Runtime Verification: A Short Tutorial</article-title>
          . In: Runtime Verification, pp.
          <fpage>1</fpage>
          -
          <lpage>24</lpage>
          . Springer, (
          <year>2009</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>d'Amorim</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Roşu</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          :
          <article-title>Efficient Monitoring of !-languages</article-title>
          . In: Computer Aided Verification, pp.
          <fpage>364</fpage>
          -
          <lpage>378</lpage>
          . Springer, (
          <year>2005</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Bauer</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Leucker</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Schallhart</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          :
          <article-title>Runtime verification for LTL and TLTL</article-title>
          .
          <source>ACM Transactions on Software Engineering and Methodology (TOSEM) 20</source>
          , (
          <year>2011</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Koymans</surname>
          </string-name>
          , R.:
          <article-title>Specifying Real-time Properties with Metric Temporal Logic</article-title>
          .
          <source>Realtime systems 2</source>
          ,
          <fpage>255</fpage>
          -
          <lpage>299</lpage>
          (
          <year>1990</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Thati</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Roşu</surname>
          </string-name>
          , G.:
          <article-title>Monitoring Algorithms for Metric Temporal Logic Specifications</article-title>
          .
          <source>Electronic Notes in Theoretical Computer Science</source>
          <volume>113</volume>
          ,
          <fpage>145</fpage>
          -
          <lpage>162</lpage>
          (
          <year>2005</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Basin</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Klaedtke</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Müller</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pfitzmann</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          :
          <article-title>Runtime Monitoring of Metric First-order Temporal Properties</article-title>
          .
          <source>In: IARCS Annual Conference on Foundations of Software Technology and Theoretical Computer Science</source>
          , pp.
          <fpage>49</fpage>
          -
          <lpage>60</lpage>
          .
          <string-name>
            <given-names>Schloss</given-names>
            <surname>Dagstuhl-Leibniz-Zentrum für</surname>
          </string-name>
          <string-name>
            <surname>Informatik</surname>
          </string-name>
          , (
          <year>2008</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>Basin</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Klaedtke</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Zălinescu</surname>
          </string-name>
          , E.:
          <article-title>Algorithms for Monitoring Real-time Properties</article-title>
          . In: Runtime Verification, pp.
          <fpage>260</fpage>
          -
          <lpage>275</lpage>
          . Springer, (
          <year>2011</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>Alur</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Henzinger</surname>
            ,
            <given-names>T.A.</given-names>
          </string-name>
          :
          <article-title>A Really Temporal Logic</article-title>
          .
          <source>Journal of the ACM (JACM) 41</source>
          ,
          <fpage>181</fpage>
          -
          <lpage>203</lpage>
          (
          <year>1994</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>Alur</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Henzinger</surname>
            ,
            <given-names>T.A.</given-names>
          </string-name>
          :
          <article-title>Real-time Logics: Complexity and Expressiveness</article-title>
          .
          <source>Information and Computation</source>
          <volume>104</volume>
          ,
          <fpage>35</fpage>
          -
          <lpage>77</lpage>
          (
          <year>1993</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13.
          <string-name>
            <surname>Bouyer</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Chevalier</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Markey</surname>
          </string-name>
          , N.:
          <article-title>On the Expressiveness of TPTL and MTL</article-title>
          .
          <source>Information and Computation</source>
          <volume>208</volume>
          ,
          <fpage>97</fpage>
          -
          <lpage>116</lpage>
          (
          <year>2010</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          14.
          <string-name>
            <surname>Kristoffersen</surname>
            ,
            <given-names>K.J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pedersen</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Andersen</surname>
            ,
            <given-names>H.R.</given-names>
          </string-name>
          :
          <source>Runtime Verification of Timed LTL Using Disjunctive Normalized Equation Systems. Electronic Notes in Theoretical Computer Science</source>
          <volume>89</volume>
          ,
          <fpage>210</fpage>
          -
          <lpage>225</lpage>
          (
          <year>2003</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          15.
          <string-name>
            <surname>Clavel</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Durán</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Eker</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lincoln</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Martí-Oliet</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Meseguer</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Quesada</surname>
            ,
            <given-names>J.F.</given-names>
          </string-name>
          :
          <article-title>Maude: Specification and Programming in Rewriting Logic</article-title>
          .
          <source>Theoretical Computer Science</source>
          <volume>285</volume>
          ,
          <fpage>187</fpage>
          -
          <lpage>243</lpage>
          (
          <year>2002</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          16.
          <string-name>
            <surname>Havelund</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rosu</surname>
          </string-name>
          , G.:
          <article-title>Monitoring Programs Using Rewriting</article-title>
          .
          <source>In: Automated Software Engineering</source>
          ,
          <year>2001</year>
          .(
          <article-title>ASE 2001)</article-title>
          .
          <source>Proceedings. 16th Annual International Conference on</source>
          , pp.
          <fpage>135</fpage>
          -
          <lpage>143</lpage>
          . IEEE, (
          <year>2001</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          17.
          <string-name>
            <surname>Clavel</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Durán</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Eker</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lincoln</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Martí-Oliet</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Meseguer</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Talcott</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          :
          <source>Maude Manual (version 2.6)</source>
          . University of Illinois,
          <source>Urbana-Champaign</source>
          <volume>1</volume>
          ,
          <issue>4</issue>
          .6 (
          <year>2011</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          18. UNISIG: SUBSET-026
          <string-name>
            <surname>: System</surname>
            <given-names>Requirements Specification.</given-names>
          </string-name>
          (
          <year>2008</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          19. UNISIG: SUBSET-039:
          <article-title>FIS for the RBC/RBC Handover</article-title>
          .
          <article-title>(</article-title>
          <year>2005</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref20">
        <mixed-citation>
          20. UNISIG: SUBSET-098
          <string-name>
            <surname>: RBC-RBC Safe Communication</surname>
            <given-names>Interface.</given-names>
          </string-name>
          (
          <year>2007</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>