Formalizing Termination Proofs under Polynomial - - PowerPoint PPT Presentation

formalizing termination proofs under polynomial quasi
SMART_READER_LITE
LIVE PREVIEW

Formalizing Termination Proofs under Polynomial - - PowerPoint PPT Presentation

Formalizing Termination Proofs under Polynomial Quasi-interpretations Naohi Eguchi 1 Chiba University July 5, 2015, LCC 2015, Kyoto, Japan 1 Supported by Grants-in-Aid for JSPS fellows (No. 25 726 ) Naohi Eguchi (Chiba) Formalizing


slide-1
SLIDE 1

Formalizing Termination Proofs under Polynomial Quasi-interpretations

Naohi Eguchi1

Chiba University

July 5, 2015, LCC 2015, Kyoto, Japan

1Supported by Grants-in-Aid for JSPS fellows (No. 25 · 726)

Naohi Eguchi (Chiba) Formalizing Termination Proofs under PQIs July 5, 2015, LCC 2015 1 / 21

slide-2
SLIDE 2

Overview 1/2

Primitive-, Multiply Recursive Functions (Peano) Arithmetic Term Rewriting

Naohi Eguchi (Chiba) Formalizing Termination Proofs under PQIs July 5, 2015, LCC 2015 2 / 21

slide-3
SLIDE 3

Overview 1/2

Primitive-, Multiply Recursive Functions (Peano) Arithmetic Term Rewriting Parsons ’70 Hofbauer ’92, Weiermann ’95 Buchholz ’95

Naohi Eguchi (Chiba) Formalizing Termination Proofs under PQIs July 5, 2015, LCC 2015 3 / 21

slide-4
SLIDE 4

Overview 2/2

Poly-time-, Poly-space Functions Bounded Arithmetic Term Rewriting Buss ’86 Bonfante- Marion-Moyen ’11, ’01

Naohi Eguchi (Chiba) Formalizing Termination Proofs under PQIs July 5, 2015, LCC 2015 4 / 21

slide-5
SLIDE 5

Overview 2/2

Poly-time-, Poly-space Functions Bounded Arithmetic Term Rewriting Buss ’86 Bonfante- Marion-Moyen ’11, ’01 This work

Naohi Eguchi (Chiba) Formalizing Termination Proofs under PQIs July 5, 2015, LCC 2015 5 / 21

slide-6
SLIDE 6

1

First order functional programs (Term rewrite systems)

2

Multiset path orders (MPOs), Lexicographic path orders (LPOs)

3

Optimal formalizations of MPO-, LPO-termination proofs (Buchholz ’95)

4

Polynomial quasi-interpretations (PQIs)

5

An optimal formalization of LPO-termination proofs under PQIs (This work)

Naohi Eguchi (Chiba) Formalizing Termination Proofs under PQIs July 5, 2015, LCC 2015 6 / 21

slide-7
SLIDE 7

First order functional programs: Syntax

Syntax: variable x ∈ V signature (finite) F := C ⊎ D constructor c ∈ C defined symbol f ∈ D term t := x | c(t1, . . . , tk) | f(t1, . . . , tk) ∈ T (F, V) constructor term s := x | c(s1, . . . , sk) ∈ T (C, V) basic term u := f(s1, . . . , sk) ∈ B(F, V) reduction rule u → t Var(t) ⊆ Var(u) Program R: finite set of reduction rules

i

− →R: innermost reduction under R

i

− →∗

R: reflexive and transitive closure i

− →R t

i

− →!

R s ⇔ t i

− →∗

R s ∈ NF(R) (normal form under R)

Naohi Eguchi (Chiba) Formalizing Termination Proofs under PQIs July 5, 2015, LCC 2015 7 / 21

slide-8
SLIDE 8

First order functional programs: Semantics

Semantics: R computes the function [ |f| ] : T(C)k → T(C) (f ∈ D) iff ∀s1, . . . , sk ∈ T(C), ∃!s ∈ T(C) s.t. f(s1, . . . , sk)

i

− →!

R s.

Necessary:

1

R: (innermost) terminating: ∀t ∈ B(F), ∃s s.t. t

i

− →!

R s

2

R: confluent

3

R: quasi-reducible (QR): any (closed) basic term is reducible

Termination criterion

R: terminating if ∃A, ≺: well-founded, ∃( | · | ) : T (F) → A s.t. (∀l → r ∈ R)(∀θ : V → T(C))( |rθ| ) ≺ ( |lθ| )

Naohi Eguchi (Chiba) Formalizing Termination Proofs under PQIs July 5, 2015, LCC 2015 8 / 21

slide-9
SLIDE 9

1

First order functional programs (Term rewrite systems)

2

Multiset path orders (MPOs), Lexicographic path orders (LPOs)

3

Optimal formalizations of MPO-, LPO-termination proofs (Buchholz ’95)

4

Polynomial quasi-interpretations (PQIs)

5

An optimal formalization of LPO-termination proofs under PQIs (This work)

Naohi Eguchi (Chiba) Formalizing Termination Proofs under PQIs July 5, 2015, LCC 2015 9 / 21

slide-10
SLIDE 10

Recursive path orders

This work is concerned with a more specific case: ∃ <rpo: recursive path order s.t. (∀l → r ∈ R) l >rpo r (R ⊆>rpo)

Definition (Recursive path orders with status)

s <rpo t := g(t1, . . . , tl) iff

1

x rpo ti for some i ∈ {1, . . . , l}, or

2

s = f(s1, . . . , sk), rk(f) < rk(g) and s1, . . . , sk <rpo t, or

3

s = g(s1, . . . , sl) and (s1, . . . , sl) <τ(g)

rpo (t1, . . . , tl), where

τ : F → {prod, mul, lex} is a status function.

Definition (Multiset-, lexicographic path orders)

1

<mpo: <rpo with mul status only

2

<lpo: <rpo with lex status only

Naohi Eguchi (Chiba) Formalizing Termination Proofs under PQIs July 5, 2015, LCC 2015 10 / 21

slide-11
SLIDE 11

1

First order functional programs (Term rewrite systems)

2

Multiset path orders (MPOs), Lexicographic path orders (LPOs)

3

Optimal formalizations of MPO-, LPO-termination proofs (Buchholz ’95)

4

Polynomial quasi-interpretations (PQIs)

5

An optimal formalization of LPO-termination proofs under PQIs (This work)

Naohi Eguchi (Chiba) Formalizing Termination Proofs under PQIs July 5, 2015, LCC 2015 11 / 21

slide-12
SLIDE 12

Formalizations of MPO-, LPO-termination proofs

Theorem (Buchholz ’95)

1

IΣ1 ⊢ “R ⊆>mpo⇒ R is terminating′′ (IΣ1: Peano arithmetic with induction restricted to c.e. sets)

2

IΣ2 ⊢ “R ⊆>lpo⇒ R is terminating′′ (IΣ2: induction restricted to “f is total” for some computable f)

Corollary

1

Computable by MPO-terminating programs ⇒ primitive rec.

2

Computable by LPO-terminating programs ⇒ multiply recursive These results are optimal because:

1

Primitive rec. ⇒ computable by MPO-terminating programs

2

Multiply rec. ⇒ computable by LPO-terminating programs

Naohi Eguchi (Chiba) Formalizing Termination Proofs under PQIs July 5, 2015, LCC 2015 12 / 21

slide-13
SLIDE 13

1

First order functional programs (Term rewrite systems)

2

Multiset path orders (MPOs), Lexicographic path orders (LPOs)

3

Optimal formalizations of MPO-, LPO-termination proofs (Buchholz ’95)

4

Polynomial quasi-interpretations (PQIs)

5

An optimal formalization of LPO-termination proofs under PQIs (This work)

Naohi Eguchi (Chiba) Formalizing Termination Proofs under PQIs July 5, 2015, LCC 2015 13 / 21

slide-14
SLIDE 14

Quasi-interpretations

Associate a quasi-interpretation ( |f| ) : Nk → N for each k-ary f ∈ F: m < n ⇒ ( |f| )(· · · m · · · ) ≤ ( |f| )(· · · n · · · ) (e.g. m < n ⇒ max(m, m′) ≤ max(n, m′)) Extend to T (F): ( |f(t1, . . . , tk)| ) := ( |f| )(( |t1| ), . . . , ( |tk| ))

Definition

1

R admits a quasi-interpretation ( | · | ) if (∀l → r ∈ R)(∀θ : V → T (C))( |rθ| ) ≤ ( |lθ| ).

2

R: LPOPoly(0)-program if R: LPO-terminating & admits a (kind 0) polynomially-bounded quasi-interpretation (PQI)

Theorem (Bonfante-Marion-Moyen ’01)

Computable by LPOPoly(0)-programs ⇔ polynomial-space computable

Naohi Eguchi (Chiba) Formalizing Termination Proofs under PQIs July 5, 2015, LCC 2015 14 / 21

slide-15
SLIDE 15

1

First order functional programs (Term rewrite systems)

2

Multiset path orders (MPOs), Lexicographic path orders (LPOs)

3

Optimal formalizations of MPO-, LPO-termination proofs (Buchholz ’95)

4

Polynomial quasi-interpretations (PQIs)

5

An optimal formalization of LPO-termination proofs under PQIs (This work)

Naohi Eguchi (Chiba) Formalizing Termination Proofs under PQIs July 5, 2015, LCC 2015 15 / 21

slide-16
SLIDE 16

Difficulty

Theorem (Buchholz ’95)

IΣ2 ⊢ “R ⊆>lpo⇒ R is terminating′′

Lemma

IΣ2 ⊢ “R ⊆>lpo⇒ ∀t ∈ T (F), the reduction tree T rooted at t is well-founded′′ Problem: size(T) ≈ 2depth(T) Polynomial-space is not closed under m → 2m The same argument does not yields the poly-space complexity Something smaller in size than reduction trees seems necessary = ⇒ Minimal function graph

Naohi Eguchi (Chiba) Formalizing Termination Proofs under PQIs July 5, 2015, LCC 2015 16 / 21

slide-17
SLIDE 17

Minimal function graphs (Jones ’97, Marion ’03)

Minimal function graph GR(t) ⊆ B(F) × T(C) (t ∈ B(F)): GR(t) ⊆ {u, v | u

i

− →!

R v} & ∃s ∈ T(C) s.t. t, s ∈ GR(t)

How to construct minimal function graphs:

1

Let t ∈ B(F)

2

∃l → r ∈ R, ∃θ : V → T(C) s.t. t = lθ (if R: quasi-reducible)

3

Let u ✁ rθ & u ∈ B(F) (u is a basic sub-term of rθ)

4

Construction of GR(t) depends on GR(u)

5

u <lpo lθ = t (if R ⊆>lpo)

6

(∀t ∈ B(F))

  • (∀u <lpo t)∃GR(u) → ∃GR(t)
  • Thus it suffices to deduce TI∃GR(<lpo):

(∀t ∈ B(F))

  • (∀s <lpo t)∃GR(s) → ∃GR(t)
  • → (∀t ∈ B(F))∃GR(t)

Suitable framework: weak enough so that m → 2m is not definable U1

2: 2nd order Bounded arithmetic corresponding to PSPACE

Naohi Eguchi (Chiba) Formalizing Termination Proofs under PQIs July 5, 2015, LCC 2015 17 / 21

slide-18
SLIDE 18

Main result

U1

2: axiomatized with ϕ(0) ∧ ∀m

  • ϕ (⌊m/2⌋) → ϕ(m)
  • → ∀mϕ(m)

(ϕ(·): Σb,1

1 -formula including ∃GR(·))

Lemma

U1

2 ⊢ “R : QR & R ⊆>lpo & R admits a PQI ′′ → TI∃GR(<lpo)

Theorem

U1

2 ⊢ “R : QR & LPOPoly(0)′′ → (∀t ∈ B(F))∃GR(t)

By Buss’ theorem ∃f: poly-space s.t. ∀t ∈ B(F), t

i

− →!

R f(t). Hence:

Corollary

Computable by quasi-reducible LPOPoly(0)-programs ⇒ polynomial-space computable

Naohi Eguchi (Chiba) Formalizing Termination Proofs under PQIs July 5, 2015, LCC 2015 18 / 21

slide-19
SLIDE 19

Summary

Polynomial-space Computable Functions Bounded Arithmetic U1

2

Term Rewriting LPOPoly(0) Buss ’86 Bonfante- Marion- Moyen ’01

Naohi Eguchi (Chiba) Formalizing Termination Proofs under PQIs July 5, 2015, LCC 2015 19 / 21

slide-20
SLIDE 20

Summary

Polynomial-space Computable Functions Bounded Arithmetic U1

2

Term Rewriting LPOPoly(0) Buss ’86 Bonfante- Marion- Moyen ’01 Optimal termination proof for LPOPoly(0)-programs in U1

2

Naohi Eguchi (Chiba) Formalizing Termination Proofs under PQIs July 5, 2015, LCC 2015 20 / 21

slide-21
SLIDE 21

Future work?

R: MPOPoly(0)-program if R: MPO-terminating (with prod status

  • nly) & admits a (kind 0) PQI

Theorem (Bonfante-Marion-Moyen ’11)

Computable by MPOPoly(0)-programs ⇔ polynomial-time computable

Question

S1

2 ⊢ “R : QR & MPOPoly(0)′′ → (∀t ∈ B(F))∃GR(t)?

Formalizing Termination Proofs under Polynomial Quasi-interpretations Submitted to Workshop on Fixed Points in Computer Science Thank you for your attention!

Naohi Eguchi (Chiba) Formalizing Termination Proofs under PQIs July 5, 2015, LCC 2015 21 / 21