Downward Closed Language Generators Parosh Aziz Abdulla Pritha
Downward Closed Language Generators Parosh Aziz Abdulla Pritha Mahata Aletta Nylén Uppsala University 21/01/2022 1
Outline v v v v 21/01/2022 Reachability Approaches Downward-closed languages Recognizability of Reachable sets Simple Regular Expressions Downward closed language generators Hierarchical dlgs Timed Petri Net Ongoing Work 2
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 21/01/2022 Reachability of a bad state in the system 3
Reachability Approaches Forward Reachability Analysis Backward Reachability Forward Reachability Backward Reachability 21/01/2022 Initial state Post* Initial states Bad states Pre* Bad state 4
Reachability Approaches(contd. ) - Forward Reachability set is usually not computable , e. g LCS[CFI 96]. - Backward reachability set is sometimes computable, e. g LCS[AJ 96 b]. Still, Forward Reachability is an appealing approach. Why ? 21/01/2022 5
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 : v 1 l v 2 iff (e. g control states) l v 1 21/01/2022 v 2 6
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 : v 1 l v 2 iff (e. g control states) f v 1 21/01/2022 l h v 2 7
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 [ABJ 98] !! 21/01/2022 8
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 • x - downward closed set x - upward closed set L 21/01/2022 9
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 M 1 M 3 21/01/2022 M 4 and M 1 M 2 on markings. M 3 M 4 10
Why downward closed languages ? Timed Petri Net, N Lossy TPN, N’ Set of Bad States, Bad (upward closed) Initial states, I loss M Ml 21/01/2022 M B’ Ml Bad Note : Considering safety properties only, markings can be made downward-closed in TPN. Bad and Ml B M B’ B’ 11
Is R recognizable ? for each a 1, a 2, …. 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 {w 1, …. , wm}. [Higman] R = w 1 U …. U wm …. U U R = w 1 wm Question : Can we find some generator such that R = L( ) ? 21/01/2022 12
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 w 1 = ab, w 2 = bc, then w 1 = A* a A* b A* , w 2 = A* b A* c A* and = (Aa)*(a+ )(Ab)* w 2 = (Ab)*(b+ )(Ac)* = 2. e = w 1 (b+c)*(a+ )(c+a)* U 1. w 2 = (c+a)*(b+ )(a+b)* = c* a* + c* (b + ) b* (a + ) a* + c* (a + ) (a + c)* a* Question : Can we find s such that w 1 , w 2 , e are expressed by s ? 21/01/2022 13
Simple Regular Expressions Generators – simple regular expressions. M - a finite alphabet. Atomic expression e over M - a regular expression of the form v (a + ) where a M v (a 1 + a 2 + …. +am )*, where a 1, a 2, …. , am M A product p over M - a concatenation (possibly empty) v (e 1 • e 2 • • • en ), where e 1, e 2, …. , en are atomic expressions over M. Simple regular expression over M - has the form v p 1 + p 2 + …. + pn , where p 1, p 2, …. , pn are products over M. 21/01/2022 14
R is recognizable ! w 1 = (b+c)*(a+ )(c+a)* atomic expressions w 2 = e (c+a)*(b+ )(a+b)* = c* a* + c* (b + ) b* (a + ) a* + c* (a + ) (a + c)* a* Products of atomic expressions e = sum of products – an SRE 21/01/2022 15
Lossy Channel System c? m Control ( LTS) c!n Channel v M – Finite alphabet of messages v State – (s, w) s - control state, w M* - channel content v Set of reachable states of LCS is downward closed and can be expressed by SREs. 21/01/2022 16
Well Quasi Ordering Natural numbers (N , ) is wqo x 1, x 2……natural numbers, there is i, j such that i < j and xi xj Finite sets (A , = ) is wqo, if A is finite, a 1, a 2, a 3, a 4, b, a 5, a 6, a 7, a 8, b, a 9…. Strings w 1 = * w 2 21/01/2022 = 1. 2. 3. 4 w 1 * w 2 (N*, *) is wqo 3. 2. 5. 3. 7. 1. 1 17
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 { } (a 1 + a 2 + …. +am )* s. t a 1, a 2, …. , am M 21/01/2022 *~B e. g Let A = N, B = {3} and * = {0, 1, 2}* = (L(~B))* L(~B) 18
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(e 1 • • • en ) = {w 1 …. . wn | w 1 L (e 1), …. . , wn L (en)} where e 1, e 2, …. , en are atomic expressions over A. • DLG over A – L(p 1 + p 2 + …. + pn) = L(p 1) U …. . U L(pn) , where p 1, p 2, …. , pn are products over A. 21/01/2022 19
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 w 1 = 2 • 3, w 2 = 1 • 2, then w 1 = N* 2 N* 3 N* w 1 = {0, 1}*(N U { }){0, 1, 2}* = L( ~ 2) L(~ ø) L( ~ 3) = 3) L( ~ 2 • ~ 1 21/01/2022 and w 2 = N* 1 N* 2 N* w 2 = 0*(N U { }){0, 1}* = = L( ~ 1) L(~ ø) L( ~2) L( ~ 1 • ~ 2) 2 20
Bags (A, ) is wqo and is equality. B 1 , B 2 : N B 1 N B 2 B 1 B B 2 (AB, B) is wqo Ø Application : Markings of a Petri Net are represented by bags. 21/01/2022 22
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 02 L( ) 1 0 0 L( ) 0 0 3 21/01/2022 0* 23
String of Bags S 1 S 2 S 1 * S 2 ((AB)*, *) is wqo 21/01/2022 24
Dlg for String of Bags A dlg for string of bags, s = = ~ ~ * + ~ 6 + * ~{bag} =~ 32 ~4 ~7 * ~ {bag} * 6 ~4 + ~3 2 ~ * ~6 ~4 3 Bag dlg * ~ 5 3 2 1 21/01/2022 3 3 ~4 ~2 + 0 125 5 8 e. g * + ~ 3 21 Bag dlg* * 9 3 2 1 0 16 210 are in language of s. 25
Dlg for String of Bags(contd. ) A = {a, b, c} : a finite alphabet A dlg for string of bags, s = = ~ ~ {a, b} * + ~ ~ + a 2 b ~{b, c} * ~b + ccccc e. g ~{b, c} ~{a, c} * ~a Bag dlg ab aacc bb cc cc 21/01/2022 aa ac a b are in language of s. 26
Hierarchical DLGs Ø (A, ) is wqo implies Ø If L A* is downward closed, then L is recognizable by some dlg . Ø We can hierarchically define dlgs (A*, *) is a wqo ( Higman’s Theorem). over A. 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. 21/01/2022 27
Timed Petri Net P 1 P 2 2. 0 [1: 3] [2: 4] 3. 0 [0: 1] [2: 5] [4: 5] 4. 0 [4: 5] [1: 6] P 3 Tokens have “ages” : Real numbers. Conditions on “ages” : Intervals. 0. 0 P 4 Extended bags of Real Numbers : Mapping from real numbers to natural numbers N U {ω}. B = {4. 0, 2. 0} B(4. 0) = 2 Marking M : A Ebag over (Places x Reals). M(P 3, 4. 0) = 2, M(P 1, 2. 0) = 1 21/01/2022 28
Timed Transitions P 1 P 2 P 1 2. 0 3. 0 [1: 3] [0: 1] [4: 5] P 3 21/01/2022 [2: 4] [2: 5] t [0: 0] [4: 5] P 4 [0: 1] Increase of time by 1. 0 [4: 5] P 3 T P 2 [1: 3] [2: 4] 4. 0 [2: 5] t [0: 0] [4: 5] P 4 29
Discrete Transitions P 1 P 2 2. 0 3. 0 [1: 3] [0: 1] [2: 5] P 3 21/01/2022 [2: 4] t [0: 0] [4: 5] P 1 Firing t D P 2 [1: 3] [2: 4] [0: 1] [4: 5] t [4: 5] P 4 [2: 5] 0. 0 P 3 [0: 0] [4: 5] 0. 0 P 4 30
Transitions = M 1 T M 2 U If M 1 or M 1 D M 2 T D M 2 Additionally, there are some lossy transitions in lossy TPN. Remark : A TPN can have unbounded number of tokens !! 21/01/2022 31
Ordering on Marking P 1 P 2 2. 0 3. 7 [1: 3] t [0: 0] P 3 P 2 2. 0 [1: 3] [2: 4] [0: 1] [2: 5] P 1 [4: 5] [2: 4] [0: 1] [4: 5] t [4: 5] P 4 [2: 5] 4. 0 [0: 0] [4: 5] 6. 2 P 3 P 4 M 1 M 2 P 2, 3. 7 M 1 P 1, 2. 0 M 2 P 2, 3. P 1, 2. 2 5 0 frac = 0 Increasing fractional parts 21/01/2022 3. 5 P 4, max age >= 5 32
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 21/01/2022 33
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…… 21/01/2022 34
Dlgs for LTPN P 1 P 2 [1: 3] [2: 4] [0: 1] [2: 5] [4: 5] [1: 5] P 3 Unboundedness in two directions : • number of tokens • age of tokens P 4 cmax = 5 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. 21/01/2022 35
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 !!! 21/01/2022 36
Universal Regions ! P 1 P 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. 2 [1: 5] P 3 [4: 5] P 4 frac = 0 R = Increasing frac 4* 5 2 0 age >= 5 3 * If M’ < M, then M’ R M= 21/01/2022 2. 0 3. 5 3. 75 P 1 P 2 4. 2 P 3 P 4 37
Universal Regions (contd. ) Let Universal Region R = Zero bag cmax = 5 P 1 3 2 dlg 2 P 2 [1: 3) [2: 5) t [0: 5) Max bag 3 4 2 3 4 [2: 4) [0: 1) [4: 5) T [1: 3) P 3 [4: 5) 4 max P 4 + + + 4 2 + 3 4 + 3 + 4 max + + max Generates O((max-1)*2 + sizeof(product) + 1) new regions by timed transition. 21/01/2022 38
Universal Regions (contd. ) 3 2 t followed by T x 4 5 At most one token in P 3 and one token in P 4 with ages as follows : 4 3 2 1 00 1 2 3 4 5 x 3 Lot of universal regions !!! Solution : Universal Zones !! 21/01/2022 39
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 21/01/2022 40
Comparison with earlier TPN work v Forward Reachability v Compute Post* v Markings are downward closed(lossy TPN). Markings are upward closed. v Universal region. Existential region. v Maximal number of tokens in a universal region. Minimal number of tokens in an existential region. 21/01/2022 Backward Reachability Compute Pre* 41
Ongoing Work • Compute Post*(R, t) for all transitions t. • Define universal zones. • Apply forward reachability algorithm. 21/01/2022 42
- Slides: 42