Научная статья на тему 'Observable Form of a Timed Finite State Machine'

Observable Form of a Timed Finite State Machine Текст научной статьи по специальности «Математика»

CC BY
94
39
i Надоели баннеры? Вы всегда можете отключить рекламу.
Ключевые слова
observable form non-deterministic Timed Finite State Machine
i Надоели баннеры? Вы всегда можете отключить рекламу.
iНе можете найти то, что вам нужно? Попробуйте сервис подбора литературы.
i Надоели баннеры? Вы всегда можете отключить рекламу.

This paper is devoted to the problem of an observable form for a given Timed Finite State Machine. This problem, together with the problem of the number of states in the observable form, has theoretical value, since it shows the way to build an observable form, and answers the question, does an observable form exist for any TFSM. Also it has a practical use in testing, since Finite State Machine methods of test generation rely on the fact that specification of a system is an observable FSM and those methods are intended to be applied for TFSMs.

Текст научной работы на тему «Observable Form of a Timed Finite State Machine»

Observable Form of a Timed Finite State Machine

Maxim Gromov, Olga Kondratjeva

Faculty of Radiophysics Tomsk State University Tomsk, Russia E-mail: {gromov, kondratjeva_olga}@sibmail.com

Abstract—This paper is devoted to the problem of an observable form for a given Timed Finite State Machine. This problem, together with the problem of the number of states in the observable form, has theoretical value, since it shows the way to build an observable form, and answers the question, does an observable form exist for any TFSM. Also it has a practical use in testing, since Finite State Machine methods of test generation rely on the fact that specification of a system is an observable FSM and those methods are intended to be applied for TFSMs.

Keywords-observable form; non-deterministic Timed Finite State Machine;

I. INTRODUCTION

Problem of testing communication protocols has drawn a lot of attention of different researches. The most popular paradigm for such testing is model based testing, when a system and its specification are supposed to be described as models of some kind, and the problem of testing is re-expressed as a problem of checking relations on those models. One of the most popular model for communication protocols description is a Finite State Machine (FSM) [1] and there are lots of tests generation methods for FSMs [6]-[8]. These methods suppose, that an FSM is given in observable form [2]. But FSM as a model has some limitations, one of which is that FSM does not consider time explicitly, but a communication protocol usualy has different behaviour depending on the time elapsed after last message it has receved or sent. This issue can be dealt with by direct introduction delay transitions into FSMs and such a model has been called Timed Finite State Machine(TFSM) [?], [4].

New model rises a problem of new methods for test generation. The obvious solution to this problem is to adopt well-known methods of test generation for regular FSMs. And this, as a consequence, gives a problem of an observable form for a given non-observable TFSM. In our work we give a solution to this problem as an observable form construction procedure.

The rest of the paper has the following structure. In section II all necessary definitions and notions are given. Section III gives some comparison of TFSM with other timed models. Section IV discusses a problem of observable form construction and gives corresponding procedure. Section V concludes the paper.

II. Preliminaries

Here and further N denotes the set of natural numbers, Z+ denotes the set of unsigned integer numbers (that is

Z+ = N U {0}).

Definition 1. A Timed Finite State Machine (TFSM) is a sixtuple S = (S, I, O, s, As, As), where S is finite, not empty set of states with designated initial state s, I and O are finite, not empty sets of input and output actions respectively, As C S x I x O x S is a transition relation, As : S ^ S x N is a delay function. We assume, that if As(s) = (s', ro), then s' = s. □

With every TFSM we associate an internal clock variable x, which measures time in integer number of ticks passed from the last state change of the TFSM.

If (s, i, o, s') G As (we denote this fact as s —^ s' and call o an output reaction of the TFSM in the state s on input action i), then we say, that TFSM S being in the state s accepts input i, immediately produces output action o and at the same moment changes state to s'. In the state s' clock variable x is reset to 0.

Function As(s) = (s'',t) (denoted as s s'') de-

scribes delay transitions of the TFSM: if no input action is applied to TFSM S in the state s within t ticks, then at the moment x = t it changes its state to s'' and resets its clock variable to 0. If AS(s) = (s, ro), then TFSM S can stay in the state s infinitely long, waiting for an input action.

Definition 2. A timed input action is a tuple (i,t) G G I x Z+, meaning that input action i should be applied to a TFSM at the moment t, after last state change of the TFSM. A timed input-output pair is a tuple ((i, t),o) G G I x Z+ x O, usually denoted as (i, t)/o. A timed input sequence a is a sequence of timed inputs, that is a G G (I x Z+)*. □

Definition 3. Given a TFSM S = (S, I, O, s, As, As).

• out(s, i) = {o G O | 3s' G S : (s, i, o, s') G As} -

set of output reactions of the TFSM S in the state s on the input i.

• [s]i/o =f {s' G S | (s, i, o, s') G As} - set of states, reachable from the state s under input-output pair (i, o) G I x O.

• [s]t - is such state s', that TFSM S reaches s' from s after t time units, that is there exist states s = si,

, 11 t2 in — 1

s2, ..., s = sn and si —► s2 —► s3 ... --------------------►

sn and < t < £j=1tj, where As(sj) =

(sj +1 ,tj), j = 1,n. Note, that due to the fact, that AS is completely defined function on the set S, such a state s' always exists and is unique.

def

• [s]<i,t)/o = [[s]i]i/o - set of states, reachable from

the state s under timed input-output pair (i,t)/o. If s' e [s](i,t)/o, then we say, that there is a transition form the state s to the state s' under the timed input (i, t) with output reaction o and denote this fact as

(i,t)/o

s -------— s'.

• out(s, (i,t)) = out([s]t,i) - set of output reactions of the TFSM S on timed input (i,t).

Definition 4. Given a TFSM S and timed input sequnce a = (ii,ti) • (ii,ti) • ... • (in,tn). We say, that timed input sequnce a brings TFSM S from the state s to the state s' if there exist such states s1, s2, ..., sn-1 and output sequence ft = o1 • o2 • ... • on, that the following

. U (*1,tl)/oi (*2,t2)/o2 <i3,t3)/o3

property holds: s ------------— s1 -----------— s2 -----------—

(in-1,tn-l)/on-1 (*n,tu)/on , , . ...

... -----------------— sn-1 --------------— s'. We denote this

fact as s ——— s' and call the sequence ft output reaction of TFSM S on timed input sequence a and the pair a/ft timed input-output sequence of the TFSM S in the state s. The set of all input-output sequnces of the TFSM S in the state s we shall denote as rS(s). □

All notions from Definition 3 are naturally extended to timed input-output sequences.

Definition 5. Two TFSMs S and P are called equivalent, iff rS(s) = rP(p). □

Definition 6. Given a TFSM S.

• TFSM S is called deterministic, iff for any pair (s,i) e S x I there exists at most one pair (o, s') e

e O x S such, that s —-— s', otherwise it is called non-deterministic.

• TFSM S is called observable, iff for any triple (s, i, o) there exists at most one state s' e S such, that

that s —— s', otherwise it is called non-observable.

Definition 7. Given non-observable TFSM S. An observable TFSM P, such that S is equivalent to P we shall call an observable form of the TFSM S. □

III. Timed Finite State Machine and Timed Automata

Comparing TFSM with classical timed automaton (TA) [9] one can see several differences. Most obvious is the number of time variables: TFSM always has only one time variable, while a TA can have any finite number of time variables. This prevents from turning an arbitrary TA into TFSM, since it is known [10], that the number of time variables is not reducable in general case.

Another difference is the roles of actions. TA considers just a set of actions, labling transitions, without assigning any roles to them, while in TFSM actions are split into input and output actions and actions always occur in pairs “input/output”. This issue can be overcome by assigning roles to actions and, eo ipso, by consideration of timed atomata with inputs and outputs (TAIO) [11] and restricting TAIo to the form, when output action always comes after input action. TAIO model also overcomes an issue of the time behaviour representation. In a TFSM

it is done in a form of time delay transitions. A TAIO analogue of time delay transitions is a transition with unobservable action t. Howevere, the latter does not mean, that a TAIO is more general model, than TFSM, because in general case TAIO, which has been gotten from TFSM, can occur nondeterministic, even if given TFSM was deterministic and no one has shown yet, that such a TAIO is determinizable. This should be done, since it is known, that in general nondeterministic TA (and TAIO as well) is not determinizable [10].

IV. BUILDING OBSERVABLE FORM OF A TFSM A. A State Stay Time

In the theory non-deterministic Finite State Machines (FSM) to build an observable form G of a given nonobservable FSM F one should map subsets of states of the FSM F, which appear due to non-observable transitions (transitions from a given state under the same input-output pair to a diffrent states) to states of G [5]. We shall adopt the same idea to TFSMs with the following modification. Due to delay transitions some set of states can appear with different values of the internal time variable x for each state in the considering set of states. This leads to the necessity to keep value of internal time variable for each state as it is done for intersection of TFSMs [4]. For example, let us imaging, that we have the following delay transitions: s1 — s1 — s1 and s2 — s2 — s2 and we consider the set of states {s1, s2} when x = 0 for each state. Then we shall get following transitions:

s1s2

0 0

s 1 s2

02

s1s2

10

s 1 s '2 01

11 — s1s2 — 10

Under each state we write the value of internal time variable x. As you can see, pair s1s2 appears in the sequence twice, but with different times.

B. A Procedure to Build an Observable Form for a Given TFSM

Given non-observable TFSM S = (S, I, O, s, AS, AS). With each state s e S we associate set Ks = = {0,1,..., ks - 1}, where AS(s) = (s', t) and ks = t, when t = to, or ks = 0, when t = to. Each state of observable form P for TFSM S corresponds to some subset of the set U = UseS{s} x Ks - the set of all possible pairs state-stay_time.

The observable form P for TFSM S is constructed as follows.

1) Initial state of P is a pair (s, 0), that is p = {(s, 0)}.

2) Let {(s1,t1)... (sn,tn)} is under consideration. If, according to AS, the following holds [{s1,..., s„}]j/o = = {si,... s^}, then transition

{(s1,t1) . . . (sn,tn)}

i/o

{(s1,0),... (sm

0)}

is in AP .

3) Let {(s1,t1)... (sn,tn)} is under consideration and

let As(s1) = (s/1,t/1), ..., As(s„) = (s^X). Then

Ap({(s1 ,t1)... (s„,t„)}) = ({(s'/X)... (sn,tn)},t),

where t = min {(ti - ti),..., (tn - tn)} - time for the earliest delay transition to fire. If tj = ж or (tj - tt) = t, then sj' = sj and tj' = 0, otherwise sj' = Sj and tj' =

tj +t.

Proposition 1. TFSM P, built with decribed procedure, is an observable form for a given S. □

It is known [5], that the number of states in observable form for a given FSM F is not greater then 2|F 1 — 1, where |F | is the number of states in the given FSM F. This estimation comes from the fact, that the number of all possible non-empty subsets of the state space F is exactly 2|f 1 - 1 and only such subsets describe states in observable form. We use the same reasoning to estimate the states number upper bound in observable form P for non-observable TFSM S. Since to describe states in P we use non-empty subsets of the set U = UseS{s} x Ks, then the number of states in P is limited by the number of such subsets, that is |P| < 2|U 1 - 1 = 2SseSks - 1, ks = |Ks|. But this estimation is too rough, since we do not take into account the fact, that due to observable form construction procedure, any state p = {(si,ti),..., (sn,tn)} of the observable form P is so, that at least one tj e {ti,..., tn} equals 0. For example, in extreme case when for any state s of the given non-observable TFSM S holds the following: AS(s) = (s', t) (time of a delay transition is the same for any state), all states of the observable form are subsets like the following {(si, 0),..., (sn, 0)} and their number is exactly 2|S| - 1.

For the reasons described above the general estimation for the number of states in observable form for a given TFSM is no reachable (as opposed to the estimation for regular FSMs [5]).

V. Conclusions

In this paper we have considered the problem of the observable form for a TFSM. We have provided the procedure to build an observable form for a given nonobservable TFSM and gave some estimation for the number of states in observable form.

The open problem of this paper is the problem of more accurate estimation of number of states in observable form of a given TFSM and the question of its reachability.

References

[1] ЕвтушенкоН.В., ПетренкоА.Ф., ВетроваМ.В. Недетерминированные автоматы: анализ и синтез. Ч. 1. Отношения и операции: Учебное пособие. — Томск: Томский государственный университет, 2006. — 142 с.

[2] Starke P.H. Abstract Automata // Elsiver, 1972. — 419 pp.

[3] MerayoM.G., Nunez M. and Rodriguez I. Formal Testing from Timed Finite State Machines // Computer Networks. — 2008. — Vol. 52, No. 2. — Pp. 432-460.

[4] Громов М.Л., Евтушенко Н.В. Синтез различающих экспериментов для временных автоматов // поступила в редакцию журнала Программирование.

[5] ТрахтенбротБ.А., БарздиньЯ.М. Конечные автоматы (поведение и синтез). — М.: Наука, 1970. — 400с.

[6] BochmannG.v. and Petrenko A.F. Protocol testing: review of methods and relevance for software testing // Proceedings of ISSTA’94. — New York, NY, USA: ACM, 1994. — Pp. 109-124

[7] Petrenko A.F. and Yevtushenko N.V. Testing from Partial Deterministic FSM Specifications // IEEE Trans. Comput. — 2005. — Vol. 54, No. 9. — Pp. 11541165.

[8] Hierons R.M. Testing from a Nondeterministic Finite State Machine Using Adaptive State Counting // IEEE Trans. Comput. — 2004. — Vol. 53, No. 10. — Pp. 1330-1342.

[9] AlurR. and DillD. A Theory of Timed Automata // Theoretical Computer Science. — 1994. — Vol. 126. — Pp. 183-235.

[10] Tripakis. S. Folk theorems on the determinization and minimization of timed automata

Information Processing Letters. — 2006. — Vol. 99, Issue 6. — Pp. 222-226.

[11] KrichenM. and TripakisS. State Identification Problems for Timed Automata // LNCS. — 2005. — Vol. 3502. — Pp. 175-191.

i Надоели баннеры? Вы всегда можете отключить рекламу.