Prefix Rewriting and the Pushdown Hierarchy Wolfgang Thomas - - PowerPoint PPT Presentation

prefix rewriting and the pushdown hierarchy
SMART_READER_LITE
LIVE PREVIEW

Prefix Rewriting and the Pushdown Hierarchy Wolfgang Thomas - - PowerPoint PPT Presentation

Prefix Rewriting and the Pushdown Hierarchy Wolfgang Thomas Francqui Lecture, Mons, April 2013 Reachability Problem Wolfgang Thomas Overview 1. Prefix Rewriting and the reachability problem 2. Interpretations 3. Unfoldings and Muchniks


slide-1
SLIDE 1

Prefix Rewriting and the Pushdown Hierarchy

Wolfgang Thomas Francqui Lecture, Mons, April 2013

slide-2
SLIDE 2

Reachability Problem

Wolfgang Thomas

slide-3
SLIDE 3

Overview

  • 1. Prefix Rewriting and the reachability problem
  • 2. Interpretations
  • 3. Unfoldings and Muchnik’s Theorem
  • 4. The pushdown hierarchy

Wolfgang Thomas

slide-4
SLIDE 4

Prefix Rewriting and the Reachability Problem

Wolfgang Thomas

slide-5
SLIDE 5

Rewriting Over Words

Rewriting system: Finite set S of rules u → v Different uses of a rule u → v for the rewrite relation ⊢ Infix rewriting: xuy ⊢ xvy Post’s canonical systems: ux ⊢ xv Prefix rewriting (B¨ uchi’s regular canonical systems):

ux ⊢ vx

Fundamental results: Infix rewriting systems and Post’s canonical systems allow to simulate Turing machines. B¨ uchi 1965: Prefix rewriting systems generate regular sets from regular sets of “axioms”, and the derivability relation is decidable.

Wolfgang Thomas

slide-6
SLIDE 6

The Setting of Pushdown Automata

A pushdown automaton has the form P = (P, Σ, Γ, p0, Z0, ∆) Configurations are words from PΓ∗ A transition induces a move from pγw to quw Write pγw ⊢ quw So pushdown automata are a special from of prefix rewriting systems. Consequence of B¨ uchi’s Theorem: The reachable configurations of a pushdown automaton form a regular set.

Wolfgang Thomas

slide-7
SLIDE 7

The Reachability Sets

Given a pushdown automaton P = (P, Σ, Γ, p0, Z0, ∆) and

T ⊆ PΓ∗ pre∗(T) := {pv ∈ PΓ∗ | ∃qw ∈ T : pv ⊢∗ qw}

Analogously post∗(T). We may suppress Σ and q0, Z0 and obtain a “pusdown system

P = (Q, Γ, ∆) with transitions of the form (p, γ, v, q).

Given a pushdown system P = (P, Γ, ∆) and a finite automaton recognizing a set T ⊆ PΓ∗, one can compute a finite automaton recognizing pre∗(T), similarly for post∗(T). Deciding p1w1 ⊢∗ p2w2: Set T = {p2w2} and check whether the automaton recognizing pre∗(T) accepts p1w1.

Wolfgang Thomas

slide-8
SLIDE 8

Example

P = (P, Γ, ∆) with P = {p0, p1, p2}, Γ = {a, b, c},

∆ =

{(p0a → p1ba), (p1b → p2ca), (p2c → p0b), (p0b → p0)}

T = {p0aa}. P-automaton for T:

A:

p0 s1 p1 p2 s2 a a

Wolfgang Thomas

slide-9
SLIDE 9

Saturation Algorithm: Idea

Wolfgang Thomas

slide-10
SLIDE 10

Saturation Algorithm

Input: P-automaton A, pushdown system P = (P, Γ, ∆)

A0 := A, i := 0

REPEAT: IF pa → p′v ∈ ∆ and Ai : p′

v

− → q THEN

add (p, a, q) to Ai and obtain Ai+1

i := i + 1 UNTIL no transition can be added

A := Ai

Output: A′

Wolfgang Thomas

slide-11
SLIDE 11

Example: Result

A′:

p0 s1 p1 p2 s2 a a b c b a b

So for T = {p0aa}:

pre∗(T) = p0b∗(a + aa) + p1b + p1ba + p2cb∗(a + aa)

Wolfgang Thomas

slide-12
SLIDE 12

Alternative: Work in the Tree of Words

Consider a prefix rewriting system over {0, 1}. Convert prefix rewriting to suffix rewriting. Then a rewrite step is definable in S2S. Example: Rule R : 11 → 0 leads from a word w11 to w0 Defining formula ϕR(z, z′): ∃x(z = x11 ∧ z′ = x0) For a system S let ϕS(z, z′) :=

R∈S ϕR(z, z′)

Wolfgang Thomas

slide-13
SLIDE 13

Preservation of Regularity

Let L ⊆ {0, 1}∗ be regular. There is an S2S-formula ϕL(x) defining L in the tree T2 We can write L ⊆ Y for ∀y(ϕL(y) → Y(y)) Then x ∈ post∗(L) iff

∀Y[(L ⊂ Y and ∀z, z′(Y(z) ∧ϕS(z, z′)) → Y(z′)) → Y(x)]

The formula ψ(X) :

∀x(X(x) ↔ “x ∈ post∗(L)′′) is satisfied

by a unique set. By Rabin’s Basis Theorem it must be regular.

Wolfgang Thomas

slide-14
SLIDE 14

Interpretations

Wolfgang Thomas

slide-15
SLIDE 15

A First Example

Show Rabin’s Tree Theorem for T3 = ({0, 1, 2}∗, S3

0, S3 1, S3 2).

Idea: Obtain a copy of T3 in T2: Consider T2-vertices in T = (10 + 110 + 1110)∗.

Wolfgang Thomas

slide-16
SLIDE 16

Interpretation: Details

The element i1 . . . im of T3 is coded by

1i1+10 . . . 1im+10 in T2.

Define the set of codes by

ϕ(x): “x is in the closure of ε under 10-, 110-, and

1110-successors” Define the 0-th, 1-st 2-nd successors by

ψ0(x, y), ψ1(x, y), ψ2(x, y)

The structure (ϕT2, (ψT2

i )i=0,1,2) restricted to ϕT2 is isomorphic

to T3.

Wolfgang Thomas

slide-17
SLIDE 17

Interpretations in General

An MSO-interpretation of a structure A = (A, RA, . . .) in a structure B is given by a “domain formula” ϕ(x) for each relation RA of A, say of arity m, an MSO-formula

ψ(x1, . . . , xm)

such that A is isomorphic to (ϕB, ψB, . . .) Then there is a transformation OF MSO-sentenceS χ (in the signature of A) to sentences χ′ (in the signature of B) such that

A | = χ iff B | = χ′.

Consequence: If A is MSO-interpretable in B and the MSO-theory of B is decidable, then so is the MSO-theory of A.

Wolfgang Thomas

slide-18
SLIDE 18

Pushdown Graphs

Consider A for language L = {anbn | n ≥ 0}:

A = ({q0, q1}, {a, b}, {Z0, Z}, q0, Z0, ∆) with

∆ = (q0, Z0, a, q0, ZZ0),

(q0, Z, a, q0, ZZ), (q0, Z, b, q1, ε), (q1, Z, b, q1, ε)

  • Initial and final configuration: q0Z0

The associated pushdown graph (of reachable configurations

  • nly) is:

q1Z0 q1ZZ0 q1ZZZ0 . . . q0Z0 q0ZZ0 q0ZZZ0 . . . b b b b b b a a a

Wolfgang Thomas

slide-19
SLIDE 19

Interpretation: Second Example

A pushdown graph is MSO-interpretable in T2 Given pushdown automaton A with stack alphabet {1, . . . , k} and states q1, . . . , qm. Let GA = (VA, EA) be the corresponding PD graph.

n := max{k, m}

Find an MSO-interpretation of GA in Tn. Represent configuration (qj, i1 . . . ir) by the vertex ir . . . i1j.

A-steps lead to local moves in Tn.

E.g. a push step from vertex ir . . . i1j to ir . . . i1i0j′. These edges are easily definable in MSO. Hence: The MSO-theory of a PD graph is decidable.

Wolfgang Thomas

slide-20
SLIDE 20

Prefix-Recognizable Graphs

Instead of rules u → v we have rules U → Y wuth regular sets

U, V.

Instead of describing a move from one word wu0 to one wv0 describe all admissible moves from a word wu to a word wv for a rule U → V with u ∈ U, v ∈ V. This can be done by describing successful runs of the automata AU, AV on the path segments from w to wu and from w to wv. A graph is MSO-interpretable in T2 iff its is prefix-recognizable.

Wolfgang Thomas

slide-21
SLIDE 21

Unfolding and Muchnik’s Theorem

Wolfgang Thomas

slide-22
SLIDE 22

Unfoldings

Given a graph (V, (Ea)a∈Σ, (Pb)b∈Σ′) the unfolding of G from a given vertex v0 is the following tree

TG(v0) = (V′, (E′

a)a∈Σ, (P′ b)b∈Σ′):

V′ consists of the vertices v0a1v1 . . . arvr with

(vi−1, vi) ∈ Eai,

E′

a contains the pairs (v0a1v1 . . . arvr, v0a1v1 . . . arvrav)

with (vr, v) ∈ Ea,

P′

b the vertices v0a1v1 . . . arvr with vr ∈ Pb.

Wolfgang Thomas

slide-23
SLIDE 23

Examples

Wolfgang Thomas

slide-24
SLIDE 24

Unfolding Preserves Decidability

Theorem (Muchnik, Courcelle/Walukiewicz) If the MSO-theory of G is decidable and v0 is an MSO-definable vertex of G, then the MSO-theory of TG(v0) is decidable. We sketch the proof for pushdown graphs. Their unfoldings are the “algebraic trees”.

Wolfgang Thomas

slide-25
SLIDE 25

Proof Architecture

Given an unfolding T of a pushdown graph G.

T is finitely branching, with labels say in Σ inherited from G.

For each MSO-formula ϕ(X1, . . . , Xn) find a parity tree automaton Aϕ such that

Aϕ accepts T(P1, . . . , Pn) iff T[P1, . . . , Pn) | = ϕ(X1, . . . , Xn)

The construction of the Aϕ follows precisely the pattern of Rabin’s equivalence theorem. Essential: In the complementation step we use the finite

  • ut-degree of G.

The general case is more involved.

Wolfgang Thomas

slide-26
SLIDE 26

Muchnik’s Theorem: Continued

Result: For a sentence ϕ we obtain a tree automaton Aϕ, say with state set Q and transition set ∆, with

Aϕ accepts T iff T | = ϕ

The left-hand side says: Automaton has a positional winning strategy in the associated game ΓA,T If G = (V, E, v0) for simplicity, the game graph consists of vertices in V × Q (for Automaton) in V × ∆ (for Pathfinder)

Wolfgang Thomas

slide-27
SLIDE 27

Muchnik’s Theorem Finished

The game ΓA,T is played on a graph

G′ = (V × {1, . . . , k}, E′, (v0, 1))

We use the following fact (shown next Friday): The set of vertices v from where Player Automaton wins in the parity game over G′ = (V′, E′, v′) is MSO-definable by a formula χ(x). Translation Theorem: For each sentence ϕ we can build a sentence ϕ+ such that

G′ |

= ϕ iff G | = ϕ+

Since the MSO theory of G is decidable, we can decide the left-hand side.

Wolfgang Thomas

slide-28
SLIDE 28

Final Step

How to infer decidability of MTh(G × {1, 2}) from decidability

  • f MTh(G)?

We do not address the definition of the edge relation but just give the idea: Simulate a set quantifier over G × {1, 2} by two set quantifiers

  • ver G.

Wolfgang Thomas

slide-29
SLIDE 29

Pushdown Hierarchy

Wolfgang Thomas

slide-30
SLIDE 30

Caucal’s Proposal

We have now two processes which preserve decidability of MSO-theory: interpretation (transforming a tree into a graph) unfolding (transforming a graph into a tree) Let us apply them in alternation! We obtain the Caucal hierarchy or pushdown hierarchy.

Wolfgang Thomas

slide-31
SLIDE 31

Definition

T0 = the class of finite trees Gn = the class of graphs which are MSO-interpretable in a

tree of Tn

Tn+1 = the class of unfoldings of graphs in Gn

Each structure in the pushdown hierarchy has a decidable MSO-theory. Nontrivial fact: The sequence G0, G1, G2, . . . is strictly increasing.

Wolfgang Thomas

slide-32
SLIDE 32

The First Levels

G0 is the class of finite graphs. T1 contains the regular trees. G1 contains the prefix-recognizable graphs.

Wolfgang Thomas

slide-33
SLIDE 33

A Finite Graph, a Regular Tree, a PD Graph

  • a
  • b
  • a
  • c
  • a
  • b
  • a
  • c
  • a
  • c
  • a
  • c
  • a
  • c
  • a

c

  • · · ·
  • · · ·
  • a
  • b
  • a
  • c
  • a
  • c
  • a
  • c
  • a
  • c
  • a

c

  • · · ·
  • f
  • d
  • e
  • d
  • e
  • d
  • e
  • d
  • e
  • · · ·

d

  • e
  • Wolfgang Thomas
slide-34
SLIDE 34

Unfolding Again

  • a

b

  • a

c

  • c
  • a

c

  • a

c

  • a

· · ·

✹ ✹

  • f
  • d

✑✑✑✑✑✑

e

✲ ✲ ✲ ✲ ✲

  • d

✄✄✄✄✄✄✄

e

❀ ❀ ❀ ❀ ❀ ❀

  • d

✄✄✄✄✄✄✄

e

❀ ❀ ❀ ❀ ❀ ❀

✲ ✲ •

f

  • f
  • d

✑✑✑✑✑✑

e

✲ ✲ ✲ ✲ ✲

  • d

✑✑✑✑✑✑

e

✲ ✲ ✲ ✲ ✲

  • d

✑✑✑✑✑✑

e

✲ ✲ ✲ ✲ ✲

  • d

✑✑✑✑✑✑

e

✶ ✶ ✶ ✶ ✶

✲ ✲ •

f

  • f
  • f
  • f
  • d

✑✑✑✑✑✑

e

✲ ✲ ✲ ✲ ✲

✲ ✲ •

f

  • f
  • · · ·

  • Wolfgang Thomas
slide-35
SLIDE 35

Interpretation of Bottom Line

The sequence of leaves defines a copy of the successor structure of the natural numbers. Domain expression: b + a∗c(d + e)∗ f Successor relation:

bacf+ fe∗cacd∗ f+ fe∗ded∗ f

Predicate “power of 2”: b + a∗cd∗ f Result: (N, Succ, Pow2) is a structure in the Caucal hierarchy.

Wolfgang Thomas

slide-36
SLIDE 36

Factorial Predicate

(N, Succ, Fac)

We start as follows:

  • a
  • b
  • a
  • b
  • a
  • b
  • a

b

  • · · ·
  • c
  • c
  • c
  • · · ·

c

  • Wolfgang Thomas
slide-37
SLIDE 37

Continuation: Unfolding and Interpretation

  • · · ·

b b b b c c c c c c

Wolfgang Thomas

slide-38
SLIDE 38

Another Unfolding

  • 1
  • 2
  • • • • • •
  • • • • • •

3

  • a

a a a b b b b c c c c c c c c c

Wolfgang Thomas

slide-39
SLIDE 39

Scope of Hierarchy?

The pushdown hierarchy is a very rich class of structures all of which have a decidable MSO-theory. Open questions: Understand which structures belong to the hierarchy Compute the smallest level on which a strcuture occurs

Wolfgang Thomas