churchs problem and a tour through automata theory wolfgang thomas pillars of computer science....

40
Church’s Problem and a Tour through Automata Theory Wolfgang Thomas Pillars of Computer Science. Springer Berlin Heidelberg, 2008

Upload: pauline-wright

Post on 18-Jan-2018

222 views

Category:

Documents


0 download

DESCRIPTION

Mealy automaton (reminder) A tuple M=(S,Σ, Γ, s 0, δ, τ) – S is the finite set of states – s 0 is the initial state – Σ is the finite input alphabet – Γ is the finite output alphabet – δ: S × Σ → S is the transition function – τ : S × Σ → Γ is the output function – f M : Σ ω → Γ ω defined as the transformation computed by M

TRANSCRIPT

Page 1: Churchs Problem and a Tour through Automata Theory Wolfgang Thomas Pillars of Computer Science. Springer Berlin Heidelberg, 2008

Church’s Problem and a Tour throughAutomata Theory

Wolfgang ThomasPillars of Computer Science. Springer

Berlin Heidelberg, 2008

Page 2: Churchs Problem and a Tour through Automata Theory Wolfgang Thomas Pillars of Computer Science. Springer Berlin Heidelberg, 2008

Church’s problem

• Stated by Alonzo Church in 1957:Given a requirement which a circuit is to satisfy, we may suppose the requirement expressed in some suitable logistic system which is an

extension of restricted recursive arithmetic. The synthesis problem is then to find recursion equivalences representing a circuit that satisfies the given

requirement (or alternatively, to determine that there is no such circuit)• The requirement taken as transformation from one infinite bit

string to another– Transforming every α to β such that holds– Transformations expected to be nonaticipatory and

computable with finite memory– Finite state automata replaces logical circuits

Page 3: Churchs Problem and a Tour through Automata Theory Wolfgang Thomas Pillars of Computer Science. Springer Berlin Heidelberg, 2008

Mealy automaton (reminder)

• A tuple M=(S,Σ, Γ , s0 , δ, τ)– S is the finite set of states– s0 is the initial state– Σ is the finite input alphabet– Γ is the finite output alphabet– δ: S × Σ → S is the transition function– τ : S × Σ → Γ is the output function– fM : Σω → Γω defined as the transformation computed

by M

Page 4: Churchs Problem and a Tour through Automata Theory Wolfgang Thomas Pillars of Computer Science. Springer Berlin Heidelberg, 2008

“Some suitable logistic system”

Page 5: Churchs Problem and a Tour through Automata Theory Wolfgang Thomas Pillars of Computer Science. Springer Berlin Heidelberg, 2008

Logistic systems• Propositional First-order Second-order logics• Propositional logic:

– Propositional variables with boolean operators• First-order logic:

– Atomic formulae• Variables + Functions +constants terms• Relations over terms

– Boolean operators– Quantifiers over variables– Models/structures

• Monadic second-order logic: – First-order logic with:

• relations and functions as variables (special case - sets)• Quantification over set variables

Page 6: Churchs Problem and a Tour through Automata Theory Wolfgang Thomas Pillars of Computer Science. Springer Berlin Heidelberg, 2008

S1S logic

• Stands for “second-order theory of one successor”

• Monadic second-order logic over ( ,+1,<,0)ℕ• Includes numbers and sets as variables• Allows for formulae such as:– .– .

Page 7: Churchs Problem and a Tour through Automata Theory Wolfgang Thomas Pillars of Computer Science. Springer Berlin Heidelberg, 2008

Church’s problem in S1S• A bit string α can be represented by the relation X such that α[i]=1

iff X(i)• Consequently, in S1S bit strings can be quantified variables• By extention, tuples of bit strings can be formulated as variables• Church’s problem restated:

• Solved in 1967 by Buchi and Landweber• We’ll follow the proof for m1=m2=1

Page 8: Churchs Problem and a Tour through Automata Theory Wolfgang Thomas Pillars of Computer Science. Springer Berlin Heidelberg, 2008

Church problem - example

Under the hood:

Page 9: Churchs Problem and a Tour through Automata Theory Wolfgang Thomas Pillars of Computer Science. Springer Berlin Heidelberg, 2008

Following the proof

• S1S specification Deterministic Muller• Deterministic Muller Muller game graph • Muller game graph Parity game graph• Parity game graph Winning strategy• Winning strategy Mealy automaton

Page 10: Churchs Problem and a Tour through Automata Theory Wolfgang Thomas Pillars of Computer Science. Springer Berlin Heidelberg, 2008

Deterministic Muller automaton(reminder)

• A tuple M=(S,Σ, s0 , δ, F)– S is the finite set of states– s0 is the initial state– Σ is the finite input alphabet– δ: Q × Σ → Q is the transition function– is the acceptance condition

• A run ρ=(r0,…) on a=(a0,…) is a sequence s.t. r0= s0, ri= δ(ri-1,ai)• The infinite states of a run -• M accepts a iff inf(ρ) is in F

Page 11: Churchs Problem and a Tour through Automata Theory Wolfgang Thomas Pillars of Computer Science. Springer Berlin Heidelberg, 2008

Nondeterministic Muller automaton(reminder)

• A tuple M=(S,Σ, S0 , Δ, F)– S0 is a set of initial states– Δ : Q × Σ → P(Q) is the transition function– A run ρ=(r0,…) on a=(a0,…) is a sequence s.t.

r0= s0, Δ (ri-1,ai) r∈ i

– M accepts a if an accepting run on a exists

Page 12: Churchs Problem and a Tour through Automata Theory Wolfgang Thomas Pillars of Computer Science. Springer Berlin Heidelberg, 2008

From S1S to Muller

• Let ф(X,Y) be a formula in S1S with free variables X,Y representing the strings α,β

• We will construct a deterministic Muller automaton running on the input ((α0,β0), (α1,β1),…)

• First, let’s express the relation ‘>‘ with the other S1S constructs

• a < b equivalent to . Not in

paper

Page 13: Churchs Problem and a Tour through Automata Theory Wolfgang Thomas Pillars of Computer Science. Springer Berlin Heidelberg, 2008

From S1S to Muller

• We can also express free number variables in term of sets:– .– Allows for intentional omitting in the proof

• And define 0• General case - ф(x1,…,xk, Y1,…, Yn)• w.l.o.g., all atomic formulae are of form– Z(Ska), for some k

• The rest, by structural induction, on board

Page 14: Churchs Problem and a Tour through Automata Theory Wolfgang Thomas Pillars of Computer Science. Springer Berlin Heidelberg, 2008

Following the proof (recap)

• S1S specification Deterministic Muller ✓• Deterministic Muller Muller game graph• Muller game graph Parity game graph• Parity game graph Winning strategy• Winning strategy Mealy automaton

Page 15: Churchs Problem and a Tour through Automata Theory Wolfgang Thomas Pillars of Computer Science. Springer Berlin Heidelberg, 2008

From Muller automata to Muller game

• Given a Muller automata expressing ф, with input ((α0,β0), (α1,β1),…), construct an equivalent automata on input (α0,β0, α1,β1,…)

• Admits a partition of S to Sα and Sβ

Page 16: Churchs Problem and a Tour through Automata Theory Wolfgang Thomas Pillars of Computer Science. Springer Berlin Heidelberg, 2008

Example

Page 17: Churchs Problem and a Tour through Automata Theory Wolfgang Thomas Pillars of Computer Science. Springer Berlin Heidelberg, 2008

Example

Page 18: Churchs Problem and a Tour through Automata Theory Wolfgang Thomas Pillars of Computer Science. Springer Berlin Heidelberg, 2008

From Muller automata to Muller game

• The equivalent automata defines a game• The arena is the state graph, denoted G=(Q,QA,E)• Note that each node has nonzero out degree– A subgraph with Q0 is a game iff there’s an edge to Q0 from

every q in Q0

• The winning condition:– Define F by identifying each original node with its QA

equivalent– Player B wins play ρ iff F Inf(∈ ρ)

Page 19: Churchs Problem and a Tour through Automata Theory Wolfgang Thomas Pillars of Computer Science. Springer Berlin Heidelberg, 2008

Following the proof (recap)

• S1S specification Deterministic Muller ✓• Deterministic Muller Muller game graph ✓• Muller game graph Parity game graph• Parity game graph Winning strategy• Winning strategy Mealy automaton

Page 20: Churchs Problem and a Tour through Automata Theory Wolfgang Thomas Pillars of Computer Science. Springer Berlin Heidelberg, 2008

Solving graph games

• A strategy for player B from q is a function f:Q+ → Q s.t. for any prefix q0,…,qk with q0=q and qk in QB ,E ∈f(q0,…,qk)

• A play ρ= q0,… is played according to f iff

• A winning strategy is such that any game played by it results in a win for player B

• WA and WB Are the states from which players A,B have a winning strategy

Page 21: Churchs Problem and a Tour through Automata Theory Wolfgang Thomas Pillars of Computer Science. Springer Berlin Heidelberg, 2008

Solving graph games

• A game is called determined if WA W∪ B=G.• Solving a game involves two tasks:– Deciding, for each state q, if it’s a winning state for

one of the players– If so, constructing a winning strategy from q

• A winning strategy f is finite-state if it can be computed by a mealy automaton

Page 22: Churchs Problem and a Tour through Automata Theory Wolfgang Thomas Pillars of Computer Science. Springer Berlin Heidelberg, 2008

Warming up – Reachability games

• Let’s explorer a simpler type of games before• On a reachability game, player B wins if the

play passes through a state in F• Define F’s ‘attractors’:

Page 23: Churchs Problem and a Tour through Automata Theory Wolfgang Thomas Pillars of Computer Science. Springer Berlin Heidelberg, 2008

Warming up – Reachability games

• Define• It holds that AttrB(F)=WB

• Furthermore, the recursive definition of AttrB admits a memoryless winning strategy from every q in WB

• G W∖ B=WA, and therefore, reachability games are decideable

• And we’ve now shown they’re solvable

Page 24: Churchs Problem and a Tour through Automata Theory Wolfgang Thomas Pillars of Computer Science. Springer Berlin Heidelberg, 2008

Appearance records

• Memoryless strategies are not enough for Muller games

• Consider this example, with F={{1,2,3}}

• Define Occ(ρ) as the set of states that are encountered in ρ

• The weak Muller game requires Occ(ρ) in F• Still not solvable with memoryless strategies

Page 25: Churchs Problem and a Tour through Automata Theory Wolfgang Thomas Pillars of Computer Science. Springer Berlin Heidelberg, 2008

Weak Muller games

• We can solve weak Muller games with a finite state strategy

• Define S with states P(Q), and Q as input alphabet

• The transition function is δ:P(Q) × Q → P(Q) defined by δ(R, p) = R {p}∪

• This memory structure is called appearance record

Page 26: Churchs Problem and a Tour through Automata Theory Wolfgang Thomas Pillars of Computer Science. Springer Berlin Heidelberg, 2008

Strong Muller games

• For strong Muller games a stronger memory structure is required (by McNaughton)

• Recall Latest Appearance Records, or LAR:– A LAR is a pair ((q1,..., qr), h), with qj being distinct

states and 0≥h≥r– The initial state is ((),0)– On input q, supposing q appears in the LAR with

index j, the new LAR will be ((q1,..., qrq,j)

Page 27: Churchs Problem and a Tour through Automata Theory Wolfgang Thomas Pillars of Computer Science. Springer Berlin Heidelberg, 2008

From Muller games to Parity games

• Consider the appearance record (AR) of a weak Muller game

• If R=(R1,…,Rk) is a prefix of T, then AR(R) AR(T)⊇

• For Rn the n’th prefix of a game ρ, Limn->∞AR(Rn) = Occ(ρ)

• AR reaches Occ(ρ) in finite steps, and halts there

Page 28: Churchs Problem and a Tour through Automata Theory Wolfgang Thomas Pillars of Computer Science. Springer Berlin Heidelberg, 2008

From Muller games to Parity games• Accociate a number c(R) with R in P(Q), that reports both

its size, and membership in F

• A play ρ admits the sequence c(AR(pi))• Note that the inclusion relation agrees with the order on

c(R)• Then, Occ(ρ) is in F iff the maximal number in the

sequence is even

Page 29: Churchs Problem and a Tour through Automata Theory Wolfgang Thomas Pillars of Computer Science. Springer Berlin Heidelberg, 2008

From Muller games to Parity games

• A weak parity game is a game with a numbering of Q, with the following winning condition:– Max(c(pi)|pi ⊇ρ) is even

• Now we can transform a weak Muller game to a weak parity game:– .– .– c as defined previously

• This transformation is called “game simulation”, as it transforms winning plays to winning plays

Page 30: Churchs Problem and a Tour through Automata Theory Wolfgang Thomas Pillars of Computer Science. Springer Berlin Heidelberg, 2008

From Muller games to Parity games

• A regular parity game has the following winning condition:– The maximal number c(p) that occurs infinitely often

is even • Now we can transform a Muller game to a parity

game:– Define as the set of ordered subsets of Q– .– .– .

Page 31: Churchs Problem and a Tour through Automata Theory Wolfgang Thomas Pillars of Computer Science. Springer Berlin Heidelberg, 2008

From Muller games to Parity games

• For a LAR ((q1,..., qr), h), denote h the ‘hit’ and {q1,...,qh} as the ‘hit set’

• Denote the maximal hit encountered infinitely often in a run ρ as hρ

• Recall this property of LARs previously proven:– ∃i s.t. hit sets of size hρ for all pj>I are identical

– Hit sets of size hρ occur infinitely often– Thus, the repeating maximal hit set is Inf(ρ)

• Therefore, the transformation is a game simulation

Page 32: Churchs Problem and a Tour through Automata Theory Wolfgang Thomas Pillars of Computer Science. Springer Berlin Heidelberg, 2008

Following the proof (recap)

• S1S specification Deterministic Muller ✓• Deterministic Muller Muller game graph ✓• Muller game graph Parity game graph ✓• Parity game graph Winning strategy• Winning strategy Mealy automaton

Page 33: Churchs Problem and a Tour through Automata Theory Wolfgang Thomas Pillars of Computer Science. Springer Berlin Heidelberg, 2008

Solving weak parity games

• It will be now shown that weak parity games are determined, and solvable with finite memory

• Let G=(Q,QA,E) be a weak parity game with coloring c:Q→ {0, . . . , k} (w.l.o.g k even)

• Define Ci={q Q | c(q) = i}∈• Denote Ak=AttrB(Ck). It holds that Ak W⊇ B

• Argue that Q A∖ k is a game graph (out degree)

Page 34: Churchs Problem and a Tour through Automata Theory Wolfgang Thomas Pillars of Computer Science. Springer Berlin Heidelberg, 2008

Solving weak parity games

• DenoteAs the set of states in the subgraph

From which player B can force the play to

• Continue defining recursively:

Page 35: Churchs Problem and a Tour through Automata Theory Wolfgang Thomas Pillars of Computer Science. Springer Berlin Heidelberg, 2008

Solving weak parity games

• It holds that• For each subgraph Gi, winning strategies for

players A,B are determined by the construction of the attractors

• Together they constitute a global finite memory winning strategy from every winning state

Page 36: Churchs Problem and a Tour through Automata Theory Wolfgang Thomas Pillars of Computer Science. Springer Berlin Heidelberg, 2008

Solving regular parity games

• It is left to show that regular parity games are determined, and admit finite memory winning strategies (proof due to McNaughton)

• Proof by induction on the size of G• For a singleton G, trivial• For the induction step, assume w.l.o.g k is

even (otherwise raise c by one, and switch roles)

Page 37: Churchs Problem and a Tour through Automata Theory Wolfgang Thomas Pillars of Computer Science. Springer Berlin Heidelberg, 2008

Solving regular parity games

• Let q be a highest-number state and define A0=AttrB({q}).

• The remaining graph is again a subgame• From the induction hypothesis, one can partition it to

winning regions UA,UB with finite memory winning strategies

• There are then two possible cases:– From q, player B can ensure to be in UB A∪ 0 in the next step,

– From q, player A can ensure to be in UA in the next step.

Page 38: Churchs Problem and a Tour through Automata Theory Wolfgang Thomas Pillars of Computer Science. Springer Berlin Heidelberg, 2008

Solving regular parity games

• For case 1, we will show WB= UB A∪ 0 ,WA = UA

• A play from UB A∪ 0 either:– remains in Ub from some point onwards, which admits a

finite memory winning strategy to player B by induction hypothesis

– Visits A0 infinitely often, from which player be can ensure infinite visits to q (highest even number)

• Thus, player B has a finite memory winning strategy from all states in UB A∪ 0 , composed of the strategies for UB , A0, and (possibly) the edge from q to A0

Page 39: Churchs Problem and a Tour through Automata Theory Wolfgang Thomas Pillars of Computer Science. Springer Berlin Heidelberg, 2008

Solving regular parity games

• For case 2, note that q Attr∈ A(UA)• Thus, A1 = AttrA(UA) is of cardinality 1≤• We can then use the induction hypothesis on

Q\A1, getting a partitioning to VA ,VB

• By repeating the same arguments, one gets WB = VB ,WA = VA A∪ 1

• Similarly, a memoryless strategy can be constructed for player A

Page 40: Churchs Problem and a Tour through Automata Theory Wolfgang Thomas Pillars of Computer Science. Springer Berlin Heidelberg, 2008

Church’s problem• We have transformed the setting of church’s problem to

first a Muller game, and subsequently an equivalent parity game

• The recursive build of the Attractors provides an algorithm for computing winning regions and finite memory winning strategies

• A mealy automaton playing the simulated game can output the desired bit string – Winning the parity game winning the Muller game– Winning the Muller game Moves of B player constitute a legal

β string