SLIDE 1 Matthew Hague
with Roland Meyer, Sebastian Muskalla,and Martin Zimmermann
Royal Holloway, University of London
Parity to Safety in Polynomial Time for Pushdown and Collapsible Pushdown Games
SLIDE 2
Abstract
Safety games for pushdown systems: n-EXPTIME-complete Parity games for pushdown systems: n-EXPTIME-complete (for order-n collapsible pushdown)
SLIDE 3
Abstract
Safety games for pushdown systems: n-EXPTIME-complete Parity games for pushdown systems: n-EXPTIME-complete (for order-n collapsible pushdown) We give a "natural" parity->safety reduction
SLIDE 4 Abstract
Safety games for pushdown systems: n-EXPTIME-complete Parity games for pushdown systems: n-EXPTIME-complete (for order-n collapsible pushdown) We give a "natural" parity->safety reduction
(i.e. not parity algorithm -> TM -> safety)
SLIDE 5
Motivation
Safety is easy to reason about (Parity is hard) Parity is more expressive To know the relationship
SLIDE 6
Ideas We Start With
Finite-state parity to safety using counters (Bernet et al, 2002)
SLIDE 7
Ideas We Start With
Finite-state parity to safety using counters (Bernet et al, 2002) Pushdown parity to safety with large counters (Fridman and Zimmermann, 2012)
SLIDE 8
Ideas We Start With
Finite-state parity to safety using counters (Bernet et al, 2002) Pushdown parity to safety with large counters (Fridman and Zimmermann, 2012) Reduction order-n -> order-(n-1) Rank awareness (H, Murawski, Ong, Serre, 2008)
SLIDE 9
Ideas We Start With
Finite-state parity to safety using counters (Bernet et al, 2002) Pushdown parity to safety with large counters (Fridman and Zimmermann, 2012) Reduction order-n -> order-(n-1) Rank awareness (H, Murawski, Ong, Serre, 2008) Encoding large counters in a pushdown stack (Cachat and Walukiewicz, 2007)
SLIDE 10
Contributions
Generalise counter encoding to collapse Direct proof based on commutativity of Counters encoding Stack removal Counters behave like a stack
SLIDE 11
Parity Game
Elvis Anarchist 4 1 2 4
SLIDE 12
Parity Game
Elvis Anarchist 4 1 2 4 Play: 4
SLIDE 13
Parity Game
Elvis Anarchist 4 1 2 4 Play: 4 1
SLIDE 14
Parity Game
Elvis Anarchist 4 1 2 4 Play: 4 1 2
SLIDE 15
Parity Game
Elvis Anarchist 4 1 2 4 Play: 4 1 2 4
SLIDE 16
Parity Game
Elvis Anarchist 4 1 2 4 Play: 4 1 2 4 4
SLIDE 17
Parity Game
Elvis Anarchist 4 1 2 4 Play: 4 1 2 4 4 1 4 4 1 2 4...
SLIDE 18 Parity Game
Elvis Anarchist 4 1 2 4 Play: 4 1 2 4 4 1 4 4 1 2 4...
Winner: Elvis if least infinitely
SLIDE 19
Parity with Counters
4 1 2 4 Count: number of each rank (without seeing anything smaller)
SLIDE 20
Parity with Counters
4 1 2 4 Count: number of each rank (without seeing anything smaller) Counters: 1: 2: 3: 4:
SLIDE 21
Parity with Counters
4 1 2 4 Count: number of each rank (without seeing anything smaller) Counters: 1: 2: 3: 4:
SLIDE 22
Parity with Counters
4 1 2 4 Count: number of each rank (without seeing anything smaller) Counters: 1: 2: 3: 4:
SLIDE 23
Parity with Counters
4 1 2 4 Count: number of each rank (without seeing anything smaller) Counters: 1: 2: 3: 4:
SLIDE 24
Parity with Counters
4 1 2 4 Count: number of each rank (without seeing anything smaller) Counters: 1: 2: 3: 4:
SLIDE 25
Parity with Counters
4 1 2 4 Count: number of each rank (without seeing anything smaller) Counters: 1: 2: 3: 4:
SLIDE 26
Parity with Counters
4 1 2 4 Count: number of each rank (without seeing anything smaller) Counters: 1: 2: 3: 4:
SLIDE 27
Parity with Counters
4 1 2 4 Count: number of each rank (without seeing anything smaller) Counters: 1: 2: 3: 4:
SLIDE 28
Parity with Counters
4 1 2 4 Count: number of each rank (without seeing anything smaller) Counters: 1: 2: 3: 4:
SLIDE 29
Parity with Counters
4 1 2 4 Count: number of each rank (without seeing anything smaller) Counters: 1: 2: 3: 4:
SLIDE 30
Parity with Counters
4 1 2 4 Count: number of each rank (without seeing anything smaller) Counters: 1: 2: 3: 4:
SLIDE 31
Parity with Counters
4 1 2 4 Count: number of each rank (without seeing anything smaller) Counters: 1: 2: 3: 4:
SLIDE 32
Parity with Counters
4 1 2 4 Count: number of each rank (without seeing anything smaller) Counters: 1: 2: 3: 4:
SLIDE 33
Parity with Counters
4 1 2 4 Count: number of each rank (without seeing anything smaller) Counters: 1: 2: 3: 4:
SLIDE 34
Parity with Counters
4 1 2 4 Count: number of each rank (without seeing anything smaller) Counters: 1: 2: 3: 4:
SLIDE 35
Parity with Counters
4 1 2 4 Count: number of each rank (without seeing anything smaller) Counters: 1: 2: 3: 4:
SLIDE 36
Parity with Counters
4 1 2 4 Count: number of each rank (without seeing anything smaller) Counters: 1: 2: 3: 4:
SLIDE 37
Parity with Counters
4 1 2 4 Count: number of each rank (without seeing anything smaller) Counters: 1: 2: 3: 4: There is a loop! (Hit 1 five times over 4 states)
SLIDE 38
Parity with Counters
4 1 2 4 Count: number of each rank (without seeing anything smaller) Counters: 1: 2: 3: 4: There is a loop! (Hit 1 five times over 4 states) The smallest rank is odd: Elvis loses!
SLIDE 39
Parity to Safety
Reduce parity to safety game (Bernet et al): Keep counters in state (n * n^k states) Elvis loses if odd counter is high
SLIDE 40
Parity to Safety
Reduce parity to safety game (Bernet et al): Keep counters in state (n * n^k states) Elvis loses if odd counter is high Exponential blow up!
SLIDE 41
Pushdown Games
a a b b b b b b p1 c p2 c p3 c p4 c Each state has: Control state (from finite set) Stack of characters Model recursive programs
SLIDE 42 Pushdown Parity to Safety
Pushdown Parity Finite-state Parity Finite-State Safety Pushdown Safety
(Walukiewicz 1996)
SLIDE 43 Pushdown Parity to Safety
Pushdown Parity Finite-state Parity Finite-State Safety Pushdown Safety
(Walukiewicz 1996) (Bernet et al 2002)
SLIDE 44 Pushdown Parity to Safety
Pushdown Parity Finite-state Parity Finite-State Safety Pushdown Safety
(Walukiewicz 1996) (Bernet et al 2002) (Fridman and Zimmermann 2012)
SLIDE 45 Pushdown Parity to Safety
Pushdown Parity Finite-state Parity Finite-State Safety Pushdown Safety
(Walukiewicz 1996) (Bernet et al 2002) (Fridman and Zimmermann 2012) Commutes!
SLIDE 46
Pushdown Parity to Safety
a a b b b b b b p1 c p2 c p3 c p4 c (a, c1, c2) (b, c1, c2) (b, c1, c2') p1 (c, c1, c2) p2 (c, c1, c2) From: To:
SLIDE 47
Pushdown Parity to Safety
a a b b b b b b p1 c p2 c p3 c p4 c (a, c1, c2) (b, c1, c2) (b, c1, c2') p1 (c, c1, c2) p2 (c, c1, c2) From: To: Counters
SLIDE 48
Exponential Blow Up?
(a, c1, c2') p (b, c1, c2) Counter values: can be exponential (Pushdown->finite-state has 2^n states) Number of stack characters: (2^n)^k (For k ranks)
SLIDE 49
Exponential Blow Up?
(a, c1, c2') p (b, c1, c2) Counter values: can be exponential (Pushdown->finite-state has 2^n states) Number of stack characters: (2^n)^k (For k ranks)
SLIDE 50
Reducing Size
(a, c1, c2') p (b, c1, c2) a c2' c1 b c2 p c1 From: To:
SLIDE 51
Reducing Size
(a, c1, c2') p (b, c1, c2) a c2' c1 b c2 p c1 From: To: Number of characters: 2^n
SLIDE 52
Updating Counters
a c2' c1 b c2 p c1 Increment c1
SLIDE 53
Updating Counters
a c2' c1 b c2 p c1 Increment c1 ( , a)
SLIDE 54
Updating Counters
a c2' c1 b c2 p c1 Increment c1 ( , a)
SLIDE 55
Updating Counters
a c2' c1 b c2 p c1 Increment c1 ( , a) Lost c2' (It will be reset)
SLIDE 56
Updating Counters
a c2' c1 b c2 p c1 Increment c1 ( , a) Lost c2' (It will be reset)
'
SLIDE 57
Updating Counters
a c2' c1 b c2 p c1 Increment c1 ( , a) Lost c2' (It will be reset)
'
SLIDE 58
Updating Counters
a c2' c1 b c2 p c1 Increment c1 ( , a) Lost c2' (It will be reset)
'
a
SLIDE 59
Polynomial No. of Characters
a c2' c1 b c2 p c1 Counters up to 2^n Alphabet exponential
SLIDE 60
Polynomial No. of Characters
a c2' c1 b c2 p c1 Counters up to 2^n Alphabet exponential
a 1 1 1 . . p .
c2' in binary c1 in binary
SLIDE 61
Polynomial No. of Characters
a c2' c1 b c2 p c1 Counters up to 2^n Alphabet exponential
a 1 1 1 . . p .
c2' in binary c1 in binary Pushdowns handle length-n binary Alphabet polynomial!
SLIDE 62
Pushdown Parity to Safety
Pushdown parity game -> pushdown safety game Naively exponential Use stack discipline of counters Binary counter encoding of pushdowns Polynomial time reduction
SLIDE 63
Collapsible Pushdown Systems
Pushdown Systems = First-Order Recursion Collapsible Pushdown Systems = Higher-Order Recursion
SLIDE 64
Higher-Order Programming: Niche?
Almost all modern languages support it Scala, Go, JavaScript, Python, ... Retro-fitted to C++ and Java Asynchronous programs/callbacks Map/Reduce
SLIDE 65
Collapsible Pushdown Systems
Higher-order program: functions of functions Higher-order pushdown: stack of stacks a b p c
SLIDE 66
Collapsible Pushdown Systems
Higher-order program: functions of functions Higher-order pushdown: stack of stacks a b p c a b c
b c
d a c p
SLIDE 67
Collapsible Pushdown Systems
Higher-order program: functions of functions Higher-order pushdown: stack of stacks a b p c a b c
b c
d a c p a b b a a c c c b a b a a c c p
SLIDE 68
Collapsible Pushdown Systems
Higher-order program: functions of functions Higher-order pushdown: stack of stacks a b p c a b c
b c
d a c p a b b a a c c c b a b a a c c p (+links)
SLIDE 69
Generalising Parity->Safety
Collapsible Pushdown -> Finite-State (n-Exponential blow up) n-Exponential Counters Can encode in binary on order-n stack!
SLIDE 70
Summary
Parity -> Safety Counters look out for loops (Even with infinite states) Reduction to finite-state Counters behave like stacks Counter values match limits of system Polynomial-time encoding
SLIDE 71
Future and Related Work
Can these ideas lead to implementations? Direct implementation Abstraction/refinement of counters Counter size vs. structure of game Backend: HorSat, Preface, &c. Parity->Safety: Berwanger and Doyen, 2008 Sohail and Somenzi, 2009 Biere et al, 2002 Podelski and Rybalchenko, 2011 Konnov et al, 2017