├── sample ├── fib.cpp ├── instantiation_diagram.png ├── Makefile ├── fib.hpp ├── instantiated_templates.txt ├── instantiation_diagram.dot ├── fib.xml └── instantiation_diagram.svg ├── instantiated_templates ├── instantiation_diagram ├── README.md └── LICENSE.md /sample/fib.cpp: -------------------------------------------------------------------------------- 1 | #include "fib.hpp" 2 | 3 | int main() 4 | { 5 | return lazy_fib >::type::value; 6 | } 7 | 8 | -------------------------------------------------------------------------------- /sample/instantiation_diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sabel83/templight/master/sample/instantiation_diagram.png -------------------------------------------------------------------------------- /sample/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2013, Abel Sinkovics (abel@sinkovics.hu) 2 | # 3 | # This program is free software: you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation, either version 3 of the License, or 6 | # (at your option) any later version. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program. If not, see . 15 | 16 | BIN=.. 17 | 18 | all : generate 19 | 20 | instantiated_templates.txt : fib.xml ; $(BIN)/instantiated_templates $< > $@ 21 | OUT+=instantiated_templates.txt 22 | 23 | instantiation_diagram.dot : fib.xml ; $(BIN)/instantiation_diagram $< > $@ 24 | OUT+=instantiation_diagram.dot 25 | 26 | instantiation_diagram.svg : instantiation_diagram.dot ; dot -Tsvg $< -o $@ 27 | OUT+=instantiation_diagram.svg 28 | 29 | instantiation_diagram.png : instantiation_diagram.dot ; dot -Tpng $< -o $@ 30 | OUT+=instantiation_diagram.png 31 | 32 | generate : $(OUT) 33 | 34 | clean : ; -rm $(OUT) 35 | 36 | -------------------------------------------------------------------------------- /instantiated_templates: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | # Copyright (C) 2013, Abel Sinkovics (abel@sinkovics.hu) 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | 18 | import sys 19 | import xml.sax 20 | 21 | class TemplightHandler(xml.sax.ContentHandler): 22 | def __init__(self): 23 | self.result = [] 24 | 25 | def startElement(self, name, attrs): 26 | if name == 'Context': 27 | self.result.append(attrs['context']) 28 | 29 | def main(): 30 | if len(sys.argv) == 2: 31 | h = TemplightHandler() 32 | xml.sax.parse(sys.argv[1], h) 33 | for t in sorted(h.result): 34 | print t 35 | else: 36 | print 'Usage: %s ' % (sys.argv[0]) 37 | 38 | if __name__ == '__main__': 39 | main() 40 | 41 | -------------------------------------------------------------------------------- /sample/fib.hpp: -------------------------------------------------------------------------------- 1 | 2 | template 3 | struct int_ 4 | { 5 | typedef int_ type; 6 | static const int value; 7 | }; 8 | 9 | template 10 | const int int_::value = N; 11 | 12 | 13 | 14 | 15 | template 16 | struct bool_ 17 | { 18 | typedef bool_ type; 19 | static const bool value; 20 | }; 21 | 22 | template 23 | const bool bool_::value = B; 24 | 25 | 26 | 27 | 28 | template 29 | struct plus 30 | { 31 | typedef int_ type; 32 | }; 33 | 34 | template 35 | struct minus 36 | { 37 | typedef int_ type; 38 | }; 39 | 40 | template 41 | struct less 42 | { 43 | typedef bool_<(A::type::value < B::type::value)> type; 44 | }; 45 | 46 | 47 | 48 | template 49 | struct if_c 50 | { 51 | typedef T type; 52 | }; 53 | 54 | template 55 | struct if_c 56 | { 57 | typedef F type; 58 | }; 59 | 60 | template 61 | struct eval_if : if_c::type {}; 62 | 63 | 64 | template 65 | struct lazy_fib : 66 | eval_if< 67 | less >, 68 | int_<1>, 69 | plus< 70 | lazy_fib > >, 71 | lazy_fib > > 72 | > 73 | > 74 | {}; 75 | 76 | template 77 | struct strict_fib; 78 | 79 | template 80 | struct strict_fib_impl : 81 | plus< 82 | typename strict_fib >::type>::type, 83 | typename strict_fib >::type>::type 84 | > 85 | {}; 86 | 87 | template 88 | struct strict_fib : 89 | eval_if< 90 | typename less >::type, 91 | int_<1>, 92 | strict_fib_impl 93 | > 94 | {}; 95 | 96 | 97 | 98 | -------------------------------------------------------------------------------- /instantiation_diagram: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | # Copyright (C) 2013, Abel Sinkovics (abel@sinkovics.hu) 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | 18 | import sys 19 | import xml.sax 20 | 21 | class TemplightHandler(xml.sax.ContentHandler): 22 | def __init__(self): 23 | # A context -> unique id mapping 24 | self._ids = {} 25 | self._next_id = 0 26 | 27 | # Elements: (, , ) 28 | self._edges = [] 29 | 30 | # instantiation stack (The call-stack of template metaprograms) 31 | self._stack = [] 32 | 33 | self._in_template_begin = False 34 | 35 | def startElement(self, name, attrs): 36 | if name == 'TemplateBegin': 37 | self._in_template_begin = True 38 | elif name == 'TemplateEnd': 39 | self._stack.pop() 40 | self._in_template_begin = False 41 | elif name == 'Context' and self._in_template_begin: 42 | self.instantiation_requested(attrs['context']) 43 | 44 | def instantiation_requested(self, name): 45 | memoized = self.store(name) 46 | tid = self._ids[name] 47 | if len(self._stack) > 0: 48 | self._edges.append((self._stack[len(self._stack) - 1], tid, memoized)) 49 | self._stack.append(tid) 50 | 51 | # returns: was the node in the map? 52 | def store(self, name): 53 | if not self._ids.has_key(name): 54 | self._ids[name] = 't%d' % (self._next_id) 55 | self._next_id = self._next_id + 1 56 | return False 57 | else: 58 | return True 59 | 60 | def display(self): 61 | print 'digraph G {' 62 | print 63 | for name in self._ids.keys(): 64 | shortname = name[:name.find('<')] 65 | print ' %s [label="%s", shape=rectangle];' % (self._ids[name], shortname) 66 | print 67 | for (f, t, m) in self._edges: 68 | if m: 69 | style = "dashed" 70 | else: 71 | style = "solid" 72 | print ' %s -> %s [style=%s];' % (f, t, style) 73 | print 74 | print '}' 75 | 76 | def main(): 77 | if len(sys.argv) == 2: 78 | h = TemplightHandler() 79 | xml.sax.parse(sys.argv[1], h) 80 | h.display() 81 | else: 82 | print 'Usage: %s ' % (sys.argv[0]) 83 | 84 | if __name__ == '__main__': 85 | main() 86 | 87 | -------------------------------------------------------------------------------- /sample/instantiated_templates.txt: -------------------------------------------------------------------------------- 1 | bool_ 2 | bool_ 3 | bool_::value 4 | bool_ 5 | bool_ 6 | bool_ 7 | bool_::value 8 | eval_if, int_<2> >, int_<1>, plus, int_<1> > >, lazy_fib, int_<2> > > > > 9 | eval_if, int_<1> >, int_<2> >, int_<1>, plus, int_<1> >, int_<1> > >, lazy_fib, int_<1> >, int_<2> > > > > 10 | eval_if, int_<2> >, int_<2> >, int_<1>, plus, int_<2> >, int_<1> > >, lazy_fib, int_<2> >, int_<2> > > > > 11 | eval_if, int_<1> >, int_<1> >, int_<2> >, int_<1>, plus, int_<1> >, int_<1> >, int_<1> > >, lazy_fib, int_<1> >, int_<1> >, int_<2> > > > > 12 | eval_if, int_<1> >, int_<2> >, int_<2> >, int_<1>, plus, int_<1> >, int_<2> >, int_<1> > >, lazy_fib, int_<1> >, int_<2> >, int_<2> > > > > 13 | if_c, plus, int_<1> > >, lazy_fib, int_<2> > > > > 14 | if_c, plus, int_<1> >, int_<1> > >, lazy_fib, int_<1> >, int_<2> > > > > 15 | if_c 16 | if_c 17 | if_c, plus, int_<2> >, int_<1> > >, lazy_fib, int_<2> >, int_<2> > > > > 18 | if_c, plus, int_<1> >, int_<1> >, int_<1> > >, lazy_fib, int_<1> >, int_<1> >, int_<2> > > > > 19 | if_c, plus, int_<1> >, int_<2> >, int_<1> > >, lazy_fib, int_<1> >, int_<2> >, int_<2> > > > > 20 | int_<0> 21 | int_<0>::value 22 | int_<1> 23 | int_<1> 24 | int_<1> 25 | int_<1> 26 | int_<1> 27 | int_<1> 28 | int_<1> 29 | int_<1> 30 | int_<1> 31 | int_<1> 32 | int_<1> 33 | int_<1>::value 34 | int_<2> 35 | int_<2> 36 | int_<2> 37 | int_<2> 38 | int_<2> 39 | int_<2> 40 | int_<2> 41 | int_<2> 42 | int_<2> 43 | int_<2> 44 | int_<2>::value 45 | int_<3> 46 | int_<3> 47 | int_<3> 48 | int_<3> 49 | int_<3> 50 | int_<3>::value 51 | lazy_fib > 52 | lazy_fib, int_<1> > > 53 | lazy_fib, int_<2> > > 54 | lazy_fib, int_<1> >, int_<1> > > 55 | lazy_fib, int_<1> >, int_<2> > > 56 | less, int_<2> > 57 | less, int_<1> >, int_<2> > 58 | less, int_<2> >, int_<2> > 59 | less, int_<1> >, int_<1> >, int_<2> > 60 | less, int_<1> >, int_<2> >, int_<2> > 61 | minus, int_<1> > 62 | minus, int_<1> > 63 | minus, int_<1> > 64 | minus, int_<2> > 65 | minus, int_<1> >, int_<1> > 66 | minus, int_<1> >, int_<2> > 67 | plus, int_<1> > >, lazy_fib, int_<2> > > > 68 | plus, int_<1> >, int_<1> > >, lazy_fib, int_<1> >, int_<2> > > > 69 | -------------------------------------------------------------------------------- /sample/instantiation_diagram.dot: -------------------------------------------------------------------------------- 1 | digraph G { 2 | 3 | t35 [label="eval_if", shape=rectangle]; 4 | t11 [label="plus", shape=rectangle]; 5 | t8 [label="bool_", shape=rectangle]; 6 | t2 [label="less", shape=rectangle]; 7 | t16 [label="int_", shape=rectangle]; 8 | t14 [label="less", shape=rectangle]; 9 | t3 [label="int_", shape=rectangle]; 10 | t37 [label="minus", shape=rectangle]; 11 | t28 [label="eval_if", shape=rectangle]; 12 | t24 [label="bool_", shape=rectangle]; 13 | t13 [label="eval_if", shape=rectangle]; 14 | t0 [label="lazy_fib", shape=rectangle]; 15 | t33 [label="if_c", shape=rectangle]; 16 | t6 [label="int_", shape=rectangle]; 17 | t9 [label="if_c", shape=rectangle]; 18 | t20 [label="lazy_fib", shape=rectangle]; 19 | t4 [label="int_", shape=rectangle]; 20 | t27 [label="lazy_fib", shape=rectangle]; 21 | t7 [label="bool_", shape=rectangle]; 22 | t26 [label="if_c", shape=rectangle]; 23 | t18 [label="if_c", shape=rectangle]; 24 | t30 [label="minus", shape=rectangle]; 25 | t19 [label="plus", shape=rectangle]; 26 | t38 [label="if_c", shape=rectangle]; 27 | t17 [label="int_", shape=rectangle]; 28 | t5 [label="int_", shape=rectangle]; 29 | t12 [label="lazy_fib", shape=rectangle]; 30 | t10 [label="if_c", shape=rectangle]; 31 | t34 [label="lazy_fib", shape=rectangle]; 32 | t31 [label="int_", shape=rectangle]; 33 | t32 [label="int_", shape=rectangle]; 34 | t36 [label="less", shape=rectangle]; 35 | t29 [label="less", shape=rectangle]; 36 | t1 [label="eval_if", shape=rectangle]; 37 | t25 [label="bool_", shape=rectangle]; 38 | t22 [label="less", shape=rectangle]; 39 | t15 [label="minus", shape=rectangle]; 40 | t21 [label="eval_if", shape=rectangle]; 41 | t23 [label="minus", shape=rectangle]; 42 | 43 | t0 -> t1 [style=solid]; 44 | t1 -> t2 [style=solid]; 45 | t2 -> t3 [style=solid]; 46 | t2 -> t3 [style=dashed]; 47 | t2 -> t4 [style=solid]; 48 | t2 -> t5 [style=solid]; 49 | t2 -> t5 [style=dashed]; 50 | t2 -> t6 [style=solid]; 51 | t1 -> t7 [style=solid]; 52 | t1 -> t8 [style=solid]; 53 | t1 -> t9 [style=solid]; 54 | t1 -> t10 [style=solid]; 55 | t1 -> t11 [style=solid]; 56 | t11 -> t12 [style=solid]; 57 | t12 -> t13 [style=solid]; 58 | t13 -> t14 [style=solid]; 59 | t14 -> t15 [style=solid]; 60 | t15 -> t3 [style=dashed]; 61 | t15 -> t16 [style=solid]; 62 | t15 -> t16 [style=dashed]; 63 | t15 -> t17 [style=solid]; 64 | t14 -> t5 [style=dashed]; 65 | t13 -> t7 [style=dashed]; 66 | t13 -> t9 [style=dashed]; 67 | t13 -> t18 [style=solid]; 68 | t13 -> t19 [style=solid]; 69 | t19 -> t20 [style=solid]; 70 | t20 -> t21 [style=solid]; 71 | t21 -> t22 [style=solid]; 72 | t22 -> t23 [style=solid]; 73 | t23 -> t15 [style=dashed]; 74 | t23 -> t5 [style=dashed]; 75 | t23 -> t16 [style=dashed]; 76 | t22 -> t16 [style=dashed]; 77 | t22 -> t5 [style=dashed]; 78 | t21 -> t24 [style=solid]; 79 | t21 -> t25 [style=solid]; 80 | t21 -> t26 [style=solid]; 81 | t21 -> t16 [style=dashed]; 82 | t19 -> t16 [style=dashed]; 83 | t19 -> t27 [style=solid]; 84 | t27 -> t28 [style=solid]; 85 | t28 -> t29 [style=solid]; 86 | t29 -> t30 [style=solid]; 87 | t30 -> t15 [style=dashed]; 88 | t30 -> t5 [style=dashed]; 89 | t29 -> t31 [style=solid]; 90 | t29 -> t32 [style=solid]; 91 | t29 -> t5 [style=dashed]; 92 | t28 -> t24 [style=dashed]; 93 | t28 -> t33 [style=solid]; 94 | t28 -> t16 [style=dashed]; 95 | t19 -> t16 [style=dashed]; 96 | t11 -> t5 [style=dashed]; 97 | t11 -> t34 [style=solid]; 98 | t34 -> t35 [style=solid]; 99 | t35 -> t36 [style=solid]; 100 | t36 -> t37 [style=solid]; 101 | t37 -> t3 [style=dashed]; 102 | t37 -> t5 [style=dashed]; 103 | t36 -> t16 [style=dashed]; 104 | t36 -> t5 [style=dashed]; 105 | t35 -> t24 [style=dashed]; 106 | t35 -> t38 [style=solid]; 107 | t35 -> t16 [style=dashed]; 108 | t11 -> t16 [style=dashed]; 109 | 110 | } 111 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Utilities for templight 2 | 3 | Here you can find scripts for getting information from an XML trace 4 | generated by [Templight](http://plc.inf.elte.hu/templight): 5 | 6 | * `instantiated_templates` prints the list of templates that were instantiated. 7 | Every template goes into its own line. You can use tools like `grep` or `wc` 8 | to get further information. 9 | * `instantiation_diagram` generates a [Grapviz](http://www.graphviz.org/) 10 | diagram of the templates that were instantiated. 11 | 12 | ## Example 13 | 14 | In the `sample` directory you can find an example source code, the XML trace 15 | file and the generated output. 16 | 17 | The generated diagram: 18 | 19 | ![Sample instantiation diagram](sample/instantiation_diagram.png) 20 | 21 | The list of templates that were instantiated: 22 | 23 | ```cpp 24 | bool_ 25 | bool_ 26 | bool_::value 27 | bool_ 28 | bool_ 29 | bool_ 30 | bool_::value 31 | eval_if, int_<2> >, int_<1>, plus, int_<1> > >, lazy_fib, int_<2> > > > > 32 | eval_if, int_<1> >, int_<2> >, int_<1>, plus, int_<1> >, int_<1> > >, lazy_fib, int_<1> >, int_<2> > > > > 33 | eval_if, int_<2> >, int_<2> >, int_<1>, plus, int_<2> >, int_<1> > >, lazy_fib, int_<2> >, int_<2> > > > > 34 | eval_if, int_<1> >, int_<1> >, int_<2> >, int_<1>, plus, int_<1> >, int_<1> >, int_<1> > >, lazy_fib, int_<1> >, int_<1> >, int_<2> > > > > 35 | eval_if, int_<1> >, int_<2> >, int_<2> >, int_<1>, plus, int_<1> >, int_<2> >, int_<1> > >, lazy_fib, int_<1> >, int_<2> >, int_<2> > > > > 36 | if_c, plus, int_<1> > >, lazy_fib, int_<2> > > > > 37 | if_c, plus, int_<1> >, int_<1> > >, lazy_fib, int_<1> >, int_<2> > > > > 38 | if_c 39 | if_c 40 | if_c, plus, int_<2> >, int_<1> > >, lazy_fib, int_<2> >, int_<2> > > > > 41 | if_c, plus, int_<1> >, int_<1> >, int_<1> > >, lazy_fib, int_<1> >, int_<1> >, int_<2> > > > > 42 | if_c, plus, int_<1> >, int_<2> >, int_<1> > >, lazy_fib, int_<1> >, int_<2> >, int_<2> > > > > 43 | int_<0> 44 | int_<0>::value 45 | int_<1> 46 | int_<1> 47 | int_<1> 48 | int_<1> 49 | int_<1> 50 | int_<1> 51 | int_<1> 52 | int_<1> 53 | int_<1> 54 | int_<1> 55 | int_<1> 56 | int_<1>::value 57 | int_<2> 58 | int_<2> 59 | int_<2> 60 | int_<2> 61 | int_<2> 62 | int_<2> 63 | int_<2> 64 | int_<2> 65 | int_<2> 66 | int_<2> 67 | int_<2>::value 68 | int_<3> 69 | int_<3> 70 | int_<3> 71 | int_<3> 72 | int_<3> 73 | int_<3>::value 74 | lazy_fib > 75 | lazy_fib, int_<1> > > 76 | lazy_fib, int_<2> > > 77 | lazy_fib, int_<1> >, int_<1> > > 78 | lazy_fib, int_<1> >, int_<2> > > 79 | less, int_<2> > 80 | less, int_<1> >, int_<2> > 81 | less, int_<2> >, int_<2> > 82 | less, int_<1> >, int_<1> >, int_<2> > 83 | less, int_<1> >, int_<2> >, int_<2> > 84 | minus, int_<1> > 85 | minus, int_<1> > 86 | minus, int_<1> > 87 | minus, int_<2> > 88 | minus, int_<1> >, int_<1> > 89 | minus, int_<1> >, int_<2> > 90 | plus, int_<1> > >, lazy_fib, int_<2> > > > 91 | plus, int_<1> >, int_<1> > >, lazy_fib, int_<1> >, int_<2> > > > 92 | ``` 93 | 94 | ## License 95 | 96 | The tools are published under the 97 | [GNU General Public License, version 3](http://www.gnu.org/licenses/gpl.html). 98 | 99 | 100 | -------------------------------------------------------------------------------- /sample/fib.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | TemplateInstantiation 5 | 6 | fib_lazy_3.cpp|5|10 7 | 8 | 9 | 10 | 11 | TemplateInstantiation 12 | 13 | ./fib.hpp|66|3 14 | 15 | 16 | 17 | 18 | TemplateInstantiation 19 | 20 | ./fib.hpp|61|23 21 | 22 | 23 | 24 | 25 | TemplateInstantiation 26 | 27 | ./fib.hpp|43|18 28 | 29 | 30 | 31 | 32 | TemplateInstantiation 33 | 34 | 35 | 36 | 37 | Memoization 38 | 39 | fib_lazy_3.cpp|5|10 40 | 41 | 42 | 43 | 44 | Memoization 45 | 46 | 47 | 48 | 49 | TemplateInstantiation 50 | 51 | ./fib.hpp|43|27 52 | 53 | 54 | 55 | 56 | TemplateInstantiation 57 | 58 | 59 | 60 | 61 | TemplateInstantiation 62 | 63 | ./fib.hpp|43|35 64 | 65 | 66 | 67 | 68 | TemplateInstantiation 69 | 70 | 71 | 72 | 73 | Memoization 74 | 75 | fib_lazy_3.cpp|5|10 76 | 77 | 78 | 79 | 80 | Memoization 81 | 82 | 83 | 84 | 85 | TemplateInstantiation 86 | 87 | ./fib.hpp|43|44 88 | 89 | 90 | 91 | 92 | TemplateInstantiation 93 | 94 | 95 | 96 | 97 | TemplateInstantiation 98 | 99 | 100 | 101 | 102 | TemplateInstantiation 103 | 104 | ./fib.hpp|61|26 105 | 106 | 107 | 108 | 109 | TemplateInstantiation 110 | 111 | 112 | 113 | 114 | TemplateInstantiation 115 | 116 | ./fib.hpp|61|32 117 | 118 | 119 | 120 | 121 | TemplateInstantiation 122 | 123 | 124 | 125 | 126 | DeducedTemplateArgumentSubstitution 127 | 128 | ./fib.hpp|55|8 129 | 130 | 131 | 132 | 133 | DeducedTemplateArgumentSubstitution 134 | 135 | 136 | 137 | 138 | TemplateInstantiation 139 | 140 | ./fib.hpp|61|18 141 | 142 | 143 | 144 | 145 | TemplateInstantiation 146 | 147 | 148 | 149 | 150 | TemplateInstantiation 151 | 152 | ./fib.hpp|61|18 153 | 154 | 155 | 156 | 157 | TemplateInstantiation 158 | 159 | ./fib.hpp|31|16 160 | 161 | 162 | 163 | 164 | TemplateInstantiation 165 | 166 | ./fib.hpp|66|3 167 | 168 | 169 | 170 | 171 | TemplateInstantiation 172 | 173 | ./fib.hpp|61|23 174 | 175 | 176 | 177 | 178 | TemplateInstantiation 179 | 180 | ./fib.hpp|43|18 181 | 182 | 183 | 184 | 185 | Memoization 186 | 187 | fib_lazy_3.cpp|5|10 188 | 189 | 190 | 191 | 192 | Memoization 193 | 194 | 195 | 196 | 197 | TemplateInstantiation 198 | 199 | ./fib.hpp|37|33 200 | 201 | 202 | 203 | 204 | TemplateInstantiation 205 | 206 | 207 | 208 | 209 | Memoization 210 | 211 | fib_lazy_3.cpp|5|10 212 | 213 | 214 | 215 | 216 | Memoization 217 | 218 | 219 | 220 | 221 | TemplateInstantiation 222 | 223 | ./fib.hpp|37|42 224 | 225 | 226 | 227 | 228 | TemplateInstantiation 229 | 230 | 231 | 232 | 233 | TemplateInstantiation 234 | 235 | 236 | 237 | 238 | Memoization 239 | 240 | fib_lazy_3.cpp|5|10 241 | 242 | 243 | 244 | 245 | Memoization 246 | 247 | 248 | 249 | 250 | TemplateInstantiation 251 | 252 | 253 | 254 | 255 | Memoization 256 | 257 | fib_lazy_3.cpp|5|10 258 | 259 | 260 | 261 | 262 | Memoization 263 | 264 | 265 | 266 | 267 | DeducedTemplateArgumentSubstitution 268 | 269 | ./fib.hpp|55|8 270 | 271 | 272 | 273 | 274 | DeducedTemplateArgumentSubstitution 275 | 276 | 277 | 278 | 279 | TemplateInstantiation 280 | 281 | ./fib.hpp|61|18 282 | 283 | 284 | 285 | 286 | TemplateInstantiation 287 | 288 | 289 | 290 | 291 | TemplateInstantiation 292 | 293 | ./fib.hpp|61|18 294 | 295 | 296 | 297 | 298 | TemplateInstantiation 299 | 300 | ./fib.hpp|31|16 301 | 302 | 303 | 304 | 305 | TemplateInstantiation 306 | 307 | ./fib.hpp|66|3 308 | 309 | 310 | 311 | 312 | TemplateInstantiation 313 | 314 | ./fib.hpp|61|23 315 | 316 | 317 | 318 | 319 | TemplateInstantiation 320 | 321 | ./fib.hpp|43|18 322 | 323 | 324 | 325 | 326 | Memoization 327 | 328 | fib_lazy_3.cpp|5|10 329 | 330 | 331 | 332 | 333 | Memoization 334 | 335 | 336 | 337 | 338 | Memoization 339 | 340 | fib_lazy_3.cpp|5|10 341 | 342 | 343 | 344 | 345 | Memoization 346 | 347 | 348 | 349 | 350 | Memoization 351 | 352 | fib_lazy_3.cpp|5|10 353 | 354 | 355 | 356 | 357 | Memoization 358 | 359 | 360 | 361 | 362 | TemplateInstantiation 363 | 364 | 365 | 366 | 367 | Memoization 368 | 369 | fib_lazy_3.cpp|5|10 370 | 371 | 372 | 373 | 374 | Memoization 375 | 376 | 377 | 378 | 379 | Memoization 380 | 381 | fib_lazy_3.cpp|5|10 382 | 383 | 384 | 385 | 386 | Memoization 387 | 388 | 389 | 390 | 391 | TemplateInstantiation 392 | 393 | 394 | 395 | 396 | TemplateInstantiation 397 | 398 | ./fib.hpp|61|26 399 | 400 | 401 | 402 | 403 | TemplateInstantiation 404 | 405 | 406 | 407 | 408 | TemplateInstantiation 409 | 410 | ./fib.hpp|61|32 411 | 412 | 413 | 414 | 415 | TemplateInstantiation 416 | 417 | 418 | 419 | 420 | TemplateInstantiation 421 | 422 | ./fib.hpp|61|18 423 | 424 | 425 | 426 | 427 | TemplateInstantiation 428 | 429 | 430 | 431 | 432 | Memoization 433 | 434 | fib_lazy_3.cpp|5|10 435 | 436 | 437 | 438 | 439 | Memoization 440 | 441 | 442 | 443 | 444 | TemplateInstantiation 445 | 446 | 447 | 448 | 449 | TemplateInstantiation 450 | 451 | 452 | 453 | 454 | Memoization 455 | 456 | fib_lazy_3.cpp|5|10 457 | 458 | 459 | 460 | 461 | Memoization 462 | 463 | 464 | 465 | 466 | TemplateInstantiation 467 | 468 | ./fib.hpp|31|33 469 | 470 | 471 | 472 | 473 | TemplateInstantiation 474 | 475 | ./fib.hpp|66|3 476 | 477 | 478 | 479 | 480 | TemplateInstantiation 481 | 482 | ./fib.hpp|61|23 483 | 484 | 485 | 486 | 487 | TemplateInstantiation 488 | 489 | ./fib.hpp|43|18 490 | 491 | 492 | 493 | 494 | Memoization 495 | 496 | fib_lazy_3.cpp|5|10 497 | 498 | 499 | 500 | 501 | Memoization 502 | 503 | 504 | 505 | 506 | Memoization 507 | 508 | fib_lazy_3.cpp|5|10 509 | 510 | 511 | 512 | 513 | Memoization 514 | 515 | 516 | 517 | 518 | TemplateInstantiation 519 | 520 | 521 | 522 | 523 | TemplateInstantiation 524 | 525 | ./fib.hpp|43|21 526 | 527 | 528 | 529 | 530 | TemplateInstantiation 531 | 532 | 533 | 534 | 535 | TemplateInstantiation 536 | 537 | ./fib.hpp|43|27 538 | 539 | 540 | 541 | 542 | TemplateInstantiation 543 | 544 | 545 | 546 | 547 | Memoization 548 | 549 | fib_lazy_3.cpp|5|10 550 | 551 | 552 | 553 | 554 | Memoization 555 | 556 | 557 | 558 | 559 | TemplateInstantiation 560 | 561 | 562 | 563 | 564 | Memoization 565 | 566 | fib_lazy_3.cpp|5|10 567 | 568 | 569 | 570 | 571 | Memoization 572 | 573 | 574 | 575 | 576 | TemplateInstantiation 577 | 578 | ./fib.hpp|61|18 579 | 580 | 581 | 582 | 583 | TemplateInstantiation 584 | 585 | 586 | 587 | 588 | Memoization 589 | 590 | fib_lazy_3.cpp|5|10 591 | 592 | 593 | 594 | 595 | Memoization 596 | 597 | 598 | 599 | 600 | TemplateInstantiation 601 | 602 | 603 | 604 | 605 | TemplateInstantiation 606 | 607 | 608 | 609 | 610 | Memoization 611 | 612 | fib_lazy_3.cpp|5|10 613 | 614 | 615 | 616 | 617 | Memoization 618 | 619 | 620 | 621 | 622 | TemplateInstantiation 623 | 624 | 625 | 626 | 627 | TemplateInstantiation 628 | 629 | 630 | 631 | 632 | TemplateInstantiation 633 | 634 | 635 | 636 | 637 | Memoization 638 | 639 | fib_lazy_3.cpp|5|10 640 | 641 | 642 | 643 | 644 | Memoization 645 | 646 | 647 | 648 | 649 | TemplateInstantiation 650 | 651 | ./fib.hpp|31|33 652 | 653 | 654 | 655 | 656 | TemplateInstantiation 657 | 658 | ./fib.hpp|66|3 659 | 660 | 661 | 662 | 663 | TemplateInstantiation 664 | 665 | ./fib.hpp|61|23 666 | 667 | 668 | 669 | 670 | TemplateInstantiation 671 | 672 | ./fib.hpp|43|18 673 | 674 | 675 | 676 | 677 | Memoization 678 | 679 | fib_lazy_3.cpp|5|10 680 | 681 | 682 | 683 | 684 | Memoization 685 | 686 | 687 | 688 | 689 | Memoization 690 | 691 | fib_lazy_3.cpp|5|10 692 | 693 | 694 | 695 | 696 | Memoization 697 | 698 | 699 | 700 | 701 | TemplateInstantiation 702 | 703 | 704 | 705 | 706 | Memoization 707 | 708 | fib_lazy_3.cpp|5|10 709 | 710 | 711 | 712 | 713 | Memoization 714 | 715 | 716 | 717 | 718 | Memoization 719 | 720 | fib_lazy_3.cpp|5|10 721 | 722 | 723 | 724 | 725 | Memoization 726 | 727 | 728 | 729 | 730 | TemplateInstantiation 731 | 732 | 733 | 734 | 735 | Memoization 736 | 737 | fib_lazy_3.cpp|5|10 738 | 739 | 740 | 741 | 742 | Memoization 743 | 744 | 745 | 746 | 747 | TemplateInstantiation 748 | 749 | ./fib.hpp|61|18 750 | 751 | 752 | 753 | 754 | TemplateInstantiation 755 | 756 | 757 | 758 | 759 | Memoization 760 | 761 | fib_lazy_3.cpp|5|10 762 | 763 | 764 | 765 | 766 | Memoization 767 | 768 | 769 | 770 | 771 | TemplateInstantiation 772 | 773 | 774 | 775 | 776 | TemplateInstantiation 777 | 778 | 779 | 780 | 781 | Memoization 782 | 783 | fib_lazy_3.cpp|5|10 784 | 785 | 786 | 787 | 788 | Memoization 789 | 790 | 791 | 792 | 793 | TemplateInstantiation 794 | 795 | 796 | 797 | 798 | TemplateInstantiation 799 | 800 | 801 | 802 | 803 | TemplateInstantiation 804 | 805 | 806 | 807 | 808 | Memoization 809 | 810 | fib_lazy_3.cpp|5|10 811 | 812 | 813 | 814 | 815 | Memoization 816 | 817 | 818 | 819 | 820 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | # GNU GENERAL PUBLIC LICENSE 2 | 3 | Version 3, 29 June 2007 4 | 5 | Copyright (C) 2007 Free Software Foundation, Inc. 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | ## Preamble 10 | 11 | The GNU General Public License is a free, copyleft license for 12 | software and other kinds of works. 13 | 14 | The licenses for most software and other practical works are designed 15 | to take away your freedom to share and change the works. By contrast, 16 | the GNU General Public License is intended to guarantee your freedom to 17 | share and change all versions of a program--to make sure it remains free 18 | software for all its users. We, the Free Software Foundation, use the 19 | GNU General Public License for most of our software; it applies also to 20 | any other work released this way by its authors. You can apply it to 21 | your programs, too. 22 | 23 | When we speak of free software, we are referring to freedom, not 24 | price. Our General Public Licenses are designed to make sure that you 25 | have the freedom to distribute copies of free software (and charge for 26 | them if you wish), that you receive source code or can get it if you 27 | want it, that you can change the software or use pieces of it in new 28 | free programs, and that you know you can do these things. 29 | 30 | To protect your rights, we need to prevent others from denying you 31 | these rights or asking you to surrender the rights. Therefore, you have 32 | certain responsibilities if you distribute copies of the software, or if 33 | you modify it: responsibilities to respect the freedom of others. 34 | 35 | For example, if you distribute copies of such a program, whether 36 | gratis or for a fee, you must pass on to the recipients the same 37 | freedoms that you received. You must make sure that they, too, receive 38 | or can get the source code. And you must show them these terms so they 39 | know their rights. 40 | 41 | Developers that use the GNU GPL protect your rights with two steps: 42 | (1) assert copyright on the software, and (2) offer you this License 43 | giving you legal permission to copy, distribute and/or modify it. 44 | 45 | For the developers' and authors' protection, the GPL clearly explains 46 | that there is no warranty for this free software. For both users' and 47 | authors' sake, the GPL requires that modified versions be marked as 48 | changed, so that their problems will not be attributed erroneously to 49 | authors of previous versions. 50 | 51 | Some devices are designed to deny users access to install or run 52 | modified versions of the software inside them, although the manufacturer 53 | can do so. This is fundamentally incompatible with the aim of 54 | protecting users' freedom to change the software. The systematic 55 | pattern of such abuse occurs in the area of products for individuals to 56 | use, which is precisely where it is most unacceptable. Therefore, we 57 | have designed this version of the GPL to prohibit the practice for those 58 | products. If such problems arise substantially in other domains, we 59 | stand ready to extend this provision to those domains in future versions 60 | of the GPL, as needed to protect the freedom of users. 61 | 62 | Finally, every program is threatened constantly by software patents. 63 | States should not allow patents to restrict development and use of 64 | software on general-purpose computers, but in those that do, we wish to 65 | avoid the special danger that patents applied to a free program could 66 | make it effectively proprietary. To prevent this, the GPL assures that 67 | patents cannot be used to render the program non-free. 68 | 69 | The precise terms and conditions for copying, distribution and 70 | modification follow. 71 | 72 | ## TERMS AND CONDITIONS 73 | 74 | ### 0. Definitions. 75 | 76 | "This License" refers to version 3 of the GNU General Public License. 77 | 78 | "Copyright" also means copyright-like laws that apply to other kinds of 79 | works, such as semiconductor masks. 80 | 81 | "The Program" refers to any copyrightable work licensed under this 82 | License. Each licensee is addressed as "you". "Licensees" and 83 | "recipients" may be individuals or organizations. 84 | 85 | To "modify" a work means to copy from or adapt all or part of the work 86 | in a fashion requiring copyright permission, other than the making of an 87 | exact copy. The resulting work is called a "modified version" of the 88 | earlier work or a work "based on" the earlier work. 89 | 90 | A "covered work" means either the unmodified Program or a work based 91 | on the Program. 92 | 93 | To "propagate" a work means to do anything with it that, without 94 | permission, would make you directly or secondarily liable for 95 | infringement under applicable copyright law, except executing it on a 96 | computer or modifying a private copy. Propagation includes copying, 97 | distribution (with or without modification), making available to the 98 | public, and in some countries other activities as well. 99 | 100 | To "convey" a work means any kind of propagation that enables other 101 | parties to make or receive copies. Mere interaction with a user through 102 | a computer network, with no transfer of a copy, is not conveying. 103 | 104 | An interactive user interface displays "Appropriate Legal Notices" 105 | to the extent that it includes a convenient and prominently visible 106 | feature that (1) displays an appropriate copyright notice, and (2) 107 | tells the user that there is no warranty for the work (except to the 108 | extent that warranties are provided), that licensees may convey the 109 | work under this License, and how to view a copy of this License. If 110 | the interface presents a list of user commands or options, such as a 111 | menu, a prominent item in the list meets this criterion. 112 | 113 | ### 1. Source Code. 114 | 115 | The "source code" for a work means the preferred form of the work 116 | for making modifications to it. "Object code" means any non-source 117 | form of a work. 118 | 119 | A "Standard Interface" means an interface that either is an official 120 | standard defined by a recognized standards body, or, in the case of 121 | interfaces specified for a particular programming language, one that 122 | is widely used among developers working in that language. 123 | 124 | The "System Libraries" of an executable work include anything, other 125 | than the work as a whole, that (a) is included in the normal form of 126 | packaging a Major Component, but which is not part of that Major 127 | Component, and (b) serves only to enable use of the work with that 128 | Major Component, or to implement a Standard Interface for which an 129 | implementation is available to the public in source code form. A 130 | "Major Component", in this context, means a major essential component 131 | (kernel, window system, and so on) of the specific operating system 132 | (if any) on which the executable work runs, or a compiler used to 133 | produce the work, or an object code interpreter used to run it. 134 | 135 | The "Corresponding Source" for a work in object code form means all 136 | the source code needed to generate, install, and (for an executable 137 | work) run the object code and to modify the work, including scripts to 138 | control those activities. However, it does not include the work's 139 | System Libraries, or general-purpose tools or generally available free 140 | programs which are used unmodified in performing those activities but 141 | which are not part of the work. For example, Corresponding Source 142 | includes interface definition files associated with source files for 143 | the work, and the source code for shared libraries and dynamically 144 | linked subprograms that the work is specifically designed to require, 145 | such as by intimate data communication or control flow between those 146 | subprograms and other parts of the work. 147 | 148 | The Corresponding Source need not include anything that users 149 | can regenerate automatically from other parts of the Corresponding 150 | Source. 151 | 152 | The Corresponding Source for a work in source code form is that 153 | same work. 154 | 155 | ### 2. Basic Permissions. 156 | 157 | All rights granted under this License are granted for the term of 158 | copyright on the Program, and are irrevocable provided the stated 159 | conditions are met. This License explicitly affirms your unlimited 160 | permission to run the unmodified Program. The output from running a 161 | covered work is covered by this License only if the output, given its 162 | content, constitutes a covered work. This License acknowledges your 163 | rights of fair use or other equivalent, as provided by copyright law. 164 | 165 | You may make, run and propagate covered works that you do not 166 | convey, without conditions so long as your license otherwise remains 167 | in force. You may convey covered works to others for the sole purpose 168 | of having them make modifications exclusively for you, or provide you 169 | with facilities for running those works, provided that you comply with 170 | the terms of this License in conveying all material for which you do 171 | not control copyright. Those thus making or running the covered works 172 | for you must do so exclusively on your behalf, under your direction 173 | and control, on terms that prohibit them from making any copies of 174 | your copyrighted material outside their relationship with you. 175 | 176 | Conveying under any other circumstances is permitted solely under 177 | the conditions stated below. Sublicensing is not allowed; section 10 178 | makes it unnecessary. 179 | 180 | ### 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 181 | 182 | No covered work shall be deemed part of an effective technological 183 | measure under any applicable law fulfilling obligations under article 184 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 185 | similar laws prohibiting or restricting circumvention of such 186 | measures. 187 | 188 | When you convey a covered work, you waive any legal power to forbid 189 | circumvention of technological measures to the extent such circumvention 190 | is effected by exercising rights under this License with respect to 191 | the covered work, and you disclaim any intention to limit operation or 192 | modification of the work as a means of enforcing, against the work's 193 | users, your or third parties' legal rights to forbid circumvention of 194 | technological measures. 195 | 196 | ### 4. Conveying Verbatim Copies. 197 | 198 | You may convey verbatim copies of the Program's source code as you 199 | receive it, in any medium, provided that you conspicuously and 200 | appropriately publish on each copy an appropriate copyright notice; 201 | keep intact all notices stating that this License and any 202 | non-permissive terms added in accord with section 7 apply to the code; 203 | keep intact all notices of the absence of any warranty; and give all 204 | recipients a copy of this License along with the Program. 205 | 206 | You may charge any price or no price for each copy that you convey, 207 | and you may offer support or warranty protection for a fee. 208 | 209 | ### 5. Conveying Modified Source Versions. 210 | 211 | You may convey a work based on the Program, or the modifications to 212 | produce it from the Program, in the form of source code under the 213 | terms of section 4, provided that you also meet all of these conditions: 214 | 215 | - a) The work must carry prominent notices stating that you modified 216 | it, and giving a relevant date. 217 | - b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | - c) You must license the entire work, as a whole, under this 222 | License to anyone who comes into possession of a copy. This 223 | License will therefore apply, along with any applicable section 7 224 | additional terms, to the whole of the work, and all its parts, 225 | regardless of how they are packaged. This License gives no 226 | permission to license the work in any other way, but it does not 227 | invalidate such permission if you have separately received it. 228 | - d) If the work has interactive user interfaces, each must display 229 | Appropriate Legal Notices; however, if the Program has interactive 230 | interfaces that do not display Appropriate Legal Notices, your 231 | work need not make them do so. 232 | 233 | A compilation of a covered work with other separate and independent 234 | works, which are not by their nature extensions of the covered work, 235 | and which are not combined with it such as to form a larger program, 236 | in or on a volume of a storage or distribution medium, is called an 237 | "aggregate" if the compilation and its resulting copyright are not 238 | used to limit the access or legal rights of the compilation's users 239 | beyond what the individual works permit. Inclusion of a covered work 240 | in an aggregate does not cause this License to apply to the other 241 | parts of the aggregate. 242 | 243 | ### 6. Conveying Non-Source Forms. 244 | 245 | You may convey a covered work in object code form under the terms 246 | of sections 4 and 5, provided that you also convey the 247 | machine-readable Corresponding Source under the terms of this License, 248 | in one of these ways: 249 | 250 | - a) Convey the object code in, or embodied in, a physical product 251 | (including a physical distribution medium), accompanied by the 252 | Corresponding Source fixed on a durable physical medium 253 | customarily used for software interchange. 254 | - b) Convey the object code in, or embodied in, a physical product 255 | (including a physical distribution medium), accompanied by a 256 | written offer, valid for at least three years and valid for as 257 | long as you offer spare parts or customer support for that product 258 | model, to give anyone who possesses the object code either (1) a 259 | copy of the Corresponding Source for all the software in the 260 | product that is covered by this License, on a durable physical 261 | medium customarily used for software interchange, for a price no 262 | more than your reasonable cost of physically performing this 263 | conveying of source, or (2) access to copy the 264 | Corresponding Source from a network server at no charge. 265 | - c) Convey individual copies of the object code with a copy of the 266 | written offer to provide the Corresponding Source. This 267 | alternative is allowed only occasionally and noncommercially, and 268 | only if you received the object code with such an offer, in accord 269 | with subsection 6b. 270 | - d) Convey the object code by offering access from a designated 271 | place (gratis or for a charge), and offer equivalent access to the 272 | Corresponding Source in the same way through the same place at no 273 | further charge. You need not require recipients to copy the 274 | Corresponding Source along with the object code. If the place to 275 | copy the object code is a network server, the Corresponding Source 276 | may be on a different server (operated by you or a third party) 277 | that supports equivalent copying facilities, provided you maintain 278 | clear directions next to the object code saying where to find the 279 | Corresponding Source. Regardless of what server hosts the 280 | Corresponding Source, you remain obligated to ensure that it is 281 | available for as long as needed to satisfy these requirements. 282 | - e) Convey the object code using peer-to-peer transmission, provided 283 | you inform other peers where the object code and Corresponding 284 | Source of the work are being offered to the general public at no 285 | charge under subsection 6d. 286 | 287 | A separable portion of the object code, whose source code is excluded 288 | from the Corresponding Source as a System Library, need not be 289 | included in conveying the object code work. 290 | 291 | A "User Product" is either (1) a "consumer product", which means any 292 | tangible personal property which is normally used for personal, family, 293 | or household purposes, or (2) anything designed or sold for incorporation 294 | into a dwelling. In determining whether a product is a consumer product, 295 | doubtful cases shall be resolved in favor of coverage. For a particular 296 | product received by a particular user, "normally used" refers to a 297 | typical or common use of that class of product, regardless of the status 298 | of the particular user or of the way in which the particular user 299 | actually uses, or expects or is expected to use, the product. A product 300 | is a consumer product regardless of whether the product has substantial 301 | commercial, industrial or non-consumer uses, unless such uses represent 302 | the only significant mode of use of the product. 303 | 304 | "Installation Information" for a User Product means any methods, 305 | procedures, authorization keys, or other information required to install 306 | and execute modified versions of a covered work in that User Product from 307 | a modified version of its Corresponding Source. The information must 308 | suffice to ensure that the continued functioning of the modified object 309 | code is in no case prevented or interfered with solely because 310 | modification has been made. 311 | 312 | If you convey an object code work under this section in, or with, or 313 | specifically for use in, a User Product, and the conveying occurs as 314 | part of a transaction in which the right of possession and use of the 315 | User Product is transferred to the recipient in perpetuity or for a 316 | fixed term (regardless of how the transaction is characterized), the 317 | Corresponding Source conveyed under this section must be accompanied 318 | by the Installation Information. But this requirement does not apply 319 | if neither you nor any third party retains the ability to install 320 | modified object code on the User Product (for example, the work has 321 | been installed in ROM). 322 | 323 | The requirement to provide Installation Information does not include a 324 | requirement to continue to provide support service, warranty, or updates 325 | for a work that has been modified or installed by the recipient, or for 326 | the User Product in which it has been modified or installed. Access to a 327 | network may be denied when the modification itself materially and 328 | adversely affects the operation of the network or violates the rules and 329 | protocols for communication across the network. 330 | 331 | Corresponding Source conveyed, and Installation Information provided, 332 | in accord with this section must be in a format that is publicly 333 | documented (and with an implementation available to the public in 334 | source code form), and must require no special password or key for 335 | unpacking, reading or copying. 336 | 337 | ### 7. Additional Terms. 338 | 339 | "Additional permissions" are terms that supplement the terms of this 340 | License by making exceptions from one or more of its conditions. 341 | Additional permissions that are applicable to the entire Program shall 342 | be treated as though they were included in this License, to the extent 343 | that they are valid under applicable law. If additional permissions 344 | apply only to part of the Program, that part may be used separately 345 | under those permissions, but the entire Program remains governed by 346 | this License without regard to the additional permissions. 347 | 348 | When you convey a copy of a covered work, you may at your option 349 | remove any additional permissions from that copy, or from any part of 350 | it. (Additional permissions may be written to require their own 351 | removal in certain cases when you modify the work.) You may place 352 | additional permissions on material, added by you to a covered work, 353 | for which you have or can give appropriate copyright permission. 354 | 355 | Notwithstanding any other provision of this License, for material you 356 | add to a covered work, you may (if authorized by the copyright holders of 357 | that material) supplement the terms of this License with terms: 358 | 359 | - a) Disclaiming warranty or limiting liability differently from the 360 | terms of sections 15 and 16 of this License; or 361 | - b) Requiring preservation of specified reasonable legal notices or 362 | author attributions in that material or in the Appropriate Legal 363 | Notices displayed by works containing it; or 364 | - c) Prohibiting misrepresentation of the origin of that material, or 365 | requiring that modified versions of such material be marked in 366 | reasonable ways as different from the original version; or 367 | - d) Limiting the use for publicity purposes of names of licensors or 368 | authors of the material; or 369 | - e) Declining to grant rights under trademark law for use of some 370 | trade names, trademarks, or service marks; or 371 | - f) Requiring indemnification of licensors and authors of that 372 | material by anyone who conveys the material (or modified versions of 373 | it) with contractual assumptions of liability to the recipient, for 374 | any liability that these contractual assumptions directly impose on 375 | those licensors and authors. 376 | 377 | All other non-permissive additional terms are considered "further 378 | restrictions" within the meaning of section 10. If the Program as you 379 | received it, or any part of it, contains a notice stating that it is 380 | governed by this License along with a term that is a further 381 | restriction, you may remove that term. If a license document contains 382 | a further restriction but permits relicensing or conveying under this 383 | License, you may add to a covered work material governed by the terms 384 | of that license document, provided that the further restriction does 385 | not survive such relicensing or conveying. 386 | 387 | If you add terms to a covered work in accord with this section, you 388 | must place, in the relevant source files, a statement of the 389 | additional terms that apply to those files, or a notice indicating 390 | where to find the applicable terms. 391 | 392 | Additional terms, permissive or non-permissive, may be stated in the 393 | form of a separately written license, or stated as exceptions; 394 | the above requirements apply either way. 395 | 396 | ### 8. Termination. 397 | 398 | You may not propagate or modify a covered work except as expressly 399 | provided under this License. Any attempt otherwise to propagate or 400 | modify it is void, and will automatically terminate your rights under 401 | this License (including any patent licenses granted under the third 402 | paragraph of section 11). 403 | 404 | However, if you cease all violation of this License, then your 405 | license from a particular copyright holder is reinstated (a) 406 | provisionally, unless and until the copyright holder explicitly and 407 | finally terminates your license, and (b) permanently, if the copyright 408 | holder fails to notify you of the violation by some reasonable means 409 | prior to 60 days after the cessation. 410 | 411 | Moreover, your license from a particular copyright holder is 412 | reinstated permanently if the copyright holder notifies you of the 413 | violation by some reasonable means, this is the first time you have 414 | received notice of violation of this License (for any work) from that 415 | copyright holder, and you cure the violation prior to 30 days after 416 | your receipt of the notice. 417 | 418 | Termination of your rights under this section does not terminate the 419 | licenses of parties who have received copies or rights from you under 420 | this License. If your rights have been terminated and not permanently 421 | reinstated, you do not qualify to receive new licenses for the same 422 | material under section 10. 423 | 424 | ### 9. Acceptance Not Required for Having Copies. 425 | 426 | You are not required to accept this License in order to receive or 427 | run a copy of the Program. Ancillary propagation of a covered work 428 | occurring solely as a consequence of using peer-to-peer transmission 429 | to receive a copy likewise does not require acceptance. However, 430 | nothing other than this License grants you permission to propagate or 431 | modify any covered work. These actions infringe copyright if you do 432 | not accept this License. Therefore, by modifying or propagating a 433 | covered work, you indicate your acceptance of this License to do so. 434 | 435 | ### 10. Automatic Licensing of Downstream Recipients. 436 | 437 | Each time you convey a covered work, the recipient automatically 438 | receives a license from the original licensors, to run, modify and 439 | propagate that work, subject to this License. You are not responsible 440 | for enforcing compliance by third parties with this License. 441 | 442 | An "entity transaction" is a transaction transferring control of an 443 | organization, or substantially all assets of one, or subdividing an 444 | organization, or merging organizations. If propagation of a covered 445 | work results from an entity transaction, each party to that 446 | transaction who receives a copy of the work also receives whatever 447 | licenses to the work the party's predecessor in interest had or could 448 | give under the previous paragraph, plus a right to possession of the 449 | Corresponding Source of the work from the predecessor in interest, if 450 | the predecessor has it or can get it with reasonable efforts. 451 | 452 | You may not impose any further restrictions on the exercise of the 453 | rights granted or affirmed under this License. For example, you may 454 | not impose a license fee, royalty, or other charge for exercise of 455 | rights granted under this License, and you may not initiate litigation 456 | (including a cross-claim or counterclaim in a lawsuit) alleging that 457 | any patent claim is infringed by making, using, selling, offering for 458 | sale, or importing the Program or any portion of it. 459 | 460 | ### 11. Patents. 461 | 462 | A "contributor" is a copyright holder who authorizes use under this 463 | License of the Program or a work on which the Program is based. The 464 | work thus licensed is called the contributor's "contributor version". 465 | 466 | A contributor's "essential patent claims" are all patent claims 467 | owned or controlled by the contributor, whether already acquired or 468 | hereafter acquired, that would be infringed by some manner, permitted 469 | by this License, of making, using, or selling its contributor version, 470 | but do not include claims that would be infringed only as a 471 | consequence of further modification of the contributor version. For 472 | purposes of this definition, "control" includes the right to grant 473 | patent sublicenses in a manner consistent with the requirements of 474 | this License. 475 | 476 | Each contributor grants you a non-exclusive, worldwide, royalty-free 477 | patent license under the contributor's essential patent claims, to 478 | make, use, sell, offer for sale, import and otherwise run, modify and 479 | propagate the contents of its contributor version. 480 | 481 | In the following three paragraphs, a "patent license" is any express 482 | agreement or commitment, however denominated, not to enforce a patent 483 | (such as an express permission to practice a patent or covenant not to 484 | sue for patent infringement). To "grant" such a patent license to a 485 | party means to make such an agreement or commitment not to enforce a 486 | patent against the party. 487 | 488 | If you convey a covered work, knowingly relying on a patent license, 489 | and the Corresponding Source of the work is not available for anyone 490 | to copy, free of charge and under the terms of this License, through a 491 | publicly available network server or other readily accessible means, 492 | then you must either (1) cause the Corresponding Source to be so 493 | available, or (2) arrange to deprive yourself of the benefit of the 494 | patent license for this particular work, or (3) arrange, in a manner 495 | consistent with the requirements of this License, to extend the patent 496 | license to downstream recipients. "Knowingly relying" means you have 497 | actual knowledge that, but for the patent license, your conveying the 498 | covered work in a country, or your recipient's use of the covered work 499 | in a country, would infringe one or more identifiable patents in that 500 | country that you have reason to believe are valid. 501 | 502 | If, pursuant to or in connection with a single transaction or 503 | arrangement, you convey, or propagate by procuring conveyance of, a 504 | covered work, and grant a patent license to some of the parties 505 | receiving the covered work authorizing them to use, propagate, modify 506 | or convey a specific copy of the covered work, then the patent license 507 | you grant is automatically extended to all recipients of the covered 508 | work and works based on it. 509 | 510 | A patent license is "discriminatory" if it does not include within 511 | the scope of its coverage, prohibits the exercise of, or is 512 | conditioned on the non-exercise of one or more of the rights that are 513 | specifically granted under this License. You may not convey a covered 514 | work if you are a party to an arrangement with a third party that is 515 | in the business of distributing software, under which you make payment 516 | to the third party based on the extent of your activity of conveying 517 | the work, and under which the third party grants, to any of the 518 | parties who would receive the covered work from you, a discriminatory 519 | patent license (a) in connection with copies of the covered work 520 | conveyed by you (or copies made from those copies), or (b) primarily 521 | for and in connection with specific products or compilations that 522 | contain the covered work, unless you entered into that arrangement, 523 | or that patent license was granted, prior to 28 March 2007. 524 | 525 | Nothing in this License shall be construed as excluding or limiting 526 | any implied license or other defenses to infringement that may 527 | otherwise be available to you under applicable patent law. 528 | 529 | ### 12. No Surrender of Others' Freedom. 530 | 531 | If conditions are imposed on you (whether by court order, agreement or 532 | otherwise) that contradict the conditions of this License, they do not 533 | excuse you from the conditions of this License. If you cannot convey a 534 | covered work so as to satisfy simultaneously your obligations under this 535 | License and any other pertinent obligations, then as a consequence you may 536 | not convey it at all. For example, if you agree to terms that obligate you 537 | to collect a royalty for further conveying from those to whom you convey 538 | the Program, the only way you could satisfy both those terms and this 539 | License would be to refrain entirely from conveying the Program. 540 | 541 | ### 13. Use with the GNU Affero General Public License. 542 | 543 | Notwithstanding any other provision of this License, you have 544 | permission to link or combine any covered work with a work licensed 545 | under version 3 of the GNU Affero General Public License into a single 546 | combined work, and to convey the resulting work. The terms of this 547 | License will continue to apply to the part which is the covered work, 548 | but the special requirements of the GNU Affero General Public License, 549 | section 13, concerning interaction through a network will apply to the 550 | combination as such. 551 | 552 | ### 14. Revised Versions of this License. 553 | 554 | The Free Software Foundation may publish revised and/or new versions of 555 | the GNU General Public License from time to time. Such new versions will 556 | be similar in spirit to the present version, but may differ in detail to 557 | address new problems or concerns. 558 | 559 | Each version is given a distinguishing version number. If the 560 | Program specifies that a certain numbered version of the GNU General 561 | Public License "or any later version" applies to it, you have the 562 | option of following the terms and conditions either of that numbered 563 | version or of any later version published by the Free Software 564 | Foundation. If the Program does not specify a version number of the 565 | GNU General Public License, you may choose any version ever published 566 | by the Free Software Foundation. 567 | 568 | If the Program specifies that a proxy can decide which future 569 | versions of the GNU General Public License can be used, that proxy's 570 | public statement of acceptance of a version permanently authorizes you 571 | to choose that version for the Program. 572 | 573 | Later license versions may give you additional or different 574 | permissions. However, no additional obligations are imposed on any 575 | author or copyright holder as a result of your choosing to follow a 576 | later version. 577 | 578 | ### 15. Disclaimer of Warranty. 579 | 580 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 581 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 582 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 583 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 584 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 585 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 586 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 587 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 588 | 589 | ### 16. Limitation of Liability. 590 | 591 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 592 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 593 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 594 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 595 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 596 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 597 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 598 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 599 | SUCH DAMAGES. 600 | 601 | ### 17. Interpretation of Sections 15 and 16. 602 | 603 | If the disclaimer of warranty and limitation of liability provided 604 | above cannot be given local legal effect according to their terms, 605 | reviewing courts shall apply local law that most closely approximates 606 | an absolute waiver of all civil liability in connection with the 607 | Program, unless a warranty or assumption of liability accompanies a 608 | copy of the Program in return for a fee. 609 | 610 | END OF TERMS AND CONDITIONS 611 | 612 | -------------------------------------------------------------------------------- /sample/instantiation_diagram.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | G 11 | 12 | 13 | t35 14 | 15 | eval_if 16 | 17 | 18 | t16 19 | 20 | int_ 21 | 22 | 23 | t35->t16 24 | 25 | 26 | 27 | 28 | t24 29 | 30 | bool_ 31 | 32 | 33 | t35->t24 34 | 35 | 36 | 37 | 38 | t38 39 | 40 | if_c 41 | 42 | 43 | t35->t38 44 | 45 | 46 | 47 | 48 | t36 49 | 50 | less 51 | 52 | 53 | t35->t36 54 | 55 | 56 | 57 | 58 | t11 59 | 60 | plus 61 | 62 | 63 | t11->t16 64 | 65 | 66 | 67 | 68 | t5 69 | 70 | int_ 71 | 72 | 73 | t11->t5 74 | 75 | 76 | 77 | 78 | t12 79 | 80 | lazy_fib 81 | 82 | 83 | t11->t12 84 | 85 | 86 | 87 | 88 | t34 89 | 90 | lazy_fib 91 | 92 | 93 | t11->t34 94 | 95 | 96 | 97 | 98 | t8 99 | 100 | bool_ 101 | 102 | 103 | t2 104 | 105 | less 106 | 107 | 108 | t3 109 | 110 | int_ 111 | 112 | 113 | t2->t3 114 | 115 | 116 | 117 | 118 | t2->t3 119 | 120 | 121 | 122 | 123 | t6 124 | 125 | int_ 126 | 127 | 128 | t2->t6 129 | 130 | 131 | 132 | 133 | t4 134 | 135 | int_ 136 | 137 | 138 | t2->t4 139 | 140 | 141 | 142 | 143 | t2->t5 144 | 145 | 146 | 147 | 148 | t2->t5 149 | 150 | 151 | 152 | 153 | t14 154 | 155 | less 156 | 157 | 158 | t14->t5 159 | 160 | 161 | 162 | 163 | t15 164 | 165 | minus 166 | 167 | 168 | t14->t15 169 | 170 | 171 | 172 | 173 | t37 174 | 175 | minus 176 | 177 | 178 | t37->t3 179 | 180 | 181 | 182 | 183 | t37->t5 184 | 185 | 186 | 187 | 188 | t28 189 | 190 | eval_if 191 | 192 | 193 | t28->t16 194 | 195 | 196 | 197 | 198 | t28->t24 199 | 200 | 201 | 202 | 203 | t33 204 | 205 | if_c 206 | 207 | 208 | t28->t33 209 | 210 | 211 | 212 | 213 | t29 214 | 215 | less 216 | 217 | 218 | t28->t29 219 | 220 | 221 | 222 | 223 | t13 224 | 225 | eval_if 226 | 227 | 228 | t13->t14 229 | 230 | 231 | 232 | 233 | t9 234 | 235 | if_c 236 | 237 | 238 | t13->t9 239 | 240 | 241 | 242 | 243 | t7 244 | 245 | bool_ 246 | 247 | 248 | t13->t7 249 | 250 | 251 | 252 | 253 | t18 254 | 255 | if_c 256 | 257 | 258 | t13->t18 259 | 260 | 261 | 262 | 263 | t19 264 | 265 | plus 266 | 267 | 268 | t13->t19 269 | 270 | 271 | 272 | 273 | t0 274 | 275 | lazy_fib 276 | 277 | 278 | t1 279 | 280 | eval_if 281 | 282 | 283 | t0->t1 284 | 285 | 286 | 287 | 288 | t20 289 | 290 | lazy_fib 291 | 292 | 293 | t21 294 | 295 | eval_if 296 | 297 | 298 | t20->t21 299 | 300 | 301 | 302 | 303 | t27 304 | 305 | lazy_fib 306 | 307 | 308 | t27->t28 309 | 310 | 311 | 312 | 313 | t26 314 | 315 | if_c 316 | 317 | 318 | t30 319 | 320 | minus 321 | 322 | 323 | t30->t5 324 | 325 | 326 | 327 | 328 | t30->t15 329 | 330 | 331 | 332 | 333 | t19->t16 334 | 335 | 336 | 337 | 338 | t19->t16 339 | 340 | 341 | 342 | 343 | t19->t20 344 | 345 | 346 | 347 | 348 | t19->t27 349 | 350 | 351 | 352 | 353 | t17 354 | 355 | int_ 356 | 357 | 358 | t12->t13 359 | 360 | 361 | 362 | 363 | t10 364 | 365 | if_c 366 | 367 | 368 | t34->t35 369 | 370 | 371 | 372 | 373 | t31 374 | 375 | int_ 376 | 377 | 378 | t32 379 | 380 | int_ 381 | 382 | 383 | t36->t16 384 | 385 | 386 | 387 | 388 | t36->t37 389 | 390 | 391 | 392 | 393 | t36->t5 394 | 395 | 396 | 397 | 398 | t29->t30 399 | 400 | 401 | 402 | 403 | t29->t5 404 | 405 | 406 | 407 | 408 | t29->t31 409 | 410 | 411 | 412 | 413 | t29->t32 414 | 415 | 416 | 417 | 418 | t1->t11 419 | 420 | 421 | 422 | 423 | t1->t8 424 | 425 | 426 | 427 | 428 | t1->t2 429 | 430 | 431 | 432 | 433 | t1->t9 434 | 435 | 436 | 437 | 438 | t1->t7 439 | 440 | 441 | 442 | 443 | t1->t10 444 | 445 | 446 | 447 | 448 | t25 449 | 450 | bool_ 451 | 452 | 453 | t22 454 | 455 | less 456 | 457 | 458 | t22->t16 459 | 460 | 461 | 462 | 463 | t22->t5 464 | 465 | 466 | 467 | 468 | t23 469 | 470 | minus 471 | 472 | 473 | t22->t23 474 | 475 | 476 | 477 | 478 | t15->t16 479 | 480 | 481 | 482 | 483 | t15->t16 484 | 485 | 486 | 487 | 488 | t15->t3 489 | 490 | 491 | 492 | 493 | t15->t17 494 | 495 | 496 | 497 | 498 | t21->t16 499 | 500 | 501 | 502 | 503 | t21->t24 504 | 505 | 506 | 507 | 508 | t21->t26 509 | 510 | 511 | 512 | 513 | t21->t25 514 | 515 | 516 | 517 | 518 | t21->t22 519 | 520 | 521 | 522 | 523 | t23->t16 524 | 525 | 526 | 527 | 528 | t23->t5 529 | 530 | 531 | 532 | 533 | t23->t15 534 | 535 | 536 | 537 | 538 | 539 | --------------------------------------------------------------------------------