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 Termination Proofs under PQIs July 5, 2015, LCC 2015 1 / 21
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
Overview 1/2 Primitive-, Multiply Recursive Functions Hofbauer ’92, Parsons ’70 Weiermann ’95 (Peano) Arithmetic Term Rewriting Buchholz ’95 Naohi Eguchi (Chiba) Formalizing Termination Proofs under PQIs July 5, 2015, LCC 2015 3 / 21
Overview 2/2 Poly-time-, Poly-space Functions Bonfante- Marion-Moyen ’11, ’01 Buss ’86 Term Rewriting Bounded Arithmetic Naohi Eguchi (Chiba) Formalizing Termination Proofs under PQIs July 5, 2015, LCC 2015 4 / 21
Overview 2/2 Poly-time-, Poly-space Functions Bonfante- Marion-Moyen ’11, ’01 Buss ’86 Term Rewriting Bounded Arithmetic This work Naohi Eguchi (Chiba) Formalizing Termination Proofs under PQIs July 5, 2015, LCC 2015 5 / 21
First order functional programs (Term rewrite systems) 1 Multiset path orders (MPOs), Lexicographic path orders (LPOs) 2 Optimal formalizations of MPO-, LPO-termination proofs 3 (Buchholz ’95) Polynomial quasi-interpretations (PQIs) 4 An optimal formalization of LPO-termination proofs under PQIs 5 (This work) Naohi Eguchi (Chiba) Formalizing Termination Proofs under PQIs July 5, 2015, LCC 2015 6 / 21
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 ( t 1 , . . . , t k ) | f ( t 1 , . . . , t k ) ∈ T ( F , V ) constructor term s := x | c ( s 1 , . . . , s k ) ∈ T ( C , V ) basic term u := f ( s 1 , . . . , s k ) ∈ 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 i − → ∗ R : reflexive and transitive closure − → R i i → ! → ∗ t − R s ⇔ t − R s ∈ NF ( R ) (normal form under R ) Naohi Eguchi (Chiba) Formalizing Termination Proofs under PQIs July 5, 2015, LCC 2015 7 / 21
First order functional programs: Semantics Semantics: ] : T ( C ) k → T ( C ) ( f ∈ D ) iff R computes the function [ | f | i → ! ∀ s 1 , . . . , s k ∈ T ( C ) , ∃ ! s ∈ T ( C ) s.t. f ( s 1 , . . . , s k ) − R s. Necessary: i → ! R : (innermost) terminating: ∀ t ∈ B ( F ) , ∃ s s.t. t − R s 1 R : confluent 2 R : quasi-reducible (QR): any (closed) basic term is reducible 3 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
First order functional programs (Term rewrite systems) 1 Multiset path orders (MPOs), Lexicographic path orders (LPOs) 2 Optimal formalizations of MPO-, LPO-termination proofs 3 (Buchholz ’95) Polynomial quasi-interpretations (PQIs) 4 An optimal formalization of LPO-termination proofs under PQIs 5 (This work) Naohi Eguchi (Chiba) Formalizing Termination Proofs under PQIs July 5, 2015, LCC 2015 9 / 21
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 ( t 1 , . . . , t l ) iff x � rpo t i for some i ∈ { 1 , . . . , l } , or 1 s = f ( s 1 , . . . , s k ) , rk ( f ) < rk ( g ) and s 1 , . . . , s k < rpo t , or 2 s = g ( s 1 , . . . , s l ) and ( s 1 , . . . , s l ) < τ ( g ) rpo ( t 1 , . . . , t l ) , where 3 τ : F → { prod , mul , lex } is a status function. Definition (Multiset-, lexicographic path orders) < mpo : < rpo with mul status only 1 < lpo : < rpo with lex status only 2 Naohi Eguchi (Chiba) Formalizing Termination Proofs under PQIs July 5, 2015, LCC 2015 10 / 21
First order functional programs (Term rewrite systems) 1 Multiset path orders (MPOs), Lexicographic path orders (LPOs) 2 Optimal formalizations of MPO-, LPO-termination proofs 3 (Buchholz ’95) Polynomial quasi-interpretations (PQIs) 4 An optimal formalization of LPO-termination proofs under PQIs 5 (This work) Naohi Eguchi (Chiba) Formalizing Termination Proofs under PQIs July 5, 2015, LCC 2015 11 / 21
Formalizations of MPO-, LPO-termination proofs Theorem (Buchholz ’95) IΣ 1 ⊢ “ R ⊆ > mpo ⇒ R is terminating ′′ 1 ( IΣ 1 : Peano arithmetic with induction restricted to c.e. sets) IΣ 2 ⊢ “ R ⊆ > lpo ⇒ R is terminating ′′ 2 ( IΣ 2 : induction restricted to “ f is total” for some computable f ) Corollary Computable by MPO-terminating programs ⇒ primitive rec. 1 Computable by LPO-terminating programs ⇒ multiply recursive 2 These results are optimal because: Primitive rec. ⇒ computable by MPO-terminating programs 1 Multiply rec. ⇒ computable by LPO-terminating programs 2 Naohi Eguchi (Chiba) Formalizing Termination Proofs under PQIs July 5, 2015, LCC 2015 12 / 21
First order functional programs (Term rewrite systems) 1 Multiset path orders (MPOs), Lexicographic path orders (LPOs) 2 Optimal formalizations of MPO-, LPO-termination proofs 3 (Buchholz ’95) Polynomial quasi-interpretations (PQIs) 4 An optimal formalization of LPO-termination proofs under PQIs 5 (This work) Naohi Eguchi (Chiba) Formalizing Termination Proofs under PQIs July 5, 2015, LCC 2015 13 / 21
Quasi-interpretations ) : N k → N for each k -ary f ∈ F : Associate a quasi-interpretation ( | f | m < n ⇒ ( | f | )( · · · m · · · ) ≤ ( | f | )( · · · n · · · ) (e.g. m < n ⇒ max( m, m ′ ) ≤ max( n, m ′ ) ) Extend to T ( F ) : ( | f ( t 1 , . . . , t k ) | ) := ( | f | )(( | t 1 | ) , . . . , ( | t k | )) Definition R admits a quasi-interpretation ( | · | ) if 1 ( ∀ l → r ∈ R )( ∀ θ : V → T ( C ))( | rθ | ) ≤ ( | lθ | ) . R : LPO Poly (0) -program if R : LPO-terminating & admits a 2 (kind 0 ) polynomially-bounded quasi-interpretation (PQI) Theorem (Bonfante-Marion-Moyen ’01) Computable by LPO Poly (0) -programs ⇔ polynomial-space computable Naohi Eguchi (Chiba) Formalizing Termination Proofs under PQIs July 5, 2015, LCC 2015 14 / 21
First order functional programs (Term rewrite systems) 1 Multiset path orders (MPOs), Lexicographic path orders (LPOs) 2 Optimal formalizations of MPO-, LPO-termination proofs 3 (Buchholz ’95) Polynomial quasi-interpretations (PQIs) 4 An optimal formalization of LPO-termination proofs under PQIs 5 (This work) Naohi Eguchi (Chiba) Formalizing Termination Proofs under PQIs July 5, 2015, LCC 2015 15 / 21
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 ) ≈ 2 depth ( T ) Polynomial-space is not closed under m �→ 2 m 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
Minimal function graphs (Jones ’97, Marion ’03) Minimal function graph G R ( t ) ⊆ B ( F ) × T ( C ) ( t ∈ B ( F )) : i → ! G R ( t ) ⊆ {� u, v � | u − R v } & ∃ s ∈ T ( C ) s.t. � t, s � ∈ G R ( t ) How to construct minimal function graphs: Let t ∈ B ( F ) 1 ∃ l → r ∈ R , ∃ θ : V → T ( C ) s.t. t = lθ (if R : quasi-reducible) 2 Let u ✁ rθ & u ∈ B ( F ) ( u is a basic sub-term of rθ ) 3 Construction of G R ( t ) depends on G R ( u ) 4 u < lpo lθ = t (if R ⊆ > lpo ) 5 � � ( ∀ t ∈ B ( F )) ( ∀ u < lpo t ) ∃ G R ( u ) → ∃ G R ( t ) 6 Thus it suffices to deduce TI ∃ G R ( < lpo ) : � � ( ∀ t ∈ B ( F )) ( ∀ s < lpo t ) ∃ G R ( s ) → ∃ G R ( t ) → ( ∀ t ∈ B ( F )) ∃ G R ( t ) Suitable framework: weak enough so that m �→ 2 m is not definable U 1 2 : 2nd order Bounded arithmetic corresponding to PSPACE Naohi Eguchi (Chiba) Formalizing Termination Proofs under PQIs July 5, 2015, LCC 2015 17 / 21
Main result U 1 � � 2 : axiomatized with ϕ (0) ∧ ∀ m ϕ ( ⌊ m/ 2 ⌋ ) → ϕ ( m ) → ∀ mϕ ( m ) ( ϕ ( · ) : Σ b , 1 1 -formula including ∃ G R ( · ) ) Lemma 2 ⊢ “ R : QR & R ⊆ > lpo & R admits a PQI ′′ → TI ∃ G R ( < lpo ) U 1 Theorem 2 ⊢ “ R : QR & LPO Poly (0) ′′ → ( ∀ t ∈ B ( F )) ∃ G R ( t ) U 1 i → ! By Buss’ theorem ∃ f : poly-space s.t. ∀ t ∈ B ( F ) , t − R f ( t ) . Hence: Corollary Computable by quasi-reducible LPO Poly (0) -programs ⇒ polynomial-space computable Naohi Eguchi (Chiba) Formalizing Termination Proofs under PQIs July 5, 2015, LCC 2015 18 / 21
Summary Polynomial-space Computable Functions Bonfante- Marion- Moyen ’01 Buss ’86 Bounded Arithmetic U 1 Term Rewriting LPO Poly (0) 2 Naohi Eguchi (Chiba) Formalizing Termination Proofs under PQIs July 5, 2015, LCC 2015 19 / 21
Recommend
More recommend