o
play

O mputational gic L Complexity Analysis by Graph Rewriting Martin - PowerPoint PPT Presentation

C O mputational gic L Complexity Analysis by Graph Rewriting Martin Avanzini and Georg Moser Computational Logic Faculty of Computer Science, University of Innsbruck FLOPS 2010 MA& GM (ICS @ UIBK) Complexity Analysis of Graph Rewriting


  1. C O mputational gic L Complexity Analysis by Graph Rewriting Martin Avanzini and Georg Moser Computational Logic Faculty of Computer Science, University of Innsbruck FLOPS 2010

  2. MA& GM (ICS @ UIBK) Complexity Analysis of Graph Rewriting 2/17

  3. Term Rewriting First Order Functional Program d(c) = 0 ➂ d( x + y ) = d( x ) + d( y ) ➀ ➁ d( x × y ) = d( x ) × y + x × d( y ) ➃ d( x − y ) = d( x ) − d( y ) data Exp = Zero 0 | Const c | Times Exp Exp e 1 × e 2 | Plus Exp Exp e 1 + e 2 | Minus Exp Exp e 1 − e 2 MA& GM (ICS @ UIBK) Complexity Analysis of Graph Rewriting 3/17

  4. Term Rewriting First Order Functional Program d(c) = 0 ➂ d( x + y ) = d( x ) + d( y ) ➀ ➁ d( x × y ) = d( x ) × y + x × d( y ) ➃ d( x − y ) = d( x ) − d( y ) Underlying Computation d(c + (c × c)) MA& GM (ICS @ UIBK) Complexity Analysis of Graph Rewriting 3/17

  5. Term Rewriting First Order Functional Program d(c) = 0 ➂ d( x + y ) = d( x ) + d( y ) ➀ ➁ d( x × y ) = d( x ) × y + x × d( y ) ➃ d( x − y ) = d( x ) − d( y ) Underlying Computation d(c + (c × c)) MA& GM (ICS @ UIBK) Complexity Analysis of Graph Rewriting 3/17

  6. Term Rewriting First Order Functional Program d(c) = 0 ➂ d( x + y ) = d( x ) + d( y ) ➀ ➁ d( x × y ) = d( x ) × y + x × d( y ) ➃ d( x − y ) = d( x ) − d( y ) Underlying Computation = d(c + (c × c)) d(c) + d( c × c ) MA& GM (ICS @ UIBK) Complexity Analysis of Graph Rewriting 3/17

  7. Term Rewriting First Order Functional Program d(c) = 0 ➂ d( x + y ) = d( x ) + d( y ) ➀ ➁ d( x × y ) = d( x ) × y + x × d( y ) ➃ d( x − y ) = d( x ) − d( y ) Underlying Computation = d(c + (c × c)) d(c) + d( c × c ) = 0 + d(c × c) MA& GM (ICS @ UIBK) Complexity Analysis of Graph Rewriting 3/17

  8. Term Rewriting First Order Functional Program d(c) = 0 ➂ d( x + y ) = d( x ) + d( y ) ➀ ➁ d( x × y ) = d( x ) × y + x × d( y ) ➃ d( x − y ) = d( x ) − d( y ) Underlying Computation = d(c + (c × c)) d(c) + d( c × c ) = 0 + d(c × c) = 0 + d(c) × c + c × d(c) MA& GM (ICS @ UIBK) Complexity Analysis of Graph Rewriting 3/17

  9. Term Rewriting First Order Functional Program d(c) = 0 ➂ d( x + y ) = d( x ) + d( y ) ➀ ➁ d( x × y ) = d( x ) × y + x × d( y ) ➃ d( x − y ) = d( x ) − d( y ) Underlying Computation = d(c + (c × c)) d(c) + d( c × c ) = 0 + d(c × c) = 0 + d(c) × c + c × d(c) = 0 + 0 × c + c × d(c) MA& GM (ICS @ UIBK) Complexity Analysis of Graph Rewriting 3/17

  10. Term Rewriting First Order Functional Program d(c) = 0 ➂ d( x + y ) = d( x ) + d( y ) ➀ ➁ d( x × y ) = d( x ) × y + x × d( y ) ➃ d( x − y ) = d( x ) − d( y ) Underlying Computation = d(c + (c × c)) d(c) + d( c × c ) = 0 + d(c × c) = 0 + d(c) × c + c × d(c) = 0 + 0 × c + c × d(c) = 0 + 0 × c + c × 0 MA& GM (ICS @ UIBK) Complexity Analysis of Graph Rewriting 3/17

  11. Term Rewriting First Order Functional Program d(c) = 0 ➂ d( x + y ) = d( x ) + d( y ) ➀ ➁ d( x × y ) = d( x ) × y + x × d( y ) ➃ d( x − y ) = d( x ) − d( y ) Underlying Computation = d(c + (c × c)) d(c) + d( c × c ) = 0 + d(c × c) = 0 + d(c) × c + c × d(c) = 0 + 0 × c + c × d(c) = 0 + 0 × c + c × 0 MA& GM (ICS @ UIBK) Complexity Analysis of Graph Rewriting 3/17

  12. Term Rewriting First Order Functional Program ≈ Term Rewrite System (TRS) d(c) → 0 ➂ d( x + y ) → d( x ) + d( y ) ➀ ➁ d( x × y ) → d( x ) × y + x × d( y ) ➃ d( x − y ) → d( x ) − d( y ) Underlying Computation ≈ Rewriting d(c + (c × c)) − → R d(c) + d( c × c ) − → R 0 + d(c × c) − → R 0 + d(c) × c + c × d(c) − → R 0 + 0 × c + c × d(c) − → R 0 + 0 × c + c × 0 MA& GM (ICS @ UIBK) Complexity Analysis of Graph Rewriting 3/17

  13. Term Rewriting First Order Functional Program ≈ Term Rewrite System (TRS) d(c) → 0 ➂ d( x + y ) → d( x ) + d( y ) ➀ ➁ d( x × y ) → d( x ) × y + x × d( y ) ➃ d( x − y ) → d( x ) − d( y ) Underlying Computation ≈ Rewriting → ! d(c + (c × c)) − R 0 + 0 × c + c × 0 MA& GM (ICS @ UIBK) Complexity Analysis of Graph Rewriting 3/17

  14. Term Rewriting First Order Functional Program ≈ Term Rewrite System (TRS) d(c) → 0 ➂ d( x + y ) → d( x ) + d( y ) ➀ ➁ d( x × y ) → d( x ) × y + x × d( y ) ➃ d( x − y ) → d( x ) − d( y ) Underlying Computation ≈ Rewriting → ! d(c + (c × c)) − R 0 + 0 × c + c × 0 ◮ above TRS computes differentiation of arithmetical expressions MA& GM (ICS @ UIBK) Complexity Analysis of Graph Rewriting 3/17

  15. Term Rewriting First Order Functional Program ≈ Term Rewrite System (TRS) d(c) → 0 ➂ d( x + y ) → d( x ) + d( y ) ➀ ➁ d( x × y ) → d( x ) × y + x × d( y ) ➃ d( x − y ) → d( x ) − d( y ) Underlying Computation ≈ Rewriting → ! d(c + (c × c)) − R 0 + 0 × c + c × 0 ◮ above TRS computes differentiation of arithmetical expressions Runtime Complexity number of reduction steps as function in the size of the initial terms MA& GM (ICS @ UIBK) Complexity Analysis of Graph Rewriting 3/17

  16. Term Rewriting Complexity ◮ innermost runtime complexity number of eager evaluation steps as function in the size of the initial terms MA& GM (ICS @ UIBK) Complexity Analysis of Graph Rewriting 4/17

  17. Term Rewriting Complexity ◮ innermost runtime complexity number of eager evaluation steps as function in the size of the initial terms rc i R ( n ) = max { dl( t , i − → R ) | size( t ) � n } i − → R ⊆ − → R is restriction to eager evaluation • ◮ derivation length dl( t , i i i i − → R ) = max { ℓ | ∃ ( t 1 , . . . , t ℓ ) . t − → R t 1 − → R . . . − → R t ℓ } MA& GM (ICS @ UIBK) Complexity Analysis of Graph Rewriting 4/17

  18. Term Rewriting Complexity ◮ innermost runtime complexity number of eager evaluation steps as function in the size of the initial terms rc i R ( n ) = max { dl( t , i − → R ) | size( t ) � n and arguments values } i − → R ⊆ − → R is restriction to eager evaluation • • measure complexity of direct function calls ◮ derivation length dl( t , i i i i − → R ) = max { ℓ | ∃ ( t 1 , . . . , t ℓ ) . t − → R t 1 − → R . . . − → R t ℓ } MA& GM (ICS @ UIBK) Complexity Analysis of Graph Rewriting 4/17

  19. Term Rewriting Complexity Analysis Example ➀ d(c) → 0 ➂ d( x + y ) → d( x ) + d( y ) ➁ d( x × y ) → d( x ) × y + x × d( y ) ➃ d( x − y ) → d( x ) − d( y ) MA& GM (ICS @ UIBK) Complexity Analysis of Graph Rewriting 5/17

  20. Term Rewriting Complexity Analysis Example ➀ d(c) → 0 ➂ d( x + y ) → d( x ) + d( y ) ➁ d( x × y ) → d( x ) × y + x × d( y ) ➃ d( x − y ) → d( x ) − d( y ) ◮ runtime complexity of above TRS is linear MA& GM (ICS @ UIBK) Complexity Analysis of Graph Rewriting 5/17

  21. Term Rewriting Complexity Analysis Example ➀ d(c) → 0 ➂ d( x + y ) → d( x ) + d( y ) ➁ d( x × y ) → d( x ) × y + x × d( y ) ➃ d( x − y ) → d( x ) − d( y ) ◮ runtime complexity of above TRS is linear ◮ this can be automatically verified $ tct -a rc -p -s "wdp (matrix :kind triangular)" dif.trs YES(?,O(n^1)) ’Weak Dependency Pairs’ ----------------------- Answer: YES(?,O(n^1)) Input Problem: runtime-complexity with respect to Rules: { D(c) -> 0() , D(*(x, y)) -> +(*(y, D(x)), *(x, D(y))) , D(+(x, y)) -> +(D(x), D(y)) , D(-(x, y)) -> -(D(x), D(y))} Proof Details: ... MA& GM (ICS @ UIBK) Complexity Analysis of Graph Rewriting 5/17

  22. Term Rewriting Complexity Analysis Example ➀ d(c) → 0 ➂ d( x + y ) → d( x ) + d( y ) ➁ d( x × y ) → d( x ) × y + x × d( y ) ➃ d( x − y ) → d( x ) − d( y ) ◮ runtime complexity of above TRS is linear ◮ this can be automatically verified is this proof really $ tct -a rc -p -s "wdp (matrix :kind triangular)" dif.trs YES(?,O(n^1)) meaningful? ’Weak Dependency Pairs’ ----------------------- Answer: YES(?,O(n^1)) Input Problem: runtime-complexity with respect to Rules: { D(c) -> 0() , D(*(x, y)) -> +(*(y, D(x)), *(x, D(y))) , D(+(x, y)) -> +(D(x), D(y)) , D(-(x, y)) -> -(D(x), D(y))} Proof Details: ... MA& GM (ICS @ UIBK) Complexity Analysis of Graph Rewriting 5/17

  23. Term Rewriting Complexity Analysis Example ➀ d(c) → 0 ➂ d( x + y ) → d( x ) + d( y ) ➁ d( x × y ) → d( x ) × y + x × d( y ) ➃ d( x − y ) → d( x ) − d( y ) ◮ runtime complexity of above TRS is linear ◮ this can be automatically verified is this proof really $ tct -a rc -p -s "wdp (matrix :kind triangular)" dif.trs YES(?,O(n^1)) a certificate for ’Weak Dependency Pairs’ polytime computability? ----------------------- Answer: YES(?,O(n^1)) Input Problem: runtime-complexity with respect to Rules: { D(c) -> 0() , D(*(x, y)) -> +(*(y, D(x)), *(x, D(y))) , D(+(x, y)) -> +(D(x), D(y)) , D(-(x, y)) -> -(D(x), D(y))} Proof Details: ... MA& GM (ICS @ UIBK) Complexity Analysis of Graph Rewriting 5/17

  24. Main Result Yes MA& GM (ICS @ UIBK) Complexity Analysis of Graph Rewriting 6/17

  25. Main Result Theorem If the (innermost) runtime-complexity of R is polynomially bounded, then each function f computed by R is polytime computable. R ( n ) � n k ⇒ f ∈ TIME(O( n 5 · ( k +1) )) rc i f computed by R MA& GM (ICS @ UIBK) Complexity Analysis of Graph Rewriting 6/17

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