Learning I/O Automata Fides Aarts and Frits Vaandrager ICIS, - - PowerPoint PPT Presentation

learning i o automata
SMART_READER_LITE
LIVE PREVIEW

Learning I/O Automata Fides Aarts and Frits Vaandrager ICIS, - - PowerPoint PPT Presentation

Introduction I/O Behavior and Determinism Interface Automata Learning IOAs Conclusions and Future Work Learning I/O Automata Fides Aarts and Frits Vaandrager ICIS, Radboud Universiteit Nijmegen CONCUR 2010, Paris Fides Aarts and Frits


slide-1
SLIDE 1

Introduction I/O Behavior and Determinism Interface Automata Learning IOAs Conclusions and Future Work

Learning I/O Automata

Fides Aarts and Frits Vaandrager

ICIS, Radboud Universiteit Nijmegen

CONCUR 2010, Paris

Fides Aarts and Frits Vaandrager Learning I/O Automata

slide-2
SLIDE 2

Introduction I/O Behavior and Determinism Interface Automata Learning IOAs Conclusions and Future Work

Background: Grammatical Inference

Teacher Learner

Angluin’s L∗ algorithm for active learning deterministic FSMs: Learner poses membership and equivalence queries

Fides Aarts and Frits Vaandrager Learning I/O Automata

slide-3
SLIDE 3

Introduction I/O Behavior and Determinism Interface Automata Learning IOAs Conclusions and Future Work

Learning Reactive Systems

Angluin’s algorithm has been extended to Mealy machines by Niese and implemented in the LearnLib tool.

Fides Aarts and Frits Vaandrager Learning I/O Automata

slide-4
SLIDE 4

Introduction I/O Behavior and Determinism Interface Automata Learning IOAs Conclusions and Future Work

Learning Reactive Systems

Angluin’s algorithm has been extended to Mealy machines by Niese and implemented in the LearnLib tool. Membership queries are replaced by output queries: which

  • utput is generated in response to a sequence of inputs?

Fides Aarts and Frits Vaandrager Learning I/O Automata

slide-5
SLIDE 5

Introduction I/O Behavior and Determinism Interface Automata Learning IOAs Conclusions and Future Work

Learning Reactive Systems

Angluin’s algorithm has been extended to Mealy machines by Niese and implemented in the LearnLib tool. Membership queries are replaced by output queries: which

  • utput is generated in response to a sequence of inputs?

Equivalence queries are approximated by test sequences generated using algorithms for model based testing.

Fides Aarts and Frits Vaandrager Learning I/O Automata

slide-6
SLIDE 6

Introduction I/O Behavior and Determinism Interface Automata Learning IOAs Conclusions and Future Work

Learning Reactive Systems (cnt)

Fides Aarts and Frits Vaandrager Learning I/O Automata

slide-7
SLIDE 7

Introduction I/O Behavior and Determinism Interface Automata Learning IOAs Conclusions and Future Work

Learning Reactive Systems (cnt)

Active learning may provide models of reactive systems in situations where we have no access to the code (black box) and not even a specification, e.g. to learn reference implementations.

Fides Aarts and Frits Vaandrager Learning I/O Automata

slide-8
SLIDE 8

Introduction I/O Behavior and Determinism Interface Automata Learning IOAs Conclusions and Future Work

Challenges

Fides Aarts and Frits Vaandrager Learning I/O Automata

slide-9
SLIDE 9

Introduction I/O Behavior and Determinism Interface Automata Learning IOAs Conclusions and Future Work

Challenges

Handle data and large state spaces

Fides Aarts and Frits Vaandrager Learning I/O Automata

slide-10
SLIDE 10

Introduction I/O Behavior and Determinism Interface Automata Learning IOAs Conclusions and Future Work

Challenges

Handle data and large state spaces Handle nondeterministic systems

Fides Aarts and Frits Vaandrager Learning I/O Automata

slide-11
SLIDE 11

Introduction I/O Behavior and Determinism Interface Automata Learning IOAs Conclusions and Future Work

Challenges

Handle data and large state spaces Handle nondeterministic systems For many applications, requirement that each input corresponds to exactly one output is overly restrictive

Fides Aarts and Frits Vaandrager Learning I/O Automata

slide-12
SLIDE 12

Introduction I/O Behavior and Determinism Interface Automata Learning IOAs Conclusions and Future Work

I/O Automata

in in

  • ut2

in in

  • ut1

Proposed independently by Lynch & Tuttle and Jonsson (1987).

Fides Aarts and Frits Vaandrager Learning I/O Automata

slide-13
SLIDE 13

Introduction I/O Behavior and Determinism Interface Automata Learning IOAs Conclusions and Future Work

The I/O Behavior of I/O Automata?

in in

  • ut2

in in

  • ut1

What output is generated in response to input sequence in in ? Common answer: either out1 훿 or out2 훿 (here 훿 = quiescence)

Fides Aarts and Frits Vaandrager Learning I/O Automata

slide-14
SLIDE 14

Introduction I/O Behavior and Determinism Interface Automata Learning IOAs Conclusions and Future Work

Determinism

Engineers want deterministic systems: for every stream of inputs that is offered to the system, the stream of outputs that is generated should be unique. Deterministic systems are predictable. A deterministic FSM is behavior deterministic: for each string the

  • utput (accepted or not accepted) is unique.

A deterministic Mealy machine is also behavior deterministic.

Fides Aarts and Frits Vaandrager Learning I/O Automata

slide-15
SLIDE 15

Introduction I/O Behavior and Determinism Interface Automata Learning IOAs Conclusions and Future Work

Determinism

Engineers want deterministic systems: for every stream of inputs that is offered to the system, the stream of outputs that is generated should be unique. Deterministic systems are predictable. A deterministic FSM is behavior deterministic: for each string the

  • utput (accepted or not accepted) is unique.

A deterministic Mealy machine is also behavior deterministic. How about I/O automata?

Fides Aarts and Frits Vaandrager Learning I/O Automata

slide-16
SLIDE 16

Introduction I/O Behavior and Determinism Interface Automata Learning IOAs Conclusions and Future Work

Determinism

An IOA is input deterministic if q

i

→ q1 ∧ q

i

→ q2 ∧ i ∈ I ⇒ q1 = q2

Fides Aarts and Frits Vaandrager Learning I/O Automata

slide-17
SLIDE 17

Introduction I/O Behavior and Determinism Interface Automata Learning IOAs Conclusions and Future Work

Determinism

An IOA is input deterministic if q

i

→ q1 ∧ q

i

→ q2 ∧ i ∈ I ⇒ q1 = q2 It is output deterministic if q

  • → q1 ∧ q
  • → q2 ∧ o ∈ O

⇒ q1 = q2

Fides Aarts and Frits Vaandrager Learning I/O Automata

slide-18
SLIDE 18

Introduction I/O Behavior and Determinism Interface Automata Learning IOAs Conclusions and Future Work

Determinism

An IOA is input deterministic if q

i

→ q1 ∧ q

i

→ q2 ∧ i ∈ I ⇒ q1 = q2 It is output deterministic if q

  • → q1 ∧ q
  • → q2 ∧ o ∈ O

⇒ q1 = q2 It is output determined if: q

  • 1

→ q1 ∧ q

  • 2

→ q2 ∧ {o1, o2} ⊆ O ⇒

  • 1 = o2 ∧ q1 = q2

Fides Aarts and Frits Vaandrager Learning I/O Automata

slide-19
SLIDE 19

Introduction I/O Behavior and Determinism Interface Automata Learning IOAs Conclusions and Future Work

Determinism

An IOA is input deterministic if q

i

→ q1 ∧ q

i

→ q2 ∧ i ∈ I ⇒ q1 = q2 It is output deterministic if q

  • → q1 ∧ q
  • → q2 ∧ o ∈ O

⇒ q1 = q2 It is output determined if: q

  • 1

→ q1 ∧ q

  • 2

→ q2 ∧ {o1, o2} ⊆ O ⇒

  • 1 = o2 ∧ q1 = q2

For usual notion of I/O behavior, input deterministic, output determined IOAs are not behavior deterministic!

Fides Aarts and Frits Vaandrager Learning I/O Automata

slide-20
SLIDE 20

Introduction I/O Behavior and Determinism Interface Automata Learning IOAs Conclusions and Future Work

Avoiding Race Conditions

Nondeterminism due to race conditions between IUT and tester. Common assumption: there is T such that IUT never produces

  • utput if more than T time has elapsed since previous event.

Allows tester to observe quiescence. Dual assumption: there is t such that IUT never produces output if less than t time has elapsed since previous event. Allows tester/learner to avoid race conditions (if it is fast enough)!

Fides Aarts and Frits Vaandrager Learning I/O Automata

slide-21
SLIDE 21

Introduction I/O Behavior and Determinism Interface Automata Learning IOAs Conclusions and Future Work

I/O Behavior of IOAs

By action Δ we give IOA opportunity to produce next output. Sequences e ∈ (IΔ)∗ are called environment sequences. By action 훿, IOA indicates that it reached quiescent state: q

→ q iff q enables no output. Define

e/u

⇒ to be least relation s.t. q

휖/휖

⇒ q q

e/u

⇒ q′ ∧ q′

i

→ q′′ ∧ i ∈ I ⇒ q

e i/u i

⇒ q′′ q

e/u

⇒ q′ ∧ q′

  • → q′′ ∧ o ∈ O훿

⇒ q

e Δ/u o

⇒ q′′ For 풜 an IOA, obs풜(e) = {u ∈ (I ∪ O훿)∗ ∣ ∃q ∈ Q : q0 e/u ⇒ q}.

Fides Aarts and Frits Vaandrager Learning I/O Automata

slide-22
SLIDE 22

Introduction I/O Behavior and Determinism Interface Automata Learning IOAs Conclusions and Future Work

Observation Equivalence and ioco

Fact (Output deterministic IOAs are behavior deterministic) If IOA 풜 is input deterministic and output determined then

  • bs풜(e) is a singleton set, for all e ∈ (IΔ)∗.

Fides Aarts and Frits Vaandrager Learning I/O Automata

slide-23
SLIDE 23

Introduction I/O Behavior and Determinism Interface Automata Learning IOAs Conclusions and Future Work

Observation Equivalence and ioco

Fact (Output deterministic IOAs are behavior deterministic) If IOA 풜 is input deterministic and output determined then

  • bs풜(e) is a singleton set, for all e ∈ (IΔ)∗.

Theorem Let 풜1 and 풜2 be IOAs. Then 풜1 ioco 풜2 iff, for all e ∈ (IΔ)∗,

  • bs풜1(e) ⊆ obs풜2(e).

Fides Aarts and Frits Vaandrager Learning I/O Automata

slide-24
SLIDE 24

Introduction I/O Behavior and Determinism Interface Automata Learning IOAs Conclusions and Future Work

Interface Automata (De Alfaro & Henzinger)

An interface automaton (IA) is a tuple 풜 = (I, O, Q, q0, →), where I, O and Q are finite, nonempty sets of input actions,

  • utput actions, and states, respectively, with I and O disjoint,

q0 ∈ Q the initial state, and →⊆ Q × (I ∪ O) × Q the transition relation. An I/O automaton (IOA) is an interface automaton in which each input action is enabled in each state.

Fides Aarts and Frits Vaandrager Learning I/O Automata

slide-25
SLIDE 25

Introduction I/O Behavior and Determinism Interface Automata Learning IOAs Conclusions and Future Work

XY-simulations

Let 풜1 and 풜2 be IAs with actions A, and let X, Y ⊆ A. Relation R ⊆ Q1 × Q2 is an XY -simulation from 풜1 to 풜2 iff, for all (q, r) ∈ R and a ∈ A q

a

→1 q′ ∧ a ∈ X ⇒ ∃r′ ∈ Q2 : r

a

→2 r′ ∧ (q′, r′) ∈ R, r

a

→2 r′ ∧ a ∈ Y ⇒ ∃q′ ∈ Q1 : q

a

→1 q′ ∧ (q′, r′) ∈ R. 풜1≤XY 풜2 if there exists an XY -simulation from 풜1 to 풜2 that contains (q0

1, q0 2).

Fides Aarts and Frits Vaandrager Learning I/O Automata

slide-26
SLIDE 26

Introduction I/O Behavior and Determinism Interface Automata Learning IOAs Conclusions and Future Work

Alternating Simulations

OI-simulations are known as alternating simulations:

d

  • ut1

in1 in2

d in1

  • ut2

d

  • ut1

Fides Aarts and Frits Vaandrager Learning I/O Automata

slide-27
SLIDE 27

Introduction I/O Behavior and Determinism Interface Automata Learning IOAs Conclusions and Future Work

Alternating Simulations and IOCO

The 훿-extension of an IA 풜 is obtained by adding a loop with

  • utput action 훿 to all quiescent states.

We write 풜1 ≤a훿 풜2 iff 풜훿

1 ≤OI 풜훿 2.

Fides Aarts and Frits Vaandrager Learning I/O Automata

slide-28
SLIDE 28

Introduction I/O Behavior and Determinism Interface Automata Learning IOAs Conclusions and Future Work

Alternating Simulations and IOCO

The 훿-extension of an IA 풜 is obtained by adding a loop with

  • utput action 훿 to all quiescent states.

We write 풜1 ≤a훿 풜2 iff 풜훿

1 ≤OI 풜훿 2.

Theorem Suppose 풜1 is input deterministic and 풜2 is output deterministic. Then 풜1 ≤a훿 풜2 implies 풜1 ioco 풜2.

Fides Aarts and Frits Vaandrager Learning I/O Automata

slide-29
SLIDE 29

Introduction I/O Behavior and Determinism Interface Automata Learning IOAs Conclusions and Future Work

Alternating Simulations and IOCO

The 훿-extension of an IA 풜 is obtained by adding a loop with

  • utput action 훿 to all quiescent states.

We write 풜1 ≤a훿 풜2 iff 풜훿

1 ≤OI 풜훿 2.

Theorem Suppose 풜1 is input deterministic and 풜2 is output deterministic. Then 풜1 ≤a훿 풜2 implies 풜1 ioco 풜2. Theorem Suppose 풜1 is input enabled and 풜2 is deterministic. Then 풜1 ioco 풜2 implies 풜1 ≤a훿 풜2.

Fides Aarts and Frits Vaandrager Learning I/O Automata

slide-30
SLIDE 30

Introduction I/O Behavior and Determinism Interface Automata Learning IOAs Conclusions and Future Work

Learning Purpose

In practice, we often cannot (or do not want to) learn full IOA. We may not be able to offer inputs at the right times, or IOA may be too big, or we are only interested to learn a part. A learning purpose is a deterministic IA 풫 that specifies which part

  • f an IOA 풜 we want to learn. Our goal is to find IA ℋ such that

풜훿 ≤OI ℋ훿 ≤AI 풫

Fides Aarts and Frits Vaandrager Learning I/O Automata

slide-31
SLIDE 31

Introduction I/O Behavior and Determinism Interface Automata Learning IOAs Conclusions and Future Work

Learning Purpose (cnt)

A trivial learning purpose:

i : I

  • : O

δ

Fides Aarts and Frits Vaandrager Learning I/O Automata

slide-32
SLIDE 32

Introduction I/O Behavior and Determinism Interface Automata Learning IOAs Conclusions and Future Work

Learning Purpose (cnt)

After an input one has to wait until the system gets into a quiescent state before offering the next input:

  • : O

i : I

δ δ

Fides Aarts and Frits Vaandrager Learning I/O Automata

slide-33
SLIDE 33

Introduction I/O Behavior and Determinism Interface Automata Learning IOAs Conclusions and Future Work

Learning Purpose (cnt)

Each input is followed by at most one output:

  • : O

i : I

δ δ

Fides Aarts and Frits Vaandrager Learning I/O Automata

slide-34
SLIDE 34

Introduction I/O Behavior and Determinism Interface Automata Learning IOAs Conclusions and Future Work

Learning Purpose (cnt)

Initially only certain inputs are allowed and two consecutive inputs are not allowed:

Fides Aarts and Frits Vaandrager Learning I/O Automata

slide-35
SLIDE 35

Introduction I/O Behavior and Determinism Interface Automata Learning IOAs Conclusions and Future Work

Uniqueness!

Key Lemma Suppose 풜1, 풜2 and 풜3 are IAs, 풜1 is active and input deterministic, 풜2 is output determined, 풜3 is output deterministic, and 풜1 ≤OI 풜3 ≤AI 풜2. Then 풜3 is uniquely determined up to bisimulation equivalence.

Fides Aarts and Frits Vaandrager Learning I/O Automata

slide-36
SLIDE 36

Introduction I/O Behavior and Determinism Interface Automata Learning IOAs Conclusions and Future Work

Learning IOAs

Learner Teacher knows deterministic learning purpose 풫 knows deterministic,

  • utput

determined IOA 풜 maintains state of 풫 maintains state of 풜 may present i ∈ I ∪ {Δ} to teacher replies with o ∈ O ∪ {훿} may do reset and jump to ini- tial state of 풫 upon reset jumps to initial state of 풜 may pose preorder query ℋ, for ℋ훿 ≤AI 풫 replies with yes if 풜 ioco ℋ or else with no+counterexample

Fides Aarts and Frits Vaandrager Learning I/O Automata

slide-37
SLIDE 37

Introduction I/O Behavior and Determinism Interface Automata Learning IOAs Conclusions and Future Work

Set Up for Learning IOAs

IOA Teacher Transducer MM Learner

Teacher is teaching IOA 풜 = (I, O, Q, q0, →) Transducer handles learning purpose 풫 and translates between IOAs and MMs Learner learns MM with inputs IΔ and outputs O ∪ {훿, +, −}.

Fides Aarts and Frits Vaandrager Learning I/O Automata

slide-38
SLIDE 38

Introduction I/O Behavior and Determinism Interface Automata Learning IOAs Conclusions and Future Work

From IAs to MMs

  • ut1

d in1 ∆/ in2/− ∆/ in2/− d in1/− in2/− in1/+ ∆/δ

  • ut1

in1/−

Fides Aarts and Frits Vaandrager Learning I/O Automata

slide-39
SLIDE 39

Introduction I/O Behavior and Determinism Interface Automata Learning IOAs Conclusions and Future Work

Lemma

IOA Teacher MM Teacher Transducer MM Learner

IOA teacher and transducer together act as teacher for MM T(AS(풜훿, 풫)).

Fides Aarts and Frits Vaandrager Learning I/O Automata

slide-40
SLIDE 40

Introduction I/O Behavior and Determinism Interface Automata Learning IOAs Conclusions and Future Work

Theorem

IOA Teacher Transducer MM Learner IOA Learner

MM learner and transducer together act as learner of IOA 휌(AS(풜훿, 풫))

Fides Aarts and Frits Vaandrager Learning I/O Automata

slide-41
SLIDE 41

Introduction I/O Behavior and Determinism Interface Automata Learning IOAs Conclusions and Future Work

Applications

We have implemented our approach and applied it to learn parts of

Fides Aarts and Frits Vaandrager Learning I/O Automata

slide-42
SLIDE 42

Introduction I/O Behavior and Determinism Interface Automata Learning IOAs Conclusions and Future Work

Applications

We have implemented our approach and applied it to learn parts of TCP

  • F. Aarts, MSc Thesis, 2009

Fides Aarts and Frits Vaandrager Learning I/O Automata

slide-43
SLIDE 43

Introduction I/O Behavior and Determinism Interface Automata Learning IOAs Conclusions and Future Work

Applications

We have implemented our approach and applied it to learn parts of TCP

  • F. Aarts, MSc Thesis, 2009

SIP

  • F. Aarts, B. Jonsson & J. Uijen, Generating Models of Infinite-State Communication Protocols using

Regular Inference with Abstraction, ICTSS 2010 Fides Aarts and Frits Vaandrager Learning I/O Automata

slide-44
SLIDE 44

Introduction I/O Behavior and Determinism Interface Automata Learning IOAs Conclusions and Future Work

Applications

We have implemented our approach and applied it to learn parts of TCP

  • F. Aarts, MSc Thesis, 2009

SIP

  • F. Aarts, B. Jonsson & J. Uijen, Generating Models of Infinite-State Communication Protocols using

Regular Inference with Abstraction, ICTSS 2010

Biometric Passport

  • F. Aarts, Inference and Abstraction of the Biometric Passport, YR-CONCUR 2010

Fides Aarts and Frits Vaandrager Learning I/O Automata

slide-45
SLIDE 45

Introduction I/O Behavior and Determinism Interface Automata Learning IOAs Conclusions and Future Work

Conclusions

Fides Aarts and Frits Vaandrager Learning I/O Automata

slide-46
SLIDE 46

Introduction I/O Behavior and Determinism Interface Automata Learning IOAs Conclusions and Future Work

Conclusions

Learning of reactive systems generalized to setting in which inputs and outputs don’t have to alternate

Fides Aarts and Frits Vaandrager Learning I/O Automata

slide-47
SLIDE 47

Introduction I/O Behavior and Determinism Interface Automata Learning IOAs Conclusions and Future Work

Conclusions

Learning of reactive systems generalized to setting in which inputs and outputs don’t have to alternate Interesting links between three widely used models: interface automata, ioco theory and Mealy machines.

Fides Aarts and Frits Vaandrager Learning I/O Automata

slide-48
SLIDE 48

Introduction I/O Behavior and Determinism Interface Automata Learning IOAs Conclusions and Future Work

Conclusions

Learning of reactive systems generalized to setting in which inputs and outputs don’t have to alternate Interesting links between three widely used models: interface automata, ioco theory and Mealy machines. Using concept of transducer, learning of IOAs has been reduced to problem of learning MMs.

Fides Aarts and Frits Vaandrager Learning I/O Automata

slide-49
SLIDE 49

Introduction I/O Behavior and Determinism Interface Automata Learning IOAs Conclusions and Future Work

Conclusions

Learning of reactive systems generalized to setting in which inputs and outputs don’t have to alternate Interesting links between three widely used models: interface automata, ioco theory and Mealy machines. Using concept of transducer, learning of IOAs has been reduced to problem of learning MMs. Initial experiments indicate work may become quite useful in practice.

Fides Aarts and Frits Vaandrager Learning I/O Automata

slide-50
SLIDE 50

Introduction I/O Behavior and Determinism Interface Automata Learning IOAs Conclusions and Future Work

Future Work

Fides Aarts and Frits Vaandrager Learning I/O Automata

slide-51
SLIDE 51

Introduction I/O Behavior and Determinism Interface Automata Learning IOAs Conclusions and Future Work

Future Work

1 Improve treatment of data (using abstraction techniques of

Aarts, Jonsson & Uijen)

Fides Aarts and Frits Vaandrager Learning I/O Automata

slide-52
SLIDE 52

Introduction I/O Behavior and Determinism Interface Automata Learning IOAs Conclusions and Future Work

Future Work

1 Improve treatment of data (using abstraction techniques of

Aarts, Jonsson & Uijen)

2 Extend to nondeterministic automata Fides Aarts and Frits Vaandrager Learning I/O Automata

slide-53
SLIDE 53

Introduction I/O Behavior and Determinism Interface Automata Learning IOAs Conclusions and Future Work

Future Work

1 Improve treatment of data (using abstraction techniques of

Aarts, Jonsson & Uijen)

2 Extend to nondeterministic automata 3 Extend to probabilistic and timed automata Fides Aarts and Frits Vaandrager Learning I/O Automata

slide-54
SLIDE 54

Introduction I/O Behavior and Determinism Interface Automata Learning IOAs Conclusions and Future Work

Future Work

1 Improve treatment of data (using abstraction techniques of

Aarts, Jonsson & Uijen)

2 Extend to nondeterministic automata 3 Extend to probabilistic and timed automata 4 Extend to other learning algoritms Fides Aarts and Frits Vaandrager Learning I/O Automata

slide-55
SLIDE 55

Introduction I/O Behavior and Determinism Interface Automata Learning IOAs Conclusions and Future Work

Future Work

1 Improve treatment of data (using abstraction techniques of

Aarts, Jonsson & Uijen)

2 Extend to nondeterministic automata 3 Extend to probabilistic and timed automata 4 Extend to other learning algoritms 5 Integrate verification, testing and learning Fides Aarts and Frits Vaandrager Learning I/O Automata

slide-56
SLIDE 56

Introduction I/O Behavior and Determinism Interface Automata Learning IOAs Conclusions and Future Work

Future Work

1 Improve treatment of data (using abstraction techniques of

Aarts, Jonsson & Uijen)

2 Extend to nondeterministic automata 3 Extend to probabilistic and timed automata 4 Extend to other learning algoritms 5 Integrate verification, testing and learning

Many nice challenges for CONCUR community!

Fides Aarts and Frits Vaandrager Learning I/O Automata