SLIDE 1
Tyrolean Complexity Tool: Features and Usage Georg Moser Andreas - - PowerPoint PPT Presentation
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 2
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
History
2008
version 1.0 extension to termination prover T T T 2
◮ 3 dedicated complexity techniques
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
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
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
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
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
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
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
Command Line Interface
1 runs on GNU/Linux
$ tct [ options ] <file> termcomp or tpdb format
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
Command Line Interface
1 runs on GNU/Linux
$ tct [ options , -s <search strategy> ] <file> demo
SLIDE 15
Command Line Interface
1 runs on GNU/Linux
$ tct [ options , -s <search strategy> ] <file>
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
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
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
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
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
Transformations
◮ processors often generate sub-problems
⊢ P1 : f1 · · · ⊢ Pn : fn ⊢ P : f
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
Transformations
Lifting and Combinators
◮ lifting to strategies
- t >
> | s and t > > | | s s . . . . ⊢ P1 : f1 · · · s . . . . ⊢ Pn : fn ⊢ P : f t
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
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
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
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
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
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
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
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
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
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
Interactive Interface
◮ run by command tct -i
SLIDE 35
Interactive Interface
◮ run by command tct -i ◮ ghci & T
C T library & proof state proof & list of open problems
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
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
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
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
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