Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Translating from LTL to automata Book: Chapter 6.

Similar presentations


Presentation on theme: "1 Translating from LTL to automata Book: Chapter 6."— Presentation transcript:

1 1 Translating from LTL to automata Book: Chapter 6

2 2 Why translating? Want to write the specification in some logic. Want model-checking tools to be able to check the specification automatically.

3 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 4 Semantics of p R q p qqqqq ¬p¬p ¬p¬p ¬p¬p ¬p¬pp qqqq ¬p¬p ¬p¬p ¬p¬p ¬p¬p Almost like q W p, but not exactly: p R q:

5 5 Replace ¬ T by F, and ¬ F by T. Replace ¬ (  Ç  ) by ( ¬  ) Æ ( ¬  ) and ¬ (  Æ  ) by ( ¬  ) Ç ( ¬  ) 1.Convert to Negation Normal Form

6 6 2. Eliminate !, }, ð Replace  !  by ( ¬  ) Ç . Replace }  by (T U  ). Replace ð  by (F R  ).

7 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 8 The data structure Incoming NewOld Next Name Incoming = Set of nodes with an edge to this node

9 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 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 11 Splitting Incoming New Old Next Incoming New Old Next Incoming New Old Next Copy incoming edges, update other field.

12 12 Evolving Incoming New Old Next Incoming New Old Next Copy incoming edges, update other field.

13 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 14 More cases:  Ç , split: 1. Add  to New. 2. Add  to New.  Æ , evolve: 1. Add  to New. O , evolve: 1. Add  to Next.

15 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:{} Tp p Old:{} New:{} Next:{} Old:{} Next:{}

16 16 How to start? Incoming NewOld Next init aU(bUc)

17 17 Incoming init aU(bUc) Incoming aU(bUc) bUc aU(bUc) a init Old Next New Old Next New Keep track of nodes evolving from original formula (init)

18 18 Incoming aU(bUc)bUc init Incoming aU(bUc), bUc c (bUc) b Old Next New init

19 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 version to the old one. Otherwise, add the node to “Nodes”. Generate a successor with “New” set to “Next” of father.

20 20 a,aU(bUc) aU(bUc) Incoming init Incoming aU(bUc) Creating a successor node. Old Next New

21 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 NewOld Next Node X Node Y a, b, ¬c

22 22 Old: New: aU(bUc) Next: Old: aU(bUc) New:a Next: aU(bUc) Old: aU(bUc),(bUc) New:b Next:(bUc) Old: aU(bUc) New:(bUc) Next: Old: aU(bUc),(bUc) New:c Next: Old: aU(bUc),a New: Next: aU(bUc) 1 Old: aU(bUc),(bUc),b New: Next:(bUc) 2 Old: aU(bUc),(bUc),c New: Next: 3

23 23 Old: New: aU(bUc) Next: Old: aU(bUc),a New: Next: aU(bUc) 1 Old: aU(bUc),(bUc),b New: Next:(bUc) 2 Old: aU(bUc),(bUc),c New: 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: bUc Next: 5 4 Old: bUc New: b Next: bUc Old: bUc New: c Next: Old: bUc,b New: Next: bUc Old: bUc,c New: 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 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, bUcc, bUc

25 25 Reminder: Buchi automata A=  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 B S0 S1

26 26 Generalized Buchi automata A=  Alphabet (finite). S: States (finite).  : S x  x S ) S is the transition relation. I µ S are the Initial states. F µ 2 S 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 B S0 S1 F 1 = {S0} F 2 = {S0,S1}

27 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 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, bUcc, bUc

29 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, bUcc, bUc

30 30 Acceptance w.r.t. aU(bUc) bUc aU(bUc) a bc bc Accepting sets:

31 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 32 Example T ab T ab T 1 1,2 2 F a  F b 1,2 correspond to F 1 and F 2, the accepting sets

33 33 Example T ab T a T T ab T b T

34 34 Example T ab T a T T ab T b T

35 35 Example T ab T a T T ab T

36 36 Example T ab T a T T

37 37 Example T ab T a T T


Download ppt "1 Translating from LTL to automata Book: Chapter 6."

Similar presentations


Ads by Google