Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Downward Closed Language Generators Parosh Aziz Abdulla Pritha Mahata Aletta Nylén Uppsala University Outline Reachability Approaches Downward-closed languages Recognizability of Reachable sets Simple Regular Expressions Downward closed language generators Hierarchical dlgs Timed Petri Net Ongoing Work Systems and properties Transition Systems (Set of states, set of initial states, alphabet, transition rules) Safety Properties ( Nothing bad will ever happen) Verification of Safety property Reachability of a bad state in the system Reachability Approaches Forward Reachability Reachability Analysis Backward Reachability Forward Reachability Backward Reachability Initial state Post* Initial states Bad states Pre* Bad state Reachability Approaches(contd.) - Forward Reachability set is usually not computable , e.g LCS[CFI96]. - Backward reachability set is sometimes computable, e.g LCS[AJ96b]. Still, Forward Reachability is an appealing approach. Why ? Forward Reachability Set of reachable states of a system – R Computability of R V = partitions of R wrt some criterion • (finite state) abstraction • Symbolic graph G (V, E) E : v1 l v2 iff (e.g control states) l v1 v2 Forward Reachability Set of reachable states of a system – R Computability of R V = partitions of R wrt some criterion • (finite state) abstraction • Symbolic graph G (V, E) E : v1 l v2 iff (e.g control states) f v1 l h v2 Forward Reachability (contd.) G simulates the transition system. If G satisfies a safetyproperty Same result holds for the concrete system. Verification is easier in G. Problem : R is often not computable. But, is R recognizable ! Yes, if R is downward-closed [ABJ98] !! Downward Closed Languages L - finite alphabet substring relation on * a language over * If x L and y x => y L, then L is downward closed. y • x • L x - downward closed set x - upward closed set Why downward closed languages ? LCS – Channel Language is downward closed. A channel can always lose messages and become empty. Reachability set is downward-closed for LCS . TPN - TPN has monotonicity wrt a preorder M1 M3 M2 M4 and M1 M2 on markings. M3 M4 Why downward closed languages ? Timed Petri Net, N Lossy TPN, N’ Set of Bad States, Bad (upward closed) Initial states, I Initial states, I loss M Bad M B’ Ml B Bad Ml Note : Considering safety properties only, markings can be made downward-closed in TPN. and Ml M B B M B’ B’ Is R recognizable ? for each a1,a2,…. A, there is i,j such that (A, ) is wqo if i < j and ai If (A, ) is wqo, (A*, aj *) is a wqo. (Higman) If a language R A* is downward closed, then R is upward closed. R is characterized by finite set of minimal elements {w1,….,wm}. [Higman] R = w1 U …. U wm …. U U R = w1 wm Question : Can we find some generator such that R = L() ? Is R recognizable ? (contd.) Answer : We can find some generator such that R = L() if for a word w in A*, w = L() and generators are closed under intersection. Let A = {a,b,c} and w1 = ab, w2 = bc, then w1 w1 = A* a A* b A* , w2 = A* b A* c A* and = (A\a)*(a+)(A\b)* w2 = (A\b)*(b+)(A\c)* = 2. e = w1 (b+c)*(a+)(c+a)* U 1. w2 = (c+a)*(b+)(a+b)* = c* a* + c* (b + ) b* (a + ) a* + c* (a + ) (a + c)* a* Question : Can we find s such that w1 , w2 , e are expressed by s ? Simple Regular Expressions Generators – simple regular expressions. M - a finite alphabet. Atomic expression e over M - a regular expression of the form (a + ) where a M (a1 + a2 + …. +am )*, where a1,a2,….,am M A product p over M - a concatenation (possibly empty) (e1 • e2 ••••• en ), where e1,e2,….,en are atomic expressions over M. Simple regular expression over M - has the form p1 + p2 + …. + pn , where p1,p2,….,pn are products over M. R is recognizable ! w1 = (b+c)*(a+)(c+a)* atomic expressions w2 = (c+a)*(b+)(a+b)* e = c* a* + c* (b + ) b* (a + ) a* + c* (a + ) (a + c)* a* Products of atomic expressions e = sum of products – an SRE Lossy Channel System c?m Control ( LTS) c!n Channel M – Finite alphabet of messages State – (s, w) s - control state, w M* - channel content Set of reachable states of LCS is downward closed and can be expressed by SREs. Well Quasi Ordering Natural numbers is wqo x1,x2……natural numbers, there is i,j such that (N , ) i < j and xi xj Finite sets (A , = ) is wqo, if A is finite, a1,a2, a3,a4,b, a5,a6, a7,a8,b, a9…. Strings w1 = * w2 = 1. 2 . 3 . 4 w1 * w2 (N*, *) is wqo 3 . 2. 5 . 3. 7 . 1. 1 SRE (M, =) , Downward Closed Language Generators M : finite alphabet A wqo (A , ) (M*, =*) , =* : substring (A*, Atomic expressions : Let B A. (a + ) s.t a M *) is wqo ~B : L(~B) = {a | a A and a is not larger or equal to any element of B} e.g Let A = N, B = {3} and L(~B) = {0,1,2} U {} (a1 + a2 + …. +am )* s.t a1,a2,….,am M *~B e.g Let A = N, B = {3} and * = {0,1,2}* = (L(~B))* L(~B) Downward Closed Language Generators Assume a wqo (A, ) Let B A Atomic expressions are of the form ~ B or ~ B • L(~ B) = Set of elements in A which are not larger or equal to any element in B. • L( ~ B) = (L(~ B) )* • A product p over A L(e1 ••••• en ) = {w1 ….. wn | w1 L (e1), ….. , wn L (en)} where e1,e2,….,en are atomic expressions over A. • DLG over A – L(p1 + p2 + …. + pn) = L(p1) U ….. U L(pn) , where p1,p2,….,pn are products over A. DLG Answer : For a downward closed language R, we can find some generator such that R = L() if = L() and 1. for a word w in A*, w 2. dlgs are closed under intersection. 1. Let (N, ) be the wqo. and w1 = 2 • 3, w2 = 1 • 2, then w1 = N* 2 N* 3 N* w1 and = {0,1}*(N U {}){0,1,2}* = L( ~ 2) L(~ ø) L(~ 3) = L( ~ 2 • ~3) 1 w2 = N* 1 N* 2 N* w2 = 0*(N U {}){0,1}* = = L( ~ 1) L(~ ø) L( ~2) L( ~ 1 • ~ 2) 2 DLG (contd.) R = w1 2. w2 = {0}* (N U {}) {0,1}* + {0}* {0,1, } {0,1}* {0,1, } {0,1}* + {0}* {0, } {0}* {0,1,2, } {0,1}* = L(~{1}) L(~ ø) L(~{2}) + ……………… + ……………… = L( ~ {1} • ( ~{2}) ) + L(………………) + L(……………..) = L( ~ {1} • ( ~{2}) + ……………… + ……………..) Bags (A, ) is wqo and is equality. B1, B2 : N B1 B2 B1 B B2 (AB, B) is wqo Application : Markings of a Petri Net are represented by bags. N Dlg for bags DLGs for bags DLGs for words with operator • both associative and commutative. A bag dlg, - ~{3} ~* {1} = {0,1,2} 0* 0 0 02 L() 1 0 0 L() L() 0 0 3 String of Bags S1 S2 S1 * S2 ((AB)*, *) is wqo Dlg for String of Bags A dlg for string of bags, s = = ~ ~ + ~* 6 + ~* {bag} ~{bag} =~ 32 ~4 ~7 ~* 6 ~4 + * ~3 2 ~4 3 Bag dlg * ~6 * ~ e.g 3 3 ~4 * ~2 + 0 125 5 8 5 3 2 1 + ~* 3 21 Bag dlg* 9 3 16 210 are in language of s. 2 1 0 Dlg for String of Bags(contd.) A = {a,b,c} : a finite alphabet A dlg for string of bags, s = = e.g ~ ~ {a,b} + *~ ~ + a2 b ~{b,c} ~{b,c} *~b + ccccc ~{b,c} ~{a,c} *~a Bag dlg ab aacc bb cc cc aa a b are in language of s. ac Hierarchical DLGs (A, ) is wqo implies If L A* is downward closed, then L is recognizable by some dlg . We can hierarchically define dlgs over A. (A*, *) is a wqo ( Higman’s Theorem). Example : A wqo (A, ) Bags(A) (AB, B) Ldc AB is recognizable by a dlg. ((AB)*, *) Atomic expressions are dlgs for bag. Strings of Bags(A) L’dc (AB)* is recognizable by a dlg. Timed Petri Net P P 1 2 2.0 [1:3] [2:4] 3. 0 [0:1] [2:5] [4:5] [4:5] [4:5] [1:6] 4. 0 0. 0 P3 P Tokens have “ages” : Real numbers. Conditions on “ages” : Intervals. 4 Extended bags of Real Numbers : Mapping from real numbers to natural numbers N U {ω}. B = {4.0, 4.0, 2.0} B(4.0) = 2 Marking M : A Ebag over (Places x Reals). M(P3,4.0) = 2, M(P1, 2.0) = 1 Timed Transitions P 1 2. 0 P P P 2 1 3. 24. 3.0 [1:3] [2:4] [0:1] [2:5] t [4:5] P3 [0:0] [0:0] [4:5] P 4 0 [0:1] Increase of time by 1.0 [4:5] P3 [1:3] [2:4] 0 [2:5] t [0:0] [0:0] [4:5] P 4 T Discrete Transitions P 1 2. 0 P P P 2 1 2 3.0 [1:3] [2:4] [0:1] [1:3] [4:5] Firing t [0:1] [4:5] t [2:5] P3 [0:0] [0:0] [2:4] t [4:5] P 4 [2:5] 0. 0 P3 [0:0] [0:0] [4:5] 0. 0 P 4 D Transitions = M1 T M2 U If M1 or M1 D M2 T D M2 Additionally, there are some lossy transitions in lossy TPN. Remark : A TPN can have unbounded number of tokens !! Ordering on Marking P 1 2. 0 P P P 2 1 2.2 23. 3.7 [1:3] 2.0 [1:3] [2:4] [0:1] [4:5] [2:4] [0:1] [4:5] t [2:5] [0:0] [0:0] P3 t [4:5] P M1 5 [2:5] 4. 0 [0:0] [0:0] 6.2 P3 P 4 M2 P2,3. 7 M1 P1,2. 0 M2 P2,3. P1,2. P1,2.2 5 0 frac = 0 Increasing fractional parts [4:5] P4,max age >= 5 4 Regions • Finite no. of clocks (e.g Timed Automata) y 3 Two clocks x,y and cmax = 3 2 1 00 1 2 3 x Clock values are equivalent in timed automata if they have same integral parts same ordering of fractional parts clock values beyond cmax are equivalent Regions(Example) • Region R : y V(x) = 0.6, V(y) = 0.5 1 0 0 V€R 1 x Not Powerful for Timed Petri Nets…… Dlgs for LTPN P P 1 2 [1:3] [2:4] [0:1] [2:5] [4:5] [4:5] [4:5] [1:5] P3 Unboundedness in two directions : • number of tokens • age of tokens P cmax = 5 4 Abstraction of ages to express sets of markings : Tokens with same fractional parts are in the same ebag. Ordering of ebags is according to the ordering of fractional parts of ages. Ages of tokens beyond cmax are equivalent. Dlgs for LTPN Constraints = strings of bags over a finite alphabet of (Places x {0,..max}) Sets of markings and Markings are downward closed for LTPN Constraints are dlgs for strings of bags over a finite set !!! Universal Regions ! P P 1 2 2.0 3.5 3.75 [1:3] [2:4] [0:1] Note : M can have at most same number of tokens as R. [2:5] [4:5] [4:5] [1:5] [4:5] 4. 2 P3 P 4 frac = 0 R = M= 2 Increasing frac 4* 5 0 2.0 3.5 3.75 P P P age >= 5 3 * If M’ < M, then M’ R 4.2 4.2 P P Universal Regions (contd.) Let Universal Region R = 3 2 Zero bag cmax = 5 dlg 2 P P 1 2 [1:3) T Max bag 3 4 2 3 4 + + 4 2 + 3 4 + [2:4) [0:1) [2:5) + 3 max + t [4:5) [0:5) P3 [1:3) [4:5) 4 max P 4 Generates O((max-1)*2 + sizeof(product) + 1) new regions by timed transition. + 4 max max max + Universal Regions (contd.) 3 2 t followed by T x4 5 At most one token in P3 and one token in P4 with ages as follows : 4 3 2 1 00 1 2 3 4 5 x3 Lot of universal regions !!! Solution : Universal Zones !! Acceleration Compute Post* Acceleration - a sequence of transitions at each step Lossy Channel system - accelerate by arbitrary iteration of control loops Lossy TPN - accelerate by arbitrary firing of enabled transitions followed by timed transitions and combine atomic expressions of the universal regions Comparison with earlier TPN work Forward Reachability Compute Post* Compute Pre* Markings are downward closed(lossy TPN). Markings are upward closed. Universal region. Existential region. Maximal number of tokens in a universal region. Minimal number of tokens in an existential region. Backward Reachability Ongoing Work • Compute Post*(R,t) for all transitions t. • Define universal zones. • Apply forward reachability algorithm.