degrees of undecidability of in term rewriting

56
Degrees of undecidability of in Term Rewriting org Endrullis, Herman Geuvers, Hans Zantema Radboud University Nijmegen, Technical University Eindhoven, Free University Amsterdam, The Netherlands CSL 2009 7-11 September 2009 Coimbra, Portugal

Upload: others

Post on 12-Sep-2021

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Degrees of undecidability of in Term Rewriting

Degrees of undecidability of in Term Rewriting

Jorg Endrullis, Herman Geuvers, Hans Zantema

Radboud University Nijmegen, Technical University Eindhoven, Free UniversityAmsterdam, The Netherlands

CSL 20097-11 September 2009

Coimbra, Portugal

Page 2: Degrees of undecidability of in Term Rewriting

Overview

I Term Rewriting Systems (TRS): definitions and properties

I Overview of results

I The arithmetic and analytical hierarchyI Technical details

I Relating Turing Machines to TRSsI Classification of properties of Turing MachinesI Weak Church-RosserI Church-RosserI Dependency Pair Problems

Page 3: Degrees of undecidability of in Term Rewriting

Term Rewriting Systems (TRS): definitions and properties

I A Signature Σ is a finite set of symbols f each having a fixedarity.

I The set Ter(Σ,X ) of terms is the smallest set satisfying:I X ⊆ Ter(Σ,X ), andI f (t1, . . . , tn) ∈ Ter(Σ,X ) if f ∈ Σ with arity n and∀i : ti ∈ Ter(Σ,X ).

I A term rewriting system (TRS) over Σ, X is a finite set R ofpairs 〈`, r〉 ∈ Ter(Σ,X ), called rewrite rules usually written as`→ r for which

I the left-hand side ` is not a variable (` 6∈ X )I all variables in the right-hand side r occur in `

(Var(r) ⊆ Var(`)).

Page 4: Degrees of undecidability of in Term Rewriting

Term Rewriting Systems (TRS): definitions and properties

For terms s, t ∈ Ter(Σ,X ) we write s →R t if there exists a rule`→ r ∈ R, a substitution σ and a context (’term with a hole’) Csuch that s ≡ C [`σ] and t ≡ C [rσ]

I →R is the rewrite relation induced by R,

I ↔R denotes the symmetric, reflexive closure of →R .

I →+R denotes the transitive closure of →R .

I →∗R denotes the reflexive, transitive closure of →R .

Page 5: Degrees of undecidability of in Term Rewriting

Basic TRS properties

I R is strongly normalizing (or terminating) on t, denotedSNR(t),if every rewrite sequence starting from t is finite.

I R is confluent (or Church-Rosser) on t, denoted CRR(t),if every pair of finite coinitial reductions starting from t canbe extended to a common reduct, that is,∀t1, t2. t1 ←∗ t →∗ t2 ⇒ ∃d . t1 →∗ d ←∗ t2.

I R is weakly confluent (or weakly Church-Rosser) on t,denoted WCRR(t), if every pair of coinitial rewrite stepsstarting from t can be joined, that is,∀t1, t2. t1 ← t −→ t2 ⇒ ∃d . t1 →∗ d ←∗ t2.

R is strongly normalizing (SNR), confluent (CRR) or weaklyconfluent (WCRR) if the respective property holds on all termst ∈ Ter(Σ,X ).

Page 6: Degrees of undecidability of in Term Rewriting

TRS properties

Church-Rosser and Weak Church-Rosser are usually also consideredon the ground terms only (ground = closed; no free variables).

I R is ground Church-Rosser, denoted grCRR ,if every pair of finite coinitial reductions starting from anyground t can be extended to a common reduct, that is,∀t, t1, t2 ground. t1 ←∗ t →∗ t2 ⇒ ∃d . t1 →∗ d ←∗ t2.

I R is ground weakly Church-Rosser, denoted grWCRR , if everypair of coinitial rewrite steps starting from a ground t can bejoined, that is,∀t, t1, t2 ground. t1 ← t −→ t2 ⇒ ∃d . t1 →∗ d ←∗ t2.

Page 7: Degrees of undecidability of in Term Rewriting

Undecidability of TRS properties

All interesting properties about TRSs are undecidable, but howundecidable?

SN WN CR grCR WCR grWCR DP DPmin

uniform Π02 Π0

2 Π02 Π0

2 Σ01 Π0

2 Π11 Π0

2

single term Σ01 Σ0

1 Π02 Π0

2 Σ01 Σ0

1 Π11 −

Existing work: Huet and Lankford (1978)Independent (but published earlier): J.G Simonsen (2009)New Contributions in red

Page 8: Degrees of undecidability of in Term Rewriting

Undecidability of TRS properties

All interesting properties about TRSs are undecidable, but howundecidable?

SN WN CR grCR WCR grWCR DP DPmin

uniform Π02 Π0

2 Π02 Π0

2 Σ01 Π0

2 Π11 Π0

2

single term Σ01 Σ0

1 Π02 Π0

2 Σ01 Σ0

1 Π11 −

Existing work: Huet and Lankford (1978)Independent (but published earlier): J.G Simonsen (2009)New Contributions in red

Page 9: Degrees of undecidability of in Term Rewriting

The Arithmetic Hierarchy

Σ01 Σ0

2

REC = ∆01

-

∆02

--

∆03

-

Π01

-

-

Π02

--

REC = class of decidable problems (over the natural numbers),Σ0

1 := ∃REC, Π01 := ∀REC, Σ0

2 := ∃∀REC, Π02 := ∀∃REC, etc.

∆0n := Σ0

n

⋂Π0

n.Σ0

n = {A | A ∈ Π0n}, Π0

n = {A | A ∈ Σ0n}

Page 10: Degrees of undecidability of in Term Rewriting

The Arithmetic Hierarchy

Σ01 Σ0

2

REC = ∆01

-

∆02

--

∆03

-

Π01

-

-

Π02

--

REC = class of decidable problems (over the natural numbers),Σ0

1 := ∃REC, Π01 := ∀REC, Σ0

2 := ∃∀REC, Π02 := ∀∃REC, etc.

∆0n := Σ0

n

⋂Π0

n.Σ0

n = {A | A ∈ Π0n}, Π0

n = {A | A ∈ Σ0n}

Page 11: Degrees of undecidability of in Term Rewriting

Examples

We leave encodings implicit, so we say e.g.

I t →∗ q := ∃〈s1, . . . , sn〉(t −→R s1 −→R . . . −→R sn = q)is in Σ1

0.

I T (M, 〈~x〉, u, v) := m is a Turing Machine M, u is thecomputation of M on ~x whose end result is v

is in REC. Kleene’s T -predicate.

I TOTAL(M) := ∀x∃u, vT (m, 〈x〉, u, v)is in Π0

2.

Page 12: Degrees of undecidability of in Term Rewriting

Properties of the classes in the Arithmetic Hierarchy

Any formula is equivalent to a formula in prenex normal form

I Qx (ϕ)⊗ Qy (ψ)⇐⇒ Qx Q y (ϕ⊗ ψ), for ⊗ ∈ {∧,∨},Q ∈ {∀, ∃}.

I Qx (ϕ)→ Qy (ψ)⇐⇒ Qx Qy (ϕ→ ψ), for Q ∈ {∀, ∃}.⇐⇒ Qy Qx (ϕ→ ψ).

Compression of quantifiers of the same type. Symbolically:

I ∀∀ 7→ ∀ and ∃∃ 7→ ∃∀x∀y(P(x , y))⇐⇒ ∀z(P((z)1, (z)2))

A bounded quantifier is no quantifier:

I ∀x < n REC = REC,

I ∃x < n REC = REC

Page 13: Degrees of undecidability of in Term Rewriting

Properties of the classes in the Arithmetic Hierarchy

Any formula is equivalent to a formula in prenex normal form

I Qx (ϕ)⊗ Qy (ψ)⇐⇒ Qx Q y (ϕ⊗ ψ), for ⊗ ∈ {∧,∨},Q ∈ {∀, ∃}.

I Qx (ϕ)→ Qy (ψ)⇐⇒ Qx Qy (ϕ→ ψ), for Q ∈ {∀, ∃}.⇐⇒ Qy Qx (ϕ→ ψ).

Compression of quantifiers of the same type. Symbolically:

I ∀∀ 7→ ∀ and ∃∃ 7→ ∃∀x∀y(P(x , y))⇐⇒ ∀z(P((z)1, (z)2))

A bounded quantifier is no quantifier:

I ∀x < n REC = REC,

I ∃x < n REC = REC

Page 14: Degrees of undecidability of in Term Rewriting

The Arithmetic Hierarchy

Σ01 Σ0

2

REC = ∆01

-

∆02

--

∆03

-

Π01

-

-

Π02

--

Theorem Σ0i ( ∆0

i+1 ( Σ0n+1 and Π0

i ( ∆0i+1 ( Π0

n+1

BlankTape(M) := ∃u, v T (M, 〈〉, u, v) ∈ Σ01 \ Π0

1

TOTAL(M) := ∀x∃u, v T (M, 〈x〉, u, v) ∈ Π02 \ Σ0

2

Page 15: Degrees of undecidability of in Term Rewriting

The Arithmetic Hierarchy

Σ01 Σ0

2

REC = ∆01

-

∆02

--

∆03

-

Π01

-

-

Π02

--

Theorem Σ0i ( ∆0

i+1 ( Σ0n+1 and Π0

i ( ∆0i+1 ( Π0

n+1

BlankTape(M) := ∃u, v T (M, 〈〉, u, v) ∈ Σ01 \ Π0

1

TOTAL(M) := ∀x∃u, v T (M, 〈x〉, u, v) ∈ Π02 \ Σ0

2

Page 16: Degrees of undecidability of in Term Rewriting

Above the arithmetical hierarchy: analytical hierarchy

All properties definable in first order arithmetic reside in thearithmetical hierarchy.If we want to quantify over functions from N to N (infinitesequences of numbers), we end up in the analytical hierarchy.Function variables are usually α, β, etc.Example:

∃α∀i(α(i)→R α(i + 1))

Page 17: Degrees of undecidability of in Term Rewriting

The Analytic Hierarchy

Σ11 Σ1

2

∆11

-

∆12

--

∆13

-

Π11

--

Π12

--

Σ11 := ∃α∀xREC, Π1

1 := ∀α∃xREC, Σ12 := ∃β∀α∃xREC, etc.

∆1n := Σ1

n

⋂Π1

n.

Σ1n+1 = ∃1αΠ1

n, Π1n+1 = ∃βΣ1

n

Σ1n = {A | A ∈ Π1

n}, Π1n = {A | A ∈ Σ1

n}.Theorem Σ1

i ( ∆1i+1 ( Σ1

n+1 and Π1i ( ∆1

i+1 ( Π1n+1

WF(M) := “M defines a well-founded relation >M” ∈ Π11 \ Σ1

1

Page 18: Degrees of undecidability of in Term Rewriting

The Analytic Hierarchy

Σ11 Σ1

2

∆11

-

∆12

--

∆13

-

Π11

--

Π12

--

Σ11 := ∃α∀xREC, Π1

1 := ∀α∃xREC, Σ12 := ∃β∀α∃xREC, etc.

∆1n := Σ1

n

⋂Π1

n.Σ1

n+1 = ∃1αΠ1n, Π1

n+1 = ∃βΣ1n

Σ1n = {A | A ∈ Π1

n}, Π1n = {A | A ∈ Σ1

n}.Theorem Σ1

i ( ∆1i+1 ( Σ1

n+1 and Π1i ( ∆1

i+1 ( Π1n+1

WF(M) := “M defines a well-founded relation >M” ∈ Π11 \ Σ1

1

Page 19: Degrees of undecidability of in Term Rewriting

Properties of the classes in the Analytic Hierarchy

We have quantifiers over numbers ∀, ∃ and over functions ∀1, ∃1.A number of quantifiers of the same type can be compressed intoone.

I ∀1∀1 7→ ∀1 and ∃1∃1 7→ ∃1

∀1 subsumes ∀.

I ∀1∀ 7→ ∀1 and ∃1∃ 7→ ∃1

∀1 moves outside over ∃ and ∃1 moves outside over ∀.

I ∃∀1 7→ ∀1∃ and ∀∃1 7→ ∃1∀I The standard form of an element of the analytic hierarchy is

Q11Q1

2 . . .Q1nQ with swopping quantifiers and Q opposite to

Q1n .

Page 20: Degrees of undecidability of in Term Rewriting

Proving that a property is essentially Π02 (and not “lower”)

A total recursive function f many-one reduces problem A toproblem B if

A(x)⇐⇒ B(f (x)), for all x

So “if we want to decide A(x), we only have to decide B(x)”.

A�m B ( A is many-one reducible to B)

in case such an f exists.

DefinitionB is called Π0

2-complete if B ∈ Π02 and forall A ∈ Π0

2, A�m B.If B is Π0

2-complete, it can’t be lower in the hierarchy.

TheoremBlankTape(M) is Σ0

1-complete,TOTAL(M) is Π0

2-complete,WF(M) is Π1

1-complete.

To prove that WCR is Σ01-complete:

Reduce it to BlankTape

Page 21: Degrees of undecidability of in Term Rewriting

Proving that a property is essentially Π02 (and not “lower”)

A total recursive function f many-one reduces problem A toproblem B if

A(x)⇐⇒ B(f (x)), for all x

So “if we want to decide A(x), we only have to decide B(x)”.

A�m B ( A is many-one reducible to B)

in case such an f exists.

DefinitionB is called Π0

2-complete if B ∈ Π02 and forall A ∈ Π0

2, A�m B.If B is Π0

2-complete, it can’t be lower in the hierarchy.

TheoremBlankTape(M) is Σ0

1-complete,TOTAL(M) is Π0

2-complete,WF(M) is Π1

1-complete.

To prove that WCR is Σ01-complete:

Reduce it to BlankTape

Page 22: Degrees of undecidability of in Term Rewriting

Proving that a property is essentially Π02 (and not “lower”)

A total recursive function f many-one reduces problem A toproblem B if

A(x)⇐⇒ B(f (x)), for all x

So “if we want to decide A(x), we only have to decide B(x)”.

A�m B ( A is many-one reducible to B)

in case such an f exists.

DefinitionB is called Π0

2-complete if B ∈ Π02 and forall A ∈ Π0

2, A�m B.If B is Π0

2-complete, it can’t be lower in the hierarchy.

TheoremBlankTape(M) is Σ0

1-complete,TOTAL(M) is Π0

2-complete,WF(M) is Π1

1-complete.

To prove that WCR is Σ01-complete:

Reduce it to BlankTape

Page 23: Degrees of undecidability of in Term Rewriting

From Turing Machines to TRSs

Translating a Turing machine M = (Q,Σ, q0, δ) to a TRS RM

Function symbols:

a ∈ Σ 7→ unary function a(−)q ∈ Q 7→ binary function q(−,−)

extra: constant . (representing “infinitely many” blanks)

Configurations:Right of the reading head: a b a a 2 2 . . . translates toa(b(a(a(.))))Left of the reading head: . . . 2 2 a b a a translates to a(a(b(a(.))))Tape content . . . 2 w a v2 . . . in state q becomes q(wR , a(v))(q is reading a, the first symbol of a v)

Page 24: Degrees of undecidability of in Term Rewriting

From Turing Machines to TRSs

Translating a Turing machine M = (Q,Σ, q0, δ) to a TRS RM

Function symbols:

a ∈ Σ 7→ unary function a(−)q ∈ Q 7→ binary function q(−,−)extra: constant . (representing “infinitely many” blanks)

Configurations:Right of the reading head: a b a a 2 2 . . . translates toa(b(a(a(.))))Left of the reading head: . . . 2 2 a b a a translates to a(a(b(a(.))))Tape content . . . 2 w a v2 . . . in state q becomes q(wR , a(v))(q is reading a, the first symbol of a v)

Page 25: Degrees of undecidability of in Term Rewriting

From Turing Machines to TRSs

Translating a Turing machine M = (Q,Σ, q0, δ) to a TRS RM

Function symbols:

a ∈ Σ 7→ unary function a(−)q ∈ Q 7→ binary function q(−,−)extra: constant . (representing “infinitely many” blanks)

Configurations:Right of the reading head: a b a a 2 2 . . . translates toa(b(a(a(.))))Left of the reading head: . . . 2 2 a b a a translates to a(a(b(a(.))))

Tape content . . . 2 w a v2 . . . in state q becomes q(wR , a(v))(q is reading a, the first symbol of a v)

Page 26: Degrees of undecidability of in Term Rewriting

From Turing Machines to TRSs

Translating a Turing machine M = (Q,Σ, q0, δ) to a TRS RM

Function symbols:

a ∈ Σ 7→ unary function a(−)q ∈ Q 7→ binary function q(−,−)extra: constant . (representing “infinitely many” blanks)

Configurations:Right of the reading head: a b a a 2 2 . . . translates toa(b(a(a(.))))Left of the reading head: . . . 2 2 a b a a translates to a(a(b(a(.))))Tape content . . . 2 w a v2 . . . in state q becomes q(wR , a(v))(q is reading a, the first symbol of a v)

Page 27: Degrees of undecidability of in Term Rewriting

Encoding a Turing Machine M as a TRS RM

Translating the transition function δ:

q(x , f (y)) −→ q′(f ′(x), y) if δ(q, f ) = (q′, f ′,R)q(g(x), f (y)) −→ q′(x , g(f ′(y))) if δ(q, f ) = (q′, f ′, L)

And special rewrite rules for dealing with the left-/rightmostblank:

q(., f (y)) −→ q′(.,2(f ′(y))) if δ(q, f ) = (q′, f ′, L)q(x , .) −→ q′(f ′(x), .) if δ(q,2) = (q′, f ′,R)

q(g(x), .) −→ q′(x , g(f ′(.))) if δ(q,2) = (q′, f ′, L)q(., .) −→ q′(.,2(f ′(.))) if δ(q,2) = (q′, f ′, L)

Page 28: Degrees of undecidability of in Term Rewriting

Encoding a Turing Machine M as a TRS RM

Translating the transition function δ:

q(x , f (y)) −→ q′(f ′(x), y) if δ(q, f ) = (q′, f ′,R)q(g(x), f (y)) −→ q′(x , g(f ′(y))) if δ(q, f ) = (q′, f ′, L)

And special rewrite rules for dealing with the left-/rightmostblank:

q(., f (y)) −→ q′(.,2(f ′(y))) if δ(q, f ) = (q′, f ′, L)q(x , .) −→ q′(f ′(x), .) if δ(q,2) = (q′, f ′,R)

q(g(x), .) −→ q′(x , g(f ′(.))) if δ(q,2) = (q′, f ′, L)q(., .) −→ q′(.,2(f ′(.))) if δ(q,2) = (q′, f ′, L)

Page 29: Degrees of undecidability of in Term Rewriting

Σ01-completeness of WCR

WCR is in Σ01: By the Critical Pairs Lemma, WCRR holds if and

only if all critical pairs of R are convergent.A Turing machine can compute on the input of a TRS R all(finitely many) critical pairs, and on the input of a TRS R and aterm t all (finitely many) one step reducts of t.

So it suffices to show that the following is in Σ01:

Decide on the input of a TRS S, n ∈ N and termst1, s1, . . . , tn, sn whether for every i = 1, . . . , n the termsti and si have a common reduct.

This property can easily be described by a Σ01 formula.

Page 30: Degrees of undecidability of in Term Rewriting

Σ01-completeness of WCR

WCR is in Σ01: By the Critical Pairs Lemma, WCRR holds if and

only if all critical pairs of R are convergent.A Turing machine can compute on the input of a TRS R all(finitely many) critical pairs, and on the input of a TRS R and aterm t all (finitely many) one step reducts of t.So it suffices to show that the following is in Σ0

1:

Decide on the input of a TRS S, n ∈ N and termst1, s1, . . . , tn, sn whether for every i = 1, . . . , n the termsti and si have a common reduct.

This property can easily be described by a Σ01 formula.

Page 31: Degrees of undecidability of in Term Rewriting

Σ01-completeness of WCR

WCR is Σ01-hard: We define TRS S to consist of the rules of RM

extended by the following:

run→ T run→ q0(., .)

q(x , f (y))→ T for every f ∈ Γ such that δ(q, f ) is undefined .

The only critical pair is T← run→ q0(., .). We have:

q0(., .)→∗S T if and only if M halts on the blank tape.

So:WCR(S) if and only if M halts on the blank tape.

Page 32: Degrees of undecidability of in Term Rewriting

Π02-completeness of CR

CR is in Π02:

CRR ⇐⇒ ∀t ∈ N. ∀r1, r2 ∈ N. ∃r ′1, r′2 ∈ N.

(((t is a term) and (r1, r2 are reductions)

and t ≡ first(r1) ≡ first(r2))

⇒ ((r ′1 and r ′2 are reductions)

and (last(r1) ≡ first(r ′1)) and (last(r2) ≡ first(r ′2))

and (last(r ′1) ≡ last(r ′2))))

.

Page 33: Degrees of undecidability of in Term Rewriting

Π02-hardness of CR

We change the TRS RM in such a way that

M halts on all inputs ⇐⇒ RM is CR

Idea: use an extension of RM with the following rules:

run(x , y)→ T

run(x , y)→ q0(x , y)

q(x , f (y))→ T for every f ∈ Γ with δ(q, f ) undefined

Then it seems that

CR(R+M)⇐⇒ the Turing machine M halts on all configurations.

However, we only have =⇒. With ⇐= a problem arises if s and tcontain variables.

Page 34: Degrees of undecidability of in Term Rewriting

Π02-hardness of CR

We change the TRS RM in such a way that

M halts on all inputs ⇐⇒ RM is CR

Idea: use an extension of RM with the following rules:

run(x , y)→ T

run(x , y)→ q0(x , y)

q(x , f (y))→ T for every f ∈ Γ with δ(q, f ) undefined

Then it seems that

CR(R+M)⇐⇒ the Turing machine M halts on all configurations.

However, we only have =⇒. With ⇐= a problem arises if s and tcontain variables.

Page 35: Degrees of undecidability of in Term Rewriting

Π02-hardness of CR

We change the TRS RM in such a way that

M halts on all inputs ⇐⇒ RM is CR

Idea: use an extension of RM with the following rules:

run(x , y)→ T

run(x , y)→ q0(x , y)

q(x , f (y))→ T for every f ∈ Γ with δ(q, f ) undefined

Then it seems that

CR(R+M)⇐⇒ the Turing machine M halts on all configurations.

However, we only have =⇒. With ⇐= a problem arises if s and tcontain variables.

Page 36: Degrees of undecidability of in Term Rewriting

Π02-hardness of CR

For a Turing machines M we define the TRS SM as RM extendedwith

run(x , .)→ T (1)

run(., y)→ q0(., y) (2)

q(x , f (y))→ T if δ(q, f ) undefined (3)

run(x , S(y))→ run(S(x), y) (4)

run(S(x), y)→ run(x ,S(y)) . (5)

Then the only cause for non-confluence can be (t1, t2 are groundterms)

q0(., s1)←(2) run(s1, .)←∗(4) run(t1, t2)→∗(5) run(s1, .)→(1) T

Thus we can prove

CR(SM)⇐⇒ the Turing machine M halts on all inputs.

Page 37: Degrees of undecidability of in Term Rewriting

Π02-hardness of CR

For a Turing machines M we define the TRS SM as RM extendedwith

run(x , .)→ T (1)

run(., y)→ q0(., y) (2)

q(x , f (y))→ T if δ(q, f ) undefined (3)

run(x , S(y))→ run(S(x), y) (4)

run(S(x), y)→ run(x ,S(y)) . (5)

Then the only cause for non-confluence can be (t1, t2 are groundterms)

q0(., s1)←(2) run(s1, .)←∗(4) run(t1, t2)→∗(5) run(s1, .)→(1) T

Thus we can prove

CR(SM)⇐⇒ the Turing machine M halts on all inputs.

Page 38: Degrees of undecidability of in Term Rewriting

Dependency Pair problems for TRSs

I For relations →R ,→S we write →R /→S for →∗S · →R .

I →R,ε denotes R-reduction,but only at the top of a term.

I Write SN(Rtop/S) instead of SN(→R,ε/→S).

SN(Rtop/S) is the finiteness of the dependency pair problem for{R, S}.So SN(Rtop/S) means that every infinite →R,ε ∪ →S reduction,contains only finitely many →R,ε steps.Motivation: There a simple syntactic construction DP such thatfor any TRS S we have

SN(DP(S)top/S)⇐⇒ SN(S).

Page 39: Degrees of undecidability of in Term Rewriting

Dependency Pair problems for TRSs

I For relations →R ,→S we write →R /→S for →∗S · →R .

I →R,ε denotes R-reduction,but only at the top of a term.

I Write SN(Rtop/S) instead of SN(→R,ε/→S).

SN(Rtop/S) is the finiteness of the dependency pair problem for{R, S}.So SN(Rtop/S) means that every infinite →R,ε ∪ →S reduction,contains only finitely many →R,ε steps.

Motivation: There a simple syntactic construction DP such thatfor any TRS S we have

SN(DP(S)top/S)⇐⇒ SN(S).

Page 40: Degrees of undecidability of in Term Rewriting

Dependency Pair problems for TRSs

I For relations →R ,→S we write →R /→S for →∗S · →R .

I →R,ε denotes R-reduction,but only at the top of a term.

I Write SN(Rtop/S) instead of SN(→R,ε/→S).

SN(Rtop/S) is the finiteness of the dependency pair problem for{R, S}.So SN(Rtop/S) means that every infinite →R,ε ∪ →S reduction,contains only finitely many →R,ε steps.Motivation: There a simple syntactic construction DP such thatfor any TRS S we have

SN(DP(S)top/S)⇐⇒ SN(S).

Page 41: Degrees of undecidability of in Term Rewriting

Dependency pair problems

The dependency pair problem {R,S} is finite if SN(Rtop/S).

SN(Rtop/S) := →∗S · →R,ε is SN

This seems a “standard” SN-for-TRS problem, so should be Π02 . . .

But: →∗S · →R,ε is not finitely branching.

Examplef (x) −→S g(f (x))g(x) −→R aFinite DP problem, but →∗S · →R,ε is not finitely branching:f (x)→∗S gn((f (x))→R,ε a.

Page 42: Degrees of undecidability of in Term Rewriting

Dependency pair problems

The dependency pair problem {R,S} is finite if SN(Rtop/S).

SN(Rtop/S) := →∗S · →R,ε is SN

This seems a “standard” SN-for-TRS problem, so should be Π02 . . .

But: →∗S · →R,ε is not finitely branching.

Examplef (x) −→S g(f (x))g(x) −→R aFinite DP problem, but →∗S · →R,ε is not finitely branching:f (x)→∗S gn((f (x))→R,ε a.

Page 43: Degrees of undecidability of in Term Rewriting

SN for non-finitely branching systems (ARSs)

SNR(a) := ∀α : N→N (α(0) = a =⇒ ∃i ¬(α(i) −→R α(i + 1)))

“There is no infinite reduction starting from a”.This is a Π1

1-statement, so finiteness of DP problems is in the classΠ1

1.

Is it Π11-complete?

Yes: we proveWF(>M)⇐⇒ SN(SM

top/SM)

for a suitable SM constructed from M. This reduces WF(>M) toSN(SM

top/SM), thus showing Π11-hardness of dependency pair

problems.

Page 44: Degrees of undecidability of in Term Rewriting

SN for non-finitely branching systems (ARSs)

SNR(a) := ∀α : N→N (α(0) = a =⇒ ∃i ¬(α(i) −→R α(i + 1)))

“There is no infinite reduction starting from a”.This is a Π1

1-statement, so finiteness of DP problems is in the classΠ1

1.Is it Π1

1-complete?Yes: we prove

WF(>M)⇐⇒ SN(SMtop/SM)

for a suitable SM constructed from M. This reduces WF(>M) toSN(SM

top/SM), thus showing Π11-hardness of dependency pair

problems.

Page 45: Degrees of undecidability of in Term Rewriting

DP is Π11-complete

We now reduce well-foundedness of >M to SN(SMtop/SM) and thus

obtain that DP is Π11-complete.

IDEA: We define a TRS SM such thatSM has an infinite reduction iff ¬WF(>M),and this reduction “keeps coming back to the top level”.

We want to mimick a computation that1. arbitrarily picks a number n1

2. arbitrarily picks a number n2

3. checks if n1 >M n2, if “no” stops, if “yes” replaces n1 by n2 andcontinues with (2)

Notation: we write n to denote Sn(0(.))

Page 46: Degrees of undecidability of in Term Rewriting

DP is Π11-complete

We now reduce well-foundedness of >M to SN(SMtop/SM) and thus

obtain that DP is Π11-complete.

IDEA: We define a TRS SM such thatSM has an infinite reduction iff ¬WF(>M),and this reduction “keeps coming back to the top level”.

We want to mimick a computation that1. arbitrarily picks a number n1

2. arbitrarily picks a number n2

3. checks if n1 >M n2, if “no” stops, if “yes” replaces n1 by n2 andcontinues with (2)

Notation: we write n to denote Sn(0(.))

Page 47: Degrees of undecidability of in Term Rewriting

DP is Π11-complete

We now reduce well-foundedness of >M to SN(SMtop/SM) and thus

obtain that DP is Π11-complete.

IDEA: We define a TRS SM such thatSM has an infinite reduction iff ¬WF(>M),and this reduction “keeps coming back to the top level”.

We want to mimick a computation that1. arbitrarily picks a number n1

2. arbitrarily picks a number n2

3. checks if n1 >M n2, if “no” stops, if “yes” replaces n1 by n2 andcontinues with (2)

Notation: we write n to denote Sn(0(.))

Page 48: Degrees of undecidability of in Term Rewriting

DP is Π11-complete

First we add

q(x , 0(y)) −→ T if δ(q, 0) = undefined

so that we haven >M p iff q0(n, p)→∗R T

Then (but this is too simple . . . ): to pick arbitrary numbers weintroduce the following TRS

pick −→ S(pick)

pick −→ 0(.)

and we add

try(T, x , y) −→ try(q(x , y), y , pick)

Page 49: Degrees of undecidability of in Term Rewriting

DP is Π11-complete

First we add

q(x , 0(y)) −→ T if δ(q, 0) = undefined

so that we haven >M p iff q0(n, p)→∗R T

Then (but this is too simple . . . ): to pick arbitrary numbers weintroduce the following TRS

pick −→ S(pick)

pick −→ 0(.)

and we add

try(T, x , y) −→ try(q(x , y), y , pick)

Page 50: Degrees of undecidability of in Term Rewriting

DP is Π11-complete

The intention is to have

try(T, pick, pick) →∗

try(T, n1, n2) →∗ try(q0(n1, n2), n2, pick) −→try(T, n2, n3) →∗ try(q0(n2, n3), n3, pick) −→ . . .

only if there is an infinite descending sequence n1 >M n2 >M n3 . . .

However we also have:

try(T, pick, pick) →∗

try(q0(pick, pick), pick, pick) →∗ try(q0(n1, n2), pick, pick)→∗

try(T, pick, pick) →∗ . . .

if n1 >M n2

Problem: try(T, u, s) should only reduce if u and s represent anumber.

Page 51: Degrees of undecidability of in Term Rewriting

DP is Π11-complete

The intention is to have

try(T, pick, pick) →∗

try(T, n1, n2) →∗ try(q0(n1, n2), n2, pick) −→try(T, n2, n3) →∗ try(q0(n2, n3), n3, pick) −→ . . .

only if there is an infinite descending sequence n1 >M n2 >M n3 . . .However we also have:

try(T, pick, pick) →∗

try(q0(pick, pick), pick, pick) →∗ try(q0(n1, n2), pick, pick)→∗

try(T, pick, pick) →∗ . . .

if n1 >M n2

Problem: try(T, u, s) should only reduce if u and s represent anumber.

Page 52: Degrees of undecidability of in Term Rewriting

DP is Π11-complete

The intention is to have

try(T, pick, pick) →∗

try(T, n1, n2) →∗ try(q0(n1, n2), n2, pick) −→try(T, n2, n3) →∗ try(q0(n2, n3), n3, pick) −→ . . .

only if there is an infinite descending sequence n1 >M n2 >M n3 . . .However we also have:

try(T, pick, pick) →∗

try(q0(pick, pick), pick, pick) →∗ try(q0(n1, n2), pick, pick)→∗

try(T, pick, pick) →∗ . . .

if n1 >M n2

Problem: try(T, u, s) should only reduce if u and s represent anumber.

Page 53: Degrees of undecidability of in Term Rewriting

DP is Π11-complete

To pick arbitrary numbers we introduce the following TRS

pick −→ c(pick)

pick −→ ok(0(.))

c(ok(x)) −→ ok(S(x))

Then pick→∗ cn(pick) −→ cn(ok(0(.))) −→ ok(Sn(0(.))) ≡ n

Lemma pick→∗ ok(t)⇐⇒ ∃n(t = Sn(0(.)))

Page 54: Degrees of undecidability of in Term Rewriting

DP is Π11-complete

To pick arbitrary numbers we introduce the following TRS

pick −→ c(pick)

pick −→ ok(0(.))

c(ok(x)) −→ ok(S(x))

Then pick→∗ cn(pick) −→ cn(ok(0(.))) −→ ok(Sn(0(.))) ≡ nLemma pick→∗ ok(t)⇐⇒ ∃n(t = Sn(0(.)))

Page 55: Degrees of undecidability of in Term Rewriting

DP is Π11-complete

Finally we add the following rewrite rule

try(T, ok(x), ok(y)) −→ try(q0(x , y), ok(y), pick)

Then: the term try(T, pick, pick) is SN(Rtop/S) iff >M iswell-founded.Proof: The only infinite reduction that is possible is of the form

try(T, pick, pick) →∗

try(T, ok(n1), ok(n2)) →∗ try(q0(n1, n2), ok(n2), pick) −→try(T, ok(n2), ok(n3)) →∗ try(q0(n2, n3), ok(n3), pick) −→

. . .

if n1 >M n2 >M n3 . . .

Page 56: Degrees of undecidability of in Term Rewriting

Remarks / Conclusions / Future work

Remarks

I In DPmin, we restrict →∗S · →R,ε to terms that are SN(S).DPmin is Π0

2-complete (see paper).

I SNω(R) is Π11-complete (see paper).

Future work:

I Characterize “all” properties of TRSs, distinguishing between“ground terms” and “all terms”: UN, . . . .

I Characterize WNω(R).WNω(R) := ∀t∃α(. . .)⇐⇒ ∃α∀t(. . .) ∈ Π1

1.

I Extend to infinite terms. SNω∞(R) := ∀β∀α(. . .) ∈ Π1

1.WNω

∞(R) := ∀β∃α(. . .) ∈ Σ12.

I Make the generalizations to SN∞, WN∞ precise, for reductionof all countable ordinal length.

I Study the proof-theoretic complexity of productivity