Learning minimal separating DFA for Compositional Verification - - PowerPoint PPT Presentation

learning minimal separating dfa for compositional
SMART_READER_LITE
LIVE PREVIEW

Learning minimal separating DFA for Compositional Verification - - PowerPoint PPT Presentation

Overview Definitions Algorithm References Learning minimal separating DFA for Compositional Verification Karsten Fix February 23, 2017 Karsten Fix Learning minimal separating DFA for Compositional Verification Overview Definitions


slide-1
SLIDE 1

Overview Definitions Algorithm References

Learning minimal separating DFA for Compositional Verification

Karsten Fix February 23, 2017

Karsten Fix Learning minimal separating DFA for Compositional Verification

slide-2
SLIDE 2

Overview Definitions Algorithm References Motivation

1

Overview Motivation

2

Definitions Separating DFA 3DFA Consistency Soundness Completeness

3

Algorithm Candidate Generator Completeness Checking Finding minimal consistent DFA Soundness Checking

4

References

Karsten Fix Learning minimal separating DFA for Compositional Verification

slide-3
SLIDE 3

Overview Definitions Algorithm References Motivation

Compositional Verification

System consist of Components M1 and M2 shall satisfy a Property P can be describe by regular Laguages L(M1), L(M2), L(P). To verify this, there’s an inference rule, that says: L(M1) ∩ L(A) ⊆ L(P) L(M2) ⊆ L(A) L(M1) ∩ L(M2) ⊆ L(P) Intuitively: We can find an Assumption A for M2.

Karsten Fix Learning minimal separating DFA for Compositional Verification

slide-4
SLIDE 4

Overview Definitions Algorithm References Motivation

Compositional Verification

This premise of the interference rule: L(M1) ∩ L(A) ⊆ L(P) can be rewritten as: L(A) ⊆ L(M1) ∩ L(P) Substitution: L(M2) ⊆ L(A) ⊆ L(M1) ∩ L(P) Then A is separating DFA for L(M2) and L(M1) ∩ L(P).

Karsten Fix Learning minimal separating DFA for Compositional Verification

slide-5
SLIDE 5

Overview Definitions Algorithm References Separating DFA 3DFA Consistency Soundness Completeness

Separating DFA

Definition Let L1, L2 ⊆ Σ∗ be disjoint regular languages. Then a DFA A is called separating DFA for L1 and L2, if it statisfies:

1 L1 ⊆ L(A) 2 L(A) ∩ L2 = ∅

Or equivalently: L1 ⊆ L(A) ⊆ L2

Karsten Fix Learning minimal separating DFA for Compositional Verification

slide-6
SLIDE 6

Overview Definitions Algorithm References Separating DFA 3DFA Consistency Soundness Completeness

Separating DFA

That means: A accepts at least all words of L1 and rejects all words of L2. L1 L(A) L2

Karsten Fix Learning minimal separating DFA for Compositional Verification

slide-7
SLIDE 7

Overview Definitions Algorithm References Separating DFA 3DFA Consistency Soundness Completeness

3DFA

Definition A 3DFA C is defined like a DFA: C = (Q, Σ, δ, q0, Acc, Rej, Dont

  • Q

) but all states are partitioned into three sets: Acc ⊆ Q: accepting states Rej ⊆ Q: rejecting states Dont ⊆ Q: Don’t care states That means: Acc ∩ Rej ∩ Dont = ∅

Karsten Fix Learning minimal separating DFA for Compositional Verification

slide-8
SLIDE 8

Overview Definitions Algorithm References Separating DFA 3DFA Consistency Soundness Completeness

3DFA

Given a 3DFA C a string w ∈ Σ∗ is: accepted by C if ˆ δ(q0, w) ∈ Acc rejected by C if ˆ δ(q0, w) ∈ Rej called don’t care string if ˆ δ(q0, w) ∈ Dont

Karsten Fix Learning minimal separating DFA for Compositional Verification

slide-9
SLIDE 9

Overview Definitions Algorithm References Separating DFA 3DFA Consistency Soundness Completeness

3DFA - Visualisation

A 3DFA will be visualised, using squares for the don’t care states. Rejecting and accepting states are visualised as circles, as usual. An Example: q0 start q1 q2 q4 q3 a b b a a b a b a b

Karsten Fix Learning minimal separating DFA for Compositional Verification

slide-10
SLIDE 10

Overview Definitions Algorithm References Separating DFA 3DFA Consistency Soundness Completeness

3DFA → DFA C+

Definition We define a DFA C+, where the don’t care states become accepting states: C+ = (Q, Σ, q0, δ, Acc ∪ Dont)

Karsten Fix Learning minimal separating DFA for Compositional Verification

slide-11
SLIDE 11

Overview Definitions Algorithm References Separating DFA 3DFA Consistency Soundness Completeness

3DFA → DFA C+

Example 3DFA C:

q0 start q1 q2 q4 q3 a b b a a b a b a b

DFA C+:

q0 start q1 q2 q4 q3 a b b a a b a b a b

Karsten Fix Learning minimal separating DFA for Compositional Verification

slide-12
SLIDE 12

Overview Definitions Algorithm References Separating DFA 3DFA Consistency Soundness Completeness

3DFA → DFA C−

Definition We define a DFA C−, where only the accepting states are accepting: C− = (Q, Σ, q0, δ, Acc)

Karsten Fix Learning minimal separating DFA for Compositional Verification

slide-13
SLIDE 13

Overview Definitions Algorithm References Separating DFA 3DFA Consistency Soundness Completeness

3DFA → DFA C−

Example 3DFA C:

q0 start q1 q2 q4 q3 a b b a a b a b a b

DFA C−:

q0 start q1 q2 q4 q3 a b b a a b a b a b

Karsten Fix Learning minimal separating DFA for Compositional Verification

slide-14
SLIDE 14

Overview Definitions Algorithm References Separating DFA 3DFA Consistency Soundness Completeness

Consistency

Definition Let A be a DFA, then it will be called consistent with a 3DFA C, if both are accepting and rejecting the same words. Means:

1 L(C−) ⊆ L(A) 2 L(A) ∩ L(C+) = ∅

Or equivalently: L(C−) ⊆ L(A) ⊆ L(C+)

Karsten Fix Learning minimal separating DFA for Compositional Verification

slide-15
SLIDE 15

Overview Definitions Algorithm References Separating DFA 3DFA Consistency Soundness Completeness

Consistency - Visualisation

DFA A consistent with a 3DFA C: L(C+) L(A) L(C−)

Karsten Fix Learning minimal separating DFA for Compositional Verification

slide-16
SLIDE 16

Overview Definitions Algorithm References Separating DFA 3DFA Consistency Soundness Completeness

Consistency - Visualisation

DFA A inconsistent with a 3DFA C: L(C+) L(A) L(C−)

Karsten Fix Learning minimal separating DFA for Compositional Verification

slide-17
SLIDE 17

Overview Definitions Algorithm References Separating DFA 3DFA Consistency Soundness Completeness

Soundness

Definition A 3DFA C is called sound with respect to L1 and L2, if any with C consistent DFA A separates L1 and L2. Remember Consistency: L(C−) ⊆ L(A) ⊆ L(C+) Separating: L1 ⊆ L(A) ⊆ L2

Karsten Fix Learning minimal separating DFA for Compositional Verification

slide-18
SLIDE 18

Overview Definitions Algorithm References Separating DFA 3DFA Consistency Soundness Completeness

Soundness - Visualisation

Any DFA A consistent with 3DFA C:

L(C−) L(C+)

Karsten Fix Learning minimal separating DFA for Compositional Verification

slide-19
SLIDE 19

Overview Definitions Algorithm References Separating DFA 3DFA Consistency Soundness Completeness

Soundness - Visualisation

is separating DFA for L1 and L2, so C is sound:

L1 L2 L(C−) L(C+)

Karsten Fix Learning minimal separating DFA for Compositional Verification

slide-20
SLIDE 20

Overview Definitions Algorithm References Separating DFA 3DFA Consistency Soundness Completeness

Soundness - Visualisation

An unsound 3DFA C:

L1 L2 u v L(C−) L(C+)

Karsten Fix Learning minimal separating DFA for Compositional Verification

slide-21
SLIDE 21

Overview Definitions Algorithm References Separating DFA 3DFA Consistency Soundness Completeness

Completeness

Definition A 3DFA C is called complete with respect to L1 and L2, if any separating DFA A for L1 and L2 is consistent with C. Remember Separating: L1 ⊆ L(A) ⊆ L2 Consistency: L(C−) ⊆ L(A) ⊆ L(C+)

Karsten Fix Learning minimal separating DFA for Compositional Verification

slide-22
SLIDE 22

Overview Definitions Algorithm References Separating DFA 3DFA Consistency Soundness Completeness

Completeness - Visualisation

Any DFA A separating L1 and L2:

L2 L(A) L1

Karsten Fix Learning minimal separating DFA for Compositional Verification

slide-23
SLIDE 23

Overview Definitions Algorithm References Separating DFA 3DFA Consistency Soundness Completeness

Completeness - Visualisation

is consistent with 3DFA C, so it is complete:

L(C+) L2 L1 L(C−)

Karsten Fix Learning minimal separating DFA for Compositional Verification

slide-24
SLIDE 24

Overview Definitions Algorithm References Separating DFA 3DFA Consistency Soundness Completeness

Completeness - Visualisation

An incomplete 3DFA C:

L(C+) L2 L1 L(C−) u v

Karsten Fix Learning minimal separating DFA for Compositional Verification

slide-25
SLIDE 25

Overview Definitions Algorithm References Separating DFA 3DFA Consistency Soundness Completeness

Summary

1 DFA A is separating DFA if: L1 ⊆ L(A) ⊆ L2 2 L(C−) : are all words a 3DFA C accepts 3 L(C+) : are all words a 3DFA C rejects 4 DFA A is consistent with 3DFA C if: L(C−) ⊆ L(A) ⊆ L(C+) 5 3DFA is sound if L1 ⊆ L(C−) and L(C+) ⊆ L2 6 3DFA is complete if L(C−) ⊆ L1 and L2 ⊆ L(C+) Karsten Fix Learning minimal separating DFA for Compositional Verification

slide-26
SLIDE 26

Overview Definitions Algorithm References Candidate Generator Completeness Checking Finding minimal consistent DFA Soundness Checking

Overview of Lsep

Candidate Generator Completeness Checking L(C−

i )

⊆ L1 L2 ⊆ L(C+

i )

Ci No CE Finding a minimal consistent DFA Yes Ci Soundness Checking L1 ⊆ L(Ai) L(Ai) ⊆ L2 Ai Yes No CE

Karsten Fix Learning minimal separating DFA for Compositional Verification

slide-27
SLIDE 27

Overview Definitions Algorithm References Candidate Generator Completeness Checking Finding minimal consistent DFA Soundness Checking

Teacher

Candidate Generator Completeness Checking L(C−

i )

⊆ L1 L2 ⊆ L(C+

i )

Ci No CE Finding a minimal consistent DFA Yes Ci Soundness Checking L1 ⊆ L(Ai) L(Ai) ⊆ L2 Ai Yes No CE

The algorithm assumes a teacher that can answer: membership queries w

?

∈ L1, w

?

∈ L2 with:

+ if w ∈ L1 − if w ∈ L2 ? otherwise, i.e. don’t care.

Karsten Fix Learning minimal separating DFA for Compositional Verification

slide-28
SLIDE 28

Overview Definitions Algorithm References Candidate Generator Completeness Checking Finding minimal consistent DFA Soundness Checking

Candidate Generator

Based on the L∗-algorithm a 3DFA Ci is computed by asking membership queries and building an observation table with entries: +, − and ?, depending on the answers of the teacher. λ b λ − ? b ? ? ba − + bab + + a − ? . . . . . . . . .

λ start b bab ba Ci a b b a a b b a

Karsten Fix Learning minimal separating DFA for Compositional Verification

slide-29
SLIDE 29

Overview Definitions Algorithm References Candidate Generator Completeness Checking Finding minimal consistent DFA Soundness Checking

Teacher

Candidate Generator Completeness Checking L(C−

i )

⊆ L1 L2 ⊆ L(C+

i )

Ci No CE Finding a minimal consistent DFA Yes Ci Soundness Checking L1 ⊆ L(Ai) L(Ai) ⊆ L2 Ai Yes No CE

The teacher also answers: containment queries, such as L(C−

i ) ?

⊆ L1, L2

?

⊆ L(C+

i )

with:

Yes, if both subset relations are true No, if one relation is false. It also gives a counterexample (CE)

Karsten Fix Learning minimal separating DFA for Compositional Verification

slide-30
SLIDE 30

Overview Definitions Algorithm References Candidate Generator Completeness Checking Finding minimal consistent DFA Soundness Checking

Minimal consistent DFA

Candidate Generator Completeness Checking L(C−

i )

⊆ L1 L2 ⊆ L(C+

i )

Ci No CE Finding a minimal consistent DFA Yes Ci Soundness Checking L1 ⊆ L(Ai) L(Ai) ⊆ L2 Ai Yes No CE

Lsep translates the 3DFA Ci into a mealy automaton, which will be minimized with existing algorithms. After minimizing it, it will be translated into a consistent DFA Ai.

Karsten Fix Learning minimal separating DFA for Compositional Verification

slide-31
SLIDE 31

Overview Definitions Algorithm References Candidate Generator Completeness Checking Finding minimal consistent DFA Soundness Checking

Soundness Checking

Candidate Generator Completeness Checking L(C−

i )

⊆ L1 L2 ⊆ L(C+

i )

Ci No CE Finding a minimal consistent DFA Yes Ci Soundness Checking L1 ⊆ L(Ai) L(Ai) ⊆ L2 Ai Yes No CE

Now the DFA Ai is minimal, complete and consistent. The last step is to check for soundness, using containment queries: L1

?

⊆ L(A) L(A)

?

⊆ L2 In case both subset relations are true, we have the minimal separating DFA for L1 and L2. Otherwise there is a CE sent to the Candidate Generator.

Karsten Fix Learning minimal separating DFA for Compositional Verification

slide-32
SLIDE 32

Overview Definitions Algorithm References Candidate Generator Completeness Checking Finding minimal consistent DFA Soundness Checking

Runtime

Candidate Generator Completeness Checking L(C−

i )

⊆ L1 L2 ⊆ L(C+

i )

Ci No CE Finding a minimal consistent DFA Yes Ci Soundness Checking L1 ⊆ L(Ai) L(Ai) ⊆ L2 Ai Yes No CE

Let n be the size of the minimal sound and complete 3DFA. Let m be the size of the longest CE, then at most n − 1 incorrect 3DFAs O(n2 + n · log(m)) queries, for a complete and sound 3DFA

Karsten Fix Learning minimal separating DFA for Compositional Verification

slide-33
SLIDE 33

Overview Definitions Algorithm References

References

This talk is mainly based on Y.-F. Chen, A. Farzan, E. M. Clarke, Y.-K. Tsay, B.-Y. Wang: Learning Minimal Separating DFA for Compositional

  • Verification. S.Kowalewski, A. Phillippou: TACAS 2009,

LNCS 5505, pp. 31-45, 2009. Springer-Verlag Berlin-Heidelberg 2009.

Karsten Fix Learning minimal separating DFA for Compositional Verification

slide-34
SLIDE 34

Overview Definitions Algorithm References

References

and in addtion the following has been studied: Gupta, A., McMillilan, K.L., Fu, Z.: Automated assumption generation for compositional verification. In: Damm, W., Hermanns, H.(eds.) CAV 2007. LNCS, vol 4590, pp. 420-432. Springer, Heidelberg (2007) Angluin, D: Learning regular sets from queries and

  • counterexamples. Information and Computation 75(2), 87-106

(1987) Paull, M.C., Unger, S.H.: Minimizing the number of states in incompletely specified sequential switching functions. IRE Transitions on Electronic Computers EC-8, 356366 (1959)

Karsten Fix Learning minimal separating DFA for Compositional Verification

slide-35
SLIDE 35

Overview Definitions Algorithm References

Thanks...

... for Listening and Attention. Any Questions?

Karsten Fix Learning minimal separating DFA for Compositional Verification