Active automata learning Based on: Bernhard Steffen, Falk Howar und - - PowerPoint PPT Presentation

active automata learning
SMART_READER_LITE
LIVE PREVIEW

Active automata learning Based on: Bernhard Steffen, Falk Howar und - - PowerPoint PPT Presentation

Active automata learning Based on: Bernhard Steffen, Falk Howar und Maik Merten: Introduction to Active Automata Learning from a Practical Perspective. SFM 2011: 256-296. Motivation We want to apply model-based techniques. But: often


slide-1
SLIDE 1

Active automata learning

Based on: Bernhard Steffen, Falk Howar und Maik Merten: Introduction to Active Automata Learning from a Practical Perspective. SFM 2011: 256-296.

slide-2
SLIDE 2

Motivation

◮ We want to apply model-based techniques. ◮ But: often there are no models. ◮ Or: existing models are unrelated to implementations.

slide-3
SLIDE 3

Motivation

◮ We want to apply model-based techniques. ◮ But: often there are no models. ◮ Or: existing models are unrelated to implementations. ◮ Produce models from implementations.

slide-4
SLIDE 4

Example (River crossing game)

slide-5
SLIDE 5

Mealy machines

slide-6
SLIDE 6

Notation

◮ Σ, Ω: sets of symbols, ranged over by αi (oi resp.) ◮ w, w′, . . .: words, sequences of symbols, e.g., w = α1α2α1.

slide-7
SLIDE 7

Notation

◮ Σ, Ω: sets of symbols, ranged over by αi (oi resp.) ◮ w, w′, . . .: words, sequences of symbols, e.g., w = α1α2α1. ◮ u, u′, . . .: prefixes; v, v′, . . .: suffixes.

slide-8
SLIDE 8

Notation

◮ Σ, Ω: sets of symbols, ranged over by αi (oi resp.) ◮ w, w′, . . .: words, sequences of symbols, e.g., w = α1α2α1. ◮ u, u′, . . .: prefixes; v, v′, . . .: suffixes.

Concatenation:

◮ Let u = αu,1 . . . αu,n and v = αv,1 . . . αv,m. ◮ Then: w = uv = αu,1 . . . αu,nαv,1 . . . αv,m

slide-9
SLIDE 9

Mealy machines

Definition (Mealy machine)

A Mealy machine is defined as a tuple M = S, s0, Σ, Ω, δ, λ where

slide-10
SLIDE 10

Mealy machines

Definition (Mealy machine)

A Mealy machine is defined as a tuple M = S, s0, Σ, Ω, δ, λ where

◮ S is a finite nonempty set of states (be n = |S| the size of the Mealy

machine),

◮ s0 ∈ S is the initial state,

slide-11
SLIDE 11

Mealy machines

Definition (Mealy machine)

A Mealy machine is defined as a tuple M = S, s0, Σ, Ω, δ, λ where

◮ S is a finite nonempty set of states (be n = |S| the size of the Mealy

machine),

◮ s0 ∈ S is the initial state, ◮ Σ is a finite input alphabet, ◮ Ω is a finite output alphabet,

slide-12
SLIDE 12

Mealy machines

Definition (Mealy machine)

A Mealy machine is defined as a tuple M = S, s0, Σ, Ω, δ, λ where

◮ S is a finite nonempty set of states (be n = |S| the size of the Mealy

machine),

◮ s0 ∈ S is the initial state, ◮ Σ is a finite input alphabet, ◮ Ω is a finite output alphabet, ◮ δ : S × Σ → S is the transition function, and ◮ λ : S × Σ → Ω is the output function.

slide-13
SLIDE 13

The unforgiving coffee machine (UCM)

(a) empty (b) with pod (c) with water (d) with pod and water (e) success (f) error

slide-14
SLIDE 14

Mealy machine example

Example (A coffee machine)

Mcm = S, s0, Σ, Ω, δ, λ, where

◮ S = {a, b, c, d, d′, e, f} ◮ s0 = a ◮ Σ = {water, pod,

button, clean}

◮ Ω = {, K, ✷}

a b c d d′ e f pod/ water/ clean/ button/✷ water/ pod/ button/✷ pod/ water/ button/✷ button/K {water, pod}/ button/K {water, pod}/ clean/ Σ \ {clean}/✷ Σ/✷

slide-15
SLIDE 15

δ and λ for words

δ∗ : S × Σ∗ → S:

◮ δ∗(s, ǫ) = s ◮ δ∗(s, αw) = δ∗(δ(s, α), w)

slide-16
SLIDE 16

δ and λ for words

δ∗ : S × Σ∗ → S:

◮ δ∗(s, ǫ) = s ◮ δ∗(s, αw) = δ∗(δ(s, α), w)

λ∗ : S × Σ∗ → Ω:

◮ λ∗(s, ǫ) = ∅ ◮ λ∗(s, wα) = λ(δ∗(s, w), α)

slide-17
SLIDE 17

Runs of Mealy machines

◮ Mealy machine processing α1α2 . . . αn ◮ will produce sequence of outputs o1o2 . . . on

slide-18
SLIDE 18

Runs of Mealy machines

◮ Mealy machine processing α1α2 . . . αn ◮ will produce sequence of outputs o1o2 . . . on

We will abstract from the complete traces!

slide-19
SLIDE 19

Runs of Mealy machines

◮ Mealy machine processing α1α2 . . . αn ◮ will produce sequence of outputs o1o2 . . . on

We will abstract from the complete traces!

Definition (Runs)

Let M : Σ∗ → Ω defined by M(w) = λ∗(s0, w).

slide-20
SLIDE 20

Runs of Mealy machines (contd.)

Example (Runs)

The run water pod button clean button, ✷ is in Mcm, while the run water button clean, is not.

a b c d d′ e f pod/ water/ clean/ button/✷ water/ pod/ button/✷ pod/ water/ button/✷ button/K {water, pod}/ button/K {water, pod}/ clean/ Σ \ {clean}/✷ Σ/✷

slide-21
SLIDE 21

Equivalence of Mealy machines

Let M ≡ M′, iff M = M′.

slide-22
SLIDE 22

Equivalence of Mealy machines

Let M ≡ M′, iff M = M′.

◮ But: we do not have M (and its domain, Σ∗, is infinite) ◮ Need other means of comparing models

slide-23
SLIDE 23

Equivalence of Mealy machines

Let M ≡ M′, iff M = M′.

◮ But: we do not have M (and its domain, Σ∗, is infinite) ◮ Need other means of comparing models ◮ Construct unique canonical Mealy machine for M and M′ ◮ Test for isomorphism (e.g., by synchronized BFS)

slide-24
SLIDE 24

Regularity

slide-25
SLIDE 25

Equivalence of words

Let P : Σ∗ → Ω

slide-26
SLIDE 26

Equivalence of words

Let P : Σ∗ → Ω

Definition (Equivalence of words wrt. P)

Two words u, u′ ∈ Σ∗ are equivalent wrt. ≡P , iff for all continuations v ∈ Σ∗, the concatenated words uv and u′v are mapped to the same

  • utput by P:

u ≡P u′ ⇔ (∀v ∈ Σ∗. P(uv) = P(u′v)).

slide-27
SLIDE 27

Equivalence of words

Let P : Σ∗ → Ω

Definition (Equivalence of words wrt. P)

Two words u, u′ ∈ Σ∗ are equivalent wrt. ≡P , iff for all continuations v ∈ Σ∗, the concatenated words uv and u′v are mapped to the same

  • utput by P:

u ≡P u′ ⇔ (∀v ∈ Σ∗. P(uv) = P(u′v)). We write [u] to denote the equivalence class of u wrt. ≡P .

slide-28
SLIDE 28

Equivalence of words (example)

water pod ≡Mcm water water pod ≡Mcm pod pod water

a b c d d′ e f pod/ water/ clean/ button/✷ water/ pod/ button/✷ pod/ water/ button/✷ button/K {water, pod}/ button/K {water, pod}/ clean/ Σ \ {clean}/✷ Σ/✷

slide-29
SLIDE 29

Myhill-Nerode for Mealy machines

Theorem (Characterization Theorem)

A mapping P : Σ∗ → Ω is a semantic functional for some Mealy machine iff ≡P has only finitely many equivalence classes (finite index).

slide-30
SLIDE 30

Myhill-Nerode for Mealy machines

Theorem (Characterization Theorem)

A mapping P : Σ∗ → Ω is a semantic functional for some Mealy machine iff ≡P has only finitely many equivalence classes (finite index). Proof (⇒):

◮ We show: M is an arbitrary Mealy machine

⇒ ≡M has finite index

slide-31
SLIDE 31

Myhill-Nerode for Mealy machines

Theorem (Characterization Theorem)

A mapping P : Σ∗ → Ω is a semantic functional for some Mealy machine iff ≡P has only finitely many equivalence classes (finite index). Proof (⇒):

◮ We show: M is an arbitrary Mealy machine

⇒ ≡M has finite index

◮ All words leading to the same state in M are equivalent wrt. ≡M.

slide-32
SLIDE 32

Myhill-Nerode for Mealy machines (contd.)

Proof (⇐): We will construct a Mealy machine for P. Let MP = S, s0, Σ, Ω, δ, λ:

◮ S is given by the classes of ≡P .

slide-33
SLIDE 33

Myhill-Nerode for Mealy machines (contd.)

Proof (⇐): We will construct a Mealy machine for P. Let MP = S, s0, Σ, Ω, δ, λ:

◮ S is given by the classes of ≡P . ◮ s0 is given by [ǫ].

slide-34
SLIDE 34

Myhill-Nerode for Mealy machines (contd.)

Proof (⇐): We will construct a Mealy machine for P. Let MP = S, s0, Σ, Ω, δ, λ:

◮ S is given by the classes of ≡P . ◮ s0 is given by [ǫ]. ◮ the transition function is defined by δ([w], α) = [wα].

slide-35
SLIDE 35

Myhill-Nerode for Mealy machines (contd.)

Proof (⇐): We will construct a Mealy machine for P. Let MP = S, s0, Σ, Ω, δ, λ:

◮ S is given by the classes of ≡P . ◮ s0 is given by [ǫ]. ◮ the transition function is defined by δ([w], α) = [wα]. ◮ the output function can be defined as λ([w], α) = o, where

P(wα) = o.

slide-36
SLIDE 36

Myhill-Nerode for Mealy machines (contd.)

Proof (⇐): We will construct a Mealy machine for P. Let MP = S, s0, Σ, Ω, δ, λ:

◮ S is given by the classes of ≡P . ◮ s0 is given by [ǫ]. ◮ the transition function is defined by δ([w], α) = [wα]. ◮ the output function can be defined as λ([w], α) = o, where

P(wα) = o. MP is well-defined and has semantic functional P.

slide-37
SLIDE 37

Example

a b c d d′ e f pod/ water/ clean/ button/✷ water/ pod/ button/✷ pod/ water/ button/✷ button/K {water, pod}/ button/K {water, pod}/ clean/ Σ \ {clean}/✷ Σ/✷

slide-38
SLIDE 38

Example

slide-39
SLIDE 39

Example

[ǫ] clean/

slide-40
SLIDE 40

Example

[ǫ] clean/ [button] button/✷ Σ/✷

slide-41
SLIDE 41

Example

[ǫ] clean/ [button] button/✷ Σ/✷ [pod] [water] pod/ water/ pod/ water/

slide-42
SLIDE 42

Example

[ǫ] clean/ [button] button/✷ Σ/✷ [pod] [water] pod/ water/ pod/ water/ [podwater] water/ {water, pod}/ pod/

slide-43
SLIDE 43

Example

[ǫ] clean/ [button] button/✷ Σ/✷ [pod] [water] pod/ water/ pod/ water/ [podwater] water/ {water, pod}/ pod/ [podwaterbutton] button/K

slide-44
SLIDE 44

Example

[ǫ] clean/ [button] button/✷ Σ/✷ [pod] [water] pod/ water/ pod/ water/ [podwater] water/ {water, pod}/ pod/ [podwaterbutton] button/K button/✷ button/✷ Σ \ {clean}/✷

slide-45
SLIDE 45

Example

[ǫ] clean/ [button] button/✷ Σ/✷ [pod] [water] pod/ water/ pod/ water/ [podwater] water/ {water, pod}/ pod/ [podwaterbutton] button/K button/✷ button/✷ Σ \ {clean}/✷ clean/

slide-46
SLIDE 46

Consequences (I)

We will call P regular if ≡P has finite index, i.e., if there is a corresponding Mealy machine MP .

slide-47
SLIDE 47

Consequences (I)

We will call P regular if ≡P has finite index, i.e., if there is a corresponding Mealy machine MP .

Corollary (Minimality)

For regular P, MP is minimal.

slide-48
SLIDE 48

Consequences (I)

We will call P regular if ≡P has finite index, i.e., if there is a corresponding Mealy machine MP .

Corollary (Minimality)

For regular P, MP is minimal. Proof:

◮ Every state of a Mealy machine M belongs to one class of ≡M.

slide-49
SLIDE 49

Consequences (I)

We will call P regular if ≡P has finite index, i.e., if there is a corresponding Mealy machine MP .

Corollary (Minimality)

For regular P, MP is minimal. Proof:

◮ Every state of a Mealy machine M belongs to one class of ≡M. ◮ MM has exactly one state per class of ≡M.

slide-50
SLIDE 50

Consequences (II)

Corollary (Bounded reachability)

For regular P, every transition of MP can be covered by a sequence of length at most n from the initial state. (n: number of states of MP )

slide-51
SLIDE 51

Consequences (II)

Corollary (Bounded reachability)

For regular P, every transition of MP can be covered by a sequence of length at most n from the initial state. (n: number of states of MP ) Especially: For every Mealy machine with N states, all transitions of its mininmal equivalent Mealy machine can be covered by sequences of length at most N.

slide-52
SLIDE 52

Canonical Mealy machines

slide-53
SLIDE 53

Minimizing automata

Question: How can we minimize non-minimal automata / proof minimality?

slide-54
SLIDE 54

Minimizing automata

Question: How can we minimize non-minimal automata / proof minimality? First idea: merge states based on equivalence of words: s ≡ s′ ⇔ ∀v ∈ Σ+ . λ∗(s, v) = λ∗(s′, v)

slide-55
SLIDE 55

Minimizing automata

Question: How can we minimize non-minimal automata / proof minimality? First idea: merge states based on equivalence of words: s ≡ s′ ⇔ ∀v ∈ Σ+ . λ∗(s, v) = λ∗(s′, v) But: it may be hard to argue about all future behaviors. ⇒ exchange quantifier!

slide-56
SLIDE 56

k-distinguishability

Definition (k-distinguishability)

Two states s, s′ ∈ S of some Mealy machine M are k-distinguishable, iff there is a word w ∈ Σ∗ of length k or shorter, for which λ∗(s, w) = λ∗(s′, w).

slide-57
SLIDE 57

k-distinguishability

Definition (k-distinguishability)

Two states s, s′ ∈ S of some Mealy machine M are k-distinguishable, iff there is a word w ∈ Σ∗ of length k or shorter, for which λ∗(s, w) = λ∗(s′, w). How big can k get?

slide-58
SLIDE 58

k-distinguishability

Definition (k-distinguishability)

Two states s, s′ ∈ S of some Mealy machine M are k-distinguishable, iff there is a word w ∈ Σ∗ of length k or shorter, for which λ∗(s, w) = λ∗(s′, w). How big can k get?

Proposition

In a Mealy machine of size n, states s ≡ s′ ∈ S are n-distinguishable.

slide-59
SLIDE 59

Naive minimization

  • 1. Compute spanning tree for M, (size n)
slide-60
SLIDE 60

Naive minimization

  • 1. Compute spanning tree for M, (size n)
  • 2. Associate every state with path to it in spanning tree (from root), its

access sequence

slide-61
SLIDE 61

Naive minimization

  • 1. Compute spanning tree for M, (size n)
  • 2. Associate every state with path to it in spanning tree (from root), its

access sequence

  • 3. For every state construct Ts : Σ≤n → Ω by

Ts(v) =def M(uv) where u is access sequence to s and v ∈ Σ≤n

slide-62
SLIDE 62

Naive minimization

  • 1. Compute spanning tree for M, (size n)
  • 2. Associate every state with path to it in spanning tree (from root), its

access sequence

  • 3. For every state construct Ts : Σ≤n → Ω by

Ts(v) =def M(uv) where u is access sequence to s and v ∈ Σ≤n

  • 4. Merge states s, s′, whenever Ts = Ts′
slide-63
SLIDE 63

Naive minimization

  • 1. Compute spanning tree for M, (size n)
  • 2. Associate every state with path to it in spanning tree (from root), its

access sequence

  • 3. For every state construct Ts : Σ≤n → Ω by

Ts(v) =def M(uv) where u is access sequence to s and v ∈ Σ≤n

  • 4. Merge states s, s′, whenever Ts = Ts′

Complexity for comparing states: O(n2 · |Σ|n)

slide-64
SLIDE 64

Partition refinement

slide-65
SLIDE 65

λ valuation

Definition

For a Mealy machine M and some state s in M, the λ valuation of s is a mapping λs : Σ → Ω, with λs(α) =def λ(s, α)

slide-66
SLIDE 66

Partition refinement (algorithm)

Input: A Mealy machine M = S, s0, Σ, Ω, δ, λ Output: A partition P on S, the set of states of the Mealy machine 1: i := 1 2: put all s ∈ S with the same λ valuation into the same class p of partition Pi 3: loop 4: for all p ∈ Pi do 5: for all s ∈ p do 6: construct mapping sig : Σ → Pi: 7: sig(α) = p′ such that δ(s, α) ∈ p′ 8: Si

sig := Si sig ∪ s

9: end for 10: Pi+1 :=

sig Si sig

11: end for 12: if Pi = Pi+1 then 13: return Pi 14: end if 15: i := i + 1 16: end loop

slide-67
SLIDE 67

Partition refinement (algorithm)

Input: A Mealy machine M = S, s0, Σ, Ω, δ, λ Output: A partition P on S, the set of states of the Mealy machine 1: i := 1 2: put all s ∈ S with the same λ valuation into the same class p of partition Pi 3: loop 4: for all p ∈ Pi do 5: for all s ∈ p do 6: construct mapping sig : Σ → Pi: 7: sig(α) = p′ such that δ(s, α) ∈ p′ 8: Si

sig := Si sig ∪ s

9: end for 10: Pi+1 :=

sig Si sig

11: end for 12: if Pi = Pi+1 then 13: return Pi 14: end if 15: i := i + 1 16: end loop

slide-68
SLIDE 68

Partition refinement (algorithm)

Input: A Mealy machine M = S, s0, Σ, Ω, δ, λ Output: A partition P on S, the set of states of the Mealy machine 1: i := 1 2: put all s ∈ S with the same λ valuation into the same class p of partition Pi 3: loop 4: for all p ∈ Pi do 5: for all s ∈ p do 6: construct mapping sig : Σ → Pi: 7: sig(α) = p′ such that δ(s, α) ∈ p′ 8: Si

sig := Si sig ∪ s

9: end for 10: Pi+1 :=

sig Si sig

11: end for 12: if Pi = Pi+1 then 13: return Pi 14: end if 15: i := i + 1 16: end loop

slide-69
SLIDE 69

Partition refinement (algorithm)

Input: A Mealy machine M = S, s0, Σ, Ω, δ, λ Output: A partition P on S, the set of states of the Mealy machine 1: i := 1 2: put all s ∈ S with the same λ valuation into the same class p of partition Pi 3: loop 4: for all p ∈ Pi do 5: for all s ∈ p do 6: construct mapping sig : Σ → Pi: 7: sig(α) = p′ such that δ(s, α) ∈ p′ 8: Si

sig := Si sig ∪ s

9: end for 10: Pi+1 :=

sig Si sig

11: end for 12: if Pi = Pi+1 then 13: return Pi 14: end if 15: i := i + 1 16: end loop

slide-70
SLIDE 70

Partition refinement (algorithm)

Input: A Mealy machine M = S, s0, Σ, Ω, δ, λ Output: A partition P on S, the set of states of the Mealy machine 1: i := 1 2: put all s ∈ S with the same λ valuation into the same class p of partition Pi 3: loop 4: for all p ∈ Pi do 5: for all s ∈ p do 6: construct mapping sig : Σ → Pi: 7: sig(α) = p′ such that δ(s, α) ∈ p′ 8: Si

sig := Si sig ∪ s

9: end for 10: Pi+1 :=

sig Si sig

11: end for 12: if Pi = Pi+1 then 13: return Pi 14: end if 15: i := i + 1 16: end loop

slide-71
SLIDE 71

Partition refinement (complexity)

◮ Initial computation of λ valuations: (n · |Σ|) ◮ Computation of sig objects per rounds: (n · |Σ|) ◮ Maximum number of rounds n.

Overall complexity: O(n2 · |Σ|)

slide-72
SLIDE 72

Partition refinement (example)

a b c d d′ e f clean/ button/✷ pod/ button/✷ water/ button/✷ clean/ {water, pod}/ {water, pod}/ water/ pod/ pod/ water/ button/K button/K Σ \ {clean}/✷ Σ/✷

slide-73
SLIDE 73

Partition refinement (example)

clean/ button/✷ pod/ button/✷ water/ button/✷ clean/ {water, pod}/ {water, pod}/ water/ pod/ pod/ water/ a b c d d′ e f button/K button/K Σ \ {clean}(esp. water)/✷ Σ(esp. clean)/✷

P1 = {a, b, c}, {d, d′}, {e}, {f}

slide-74
SLIDE 74

Partition refinement (example)

clean/ button/✷ pod/ button/✷ water/ button/✷ clean/ {water, pod}/ {water, pod}/ button/K button/K Σ \ {clean}/✷ Σ/✷ a b c d d′ e f water/ pod/ pod/ water/

P1 = {a, b, c}, {d, d′}, {e}, {f} P2 = {a}, {b}, {c}, {d, d′}, {e}, {f}

slide-75
SLIDE 75

Partition refinement (example)

clean/ button/✷ pod/ button/✷ water/ button/✷ clean/ {water, pod}/ {water, pod}/ button/K button/K Σ \ {clean}/✷ Σ/✷ a b c d d′ e f water/ pod/ pod/ water/

P1 = {a, b, c}, {d, d′}, {e}, {f} P2 = {a}, {b}, {c}, {d, d′}, {e}, {f} P3 = {a}, {b}, {c}, {d, d′}, {e}, {f}

slide-76
SLIDE 76

Minimized Mealy machine

a b c d e f

pod/ water/ clean/ button/✷ water/ pod/ button/✷ pod/ water/ button/✷ button/K {water, pod}/ clean/ Σ \ {clean}/✷ Σ/✷

slide-77
SLIDE 77

Extension to black-boxes

slide-78
SLIDE 78

Scenario

◮ System under learning (SUL) is a black-box ◮ No knowledge about (number of) internal

states

◮ Input alphabet given ◮ Tests can be executed on SUL, output can

be recorded

slide-79
SLIDE 79

Scenario

◮ System under learning (SUL) is a black-box ◮ No knowledge about (number of) internal

states

◮ Input alphabet given ◮ Tests can be executed on SUL, output can

be recorded Try to produce complete and correct behavioral model of (interface-)behavior

slide-80
SLIDE 80

Naive learning

Bad news: in general impossible! The possibility that one has not tested enough will always remain.

slide-81
SLIDE 81

Naive learning

Bad news: in general impossible! The possibility that one has not tested enough will always remain.

◮ Assume maximum number of states to be N. ◮ Modify naive minimization

slide-82
SLIDE 82

Naive minimization

  • 1. Compute prefix tree for depth N.
slide-83
SLIDE 83

Naive minimization

  • 1. Compute prefix tree for depth N.
  • 2. Associate every state with path to it in prefix tree (from root)
slide-84
SLIDE 84

Naive minimization

  • 1. Compute prefix tree for depth N.
  • 2. Associate every state with path to it in prefix tree (from root)
  • 3. For every state construct Ts : Σ≤N → Ω by

Ts(v) =def M(uv) where u is access sequence to s and v ∈ Σ≤N

slide-85
SLIDE 85

Naive minimization

  • 1. Compute prefix tree for depth N.
  • 2. Associate every state with path to it in prefix tree (from root)
  • 3. For every state construct Ts : Σ≤N → Ω by

Ts(v) =def M(uv) where u is access sequence to s and v ∈ Σ≤N

  • 4. Merge states s, s′, whenever Ts = Ts′
slide-86
SLIDE 86

Naive minimization

  • 1. Compute prefix tree for depth N.
  • 2. Associate every state with path to it in prefix tree (from root)
  • 3. For every state construct Ts : Σ≤N → Ω by

Ts(v) =def M(uv) where u is access sequence to s and v ∈ Σ≤N

  • 4. Merge states s, s′, whenever Ts = Ts′

Complexity for comparing states: O(|Σ|N · |Σ|N) = O(|Σ|2N)

slide-87
SLIDE 87

Summarizing

◮ States can be represented by access sequences ◮ States can be distinguished by suffixes

slide-88
SLIDE 88

Summarizing

◮ States can be represented by access sequences ◮ States can be distinguished by suffixes

Open questions:

◮ Can we extend the partition refinement pattern to produce suffixes? ◮ Can the partition refinement pattern be applied in the black box

scenario?

slide-89
SLIDE 89

The ID learning algorithm

slide-90
SLIDE 90

Identifying states

Definition (Output-signature)

For a SUL and some word u in Σ∗, the output-signature of u in SUL is a mapping SULD

u : D → Ω with D ⊂ Σ∗, and

SULu(v) =def SUL(uv)

slide-91
SLIDE 91

ID learning algorithm

Input: A SUL with inputs Σ, a set U ⊂ Σ∗ of access sequences to all states of SUL Output: A Mealy machine M = S, s0, Σ, Ω, δ, λ for SUL 1: i := 1, D := Σ, S := U ∪ U × Σ 2: start: 3: compute SULD

u for all u ∈ S

4: put u, u′ ∈ S into the same class p of partition Pi if SULD

u = SULD u′

5: for all p ∈ Pi do 6: for all α ∈ Σ do 7: for all u, u′ ∈ p ∩ U do 8: if uα ∈ p′ ∧ u′α / ∈ p′ then 9: Let v ∈ D be s.t. SULD

uα(v) = SULD u′α(v)

10: D := D ∪ {αv}, i := i + 1 11: goto start 12: end if 13: end for 14: end for 15: end for 16: construct MSUL from Pi

slide-92
SLIDE 92

ID learning algorithm

Input: A SUL with inputs Σ, a set U ⊂ Σ∗ of access sequences to all states of SUL Output: A Mealy machine M = S, s0, Σ, Ω, δ, λ for SUL 1: i := 1, D := Σ, S := U ∪ U × Σ 2: start: 3: compute SULD

u for all u ∈ S

4: put u, u′ ∈ S into the same class p of partition Pi if SULD

u = SULD u′

5: for all p ∈ Pi do 6: for all α ∈ Σ do 7: for all u, u′ ∈ p ∩ U do 8: if uα ∈ p′ ∧ u′α / ∈ p′ then 9: Let v ∈ D be s.t. SULD

uα(v) = SULD u′α(v)

10: D := D ∪ {αv}, i := i + 1 11: goto start 12: end if 13: end for 14: end for 15: end for 16: construct MSUL from Pi

slide-93
SLIDE 93

ID learning algorithm

Input: A SUL with inputs Σ, a set U ⊂ Σ∗ of access sequences to all states of SUL Output: A Mealy machine M = S, s0, Σ, Ω, δ, λ for SUL 1: i := 1, D := Σ, S := U ∪ U × Σ 2: start: 3: compute SULD

u for all u ∈ S

4: put u, u′ ∈ S into the same class p of partition Pi if SULD

u = SULD u′

5: for all p ∈ Pi do 6: for all α ∈ Σ do 7: for all u, u′ ∈ p ∩ U do 8: if uα ∈ p′ ∧ u′α / ∈ p′ then 9: Let v ∈ D be s.t. SULD

uα(v) = SULD u′α(v)

10: D := D ∪ {αv}, i := i + 1 11: goto start 12: end if 13: end for 14: end for 15: end for 16: construct MSUL from Pi

slide-94
SLIDE 94

ID learning algorithm

Input: A SUL with inputs Σ, a set U ⊂ Σ∗ of access sequences to all states of SUL Output: A Mealy machine M = S, s0, Σ, Ω, δ, λ for SUL 1: i := 1, D := Σ, S := U ∪ U × Σ 2: start: 3: compute SULD

u for all u ∈ S

4: put u, u′ ∈ S into the same class p of partition Pi if SULD

u = SULD u′

5: for all p ∈ Pi do 6: for all α ∈ Σ do 7: for all u, u′ ∈ p ∩ U do 8: if uα ∈ p′ ∧ u′α / ∈ p′ then 9: Let v ∈ D be s.t. SULD

uα(v) = SULD u′α(v)

10: D := D ∪ {αv}, i := i + 1 11: goto start 12: end if 13: end for 14: end for 15: end for 16: construct MSUL from Pi

slide-95
SLIDE 95

ID learning algorithm

Input: A SUL with inputs Σ, a set U ⊂ Σ∗ of access sequences to all states of SUL Output: A Mealy machine M = S, s0, Σ, Ω, δ, λ for SUL 1: i := 1, D := Σ, S := U ∪ U × Σ 2: start: 3: compute SULD

u for all u ∈ S

4: put u, u′ ∈ S into the same class p of partition Pi if SULD

u = SULD u′

5: for all p ∈ Pi do 6: for all α ∈ Σ do 7: for all u, u′ ∈ p ∩ U do 8: if uα ∈ p′ ∧ u′α / ∈ p′ then 9: Let v ∈ D be s.t. SULD

uα(v) = SULD u′α(v)

10: D := D ∪ {αv}, i := i + 1 11: goto start 12: end if 13: end for 14: end for 15: end for 16: construct MSUL from Pi

slide-96
SLIDE 96

Model construction from final Pi

We will construct a Mealy machine from final Pi by: Let MSUL = S, s0, Σ, Ω, δ, λ:

◮ S is given by the classes of Pi.

slide-97
SLIDE 97

Model construction from final Pi

We will construct a Mealy machine from final Pi by: Let MSUL = S, s0, Σ, Ω, δ, λ:

◮ S is given by the classes of Pi. ◮ s0 is given by p that contains ǫ.

slide-98
SLIDE 98

Model construction from final Pi

We will construct a Mealy machine from final Pi by: Let MSUL = S, s0, Σ, Ω, δ, λ:

◮ S is given by the classes of Pi. ◮ s0 is given by p that contains ǫ. ◮ the transition function is defined by δ(p, α) = p′ if exists

u ∈ p ∩ U with uα ∈ p′

slide-99
SLIDE 99

Model construction from final Pi

We will construct a Mealy machine from final Pi by: Let MSUL = S, s0, Σ, Ω, δ, λ:

◮ S is given by the classes of Pi. ◮ s0 is given by p that contains ǫ. ◮ the transition function is defined by δ(p, α) = p′ if exists

u ∈ p ∩ U with uα ∈ p′

◮ the output function can be defined as λ(p, α) = o if exists

u ∈ p ∩ U with SULD

u (α) = o

slide-100
SLIDE 100

Model construction from final Pi

We will construct a Mealy machine from final Pi by: Let MSUL = S, s0, Σ, Ω, δ, λ:

◮ S is given by the classes of Pi. ◮ s0 is given by p that contains ǫ. ◮ the transition function is defined by δ(p, α) = p′ if exists

u ∈ p ∩ U with uα ∈ p′

◮ the output function can be defined as λ(p, α) = o if exists

u ∈ p ∩ U with SULD

u (α) = o

MSUL is well-defined and has semantic functional SUL if U contains access sequences to all classes of SUL.

slide-101
SLIDE 101

The coffee machine

a b c d d′ e f pod/ water/ clean/ button/✷ water/ pod/ button/✷ pod/ water/ button/✷ button/K {water, pod}/ button/K {water, pod}/ clean/ Σ \ {clean}/✷ Σ/✷

slide-102
SLIDE 102

ID learning algorithm (example)

pod water button clean λ

  • pod
  • water
  • button

✷ ✷ ✷ ✷ pod water

  • K
  • water pod
  • K
  • pod water button

✷ ✷ ✷

  • . . .

. . . . . . . . . . . .

slide-103
SLIDE 103

ID learning algorithm (example)

pod water button clean λ

  • pod
  • water
  • button

✷ ✷ ✷ ✷ pod water

  • K
  • water pod
  • K
  • pod water button

✷ ✷ ✷

  • . . .

. . . . . . . . . . . .

slide-104
SLIDE 104

ID learning algorithm (example)

pod water button clean λ

  • pod
  • water
  • button

✷ ✷ ✷ ✷ pod water

  • K
  • water pod
  • K
  • pod water button

✷ ✷ ✷

  • . . .

. . . . . . . . . . . .

slide-105
SLIDE 105

ID learning algorithm (example)

pod water button clean pod button λ

pod

water

  • K

button ✷ ✷ ✷ ✷ ✷ pod water

  • K
  • K

water pod

  • K
  • K

pod water button ✷ ✷ ✷

. . . . . . . . . . . . . . . . . .

slide-106
SLIDE 106

ID learning algorithm (example)

pod water button clean pod button λ

pod

water

  • K

button ✷ ✷ ✷ ✷ ✷ pod water

  • K
  • K

water pod

  • K
  • K

pod water button ✷ ✷ ✷

. . . . . . . . . . . . . . . . . .

slide-107
SLIDE 107

ID learning algorithm (example)

pod water button clean pod button λ

pod

water

  • K

button ✷ ✷ ✷ ✷ ✷ pod water

  • K
  • K

water pod

  • K
  • K

pod water button ✷ ✷ ✷

. . . . . . . . . . . . . . . . . .

slide-108
SLIDE 108

ID learning algorithm (example)

pod water button clean pod button water button λ

✷ pod

K water

  • K

✷ button ✷ ✷ ✷ ✷ ✷ ✷ pod water

  • K
  • K

K water pod

  • K
  • K

K pod water button ✷ ✷ ✷

✷ . . . . . . . . . . . . . . . . . . . . .

slide-109
SLIDE 109

ID learning algorithm (example)

pod water button clean pod button water button λ

✷ pod

K water

  • K

✷ button ✷ ✷ ✷ ✷ ✷ ✷ pod water

  • K
  • K

K water pod

  • K
  • K

K pod water button ✷ ✷ ✷

✷ . . . . . . . . . . . . . . . . . . . . .

slide-110
SLIDE 110

ID learning algorithm (example)

pod water button clean pod button water button λ

✷ pod

K water

  • K

✷ button ✷ ✷ ✷ ✷ ✷ ✷ pod water

  • K
  • K

K water pod

  • K
  • K

K pod water button ✷ ✷ ✷

✷ water pod button ✷ ✷ ✷

✷ pod water water

  • K
  • K

K water pod water

  • K
  • K

K pod water pod

  • K
  • K

K water pod pod

  • K
  • K

K pod water clean

✷ water pod clean

✷ . . . . . . . . . . . . . . . . . . . . .

slide-111
SLIDE 111

ID learning algorithm (example)

slide-112
SLIDE 112

ID learning algorithm (example)

a clean/

slide-113
SLIDE 113

ID learning algorithm (example)

a clean/ f button/✷ Σ/✷

slide-114
SLIDE 114

ID learning algorithm (example)

a clean/ f button/✷ Σ/✷ b c pod/ water/ pod/ water/

slide-115
SLIDE 115

ID learning algorithm (example)

a clean/ f button/✷ Σ/✷ b c pod/ water/ pod/ water/ d water/ {water, pod}/ pod/

slide-116
SLIDE 116

ID learning algorithm (example)

a clean/ f button/✷ Σ/✷ b c pod/ water/ pod/ water/ d water/ {water, pod}/ pod/ e button/K

slide-117
SLIDE 117

ID learning algorithm (example)

a clean/ f button/✷ Σ/✷ b c pod/ water/ pod/ water/ d water/ {water, pod}/ pod/ e button/K button/✷ button/✷ Σ \ {clean}/✷ clean/

slide-118
SLIDE 118

ID learning algorithm (complexity)

Measure: number of tests to be conducted

◮ Number of prefixes is in O(U|Σ|) ◮ Number of suffixes is in O(|Σ| + n)

Number of tests is in O(U|Σ|2 + U|Σ|n) In case U in O(n), we get O(n|Σ|2 + n2|Σ|)

slide-119
SLIDE 119

Intermediate summary

Learning in general incomplete! The possibility that one has not tested enough will always remain. Solutions for restricted problems so far:

  • 1. Maximum number of states given (naive), O(|Σ|2N).
  • 2. Prefixes for all states given, O(U|Σ|2 + U|Σ|n)
  • 3. Maximum number of states given (partition refinement),

O( (|Σ|N)|Σ|2 + (|Σ|N)|Σ|n) = O(|Σ|Nn)

  • 4. Use equivalence queries, ?.

Is it possible to construct prefixes incrementally?

slide-120
SLIDE 120

Intermediate summary

Learning in general incomplete! The possibility that one has not tested enough will always remain. Solutions for restricted problems so far:

  • 1. Maximum number of states given (naive), O(|Σ|2N).
  • 2. Prefixes for all states given, O(U|Σ|2 + U|Σ|n)
  • 3. Maximum number of states given (partition refinement),

O( (|Σ|N)|Σ|2 + (|Σ|N)|Σ|n) = O(|Σ|Nn)

  • 4. Use equivalence queries, ?.

Is it possible to construct prefixes incrementally?

slide-121
SLIDE 121

Intermediate summary

Learning in general incomplete! The possibility that one has not tested enough will always remain. Solutions for restricted problems so far:

  • 1. Maximum number of states given (naive), O(|Σ|2N).
  • 2. Prefixes for all states given, O(U|Σ|2 + U|Σ|n)
  • 3. Maximum number of states given (partition refinement),

O( (|Σ|N)|Σ|2 + (|Σ|N)|Σ|n) = O(|Σ|Nn)

  • 4. Use equivalence queries, ?.

Is it possible to construct prefixes incrementally?

slide-122
SLIDE 122

Intermediate summary

Learning in general incomplete! The possibility that one has not tested enough will always remain. Solutions for restricted problems so far:

  • 1. Maximum number of states given (naive), O(|Σ|2N).
  • 2. Prefixes for all states given, O(U|Σ|2 + U|Σ|n)
  • 3. Maximum number of states given (partition refinement),

O( (|Σ|N)|Σ|2 + (|Σ|N)|Σ|n) = O(|Σ|Nn)

  • 4. Use equivalence queries, ?.

Is it possible to construct prefixes incrementally?

slide-123
SLIDE 123

Intermediate summary

Learning in general incomplete! The possibility that one has not tested enough will always remain. Solutions for restricted problems so far:

  • 1. Maximum number of states given (naive), O(|Σ|2N).
  • 2. Prefixes for all states given, O(U|Σ|2 + U|Σ|n)
  • 3. Maximum number of states given (partition refinement),

O( (|Σ|N)|Σ|2 + (|Σ|N)|Σ|n) = O(|Σ|Nn)

  • 4. Use equivalence queries, ?.

Is it possible to construct prefixes incrementally?

slide-124
SLIDE 124

Intermediate summary

Learning in general incomplete! The possibility that one has not tested enough will always remain. Solutions for restricted problems so far:

  • 1. Maximum number of states given (naive), O(|Σ|2N).
  • 2. Prefixes for all states given, O(U|Σ|2 + U|Σ|n)
  • 3. Maximum number of states given (partition refinement),

O( (|Σ|N)|Σ|2 + (|Σ|N)|Σ|n) = O(|Σ|Nn)

  • 4. Use equivalence queries, ?.

Is it possible to construct prefixes incrementally?

slide-125
SLIDE 125

The L∗

M-algorithm

slide-126
SLIDE 126

Handling counterexamples

slide-127
SLIDE 127

CE descomposition

Let [u]H denote the access sequence of u in hypothesis H.

Theorem (Counterexample Decomposition)

For every counterexample ¯ c there exists a decomposition ¯ c = uαv into a prefix u, an action α, and a suffix v such that mq([u]Hαv) = mq([uα]Hv). [u]Hα and [uα]H lead to same state in H ⇒ use suffix v to produce un-closedness in observation table

slide-128
SLIDE 128

CE descomposition

Let [u]H denote the access sequence of u in hypothesis H.

Theorem (Counterexample Decomposition)

For every counterexample ¯ c there exists a decomposition ¯ c = uαv into a prefix u, an action α, and a suffix v such that mq([u]Hαv) = mq([uα]Hv). [u]Hα and [uα]H lead to same state in H ⇒ use suffix v to produce un-closedness in observation table

slide-129
SLIDE 129

The coffe machine

a b c d d′ e f pod/ water/ clean/ button/✷ water/ pod/ button/✷ pod/ water/ button/✷ button/K {water, pod}/ button/K {water, pod}/ clean/ Σ \ {clean}/✷ Σ/✷

slide-130
SLIDE 130

The coffe machine - counterexample

  • Hyp. 1:

a f Σ \ {button}/ button/ Σ/✷

slide-131
SLIDE 131

The coffe machine - counterexample

  • Hyp. 1:

a f Σ \ {button}/ button/ Σ/✷

Counterexample: ¯ c = pod water pod water button, leads to K in UCM but to ✷ in Hyp.

slide-132
SLIDE 132

The coffe machine - counterexample

  • Hyp. 1:

a f Σ \ {button}/ button/ Σ/✷

Counterexample: ¯ c = pod water pod water button, leads to K in UCM but to ✷ in Hyp.

i u [u]H α v Mcm() 1 ǫ ǫ pod water pod water button K 2 pod ǫ water pod water button K

slide-133
SLIDE 133

The coffe machine - counterexample

  • Hyp. 1:

a f Σ \ {button}/ button/ Σ/✷

Counterexample: ¯ c = pod water pod water button, leads to K in UCM but to ✷ in Hyp.

i u [u]H α v Mcm() 1 ǫ ǫ pod water pod water button K 2 pod ǫ water pod water button K 3 pod water ǫ pod water button K

slide-134
SLIDE 134

The coffe machine - counterexample

  • Hyp. 1:

a f Σ \ {button}/ button/ Σ/✷

Counterexample: ¯ c = pod water pod water button, leads to K in UCM but to ✷ in Hyp.

i u [u]H α v Mcm() 1 ǫ ǫ pod water pod water button K 2 pod ǫ water pod water button K 3 pod water ǫ pod water button K 4 pod water pod ǫ water button ✷

slide-135
SLIDE 135

The coffe machine - counterexample

  • Hyp. 1:

a f Σ \ {button}/ button/ Σ/✷

Counterexample: ¯ c = pod water pod water button, leads to K in UCM but to ✷ in Hyp.

i u [u]H α v Mcm() 1 ǫ ǫ pod water pod water button K 2 pod ǫ water pod water button K 3 pod water ǫ pod water button K 4 pod water pod ǫ water button ✷ 5 pod water pod water ǫ button ǫ ✷

slide-136
SLIDE 136

But

Both strategies (i.e., all prefixes to Sp, all suffixes to D) are expensive. Is there a more efficient strategy?

slide-137
SLIDE 137

Binary search for counterexamples

Input: counterexample ¯ c = ¯ c1 . . . ¯ cm, hypothesis H. Output: new suffix for D 1: o¯

c := mq(¯

c) 2: lower := 2, upper := m − 1 3: loop 4: mid := ⌊(lower + upper) / 2⌋ 5: s := ¯ c1 . . . ¯ cmid−1, s′ := [s]H, d := ¯ cmid . . . ¯ cm 6:

  • mid := mq(s′d)

7: if omid = o¯

c then

8: lower := mid + 1 // same as reference output: move right 9: if upper < lower then 10: return ¯ cmid+1 . . . ¯ cm 11: end if 12: else 13: upper := mid − 1 // not same as reference output: move left 14: if upper < lower then 15: return ¯ cmid . . . ¯ cm 16: end if 17: end if 18: end loop

slide-138
SLIDE 138

Binary search for counterexamples

Input: counterexample ¯ c = ¯ c1 . . . ¯ cm, hypothesis H. Output: new suffix for D 1: o¯

c := mq(¯

c) 2: lower := 2, upper := m − 1 3: loop 4: mid := ⌊(lower + upper) / 2⌋ 5: s := ¯ c1 . . . ¯ cmid−1, s′ := [s]H, d := ¯ cmid . . . ¯ cm 6:

  • mid := mq(s′d)

7: if omid = o¯

c then

8: lower := mid + 1 // same as reference output: move right 9: if upper < lower then 10: return ¯ cmid+1 . . . ¯ cm 11: end if 12: else 13: upper := mid − 1 // not same as reference output: move left 14: if upper < lower then 15: return ¯ cmid . . . ¯ cm 16: end if 17: end if 18: end loop

slide-139
SLIDE 139

Binary search for counterexamples

Input: counterexample ¯ c = ¯ c1 . . . ¯ cm, hypothesis H. Output: new suffix for D 1: o¯

c := mq(¯

c) 2: lower := 2, upper := m − 1 3: loop 4: mid := ⌊(lower + upper) / 2⌋ 5: s := ¯ c1 . . . ¯ cmid−1, s′ := [s]H, d := ¯ cmid . . . ¯ cm 6:

  • mid := mq(s′d)

7: if omid = o¯

c then

8: lower := mid + 1 // same as reference output: move right 9: if upper < lower then 10: return ¯ cmid+1 . . . ¯ cm 11: end if 12: else 13: upper := mid − 1 // not same as reference output: move left 14: if upper < lower then 15: return ¯ cmid . . . ¯ cm 16: end if 17: end if 18: end loop

slide-140
SLIDE 140

Binary search for counterexamples

Input: counterexample ¯ c = ¯ c1 . . . ¯ cm, hypothesis H. Output: new suffix for D 1: o¯

c := mq(¯

c) 2: lower := 2, upper := m − 1 3: loop 4: mid := ⌊(lower + upper) / 2⌋ 5: s := ¯ c1 . . . ¯ cmid−1, s′ := [s]H, d := ¯ cmid . . . ¯ cm 6:

  • mid := mq(s′d)

7: if omid = o¯

c then

8: lower := mid + 1 // same as reference output: move right 9: if upper < lower then 10: return ¯ cmid+1 . . . ¯ cm 11: end if 12: else 13: upper := mid − 1 // not same as reference output: move left 14: if upper < lower then 15: return ¯ cmid . . . ¯ cm 16: end if 17: end if 18: end loop

slide-141
SLIDE 141

Binary search for counterexamples

Input: counterexample ¯ c = ¯ c1 . . . ¯ cm, hypothesis H. Output: new suffix for D 1: o¯

c := mq(¯

c) 2: lower := 2, upper := m − 1 3: loop 4: mid := ⌊(lower + upper) / 2⌋ 5: s := ¯ c1 . . . ¯ cmid−1, s′ := [s]H, d := ¯ cmid . . . ¯ cm 6:

  • mid := mq(s′d)

7: if omid = o¯

c then

8: lower := mid + 1 // same as reference output: move right 9: if upper < lower then 10: return ¯ cmid+1 . . . ¯ cm 11: end if 12: else 13: upper := mid − 1 // not same as reference output: move left 14: if upper < lower then 15: return ¯ cmid . . . ¯ cm 16: end if 17: end if 18: end loop

slide-142
SLIDE 142

Binary search for counterexamples

Input: counterexample ¯ c = ¯ c1 . . . ¯ cm, hypothesis H. Output: new suffix for D 1: o¯

c := mq(¯

c) 2: lower := 2, upper := m − 1 3: loop 4: mid := ⌊(lower + upper) / 2⌋ 5: s := ¯ c1 . . . ¯ cmid−1, s′ := [s]H, d := ¯ cmid . . . ¯ cm 6:

  • mid := mq(s′d)

7: if omid = o¯

c then

8: lower := mid + 1 // same as reference output: move right 9: if upper < lower then 10: return ¯ cmid+1 . . . ¯ cm 11: end if 12: else 13: upper := mid − 1 // not same as reference output: move left 14: if upper < lower then 15: return ¯ cmid . . . ¯ cm 16: end if 17: end if 18: end loop

slide-143
SLIDE 143

Binary search for counterexamples

Input: counterexample ¯ c = ¯ c1 . . . ¯ cm, hypothesis H. Output: new suffix for D 1: o¯

c := mq(¯

c) 2: lower := 2, upper := m − 1 3: loop 4: mid := ⌊(lower + upper) / 2⌋ 5: s := ¯ c1 . . . ¯ cmid−1, s′ := [s]H, d := ¯ cmid . . . ¯ cm 6:

  • mid := mq(s′d)

7: if omid = o¯

c then

8: lower := mid + 1 // same as reference output: move right 9: if upper < lower then 10: return ¯ cmid+1 . . . ¯ cm 11: end if 12: else 13: upper := mid − 1 // not same as reference output: move left 14: if upper < lower then 15: return ¯ cmid . . . ¯ cm 16: end if 17: end if 18: end loop

slide-144
SLIDE 144

Binary search for counterexamples

Input: counterexample ¯ c = ¯ c1 . . . ¯ cm, hypothesis H. Output: new suffix for D 1: o¯

c := mq(¯

c) 2: lower := 2, upper := m − 1 3: loop 4: mid := ⌊(lower + upper) / 2⌋ 5: s := ¯ c1 . . . ¯ cmid−1, s′ := [s]H, d := ¯ cmid . . . ¯ cm 6:

  • mid := mq(s′d)

7: if omid = o¯

c then

8: lower := mid + 1 // same as reference output: move right 9: if upper < lower then 10: return ¯ cmid+1 . . . ¯ cm 11: end if 12: else 13: upper := mid − 1 // not same as reference output: move left 14: if upper < lower then 15: return ¯ cmid . . . ¯ cm 16: end if 17: end if 18: end loop

slide-145
SLIDE 145

Binary search over counterexample

  • Hyp. 1:

a f Σ \ {button}/ button/ Σ/✷

Counterexample: ¯ c = pod water pod water button, leads to K in UCM but to ✷ in Hyp.

slide-146
SLIDE 146

Binary search over counterexample

  • Hyp. 1:

a f Σ \ {button}/ button/ Σ/✷

Counterexample: ¯ c = pod water pod water button, leads to K in UCM but to ✷ in Hyp.

u [u]H lower mid upper 1 2 3 4 5 ǫ ǫ K pod water pod water ǫ ✷

slide-147
SLIDE 147

Binary search over counterexample

  • Hyp. 1:

a f Σ \ {button}/ button/ Σ/✷

Counterexample: ¯ c = pod water pod water button, leads to K in UCM but to ✷ in Hyp.

u [u]H lower mid upper 1 2 3 4 5 ǫ ǫ K pod water pod water ǫ ✷ pod water ǫ 2 3 4 K

slide-148
SLIDE 148

Binary search over counterexample

  • Hyp. 1:

a f Σ \ {button}/ button/ Σ/✷

Counterexample: ¯ c = pod water pod water button, leads to K in UCM but to ✷ in Hyp.

u [u]H lower mid upper 1 2 3 4 5 ǫ ǫ K pod water pod water ǫ ✷ pod water ǫ 2 3 4 K pod water pod ǫ 3+1 4 4 ✷

slide-149
SLIDE 149

Binary search over counterexample

  • Hyp. 1:

a f Σ \ {button}/ button/ Σ/✷

Counterexample: ¯ c = pod water pod water button, leads to K in UCM but to ✷ in Hyp.

u [u]H lower mid upper 1 2 3 4 5 ǫ ǫ K pod water pod water ǫ ✷ pod water ǫ 2 3 4 K pod water pod ǫ 3+1 4 4 ✷

  • 4
  • 4-1
slide-150
SLIDE 150

Summary

slide-151
SLIDE 151

Active automata learning / summary

◮ System under learning (SUL) is a

black-box

◮ Input alphabet given ◮ Tests can be executed on SUL, output can

be recorded

◮ Membership queries: SUL : Σ∗ → Ω

slide-152
SLIDE 152

Active automata learning / summary

Bad news: in general impossible! The possibility that one has not tested enough will always remain.

◮ States can be represented by access sequences ◮ States can be distinguished by suffixes ◮ Partition refinement pattern yields suffixes! ◮ In general, we cannot construct prefixes incrementally!

Good news: We can introduce some magic that resolves prefix problem. Equivalence queries test wether H = SUL, or not.

slide-153
SLIDE 153

Active automata learning / summary

Bad news: in general impossible! The possibility that one has not tested enough will always remain.

◮ States can be represented by access sequences ◮ States can be distinguished by suffixes ◮ Partition refinement pattern yields suffixes! ◮ In general, we cannot construct prefixes incrementally!

Good news: We can introduce some magic that resolves prefix problem. Equivalence queries test wether H = SUL, or not.

slide-154
SLIDE 154

Active automata learning / summary

Bad news: in general impossible! The possibility that one has not tested enough will always remain.

◮ States can be represented by access sequences ◮ States can be distinguished by suffixes ◮ Partition refinement pattern yields suffixes! ◮ In general, we cannot construct prefixes incrementally!

Good news: We can introduce some magic that resolves prefix problem. Equivalence queries test wether H = SUL, or not.

slide-155
SLIDE 155

Active automata learning / summary

Bad news: in general impossible! The possibility that one has not tested enough will always remain.

◮ States can be represented by access sequences ◮ States can be distinguished by suffixes ◮ Partition refinement pattern yields suffixes! ◮ In general, we cannot construct prefixes incrementally!

Good news: We can introduce some magic that resolves prefix problem. Equivalence queries test wether H = SUL, or not.

slide-156
SLIDE 156

Summary (learning w/ MQ)

  • 1. Maximum number of states given (naive): construct perfix tree of

depth N trees and trees Ts. MQ complexity: O(|Σ|2N).

  • 2. Prefixes for all states given (ID algo.): use partition refinement to

find suffixes. MQ complexity: O(U|Σ|2 + U|Σ|n)

  • 3. Maximum number of states given (partition refinement): combine
  • approaches. MQ complexity:

O( (|Σ|N)|Σ|2 + (|Σ|N)|Σ|n) = O(|Σ|Nn)

slide-157
SLIDE 157

Summary (learning w/ MQ)

  • 1. Maximum number of states given (naive): construct perfix tree of

depth N trees and trees Ts. MQ complexity: O(|Σ|2N).

  • 2. Prefixes for all states given (ID algo.): use partition refinement to

find suffixes. MQ complexity: O(U|Σ|2 + U|Σ|n)

  • 3. Maximum number of states given (partition refinement): combine
  • approaches. MQ complexity:

O( (|Σ|N)|Σ|2 + (|Σ|N)|Σ|n) = O(|Σ|Nn)

slide-158
SLIDE 158

Summary (learning w/ MQ)

  • 1. Maximum number of states given (naive): construct perfix tree of

depth N trees and trees Ts. MQ complexity: O(|Σ|2N).

  • 2. Prefixes for all states given (ID algo.): use partition refinement to

find suffixes. MQ complexity: O(U|Σ|2 + U|Σ|n)

  • 3. Maximum number of states given (partition refinement): combine
  • approaches. MQ complexity:

O( (|Σ|N)|Σ|2 + (|Σ|N)|Σ|n) = O(|Σ|Nn)

slide-159
SLIDE 159

Summary (learning w/ MQ and EQ)

Angluins algorithm:

◮ Use observation tables to organize results from tests ◮ Partition states according to (growing partial) λs : Σ∗ → Ω. ◮ Iteratively refine partition:

◮ Closedness: Move“new”row from lower to upper part of table.

(Allows to drop the assumption from ID algo. that all necessary prefixes are given as input).

◮ Consistency: Partition refinement to generate suffixes.

slide-160
SLIDE 160

Summary (learning w/ MQ and EQ)

Angluins algorithm:

◮ Use observation tables to organize results from tests ◮ Partition states according to (growing partial) λs : Σ∗ → Ω. ◮ Iteratively refine partition:

◮ Closedness: Move“new”row from lower to upper part of table.

(Allows to drop the assumption from ID algo. that all necessary prefixes are given as input).

◮ Consistency: Partition refinement to generate suffixes.

slide-161
SLIDE 161

Summary (learning w/ MQ and EQ)

Angluins algorithm (contd.):

◮ Use equivalence queries to get counterexamples:

◮ Counterexample passes additional state (cf. proof in lecture & in

paper)

⇒ put all prefixes of ce. to upper part of table. (i.e., “incremental”ID algorithm)

◮ Complexity:

◮ MQ: O(nm|Σ| · (n + |Σ|)) = O(n2|Σ|m + n|Σ|2m) ◮ EQ: O(n)

slide-162
SLIDE 162

Summary (learning w/ MQ and EQ)

Angluins algorithm (contd.):

◮ Use equivalence queries to get counterexamples:

◮ Counterexample passes additional state (cf. proof in lecture & in

paper)

⇒ put all prefixes of ce. to upper part of table. (i.e., “incremental”ID algorithm)

◮ Complexity:

◮ MQ: O(nm|Σ| · (n + |Σ|)) = O(n2|Σ|m + n|Σ|2m) ◮ EQ: O(n)

slide-163
SLIDE 163

Summary (learning w/ MQ and EQ)

Angluins algorithm (contd.):

◮ Use equivalence queries to get counterexamples:

◮ Counterexample passes additional state (cf. proof in lecture & in

paper)

⇒ put all prefixes of ce. to upper part of table. (i.e., “incremental”ID algorithm)

◮ Complexity:

◮ MQ: O(nm|Σ| · (n + |Σ|)) = O(n2|Σ|m + n|Σ|2m) ◮ EQ: O(n)

slide-164
SLIDE 164

Summary (learning w/ MQ and EQ)

Other strategies to handle counterexamples (due to decomposition theorem):

◮ Add all suffixes of ce. to suffixes:

◮ No inconsistencies! ◮ Complexity (MQ): O(n|Σ| · (nm + |Σ|)) = O(n2|Σ|m + n|Σ|2)

◮ Find one suffix by binary search:

◮ Complexity (MQ):

O(n|Σ| · (n + |Σ|) + n · log2(m)) = O(n2|Σ| + n|Σ|2 + n · log2(m))

◮ Complexity (EQ): O(n)

slide-165
SLIDE 165

Summary (learning w/ MQ and EQ)

Other strategies to handle counterexamples (due to decomposition theorem):

◮ Add all suffixes of ce. to suffixes:

◮ No inconsistencies! ◮ Complexity (MQ): O(n|Σ| · (nm + |Σ|)) = O(n2|Σ|m + n|Σ|2)

◮ Find one suffix by binary search:

◮ Complexity (MQ):

O(n|Σ| · (n + |Σ|) + n · log2(m)) = O(n2|Σ| + n|Σ|2 + n · log2(m))

◮ Complexity (EQ): O(n)

slide-166
SLIDE 166

Summary (learning w/ MQ and EQ)

Other strategies to handle counterexamples (due to decomposition theorem):

◮ Add all suffixes of ce. to suffixes:

◮ No inconsistencies! ◮ Complexity (MQ): O(n|Σ| · (nm + |Σ|)) = O(n2|Σ|m + n|Σ|2)

◮ Find one suffix by binary search:

◮ Complexity (MQ):

O(n|Σ| · (n + |Σ|) + n · log2(m)) = O(n2|Σ| + n|Σ|2 + n · log2(m))

◮ Complexity (EQ): O(n)

slide-167
SLIDE 167

Summary (learning w/ MQ and EQ)

Other strategies to handle counterexamples (due to decomposition theorem):

◮ Add all suffixes of ce. to suffixes:

◮ No inconsistencies! ◮ Complexity (MQ): O(n|Σ| · (nm + |Σ|)) = O(n2|Σ|m + n|Σ|2)

◮ Find one suffix by binary search:

◮ Complexity (MQ):

O(n|Σ| · (n + |Σ|) + n · log2(m)) = O(n2|Σ| + n|Σ|2 + n · log2(m))

◮ Complexity (EQ): O(n)