type introduction for runtime complexity analysis
play

Type Introduction for Runtime Complexity Analysis Scienza e - PowerPoint PPT Presentation

Type Introduction for Runtime Complexity Analysis Scienza e Ingegneria Universit degli Studi di Bologna University of Innsbruck Workshop on Termination, October 27, 2014 Martin Avanzini 1 (Joint work with Bertram Felgenhauer 2 ) 1 Dipartimento


  1. Type Introduction for Runtime Complexity Analysis Scienza e Ingegneria Università degli Studi di Bologna University of Innsbruck Workshop on Termination, October 27, 2014 Martin Avanzini 1 (Joint work with Bertram Felgenhauer 2 ) 1 Dipartimento di Informatica 2 Institute for Computer Science

  2. ; 2. runtime-complexity function basic term v are values Runtime Complexity of TRSs [Hirokawa & Moser, 2008] [Hofbauer & Lautemann, 1989] 1. derivational-complexity function • derivation height dh ( t , → ) := max { n | ∃ s . t → n s } dc R ( n ) = max { dh ( f ( ⃗ → R ) | f ( ⃗ s ) , − s ) of size up to n } rc R ( n ) = max { dh ( f ( ⃗ v ) , − → R ) | f ( ⃗ v ) and ⃗ of size up to n } � �� �

  3. ; 2. runtime-complexity function basic term v are values Runtime Complexity of TRSs [Hirokawa & Moser, 2008] [Hofbauer & Lautemann, 1989] 1. derivational-complexity function • derivation height dh ( t , → ) := max { n | ∃ s . t → n s } dc R ( n ) = max { dh ( f ( ⃗ → R ) | f ( ⃗ s ) , − s ) of size up to n } rc R ( n ) = max { dh ( f ( ⃗ v ) , − → R ) | f ( ⃗ v ) and ⃗ of size up to n } � �� �

  4. ; 2. runtime-complexity function basic term Runtime Complexity of TRSs [Hirokawa & Moser, 2008] [Hofbauer & Lautemann, 1989] 1. derivational-complexity function • derivation height dh ( t , → ) := max { n | ∃ s . t → n s } dc R ( n ) = max { dh ( f ( ⃗ → R ) | f ( ⃗ s ) , − s ) of size up to n } rc R ( n ) = max { dh ( f ( ⃗ v ) , − → R ) | f ( ⃗ v ) and ⃗ of size up to n } v are values � �� �

  5. ; 2. runtime-complexity function basic term v are values Runtime Complexity of TRSs [Hirokawa & Moser, 2008] [Hofbauer & Lautemann, 1989] 1. derivational-complexity function • derivation height dh ( t , → ) := max { n | ∃ s . t → n s } dc R ( n ) = max { dh ( f ( ⃗ → R ) | f ( ⃗ s ) , − s ) of size up to n } rc R ( n ) = max { dh ( f ( ⃗ v ) , − → R ) | f ( ⃗ v ) and ⃗ of size up to n } � �� �

  6. ; v are values 1. derivational-complexity function [Hofbauer & Lautemann, 1989] 2. innermost runtime-complexity function [Hirokawa & Moser, 2008] rc i Runtime Complexity of TRSs basic term i • derivation height dh ( t , → ) := max { n | ∃ s . t → n s } dc R ( n ) = max { dh ( f ( ⃗ → R ) | f ( ⃗ s ) , − s ) of size up to n } R ( n ) = max { dh ( f ( ⃗ v ) , → R ) | f ( ⃗ − v ) and ⃗ of size up to n } � �� �

  7. ; C – theory recently reformulated in context of many-sorted TRSs – fast and powerful – automated, amortised cost analysis of functional programs http://raml.tcs.ifi.lmu.de/prototype – RAML prototype http://cl-informatik.uibk.ac.at/software/tct T – T Automated Complexity Analysis of TRSs http://dfa.imn.htwk-leipzig.de/matchbox – Matchbox/Poly http://cl-informatik.uibk.ac.at/software/cat – Cat http://aprove.informatik.rwth-aachen.de – AProVE [Hofmann and Moser, 2014] • part of annual termination competition since 2008 • Tools

  8. ; C – theory recently reformulated in context of many-sorted TRSs – fast and powerful – automated, amortised cost analysis of functional programs http://raml.tcs.ifi.lmu.de/prototype – RAML prototype http://cl-informatik.uibk.ac.at/software/tct T – T Automated Complexity Analysis of TRSs http://dfa.imn.htwk-leipzig.de/matchbox – Matchbox/Poly http://cl-informatik.uibk.ac.at/software/cat – Cat http://aprove.informatik.rwth-aachen.de – AProVE [Hofmann and Moser, 2014] • part of annual termination competition since 2008 • Tools

  9. ; C – theory recently reformulated in context of many-sorted TRSs – fast and powerful – automated, amortised cost analysis of functional programs http://raml.tcs.ifi.lmu.de/prototype – RAML prototype http://cl-informatik.uibk.ac.at/software/tct T – T Automated Complexity Analysis of TRSs http://dfa.imn.htwk-leipzig.de/matchbox – Matchbox/Poly http://cl-informatik.uibk.ac.at/software/cat – Cat http://aprove.informatik.rwth-aachen.de – AProVE [Hofmann and Moser, 2014] • part of annual termination competition since 2008 • Tools

  10. ; Persistency 3. innermost termination – … [Iwama, 2003; 2004] locally confluent overlay TRSs – non-overlapping or [Aoto, 1998] – all variables of same sort [Zantema,1994] non-duplicating TRSs – non-collapsing or 2. termination 1. confluence Definition [Iwama, 2004] [Aoto and Toyama, 1997] property P is persistent if for all many-sorted TRS R P ( R ) ⇐ ⇒ P (Θ( R )) • Θ( R ) denotes un(i)sorted TRS underlying R ✔ ✗ ✔ ✔ ✔ ✔

  11. ; Persistency 3. innermost termination – … [Iwama, 2003; 2004] locally confluent overlay TRSs – non-overlapping or [Aoto, 1998] – all variables of same sort [Zantema,1994] non-duplicating TRSs – non-collapsing or 2. termination 1. confluence Definition [Iwama, 2004] [Aoto and Toyama, 1997] property P is persistent if for all many-sorted TRS R P ( R ) ⇐ ⇒ P (Θ( R )) • Θ( R ) denotes un(i)sorted TRS underlying R ✔ ✗ ✔ ✔ ✔ ✔

  12. ; Persistency 3. innermost termination – … [Iwama, 2003; 2004] locally confluent overlay TRSs – non-overlapping or [Aoto, 1998] – all variables of same sort [Zantema,1994] non-duplicating TRSs – non-collapsing or 2. termination 1. confluence Definition [Iwama, 2004] [Aoto and Toyama, 1997] property P is persistent if for all many-sorted TRS R P ( R ) ⇐ ⇒ P (Θ( R )) • Θ( R ) denotes un(i)sorted TRS underlying R ✔ ✗ ✔ ✔ ✔ ✔

  13. ; Persistency 3. innermost termination – … [Iwama, 2003; 2004] locally confluent overlay TRSs – non-overlapping or [Aoto, 1998] – all variables of same sort [Zantema,1994] non-duplicating TRSs – non-collapsing or 2. termination 1. confluence Definition [Iwama, 2004] [Aoto and Toyama, 1997] property P is persistent if for all many-sorted TRS R P ( R ) ⇐ ⇒ P (Θ( R )) • Θ( R ) denotes un(i)sorted TRS underlying R ✔ ✗ ✔ ✔ ✔ ✔

  14. ; Persistency 3. innermost termination – … [Iwama, 2003; 2004] locally confluent overlay TRSs – non-overlapping or [Aoto, 1998] – all variables of same sort [Zantema,1994] non-duplicating TRSs – non-collapsing or 2. termination 1. confluence Definition [Iwama, 2004] [Aoto and Toyama, 1997] property P is persistent if for all many-sorted TRS R P ( R ) ⇐ ⇒ P (Θ( R )) • Θ( R ) denotes un(i)sorted TRS underlying R ✔ ✗ ✔ ✔ ✔ ✔

  15. ; Sorted Rewriting notations (i) 3. function symbols are equipped with sort declaration 4. term is well-sorted according to rules 1. finite set of sorts S 2. for each sort α ∈ S , set of sorted variables V α = { x α , y α , . . . } f :: ( α 1 , . . . , α k ) → α x ∈ V α t 1 :: α 1 . . . t k :: α k f :: ( α 1 , . . . , α k ) → α ( Var ) ( Fun ) x :: α f ( t 1 , . . . , t k ) :: α

  16. ; Sorted Rewriting notations (i) 3. function symbols are equipped with sort declaration 4. term is well-sorted according to rules 1. finite set of sorts S 2. for each sort α ∈ S , set of sorted variables V α = { x α , y α , . . . } f :: ( α 1 , . . . , α k ) → α x ∈ V α t 1 :: α 1 . . . t k :: α k f :: ( α 1 , . . . , α k ) → α ( Var ) ( Fun ) x :: α f ( t 1 , . . . , t k ) :: α

  17. ; Sorted Rewriting notations (ii) 5. many-sorted TRS R satisfies for each l → r ∈ R : l :: α and r :: α for some sort α ∈ S 6. rewrite relation − → R defined on well-sorted terms only

  18. ; Sorted Rewriting notations (ii) 5. many-sorted TRS R satisfies for each l → r ∈ R : l :: α and r :: α for some sort α ∈ S 6. rewrite relation − → R defined on well-sorted terms only

  19. ; Theorem proof outline. every reduction Main Result simulated stepwise by The (innermost) runtime-complexity functions of R and Θ( R ) coincide. • rc ( i ) Θ( R ) ( n ) ⩽ rc ( i ) R ( n ) : ( i ) ( i ) ( i ) f ( v 1 , . . . , v n ) − → Θ( R ) t 1 − → Θ( R ) t 2 − → Θ( R ) · · · ( i ) ( i ) ( i ) f ( v ′ 1 , . . . , v ′ t ′ t ′ n ) − → R − → R − → R · · · 1 2 where | v ′ i | ⩽ | v i | . • rc ( i ) Θ( R ) ( n ) ⩾ rc ( i ) R ( n ) : trivial

  20. ; Theorem proof outline. every reduction Main Result simulated stepwise by The (innermost) runtime-complexity functions of R and Θ( R ) coincide. • rc ( i ) Θ( R ) ( n ) ⩽ rc ( i ) R ( n ) : ( i ) ( i ) ( i ) f ( v 1 , . . . , v n ) − → Θ( R ) t 1 − → Θ( R ) t 2 − → Θ( R ) · · · ( i ) ( i ) ( i ) f ( v ′ 1 , . . . , v ′ t ′ t ′ n ) − → R − → R − → R · · · 1 2 where | v ′ i | ⩽ | v i | . • rc ( i ) Θ( R ) ( n ) ⩾ rc ( i ) R ( n ) : trivial

  21. ; Persistency Toyama’s example Example where TRS R T consists of f ( 0 , 1 , x ) → f ( x , x , x ) g ( y , z ) → y g ( y , z ) → z 0 :: • 1 :: • f :: ( • , • , • ) → • g :: ( • , • ) → ⋆ • uni-sorted variant Θ( R T ) gives cycle f ( 0 , 1 , g ( 0 , 1 )) − → Θ( R T ) f ( g ( 0 , 1 ) , g ( 0 , 1 ) , g ( 0 , 1 )) − → Θ( R T ) f ( 0 , g ( 0 , 1 ) , g ( 0 , 1 )) − → Θ( R T ) f ( 0 , 1 , g ( 0 , 1 )) • R T is terminating

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend