Learning Symbolic Automata Samuel Drews Loris DAntoni University - - PowerPoint PPT Presentation

learning symbolic automata
SMART_READER_LITE
LIVE PREVIEW

Learning Symbolic Automata Samuel Drews Loris DAntoni University - - PowerPoint PPT Presentation

Learning Symbolic Automata Samuel Drews Loris DAntoni University of Wisconsin-Madison Motivation Model System Automata Learning Java API code Classic Automata 1,3,5,7 1,3,5,7 0,2,4,6 0,2,4,6 Alphabet = {0,1,2,3,4,5,6,7}


slide-1
SLIDE 1

Learning Symbolic Automata

Samuel Drews Loris D’Antoni University of Wisconsin-Madison

slide-2
SLIDE 2

Motivation

Java API code Automata Learning System Model

slide-3
SLIDE 3

Classic Automata

1,3,5,7 1,3,5,7 0,2,4,6 0,2,4,6

Alphabet Σ = {0,1,2,3,4,5,6,7} Transition δ : Q × Σ → Q

slide-4
SLIDE 4

1,3,5,7,... 1,3,5,7,... 0,2,4,6,... 0,2,4,6,...

Alphabet Σ = {0,1,2,3,4,5,6,7,...} Transition δ : Q × Σ → Q

Classic Automata

slide-5
SLIDE 5

Symbolic Automata

  • dd
  • dd

even even

Alphabet Σ = {0,1,2,3,4,5,6,7,...} Boolean Algebra BA = {⊥, odd, even, ⊤} Transition δ : Q × BA → Q

slide-6
SLIDE 6

Symbolic Automata

  • dd
  • dd

even even

Alphabet Σ = {0,1,2,3,4,5,6,7,...} Boolean Algebra BA = {⊥, odd, even, ⊤} Transition δ : Q × BA → Q Boolean Algebra φ∈BA → ¬φ∈BA φ,ψ ∈ BA → φ∧ψ ∈ BA

slide-7
SLIDE 7

Λ* Oracle Queries

Membership Query word

✓ accept ✗ not accept

Equivalence Query automaton

✓ equivalent ✗ not equivalent; counterexample word

slide-8
SLIDE 8

Λ* Partitioning Function

Partitioning Function List[2Σ] List[BA] Ex: 1,3 6 P([{1,3},{6}])

  • dd

even [odd, even] =

slide-9
SLIDE 9

Refine Observation Table Conjecture Classic Automaton Equivalence Query + Counterexample

Angluin’s L* (classic automata)

Membership Queries

slide-10
SLIDE 10

Refine Observation Table Sparse Membership Queries Conjecture Symbolic Automaton Equivalence Query + Counterexample

Λ*

Intermediary Automaton Partitioning Function

slide-11
SLIDE 11

Anatomy of the Observation Table

ε ε ✓ ✓ 5 ✗ ✗ 5,0 ✗ ✓ ✓ ✓ 5,0,0 ✓ ✓

Rows: strings that lead to states (representatives above divider) Columns: suffixes that tell states apart Body: whether automaton accepts word

slide-12
SLIDE 12

ε ε ✓ ✓ 5 ✗ ✗ 5,0 ✗ ✓ ✓ ✓ 5,0,0 ✓ ✓

Anatomy of the Observation Table

Rows: strings that lead to states (representatives above divider) Columns: suffixes that tell states apart Body: whether automaton accepts word

slide-13
SLIDE 13

ε ε ✓ ✓ 5 ✗ ✗ 5,0 ✗ ✓ ✓ ✓ 5,0,0 ✓ ✓

Anatomy of the Observation Table

Rows: strings that lead to states (representatives above divider) Columns: suffixes that tell states apart Body: whether automaton accepts word

slide-14
SLIDE 14

ε ε ✓ ✓ 5 ✗ ✗ 5,0 ✗ ✓ ✓ ✓ 5,0,0 ✓ ✓

Anatomy of the Observation Table

Rows: strings that lead to states (representatives above divider) Columns: suffixes that tell states apart Body: whether automaton accepts word

slide-15
SLIDE 15

ε ε ✓ ✓ 5 ✗ ✗ 5,0 ✗ ✓ ✓ ✓ 5,0,0 ✓ ✓

Anatomy of the Observation Table

Rows: strings that lead to states (representatives above divider) Columns: suffixes that tell states apart Body: whether automaton accepts word

slide-16
SLIDE 16

ε ε ✓ ✓ 5 ✗ ✗ 5,0 ✗ ✓ ✓ ✓ 5,0,0 ✓ ✓

Anatomy of the Observation Table

Rows: strings that lead to states (representatives above divider) Columns: suffixes that tell states apart Body: whether automaton accepts word does not accept 5,0·ε accepts 5,0·0

slide-17
SLIDE 17

Observation Table to Intermediary Automaton

ε ε ✓ ✓ 5 ✗ ✗ 5,0 ✗ ✓ ✓ ✓ 5,0,0 ✓ ✓ ε

✓✓

5

✗✗

5,0

✗✓

slide-18
SLIDE 18

Observation Table to Intermediary Automaton

ε ε ✓ ✓ 5 ✗ ✗ 5,0 ✗ ✓ ✓ ✓ 5,0,0 ✓ ✓ ε

✓✓

5

✗✗

5,0

✗✓

slide-19
SLIDE 19

Observation Table to Intermediary Automaton

ε ε ✓ ✓ 5 ✗ ✗ 5,0 ✗ ✓ ✓ ✓ 5,0,0 ✓ ✓ ε

✓✓

5

✗✗

5,0

✗✓

slide-20
SLIDE 20

Observation Table to Intermediary Automaton

ε ε ✓ ✓ 5 ✗ ✗ 5,0 ✗ ✓ ✓ ✓ 5,0,0 ✓ ✓ ε

✓✓

5

✗✗

5,0

✗✓

5,0 5,0,0

slide-21
SLIDE 21

Observation Table to Intermediary Automaton

ε ε ✓ ✓ 5 ✗ ✗ 5,0 ✗ ✓ ✓ ✓ 5,0,0 ✓ ✓ ε

✓✓

5

✗✗

5 5,0

✗✓

slide-22
SLIDE 22

… to Symbolic Automaton

ε

✓✓

5

✗✗

5 5,0

✗✓

slide-23
SLIDE 23

… to Symbolic Automaton

ε

✓✓

5

✗✗

5 5,0

✗✓

slide-24
SLIDE 24

… to Symbolic Automaton

ε

✓✓

5

✗✗

5 5,0

✗✓

[0,∞)

Use partitioning function: P([{0}]) = [0,∞) BA = intervals over Z≥0

slide-25
SLIDE 25

… to Symbolic Automaton

ε

✓✓

5

✗✗

5 5,0

✗✓

[0,∞) [0,∞)

Use partitioning function: P([{0}]) = [0,∞) BA = intervals over Z≥0

slide-26
SLIDE 26

… to Symbolic Automaton

ε

✓✓

5

✗✗

5 5,0

✗✓

[0,5) [5,∞) [0,∞) [0,∞)

Use partitioning function: P([{0},{5}]) = [0,5), [5,∞) BA = intervals over Z≥0

slide-27
SLIDE 27

… to Symbolic Automaton

[0,5) [5,∞) [0,∞) [0,∞) ε ε ✓ ✓ 5 ✗ ✗ 5,0 ✗ ✓ ✓ ✓ 5,0,0 ✓ ✓

slide-28
SLIDE 28

Λ* by Example

Σ = non-negative integers BA = unions of intervals over Σ

[51,101) [0,∞) [0,∞) [0,51) ∪ [101,∞)

slide-29
SLIDE 29

Λ* by Example

Initialize table: Membership query for ε Membership query for 0 (arbitrary)

[51,101) [0,∞) [0,∞) [0,51) ∪ [101,∞)

ε ε ✓ ✓

slide-30
SLIDE 30

Λ* by Example

Initialize table: Membership query for ε Membership query for 0 (arbitrary)

[51,101) [0,∞) [0,∞) [0,51) ∪ [101,∞)

ε ε ✓ ✓

Λ* : query for single element L* : queries for all of Σ

ε ε ✓ ✓ 1 ✓ 2 ✓ …

slide-31
SLIDE 31

Λ* by Example

[51,101) [0,∞) [0,∞) [0,51) ∪ [101,∞)

Build “sparse” automaton from table δ : Q × Σ → Q

ε ✓ ε ε ✓ ✓

slide-32
SLIDE 32

Λ* by Example

[51,101) [0,∞) [0,∞) [0,51) ∪ [101,∞)

Build “sparse” automaton from table δ : Q × Σ → Q

ε ✓

L* : equivalence query Λ* : build symbolic Automaton δ : Q × BA → Q

ε ε ✓ ✓

slide-33
SLIDE 33

Λ* by Example

[51,101) [0,∞) [0,∞) [0,51) ∪ [101,∞)

ε ✓ [0,∞)

Build symbolic automaton using partitioning function: suppose P({0}) = [0,∞)

ε ε ✓ ✓

slide-34
SLIDE 34

Λ* by Example

[51,101) [0,∞) [0,∞) [0,51) ∪ [101,∞)

ε ε ✓ ✓ 51 ✗ [0,∞)

Equivalence query: Not equivalent! cex (51, ✗)

slide-35
SLIDE 35

Λ* by Example

[51,101) [0,∞) [0,∞) [0,51) ∪ [101,∞)

ε ε ✓ ✓ 51 ✗

Move 51 to top

ε ε ✓ 51 ✗ ✓ ε ε ✓ 51 ✗ ✓ 51,0 ✗

Not closed: 51 leads to a new state Membership query

  • n 51,0
slide-36
SLIDE 36

Λ* by Example

[51,101) [0,∞) [0,∞) [0,51) ∪ [101,∞)

ε ε ✓ ✓ 51 ✗

Move 51 to top

ε ε ✓ 51 ✗ ✓ ε ε ✓ 51 ✗ ✓ 51,0 ✗

Not closed: 51 leads to a new state Membership query

  • n 51,0

L* queries all of 51·Σ

slide-37
SLIDE 37

Λ* by Example

[51,101) [0,∞) [0,∞) [0,51) ∪ [101,∞)

suppose P({0},{51}) = [0,51) , [51,∞) P({0}) = [0,∞)

ε ✓ ε ε ✓ 51 ✗ ✓ 51,0 ✗ 51 ✗ 51 [0,51) [0,∞) [51,∞)

slide-38
SLIDE 38

Λ* by Example

[51,101) [0,∞) [0,∞) [0,51) ∪ [101,∞)

[0,51) [0,∞) [51,∞)

Equivalence query: Not equivalent! cex (101; ✓)

ε ε ✓ 51 ✗ ✓ 51,0 ✗

slide-39
SLIDE 39

Λ* by Example

[51,101) [0,∞) [0,∞) [0,51) ∪ [101,∞)

[0,51) [0,∞) [51,∞)

Equivalence query: Not equivalent! cex (101; ✓)

ε ε ✓ 51 ✗ ✓ 51,0 ✗ 101 ✓

slide-40
SLIDE 40

Λ* by Example

[51,101) [0,∞) [0,∞) [0,51) ∪ [101,∞)

[0,51) [0,∞) [51,∞)

Equivalence query: Not equivalent! cex (101; ✓) L* : every cex is a new state Λ* : some cex is refining the

  • utgoing predicates

ε ε ✓ 51 ✗ ✓ 51,0 ✗ 101 ✓

slide-41
SLIDE 41

Λ* by Example

[51,101) [0,∞) [0,∞) [0,51) ∪ [101,∞)

[0,51)∪[101,∞) [0,∞) [51,100) ε ✓ 0,101 51 ✗ 51 ε ε ✓ 51 ✗ ✓ 51,0 ✗ 101 ✓

suppose P({0,101},{51}) = [0,51)∪[101,∞) , [51,∞) P({0}) = [0,∞)

slide-42
SLIDE 42

Λ* by Example

[51,101) [0,∞) [0,∞) [0,51) ∪ [101,∞)

ε ε ✓ 51 ✗ ✓ 51,0 ✗ 101 ✓ 51,0,0 ✓ [0,51)∪[101,∞) [0,∞) [51,100)

Equivalence query: Not equivalent! cex (51,0,0; ✓)

slide-43
SLIDE 43

Λ* by Example

[51,101) [0,∞) [0,∞) [0,51) ∪ [101,∞)

??

51 and 51,0 seem like same state 51·0 and 51,0·0 are different states

ε ε ✓ 51 ✗ ✓ 51,0 ✗ 101 ✓ 51,0,0 ✓

slide-44
SLIDE 44

Λ* by Example

[51,101) [0,∞) [0,∞) [0,51) ∪ [101,∞)

ε ε ✓ ✓ 51 ✗ ✗ ✓ ✓ 51,0 ✗ ✓ 101 ✓ ✓ 51,0,0 ✓ ✓

Inconsistent: add 0 to E 51 and 51,0 seem like same state 51·0 and 51,0·0 are different states

?? ε ε ✓ 51 ✗ ✓ 51,0 ✗ 101 ✓ 51,0,0 ✓

slide-45
SLIDE 45

Λ* by Example

[51,101) [0,∞) [0,∞) [0,51) ∪ [101,∞)

ε ε ✓ ✓ 51 ✗ ✗ 51,0 ✗ ✓ ✓ ✓ 101 ✓ ✓ 51,0,0 ✓ ✓

make closed move 51,0 to top

ε ε ✓ ✓ 51 ✗ ✗ ✓ ✓ 51,0 ✗ ✓ 101 ✓ ✓ 51,0,0 ✓ ✓

slide-46
SLIDE 46

Λ* by Example

[51,101) [0,∞) [0,∞) [0,51) ∪ [101,∞)

P({0,101},{51}) = [0,51)∪[101,∞) , [51,101) P({0}) = [0,∞)

ε

✓✓

0,101 51

✗✗

51 ε ε ✓ ✓ 51 ✗ ✗ 51,0 ✗ ✓ ✓ ✓ 101 ✓ ✓ 51,0,0 ✓ ✓ 51,0

✗✓

[0,51)∪[101,∞) [0,∞) [51,100) [0,∞)

slide-47
SLIDE 47

Λ* by Example

[51,101) [0,∞) [0,∞) [0,51) ∪ [101,∞)

[0,51)∪[101,∞) [0,∞) [51,100) [0,∞)

Equivalence query: Equivalent!

ε ε ✓ ✓ 51 ✗ ✗ 51,0 ✗ ✓ ✓ ✓ 101 ✓ ✓ 51,0,0 ✓ ✓

slide-48
SLIDE 48

Why did this work?

Infinite alphabet, but finite examples Oracle gave us good counterexamples Call this projection of the oracle a generator: [{0}] → [{0},{51}] → [{0,101},{51}]

ε [0,51)∪[101,∞) [51,100) ε 51 ε 0, 101 51 ε

slide-49
SLIDE 49

Learnability of Boolean Algebra

Learn automaton with oracle providing Σ* examples Learn partition in BA with generator providing Σ examples

slide-50
SLIDE 50

“Bad” Oracle

Suppose the oracle does not provide optimal counterexamples generator: [{0}] → [{0},{59}] → [{0,500},{59,53}] → …

ε 59 ε 0, 500 59, 53 ε ε 0, 500 59, 53, 51 ε 0, 500, 401 59, 53, 51

...

slide-51
SLIDE 51

“Bad” Oracle

Suppose the oracle does not provide optimal counterexamples

ε 0, 500 59, 53

slide-52
SLIDE 52

“Bad” Oracle

Suppose the oracle does not provide optimal counterexamples Partitioning function assumes everything >500 behaves the same as 500 Since 500 > 101, we will never see another example >500

ε 0, 500 59, 53 ε [0,51)∪[101,∞) [51,100)

slide-53
SLIDE 53

sg-learnability of Boolean Algebra

c - partition in BA, g - generator Fix a partitioning function P: define sg(c) = # examples from g needed for P to produce c Ex: c = [0,51)∪[101,∞) , [51,101) Good examples: sg(c) = 3 Bad examples: sg’(c) < ∞

slide-54
SLIDE 54

sg-learnability

# Equivalence queries to learn symbolic automata M ≤ n2 ∑g,csg(c)

  • racle examples
slide-55
SLIDE 55

Learning Classes

C∀

finite

C∀

size

C∀

constant

C∃

finite

C∃

size

C∃

constant

⊆ ⊆ ⊆ ⊆ ⊆ ⊆ ⊆

slide-56
SLIDE 56

Learning Classes

C∀

finite

C∀

size

C∀

constant

C∃

finite

C∃

size

C∃

constant

There exists a generator: any partition is learned from a constant # examples ⊆ ⊆ ⊆ ⊆ ⊆ ⊆ ⊆

slide-57
SLIDE 57

Learning Classes

C∀

finite

C∀

size

C∀

constant

C∃

finite

C∃

size

C∃

constant

There exists a generator: any partition is learned from a constant # examples For every generator: any partition is learned from a # examples based on the size of the partition ⊆ ⊆ ⊆ ⊆ ⊆ ⊆ ⊆

slide-58
SLIDE 58

Learning Classes

C∀

finite

C∀

size

C∀

constant

C∃

finite

C∃

size

C∃

constant

There exists a generator: any partition is learned from a constant # examples For every generator: any partition is learned from a # examples based on the size of the partition ⊆ Λ* example ⊆ ⊆ ⊆ ⊆ ⊆ ⊆

slide-59
SLIDE 59

Composition of Boolean Algebras

We have a non-negative integer partitioning function in C∃

size

Can we learn partitions over all integers? Disjoint union: Z ≅ Z<0 ⊎ Z≥0 {-4,5}, {-2,0}

slide-60
SLIDE 60

Composition of Boolean Algebras

We have a non-negative integer partitioning function in C∃

size

Can we learn partitions over all integers? Disjoint union: Z ≅ Z<0 ⊎ Z≥0 {-4,5}, {-2,0} {5}, {0} {-4}, {-2}

slide-61
SLIDE 61

Composition of Boolean Algebras

We have a non-negative integer partitioning function in C∃

size

Can we learn partitions over all integers? Disjoint union: Z ≅ Z<0 ⊎ Z≥0 {-4,5}, {-2,0} {5}, {0} {-4}, {-2} [5,∞), [0,5) (-∞,-4], (-4,-1]

slide-62
SLIDE 62

Composition of Boolean Algebras

We have a non-negative integer partitioning function in C∃

size

Can we learn partitions over all integers? Disjoint union: Z ≅ Z<0 ⊎ Z≥0 {-4,5}, {-2,0} {5}, {0} {-4}, {-2} [5,∞), [0,5) (-∞,-4], (-4,-1] (-∞,-4]∪[5,∞), (-4,5)

slide-63
SLIDE 63

Composition of Boolean Algebras

We can learn partitions over all integers Z Can we learn partitions over Z2? Cartesian product: Z2 ≅ Z × Z

slide-64
SLIDE 64

Composition of Boolean Algebras

We can learn partitions over all integers Z Can we learn partitions over Z2? Cartesian product: Z2 ≅ Z × Z

slide-65
SLIDE 65

Composition of Boolean Algebras

We can learn partitions over all integers Z Can we learn partitions over Z2? Cartesian product: Z2 ≅ Z × Z

slide-66
SLIDE 66

Composition of Boolean Algebras

If BA1 and BA2 are Boolean Algebras in learning class C BA1 ⊎ BA2 is in C BA1 × BA2 is in C

slide-67
SLIDE 67

Composition of Boolean Algebras

Learning an automaton over strings of network packets Packet UDP TCP ⊎ header data header data × ×

slide-68
SLIDE 68

Refine Observation Table Sparse Membership Queries Conjecture Symbolic Automaton Equivalence Query + Counterexample

Λ*

Intermediary Automaton Partitioning Function

C∀

finite

C∀

size

C∀

constant

C∃

finite

C∃

size

C∃

constant

⊆ ⊆ ⊆ ⊆ ⊆ ⊆ ⊆