370 likes | 509 Views
Translating from LTL to automata Book: Chapter 6. Why translating?. Want to write the specification in some logic. Want model-checking tools to be able to check the specification automatically. Preprocessing. Convert into normal form, where negation only applies to propositional variables.
E N D
Why translating? • Want to write the specification in some logic. • Want model-checking tools to be able to check the specification automatically.
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 (¬).
¬p ¬p ¬p ¬p p ¬p ¬p ¬p ¬p p q q q q q q q q q Semantics of p R q p R q: Almost like q W p, but not exactly:
1.Convert to Negation Normal Form • Replace ¬T by F, and ¬F by T. • Replace ¬ (Ç) by (¬) Æ (¬) and¬ (Æ) by (¬) Ç (¬)
2. Eliminate !, }, ð • Replace ! by (¬) Ç. • Replace } by (T U). • Replace ð by (F R).
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 ) )
Incoming New Old Next The data structure Incoming = Set of nodes with an edge to this node Name
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.
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.
Incoming New Old Next Incoming Incoming New Old New Old Next Next Splitting Copy incoming edges, update other field.
Incoming New Old Next Incoming New Old Next Evolving Copy incoming edges, update other field.
Possible cases: • U , split: • Add to New, add U to Next. • Add to New. Because U = Ç ( Æ O ( U )). • R , split: • Add to New. • Add to New, R to Next. Because R = Æ ( Ç O ( R )).
More cases: • Ç, split: • Add to New. • Add to New. • Æ, evolve: • Add to New. • O , evolve: • Add to Next.
Example } p T p p Old: {} New: {TU p} Next: {} (TU p) Old: {TU p} New: {T} Next: {TU p} Old:{TU p} New:{} Next:{TU p} Old: {TU p} New: {p} Next: {} Old:{TU p, p} New:{} Next:{} Old:{} New:{} Next:{} Old:{TU p} Next:{TU p} Old:{TU p, p} Next:{} Old:{} Next:{}
How to start? init Incoming New Old aU(bUc) Next
Incoming Incoming a aU(bUc) bUc aU(bUc) aU(bUc) New Old init Incoming Next New Old aU(bUc) Next Keep track of nodes evolving from original formula (init) init init
New Old Incoming Next bUc aU(bUc) init init init Incoming Incoming aU(bUc),bUc aU(bUc), bUc b c (bUc)
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.
New Old init Next Incoming Incoming aU(bUc) a,aU(bUc) Creating a successor node. aU(bUc)
Incoming New Old Next How to obtain the automaton? Node X • There is an edge from node X to Y if X is in the incoming list of Y • Initial node is init. a, b, ¬c Node Y
Old: aU(bUc) New:a Next: aU(bUc) Old: aU(bUc) New:(bUc) Next: Old: aU(bUc),a New: Next: aU(bUc) Old: aU(bUc),(bUc) New:b Next:(bUc) Old: aU(bUc),(bUc) New:c Next: 1 Old: aU(bUc),(bUc),c New: Next: 3 Old: aU(bUc),(bUc),b New: Next:(bUc) 2 Old: New: aU(bUc) Next:
Old: aU(bUc),a New: Next: aU(bUc) Old: aU(bUc),(bUc),b New: Next:(bUc) Old: aU(bUc),(bUc),c New: Next: 3 1 2 Old: New: aU(bUc) Next: Old: New: bUc Next: Old: New: Next: 6 Old: bUc New: b Next: bUc Old: bUc New: c Next: 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: 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. 5 4
The resulting nodes. a, aU(bUc) b, bUc, aU(bUc) c, bUc, aU(bUc) b, bUc c, bUc Initial states: All nodes with incoming edge from “init”.
A S0 S1 B A B 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
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 S0 S1 B A B F1 = {S0} F2 = {S0,S1}
Accepting states • Generalized Büchi automaton • Multiple accepting sets, one for each Untilsub-formula ( U ) such that • The Oldfield contains or • The Oldfield doesn’t contain U
Accepting w.r.t. bUc a, aU(bUc) b, bUc, aU(bUc) c, bUc, aU(bUc) b, bUc c, bUc All nodes with c in their past (Old), or without (commitment for) bUc in their past.
Acceptance w.r.t. aU(bUc) a, aU(bUc) b, bUc, aU(bUc) c, bUc, aU(bUc) b, bUc c, bUc All nodes with bUc in their past, or without aU(bUc) in their past.
Acceptance w.r.t. aU(bUc) a b c b c bUc aU(bUc) Accepting sets:
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 nextcopy • Each cycle must go through every copy • Each cycle must contain accepting states from each accepting set
Example F a F b T a b a b 2 1 T T 1,2 1,2 correspond to F1 and F2, the accepting sets
Example T T a b a b a b T T T T
Example T T a b a b a b T T T T
Example T T a b a b a T T T
Example T a b a T T T
T a b a T T T Example