07.01.2013 Views

Lecture Notes in Computer Science 3472

Lecture Notes in Computer Science 3472

Lecture Notes in Computer Science 3472

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

1 Hom<strong>in</strong>g and Synchroniz<strong>in</strong>g Sequences<br />

Sven Sandberg<br />

Department of Information Technology<br />

Uppsala University<br />

svens@it.uu.se<br />

1.1 Introduction<br />

1.1.1 Mealy Mach<strong>in</strong>es<br />

This chapter considers two fundamental problems for Mealy mach<strong>in</strong>es, i.e., f<strong>in</strong>itestate<br />

mach<strong>in</strong>es with <strong>in</strong>puts and outputs. The mach<strong>in</strong>es will be used <strong>in</strong> subsequent<br />

chapters as models of a system or program to test. We repeat Def<strong>in</strong>ition 21.1 of<br />

Chapter 21 here: readers already familiar with Mealy mach<strong>in</strong>es can safely skip<br />

to Section 1.1.2.<br />

Def<strong>in</strong>ition 1.1. A Mealy Mach<strong>in</strong>e is a 5-tuple M = 〈I , O, S,δ,λ〉, whereI , O<br />

and S are f<strong>in</strong>ite nonempty sets, and δ : S × I → S and λ : S × I → O are total<br />

functions.<br />

The <strong>in</strong>terpretation of a Mealy mach<strong>in</strong>e is as follows. The set S consists of<br />

“states”. At any po<strong>in</strong>t <strong>in</strong> time, the mach<strong>in</strong>e is <strong>in</strong> one state s ∈ S. Itispossible<br />

to give <strong>in</strong>puts to the mach<strong>in</strong>e, by apply<strong>in</strong>g an <strong>in</strong>put letter a ∈ I .Themach<strong>in</strong>e<br />

responds by giv<strong>in</strong>g output λ(s, a) and transform<strong>in</strong>g itself to the new state δ(s, a).<br />

We depict Mealy mach<strong>in</strong>es as directed edge-labeled graphs, where S is the set of<br />

vertices. The outgo<strong>in</strong>g edges from a state s ∈ S lead to δ(s, a) for all a ∈ I ,and<br />

they are labeled “a/b”, where a is the <strong>in</strong>put symbol and b is the output symbol<br />

λ(s, a). See Figure 1.1 for an example.<br />

We say that Mealy mach<strong>in</strong>es are completely specified, because at every state<br />

there is a next state for every <strong>in</strong>put (δ and λ are total). They are also determ<strong>in</strong>istic,<br />

because only one next state is possible.<br />

Apply<strong>in</strong>g a str<strong>in</strong>g a1a2 ···ak ∈ I ∗ of <strong>in</strong>put symbols start<strong>in</strong>g <strong>in</strong> a state s1<br />

gives the sequence of states s1, s2,...,sk+1 with sj +1 = δ(sj , aj ). We extend<br />

the transition function to δ(s1, a1a2 ···ak ) def<br />

= sk+1 and the output function to<br />

λ(s1, a1a2 ···ak ) def<br />

= λ(s1, a1)λ(s2, a2) ···λ(sk , ak ), i.e., the concatenation of all<br />

outputs. Moreover, if Q ⊆ S is a set of states then δ(Q, x ) def<br />

= {δ(s, x ):s ∈ Q}.<br />

We sometimes use the shorthand s a<br />

−→t for δ(s, a) =t, and if <strong>in</strong> addition we know<br />

that λ(s, a) =b then we write s a/b<br />

−−−→t. Thenumber|S| of states is denoted n.<br />

Throughout this chapter we will assume that an explicit Mealy mach<strong>in</strong>e<br />

M = 〈I , O, S,δ,λ〉 is given.<br />

M. Broy et al. (Eds.): Model-Based Test<strong>in</strong>g of Reactive Systems, LNCS <strong>3472</strong>, pp. 5-33, 2005.<br />

© Spr<strong>in</strong>ger-Verlag Berl<strong>in</strong> Heidelberg 2005

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!