Tyrolean Complexity Tool: Features and Usage Georg Moser Andreas - - PowerPoint PPT Presentation

tyrolean complexity tool features and usage
SMART_READER_LITE
LIVE PREVIEW

Tyrolean Complexity Tool: Features and Usage Georg Moser Andreas - - PowerPoint PPT Presentation

Tyrolean Complexity Tool: Features and Usage Georg Moser Andreas Schnabl Martin Avanzini Institute of Computer Science University of Innsbruck, Austria June 16, 2013 Tyrolean Complexity Tool T T C (runtime) complexity analyser for term


slide-1
SLIDE 1

Tyrolean Complexity Tool: Features and Usage

Martin Avanzini Georg Moser Andreas Schnabl

Institute of Computer Science University of Innsbruck, Austria

June 16, 2013

slide-2
SLIDE 2

Tyrolean Complexity Tool T C T

◮ (runtime) complexity analyser for term rewrite systems (TRSs)

http://cl-informatik.uibk.ac.at/software/tct

slide-3
SLIDE 3

Tyrolean Complexity Tool T C T

◮ (runtime) complexity analyser for term rewrite systems (TRSs)

http://cl-informatik.uibk.ac.at/software/tct

T C T

O(nk) don’t know

mergesort(nil) → nil mergesort(x : nil) → x : nil mergesort(x : y : ys) → mergesort’(msplit(x : y : ys)) mergesort’(pair(xs,ys)) → merge(mergesort(xs),mer . . .

slide-4
SLIDE 4

History

2008

version 1.0 extension to termination prover T T T 2

◮ 3 dedicated complexity techniques

slide-5
SLIDE 5

History

2008

version 1.0 extension to termination prover T T T 2

◮ 3 dedicated complexity techniques

2009

version 1.5 new implementation

◮ in Haskell ◮ 9 methods implemented ◮ ≈ 3.400 lines of code

slide-6
SLIDE 6

History

2008

version 1.0 extension to termination prover T T T 2

◮ 3 dedicated complexity techniques

2009

version 1.5 new implementation

◮ in Haskell ◮ 9 methods implemented ◮ ≈ 3.400 lines of code

2013

version 2.0 current version

◮ 23 methods implemented ◮ ≈ 13.000 lines of code / 4.000 lines of comment

slide-7
SLIDE 7

Interfaces

1 web

http://cl-informatik.uibk.ac.at/software/tct

2 command line

  • automatic mode
  • customisable through search strategies

3 interactive

  • semi-automatic mode
slide-8
SLIDE 8

Interfaces

1 web

http://cl-informatik.uibk.ac.at/software/tct

2 command line

  • automatic mode
  • customisable through search strategies

3 interactive

  • semi-automatic mode
slide-9
SLIDE 9

Interfaces

1 web

http://cl-informatik.uibk.ac.at/software/tct

2 command line

  • automatic mode
  • customisable through search strategies

3 interactive

  • semi-automatic mode

demo

slide-10
SLIDE 10

Interfaces

1 web

http://cl-informatik.uibk.ac.at/software/tct

2 command line

  • automatic mode
  • customisable through search strategies

3 interactive

  • semi-automatic mode
slide-11
SLIDE 11

Interfaces

1 web

http://cl-informatik.uibk.ac.at/software/tct

2 command line

  • automatic mode
  • customisable through search strategies

3 interactive

  • semi-automatic mode
slide-12
SLIDE 12

Command Line Interface

1 runs on GNU/Linux

$ tct [ options ] <file> termcomp or tpdb format

slide-13
SLIDE 13

Command Line Interface

1 runs on GNU/Linux

$ tct [ options , -s <search strategy> ] <file> termcomp or tpdb format S-expression syntax (<name> [:<argname> <arg>]* [<arg>]*)

◮ matrix ◮ matrix :degree 2 ◮ fastest (matrix :degree 2)

(timeout 3 (bounds :enrichment match))

slide-14
SLIDE 14

Command Line Interface

1 runs on GNU/Linux

$ tct [ options , -s <search strategy> ] <file> demo

slide-15
SLIDE 15

Command Line Interface

1 runs on GNU/Linux

$ tct [ options , -s <search strategy> ] <file>

slide-16
SLIDE 16

Command Line Interface

1 runs on GNU/Linux

$ tct [ options , -s <search strategy> ] <file>

2 configured in ~/.tct/tct.hs import Tct.Configuration import Tct.Interactive import Tct.Instances import qualified Termlib.Repl as TR main :: IO () main = tct config config :: Config config = defaultConfig

slide-17
SLIDE 17

Customisation

import Tct.Configuration import Tct.Interactive import Tct.Instances import qualified Termlib.Repl as TR main = tct config config = defaultConfig { strategies = strategies } where strategies = [ matrices : : : strategy "matrices" ( optional naturalArg "start" (Nat 1) : + : naturalArg ) , withDP : : : strategy "withDP" ] matrices (Nat start : + : Nat n) = fastest [ matrix ‘withDimension‘ d ‘withBits‘ bitsForDimension d | d <- [start..start+n] ] where bitsForDimension d | d < 3 = 2 | otherwise = 1 withDP = ...

slide-18
SLIDE 18

Customisation

import Tct.Configuration import Tct.Interactive import Tct.Instances import qualified Termlib.Repl as TR main = tct config config = defaultConfig { strategies = strategies } where strategies = [ matrices : : : strategy "matrices" ( optional naturalArg "start" (Nat 1) : + : naturalArg ) , withDP : : : strategy "withDP" ] matrices (Nat start : + : Nat n) = fastest [ matrix ‘withDimension‘ d ‘withBits‘ bitsForDimension d | d <- [start..start+n] ] where bitsForDimension d | d < 3 = 2 | otherwise = 1 withDP = ...

search strategy declaration <code> : : : strategy "<name>" [<parameters-declaration>] search strategy implementation

slide-19
SLIDE 19

Proof Search Strategies

◮ processors

  • matrix
  • poly
  • popstar
  • . . .

◮ processor modifiers

  • <processor> ‘withDegree‘ <deg>
  • <processor> ‘withBits‘ <bits>
  • . . .

◮ combinators

  • timeout <secs> <strategy>
  • best <strategy> · · · <strategy>
  • fastest <strategy> · · · <strategy>
  • ite <strategy> <strategy> <strategy>
  • . . .
slide-20
SLIDE 20

Customisation

import Tct.Configuration import Tct.Interactive import Tct.Instances import qualified Termlib.Repl as TR main = tct config config = defaultConfig { strategies = strategies } where strategies = [ matrices : : : strategy "matrices" ( optional naturalArg "start" (Nat 1) : + : naturalArg ) , withDP : : : strategy "withDP" ] matrices (Nat start : + : Nat n) = fastest [ matrix ‘withDimension‘ d ‘withBits‘ bitsForDimension d | d <- [start..start+n] ] where bitsForDimension d | d < 3 = 2 | otherwise = 1 withDP = ...

slide-21
SLIDE 21

Transformations

◮ processors often generate sub-problems

⊢ P1 : f1 · · · ⊢ Pn : fn ⊢ P : f

slide-22
SLIDE 22

Transformations

◮ processors often generate sub-problems

⊢ P1 : f1 · · · ⊢ Pn : fn ⊢ P : f

◮ implemented as transformations in T

C T

  • dependencyPairs and dependencyTuples
  • decompose and decomposeDG
  • pathAnalysis
  • weightGap
  • . . .
slide-23
SLIDE 23

Transformations

Lifting and Combinators

◮ lifting to strategies

  • t >

> | s and t > > | | s s . . . . ⊢ P1 : f1 · · · s . . . . ⊢ Pn : fn ⊢ P : f t

slide-24
SLIDE 24

Transformations

Lifting and Combinators

◮ lifting to strategies

  • t >

> | s and t > > | | s

◮ combinators

  • t1 >

> > t2 ⊢ Q1 : g1 · · · ⊢ Qk : gk ⊢ P1 : f1 t2 · · · ⊢ Ql : gl · · · ⊢ Qm : gm ⊢ Pn : fn t2 ⊢ P : f t1

slide-25
SLIDE 25

Transformations

Lifting and Combinators

◮ lifting to strategies

  • t >

> | s and t > > | | s

◮ combinators

  • t1 >

> > t2

  • t1 <> t2 and t1 <

| > t2 ⊢ P1 : f1 · · · ⊢ Pm : fm ⊢ P : f t1

  • r

⊢ Q1 : g1 · · · ⊢ Qn : gn ⊢ P : f t2

slide-26
SLIDE 26

Transformations

Lifting and Combinators

◮ lifting to strategies

  • t >

> | s and t > > | | s

◮ combinators

  • t1 >

> > t2

  • t1 <> t2 and t1 <

| > t2

  • try t and force t
slide-27
SLIDE 27

Transformations

Lifting and Combinators

◮ lifting to strategies

  • t >

> | s and t > > | | s

◮ combinators

  • t1 >

> > t2

  • t1 <> t2 and t1 <

| > t2

  • try t and force t
  • exhaustively t = t >

> > try (exhaustively t)

slide-28
SLIDE 28

Transformations

Example

withDP = (dps <> dts) > > > try (exhaustively decomposeIndependent) > > > try cleanSuffix > > > try usableRules where dps = dependencyPairs > > > try usableRules > > > timeout 5 wgOnRules dts = dependencyTuples wgOnRules = weightgap ‘withDimension‘ 1 ‘wgOn‘ WgOnTrs

slide-29
SLIDE 29

Transformations

Example

withDP = (dps <> dts) > > > try (exhaustively decomposeIndependent) > > > try cleanSuffix > > > try usableRules where dps = dependencyPairs > > > try usableRules > > > timeout 5 wgOnRules dts = dependencyTuples wgOnRules = weightgap ‘withDimension‘ 1 ‘wgOn‘ WgOnTrs

slide-30
SLIDE 30

Transformations

Example

withDP = (dps <> dts) > > > try (exhaustively decomposeIndependent) > > > try cleanSuffix > > > try usableRules where dps = dependencyPairs > > > try usableRules > > > timeout 5 wgOnRules dts = dependencyTuples wgOnRules = weightgap ‘withDimension‘ 1 ‘wgOn‘ WgOnTrs

continue if usableRules fails abort if timeout 5 wgOnRules fails

slide-31
SLIDE 31

Transformations

Example

withDP = (dps <> dts) > > > try (exhaustively decomposeIndependent) > > > try cleanSuffix > > > try usableRules where dps = dependencyPairs > > > try usableRules > > > timeout 5 wgOnRules dts = dependencyTuples wgOnRules = weightgap ‘withDimension‘ 1 ‘wgOn‘ WgOnTrs

slide-32
SLIDE 32

Transformations

Example

withDP = (dps <> dts) > > > try (exhaustively decomposeIndependent) > > > try cleanSuffix > > > try usableRules where dps = dependencyPairs > > > try usableRules > > > timeout 5 wgOnRules dts = dependencyTuples wgOnRules = weightgap ‘withDimension‘ 1 ‘wgOn‘ WgOnTrs

slide-33
SLIDE 33

Interfaces

1 web

http://cl-informatik.uibk.ac.at/software/tct

2 command line

  • automatic mode
  • customisable through search strategies

3 interactive

  • semi-automatic mode
slide-34
SLIDE 34

Interactive Interface

◮ run by command tct -i

slide-35
SLIDE 35

Interactive Interface

◮ run by command tct -i ◮ ghci & T

C T library & proof state proof & list of open problems

slide-36
SLIDE 36

Interactive Interface

◮ run by command tct -i ◮ ghci & T

C T library & proof state basic functionality

1 modify proof state

  • load "<filename>"
  • apply method
  • select lst and unselect lst

proof & list of open problems

slide-37
SLIDE 37

Interactive Interface

◮ run by command tct -i ◮ ghci & T

C T library & proof state basic functionality

1 modify proof state

  • load "<filename>"
  • apply method
  • select lst and unselect lst

2 history

  • undo, reset

proof & list of open problems

slide-38
SLIDE 38

Interactive Interface

◮ run by command tct -i ◮ ghci & T

C T library & proof state basic functionality

1 modify proof state

  • load "<filename>"
  • apply method
  • select lst and unselect lst

2 history

  • undo, reset

3 inspect proof state

  • state and proof
  • problems, uargs, wdgs, . . .
  • writeProof "<filename>"

proof & list of open problems

slide-39
SLIDE 39

Interactive Interface

◮ run by command tct -i ◮ ghci & T

C T library & proof state basic functionality

1 modify proof state

  • load "<filename>"
  • apply method
  • select lst and unselect lst

2 history

  • undo, reset

3 inspect proof state

  • state and proof
  • problems, uargs, wdgs, . . .
  • writeProof "<filename>"

proof & list of open problems demo

slide-40
SLIDE 40

Interactive Interface

◮ run by command tct -i ◮ ghci & T

C T library & proof state basic functionality

1 modify proof state

  • load "<filename>"
  • apply method
  • select lst and unselect lst

2 history

  • undo, reset

3 inspect proof state

  • state and proof
  • problems, uargs, wdgs, . . .
  • writeProof "<filename>"

proof & list of open problems

slide-41
SLIDE 41

Conclusion

T C T is a complexity analyser for TRSs

◮ open source ◮ implements majority of techniques known for polynomial complexity

analysis

◮ automatic & interactive mode