Post on 31-Dec-2015
description
1
Translating from LTL to automataBook: Chapter 6
2
Why translating?
Want to write the specification in some logic.
Want model-checking tools to be able to check the specification automatically.
3
Preprocessing
Convert into normal form, where negation only applies to propositional variables.
¬ becomes }¬. ¬} becomes ¬. What about ¬ ( U )? Define operator R (Release) such that
¬ ( U ) = (¬) R (¬), ¬ ( R ) = (¬) U (¬).
4
Semantics of p R q
p
q q qqq
¬p¬p¬p¬p
p
q qqq
¬p¬p¬p¬p
Almost like q W p, but not exactly:
p R q:
5
Replace ¬T by F, and ¬F by T. Replace ¬ ( Ç ) by (¬) Æ (¬)
and ¬ ( Æ ) by (¬) Ç (¬)
1.Convert to Negation Normal Form
6
2. Eliminate !, },
Replace ! by (¬ ) Ç . Replace } by (T U ). Replace by (F R ).
7
Example
Translate ( } P ) ! ( } Q ) Eliminate implication ¬( } P ) Ç ( } Q ) Eliminate , } :
¬( F R ( T U P ) ) Ç ( F R ( T U Q ) ) Push negation inwards:
(T U (F R ¬ P ) ) Ç ( F R ( T U Q ) )
8
The data structure
Incoming
New Old
NextName
Incoming = Set of nodes with an edge to this node
9
The main idea
U = Ç ( Æ O ( U ) ) R = Æ ( Ç O ( R ) ) This separates the formulas to two
parts: One holds in the current state, and The other in the next state.
10
How to translate?
Take one formula from “New” and add it to “Old”.
According to the formula, either Split the current node into two, or Evolve the node into a new version.
11
Splitting
Incoming
New Old
Next
Incoming
New Old
Next
Incoming
New Old
Next
Copy incoming edges, update other field.
12
Evolving
Incoming
New Old
Next
Incoming
New Old
Next
Copy incoming edges, update other field.
13
Possible cases:
U , split: 1. Add to New, add U to Next.2. Add to New.Because U = Ç ( Æ O ( U )).
R , split:1. Add to New.2. Add to New, R to Next.Because R = Æ ( Ç O ( R )).
14
More cases:
Ç , split:1. Add to New.2. Add to New.
Æ , evolve:1. Add to New.
O , evolve:1. Add to Next.
15
Example} p
(T U p)Old: {}New: {T U p}Next: {}
Old: {T U p}New: {T}Next: {T U p}
Old: {T U p}New: {p}Next: {}
Old:{T U p}New:{}Next:{T U p}
Old:{T U p}Next:{T U p}
Old:{T U p, p}New:{}Next:{}
Old:{T U p, p}Next:{}
T pp
Old:{}New:{}Next:{}
Old:{}Next:{}
16
How to start?
Incoming
New Old
Next
init
aU(bUc)
17
Incoming
init
aU(bUc)
Incoming Incoming
aU(bUc)aU(bUc) bUc
aU(bUc)
a
init init
Old
Next
New
Old
Next
New
Keep track of nodes evolving from original formula (init)
18
Incoming
aU(bUc)bUc
init initIncoming Incoming
aU(bUc), bUc
aU(bUc),bUc
c
(bUc)
b
Old
Next
Newinit
19
When to stop splitting?
When “New” is empty. Then compare against a list of existing
nodes “Nodes”: If a node with the same “Old”, “Next” exists,
just add the incoming edges of the new versionto the old one.
Otherwise, add the node to “Nodes”. Generate a successor with “New” set to “Next” of father.
20
a,aU(bUc)
aU(bUc)
Incoming
init
Incoming
aU(bUc)
Creating a successor node.
Old
Next
New
21
How to obtain the automaton?
There is an edge from node X to Y if X is in the incoming list of Y
Initial node is init.
Incoming
New Old
Next
Node X
Node Y
a, b, ¬c
22
Old:New: aU(bUc)Next:
Old: aU(bUc)New:aNext: aU(bUc)
Old: aU(bUc),(bUc)New:bNext:(bUc)
Old: aU(bUc)New:(bUc)Next:
Old: aU(bUc),(bUc)New:cNext:
Old: aU(bUc),aNew:Next: aU(bUc)1
Old: aU(bUc),(bUc),bNew:Next:(bUc)2
Old: aU(bUc),(bUc),cNew:Next:3
23
Old:New: aU(bUc)Next:
Old: aU(bUc),aNew:Next: aU(bUc)1
Old: aU(bUc),(bUc),bNew:Next:(bUc)2
Old: aU(bUc),(bUc),cNew:Next:3
If we continue here, we re-create nodes 1,2,3. So ‘1’ will be added to the ‘incoming’ list of 1,2,3.
Old:New: bUcNext:
54
Old: bUcNew: bNext: bUc
Old: bUcNew: cNext:
Old: bUc,bNew: Next: bUc
Old: bUc,cNew: Next:If we continue here,
we re-create nodes 4,5. So ‘4’ will be added to the ‘incoming’ list of 4,5.
6
Old: New:Next:
24
The resulting nodes.
Initial states: All nodes with incoming edge from “init”.
a, aU(bUc) b, bUc, aU(bUc) c, bUc, aU(bUc)
b, bUc c, bUc
25
Reminder: Buchi automata
A=<, S, , I, F> Alphabet (finite). S: States (finite). : S x x S ) S is the transition relation. I µ S are the Initial states. F µ S is a set of accepting states.
An infinite word is accepted in A if it passes an infinite no. of times in at least one of the F states
A
A
B BS0 S1
26
Generalized Buchi automata
A=<, S, , I, F> Alphabet (finite). S: States (finite). : S x x S ) S is the transition relation. I µ S are the Initial states. F µ 2S is a set of sets of accepting states.
An infinite word is accepted in A if it passes an infinite no. of times in at least one state in element of F
A
A
B BS0 S1
F1 = {S0}F2 = {S0,S1}
27
Generalized Büchi automaton Multiple accepting sets, one for each
Until sub-formula ( U ) such that The Old field contains
or The Old field doesn’t contain U
Accepting states
28
Accepting w.r.t. bUc
All nodes with c in their past (Old), or without (commitment for) bUc in their past.
a, aU(bUc) b, bUc, aU(bUc) c, bUc, aU(bUc)
b, bUc c, bUc
29
Acceptance w.r.t. aU(bUc)
All nodes with bUc in their past, or without aU(bUc) in their past.
a, aU(bUc) b, bUc, aU(bUc) c, bUc, aU(bUc)
b, bUc c, bUc
30
Acceptance w.r.t. aU(bUc)
bUcaU(bUc)
a b c
b c
Accepting sets:
31
De-generalization of GBA
Turn a generalized Büchi automaton into a Büchi automaton
Consider as many copies of the automaton as the number of accepting sets
Replace incoming edges from accepting states with edges to the next copy
Each cycle must go through every copy Each cycle must contain accepting states
from each accepting set
32
Example
T
a b
T
a b
T
1
1,2
2
F a F b
1,2 correspond to F1 and F2, the accepting sets
33
Example
T
a b
T
a
T
T
a b
T
b
T
34
Example
T
a b
T
a
T
T
a b
T
b
T
35
Example
T
a b
T
a
T
T
a b
T
36
Example
T
a b
T
a
T T
37
Example
T
a b
T
a
TT