invocation-tree 0.0.30__tar.gz → 0.0.32__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. {invocation_tree-0.0.30/invocation_tree.egg-info → invocation_tree-0.0.32}/PKG-INFO +6 -27
  2. {invocation_tree-0.0.30 → invocation_tree-0.0.32}/README.md +4 -0
  3. invocation_tree-0.0.32/images/factorial.gif +0 -0
  4. invocation_tree-0.0.32/images/permutations.gif +0 -0
  5. invocation_tree-0.0.32/images/permutations_collect.gif +0 -0
  6. invocation_tree-0.0.32/images/permutations_neighbor.gif +0 -0
  7. invocation_tree-0.0.32/images/permutations_return.gif +0 -0
  8. invocation_tree-0.0.32/images/quick_sort.gif +0 -0
  9. {invocation_tree-0.0.30 → invocation_tree-0.0.32}/invocation_tree/__init__.py +13 -10
  10. {invocation_tree-0.0.30 → invocation_tree-0.0.32/invocation_tree.egg-info}/PKG-INFO +6 -27
  11. {invocation_tree-0.0.30 → invocation_tree-0.0.32}/invocation_tree.egg-info/SOURCES.txt +0 -7
  12. {invocation_tree-0.0.30 → invocation_tree-0.0.32}/pyproject.toml +3 -3
  13. invocation_tree-0.0.30/images/edges_to_dict.py +0 -26
  14. invocation_tree-0.0.30/images/factorial.gif +0 -0
  15. invocation_tree-0.0.30/images/graph.png.png +0 -0
  16. invocation_tree-0.0.30/images/permutations.gif +0 -0
  17. invocation_tree-0.0.30/images/permutations_collect.gif +0 -0
  18. invocation_tree-0.0.30/images/permutations_neighbor.gif +0 -0
  19. invocation_tree-0.0.30/images/permutations_return.gif +0 -0
  20. invocation_tree-0.0.30/images/puz.txt +0 -1
  21. invocation_tree-0.0.30/images/quick_sort.gif +0 -0
  22. invocation_tree-0.0.30/images/test.pdf +0 -0
  23. invocation_tree-0.0.30/images/test.py +0 -22
  24. invocation_tree-0.0.30/images/tree.pdf +0 -0
  25. invocation_tree-0.0.30/images/tree_problem.gv +0 -395
  26. {invocation_tree-0.0.30 → invocation_tree-0.0.32}/LICENSE.txt +0 -0
  27. {invocation_tree-0.0.30 → invocation_tree-0.0.32}/MANIFEST.in +0 -0
  28. {invocation_tree-0.0.30 → invocation_tree-0.0.32}/images/__pycache__/graph.cpython-313.pyc +0 -0
  29. {invocation_tree-0.0.30 → invocation_tree-0.0.32}/images/compute.gif +0 -0
  30. {invocation_tree-0.0.30 → invocation_tree-0.0.32}/images/compute.py +0 -0
  31. {invocation_tree-0.0.30 → invocation_tree-0.0.32}/images/create_gif.sh +0 -0
  32. {invocation_tree-0.0.30 → invocation_tree-0.0.32}/images/create_images.sh +0 -0
  33. {invocation_tree-0.0.30 → invocation_tree-0.0.32}/images/draw_graph.py +0 -0
  34. {invocation_tree-0.0.30 → invocation_tree-0.0.32}/images/draw_graph_d_x.py +0 -0
  35. {invocation_tree-0.0.30 → invocation_tree-0.0.32}/images/edges_big.out +0 -0
  36. {invocation_tree-0.0.30 → invocation_tree-0.0.32}/images/edges_big_d_x.out +0 -0
  37. {invocation_tree-0.0.30 → invocation_tree-0.0.32}/images/edges_small.out +0 -0
  38. {invocation_tree-0.0.30 → invocation_tree-0.0.32}/images/factorial.py +0 -0
  39. {invocation_tree-0.0.30 → invocation_tree-0.0.32}/images/graph.py +0 -0
  40. {invocation_tree-0.0.30 → invocation_tree-0.0.32}/images/graph_big.png +0 -0
  41. {invocation_tree-0.0.30 → invocation_tree-0.0.32}/images/graph_big_d_x.png +0 -0
  42. {invocation_tree-0.0.30 → invocation_tree-0.0.32}/images/graph_small.png +0 -0
  43. {invocation_tree-0.0.30 → invocation_tree-0.0.32}/images/jugs.png +0 -0
  44. {invocation_tree-0.0.30 → invocation_tree-0.0.32}/images/jugs_depth_first.py +0 -0
  45. {invocation_tree-0.0.30 → invocation_tree-0.0.32}/images/perms_LR3.png +0 -0
  46. {invocation_tree-0.0.30 → invocation_tree-0.0.32}/images/permutations.py +0 -0
  47. {invocation_tree-0.0.30 → invocation_tree-0.0.32}/images/permutations_collect.py +0 -0
  48. {invocation_tree-0.0.30 → invocation_tree-0.0.32}/images/permutations_dot.py +0 -0
  49. {invocation_tree-0.0.30 → invocation_tree-0.0.32}/images/permutations_neighbor.py +0 -0
  50. {invocation_tree-0.0.30 → invocation_tree-0.0.32}/images/permutations_return.py +0 -0
  51. {invocation_tree-0.0.30 → invocation_tree-0.0.32}/images/permutations_vscode.gif +0 -0
  52. {invocation_tree-0.0.30 → invocation_tree-0.0.32}/images/print_all_paths.py +0 -0
  53. {invocation_tree-0.0.30 → invocation_tree-0.0.32}/images/print_all_paths_of_length.py +0 -0
  54. {invocation_tree-0.0.30 → invocation_tree-0.0.32}/images/print_all_paths_via.py +0 -0
  55. {invocation_tree-0.0.30 → invocation_tree-0.0.32}/images/quick_sort.py +0 -0
  56. {invocation_tree-0.0.30 → invocation_tree-0.0.32}/images/students.gif +0 -0
  57. {invocation_tree-0.0.30 → invocation_tree-0.0.32}/images/students.py +0 -0
  58. {invocation_tree-0.0.30 → invocation_tree-0.0.32}/images/vscode.png +0 -0
  59. {invocation_tree-0.0.30 → invocation_tree-0.0.32}/invocation_tree/regex_set.py +0 -0
  60. {invocation_tree-0.0.30 → invocation_tree-0.0.32}/invocation_tree.egg-info/dependency_links.txt +0 -0
  61. {invocation_tree-0.0.30 → invocation_tree-0.0.32}/invocation_tree.egg-info/requires.txt +0 -0
  62. {invocation_tree-0.0.30 → invocation_tree-0.0.32}/invocation_tree.egg-info/top_level.txt +0 -0
  63. {invocation_tree-0.0.30 → invocation_tree-0.0.32}/setup.cfg +0 -0
@@ -1,34 +1,9 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: invocation_tree
3
- Version: 0.0.30
3
+ Version: 0.0.32
4
4
  Summary: Generates an invocation tree of functions calls.
5
5
  Author-email: Bas Terwijn <bterwijn@gmail.com>
6
- License: BSD 2-Clause License
7
-
8
- Copyright (c) 2017, pyexample
9
- All rights reserved.
10
-
11
- Redistribution and use in source and binary forms, with or without
12
- modification, are permitted provided that the following conditions are met:
13
-
14
- * Redistributions of source code must retain the above copyright notice, this
15
- list of conditions and the following disclaimer.
16
-
17
- * Redistributions in binary form must reproduce the above copyright notice,
18
- this list of conditions and the following disclaimer in the documentation
19
- and/or other materials provided with the distribution.
20
-
21
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
25
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31
-
6
+ License-Expression: BSD-2-Clause
32
7
  Project-URL: Homepage, https://github.com/bterwijn/invocation_tree
33
8
  Project-URL: Repository, https://github.com/bterwijn/invocation_tree.git
34
9
  Classifier: Development Status :: 4 - Beta
@@ -626,6 +601,10 @@ tree = ivt.Invocation_Tree()
626
601
  - set of all functions names that are not shown in the tree
627
602
  - **tree.ignore_calls** : set()
628
603
  - set of all functions names that are not shown in the tree, including its children
604
+ - **tree.fontname** : str
605
+ - the font used in the graph, default 'Courier' (as widely available monospace).
606
+ - **tree.fontsize** : str
607
+ - the font size used in the graph, default '14'.
629
608
 
630
609
  # Troubleshooting #
631
610
  - Adobe Acrobat Reader [doesn't refresh a PDF file](https://community.adobe.com/t5/acrobat-reader-discussions/reload-refresh-pdfs/td-p/9632292) when it changes on disk and blocks updates which results in an `Could not open 'tree.pdf' for writing : Permission denied` error. One solution is to install a PDF reader that does refresh ([SumatraPDF](https://www.sumatrapdfreader.org/), [Okular](https://okular.kde.org/), ...) and set it as the default PDF reader. Another solution is to `render()` the graph to a different output format.
@@ -581,6 +581,10 @@ tree = ivt.Invocation_Tree()
581
581
  - set of all functions names that are not shown in the tree
582
582
  - **tree.ignore_calls** : set()
583
583
  - set of all functions names that are not shown in the tree, including its children
584
+ - **tree.fontname** : str
585
+ - the font used in the graph, default 'Courier' (as widely available monospace).
586
+ - **tree.fontsize** : str
587
+ - the font size used in the graph, default '14'.
584
588
 
585
589
  # Troubleshooting #
586
590
  - Adobe Acrobat Reader [doesn't refresh a PDF file](https://community.adobe.com/t5/acrobat-reader-discussions/reload-refresh-pdfs/td-p/9632292) when it changes on disk and blocks updates which results in an `Could not open 'tree.pdf' for writing : Permission denied` error. One solution is to install a PDF reader that does refresh ([SumatraPDF](https://www.sumatrapdfreader.org/), [Okular](https://okular.kde.org/), ...) and set it as the default PDF reader. Another solution is to `render()` the graph to a different output format.
@@ -9,7 +9,7 @@ import difflib
9
9
 
10
10
  import invocation_tree.regex_set as regset
11
11
 
12
- __version__ = "0.0.30"
12
+ __version__ = "0.0.32"
13
13
  __author__ = 'Bas Terwijn'
14
14
 
15
15
  def highlight_diff(str1, str2):
@@ -100,6 +100,14 @@ class Invocation_Tree:
100
100
  self.hide_vars = hide_vars
101
101
  self.cleanup = cleanup
102
102
  self.quiet = quiet
103
+ self.hide_calls = {'Invocation_Tree.__exit__', 'Invocation_Tree.stop_trace', '<genexpr>'}
104
+ self.ignore_calls = set()
105
+ self.ignoring_call = None
106
+ self.regset_hide_vars = regset.Regex_Set(self.hide_vars)
107
+ self.regset_hide_calls = regset.Regex_Set(self.hide_calls)
108
+ self.regset_ignore_calls = regset.Regex_Set(self.ignore_calls)
109
+ self.fontname = 'Courier'
110
+ self.fontsize = '14'
103
111
  # --- core
104
112
  self.stack = []
105
113
  self.returned = []
@@ -112,12 +120,7 @@ class Invocation_Tree:
112
120
  self.is_highlighted = False
113
121
  self.graph = None
114
122
  self.prev_global_tracer = None
115
- self.hide_calls = {'Invocation_Tree.__exit__', 'Invocation_Tree.stop_trace', '<genexpr>'}
116
- self.ignore_calls = set()
117
- self.ignoring_call = None
118
- self.regset_hide_vars = regset.Regex_Set(self.hide_vars)
119
- self.regset_hide_calls = regset.Regex_Set(self.hide_calls)
120
- self.regset_ignore_calls = regset.Regex_Set(self.ignore_calls)
123
+
121
124
 
122
125
  def __repr__(self):
123
126
  return f'Invocation_Tree(filename={repr(self.filename)}, show={self.show}, block={self.block}, each_line={self.each_line}, gifcount={self.gifcount})'
@@ -218,9 +221,9 @@ class Invocation_Tree:
218
221
  return self.filename
219
222
 
220
223
  def create_graph(self):
221
- graphviz_graph_attr = {}
222
- graphviz_node_attr = {'shape':'plaintext'}
223
- graphviz_edge_attr = {}
224
+ graphviz_graph_attr = {'fontname': self.fontname, 'fontsize': str(self.fontsize)}
225
+ graphviz_node_attr = {'fontname': self.fontname, 'fontsize': str(self.fontsize), 'shape':'plaintext'}
226
+ graphviz_edge_attr = {'fontname': self.fontname, 'fontsize': str(self.fontsize)}
224
227
  graph = Digraph('invocation_tree',
225
228
  graph_attr=graphviz_graph_attr,
226
229
  node_attr=graphviz_node_attr,
@@ -1,34 +1,9 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: invocation_tree
3
- Version: 0.0.30
3
+ Version: 0.0.32
4
4
  Summary: Generates an invocation tree of functions calls.
5
5
  Author-email: Bas Terwijn <bterwijn@gmail.com>
6
- License: BSD 2-Clause License
7
-
8
- Copyright (c) 2017, pyexample
9
- All rights reserved.
10
-
11
- Redistribution and use in source and binary forms, with or without
12
- modification, are permitted provided that the following conditions are met:
13
-
14
- * Redistributions of source code must retain the above copyright notice, this
15
- list of conditions and the following disclaimer.
16
-
17
- * Redistributions in binary form must reproduce the above copyright notice,
18
- this list of conditions and the following disclaimer in the documentation
19
- and/or other materials provided with the distribution.
20
-
21
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
25
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31
-
6
+ License-Expression: BSD-2-Clause
32
7
  Project-URL: Homepage, https://github.com/bterwijn/invocation_tree
33
8
  Project-URL: Repository, https://github.com/bterwijn/invocation_tree.git
34
9
  Classifier: Development Status :: 4 - Beta
@@ -626,6 +601,10 @@ tree = ivt.Invocation_Tree()
626
601
  - set of all functions names that are not shown in the tree
627
602
  - **tree.ignore_calls** : set()
628
603
  - set of all functions names that are not shown in the tree, including its children
604
+ - **tree.fontname** : str
605
+ - the font used in the graph, default 'Courier' (as widely available monospace).
606
+ - **tree.fontsize** : str
607
+ - the font size used in the graph, default '14'.
629
608
 
630
609
  # Troubleshooting #
631
610
  - Adobe Acrobat Reader [doesn't refresh a PDF file](https://community.adobe.com/t5/acrobat-reader-discussions/reload-refresh-pdfs/td-p/9632292) when it changes on disk and blocks updates which results in an `Could not open 'tree.pdf' for writing : Permission denied` error. One solution is to install a PDF reader that does refresh ([SumatraPDF](https://www.sumatrapdfreader.org/), [Okular](https://okular.kde.org/), ...) and set it as the default PDF reader. Another solution is to `render()` the graph to a different output format.
@@ -11,10 +11,8 @@ images/draw_graph_d_x.py
11
11
  images/edges_big.out
12
12
  images/edges_big_d_x.out
13
13
  images/edges_small.out
14
- images/edges_to_dict.py
15
14
  images/factorial.gif
16
15
  images/factorial.py
17
- images/graph.png.png
18
16
  images/graph.py
19
17
  images/graph_big.png
20
18
  images/graph_big_d_x.png
@@ -35,15 +33,10 @@ images/permutations_vscode.gif
35
33
  images/print_all_paths.py
36
34
  images/print_all_paths_of_length.py
37
35
  images/print_all_paths_via.py
38
- images/puz.txt
39
36
  images/quick_sort.gif
40
37
  images/quick_sort.py
41
38
  images/students.gif
42
39
  images/students.py
43
- images/test.pdf
44
- images/test.py
45
- images/tree.pdf
46
- images/tree_problem.gv
47
40
  images/vscode.png
48
41
  images/__pycache__/graph.cpython-313.pyc
49
42
  invocation_tree/__init__.py
@@ -4,13 +4,13 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "invocation_tree"
7
- version = "0.0.30"
7
+ version = "0.0.32"
8
8
  description = "Generates an invocation tree of functions calls."
9
9
  authors = [
10
10
  {name = "Bas Terwijn", email = "bterwijn@gmail.com"}
11
11
  ]
12
- #license = { text = "BSD-2-Clause" } # needed for python <=3.8
13
- license = { file = "LICENSE.txt" }
12
+ license = "BSD-2-Clause"
13
+ license-files = ["LICENSE.txt"]
14
14
  readme = "README.md"
15
15
  requires-python = ">=3.7"
16
16
  classifiers = [
@@ -1,26 +0,0 @@
1
- edges = [('a', 'j'), ('f', 'j'), ('c', 'e'), ('b', 'd'), ('b', 'e'), ('f', 'g'), ('g', 'i'), ('h', 'i'), ('e', 'h'), ('a', 'i'), ('b', 'h'), ('b', 'f')]
2
-
3
- def edges_to_steps(edges: list[tuple[str, str]]) -> dict[str,list[str]]:
4
- """ Returns a dict with for each node the nodes it is connected with. """
5
- steps = {}
6
- for n1, n2 in edges:
7
- if not n1 in steps:
8
- steps[n1] = []
9
- steps[n1].append(n2)
10
- if not n2 in steps:
11
- steps[n2] = []
12
- steps[n2].append(n1)
13
- return steps
14
-
15
- def print_all_paths(steps, path, goal):
16
- current = path[-1] # last node in path is the current
17
- if current == goal: # stop condition
18
- print(path)
19
- else:
20
- valid_steps = steps[current]
21
- for s in valid_steps:
22
- if s not in path: # don't use same node twice
23
- print_all_paths(steps, path+s, goal)
24
-
25
- steps = edges_to_steps(edges)
26
- print_all_paths(steps, 'a', 'b')
Binary file
Binary file
@@ -1 +0,0 @@
1
- python jugs_breadth_first.py 51 3,5,34,107
Binary file
@@ -1,22 +0,0 @@
1
- import invocation_tree as ivt
2
-
3
- def funB():
4
- b = -1
5
- b = 100
6
- return b
7
-
8
- def funA():
9
- a = -1
10
- a = funB()
11
- a = funB()
12
- return a
13
-
14
- def funX():
15
- x = -1
16
- x = funA()
17
- x = funA()
18
- return x
19
-
20
- tree = ivt.blocking()
21
- #tree.ignore_calls.add('funB')
22
- tree(funX)
Binary file
@@ -1,395 +0,0 @@
1
- digraph invocation_tree {
2
- node [shape=plaintext]
3
- 0 [label=<
4
- <TABLE BORDER="1" CELLBORDER="0" CELLSPACING="0" BGCOLOR="#ccffcc">
5
- <TR><TD ALIGN="left">➤solver_depth_first</TD></TR>
6
- <TR><TD ALIGN="left"> jugs: 0/3 0/5</TD></TR>
7
- <TR><TD ALIGN="left"> goal: 4</TD></TR>
8
- <TR><TD ALIGN="left"> jugs_hist: {3/3 0/5, 0/3 0/5}</TD></TR>
9
- <TR><TD ALIGN="left"> action_hist: [(0, 3)<FONT COLOR="#ff6666"><B>[-]</B></FONT>]</TD></TR>
10
- </TABLE>>]
11
- 1 [label=<
12
- <TABLE BORDER="1" CELLBORDER="0" CELLSPACING="0" BGCOLOR="#ffcccc">
13
- <TR><TD ALIGN="left">➤Jugs.copy</TD></TR>
14
- <TR><TD ALIGN="left"> self: 0/3 0/5</TD></TR>
15
- <TR><TD ALIGN="left">return 0/3 0/5</TD></TR>
16
- </TABLE>>]
17
- 2 [label=<
18
- <TABLE BORDER="1" CELLBORDER="0" CELLSPACING="0" BGCOLOR="#ccffcc">
19
- <TR><TD ALIGN="left">➤solver_depth_first_recursive</TD></TR>
20
- <TR><TD ALIGN="left"> jugs: 3/3 0/5</TD></TR>
21
- <TR><TD ALIGN="left"> goal: 4</TD></TR>
22
- <TR><TD ALIGN="left"> jugs_hist: {3/3 0/5, 0/3 0/5}</TD></TR>
23
- <TR><TD ALIGN="left"> action_hist: [(0, 3)<FONT COLOR="#ff6666"><B>[-]</B></FONT>]</TD></TR>
24
- <TR><TD ALIGN="left"> actions: [(0, 3), (1, 5)]</TD></TR>
25
- <TR><TD ALIGN="left"> action: (0, 3)</TD></TR>
26
- <TR><TD ALIGN="left"> goal_reached: False</TD></TR>
27
- </TABLE>>]
28
- 3 [label=<
29
- <TABLE BORDER="1" CELLBORDER="0" CELLSPACING="0" BGCOLOR="#ffcccc">
30
- <TR><TD ALIGN="left">➤Jugs.__hash__</TD></TR>
31
- <TR><TD ALIGN="left"> self: 0/3 0/5</TD></TR>
32
- <TR><TD ALIGN="left">return -8458139203682520985</TD></TR>
33
- </TABLE>>]
34
- 4 [label=<
35
- <TABLE BORDER="1" CELLBORDER="0" CELLSPACING="0" BGCOLOR="#ffcccc">
36
- <TR><TD ALIGN="left">➤Jugs.copy</TD></TR>
37
- <TR><TD ALIGN="left"> self: 0/3 0/5</TD></TR>
38
- <TR><TD ALIGN="left">return 0/3 0/5</TD></TR>
39
- </TABLE>>]
40
- 5 [label=<
41
- <TABLE BORDER="1" CELLBORDER="0" CELLSPACING="0" BGCOLOR="#ffcccc">
42
- <TR><TD ALIGN="left">➤Jugs.__hash__</TD></TR>
43
- <TR><TD ALIGN="left"> self: 0/3 0/5</TD></TR>
44
- <TR><TD ALIGN="left">return -8458139203682520985</TD></TR>
45
- </TABLE>>]
46
- 6 [label=<
47
- <TABLE BORDER="1" CELLBORDER="0" CELLSPACING="0" BGCOLOR="#ffcccc">
48
- <TR><TD ALIGN="left">➤Jugs.all_actions</TD></TR>
49
- <TR><TD ALIGN="left"> self: 0/3 0/5</TD></TR>
50
- <TR><TD ALIGN="left"> actions: [(0, 3), (1, 5)]</TD></TR>
51
- <TR><TD ALIGN="left"> i: 1</TD></TR>
52
- <TR><TD ALIGN="left"> a: None</TD></TR>
53
- <TR><TD ALIGN="left"> j: 1</TD></TR>
54
- <TR><TD ALIGN="left">return [(0, 3), (1, 5)]</TD></TR>
55
- </TABLE>>]
56
- 7 [label=<
57
- <TABLE BORDER="1" CELLBORDER="0" CELLSPACING="0" BGCOLOR="#ffcccc">
58
- <TR><TD ALIGN="left">➤Jugs.__len__</TD></TR>
59
- <TR><TD ALIGN="left"> self: 0/3 0/5</TD></TR>
60
- <TR><TD ALIGN="left">return 2</TD></TR>
61
- </TABLE>>]
62
- 8 [label=<
63
- <TABLE BORDER="1" CELLBORDER="0" CELLSPACING="0" BGCOLOR="#ffcccc">
64
- <TR><TD ALIGN="left">➤Jugs.fill_action</TD></TR>
65
- <TR><TD ALIGN="left"> self: 0/3 0/5</TD></TR>
66
- <TR><TD ALIGN="left"> jug_index: 0</TD></TR>
67
- <TR><TD ALIGN="left"> delta: 3</TD></TR>
68
- <TR><TD ALIGN="left">return (0, 3)</TD></TR>
69
- </TABLE>>]
70
- 9 [label=<
71
- <TABLE BORDER="1" CELLBORDER="0" CELLSPACING="0" BGCOLOR="#ffcccc">
72
- <TR><TD ALIGN="left">➤Jugs.empty_action</TD></TR>
73
- <TR><TD ALIGN="left"> self: 0/3 0/5</TD></TR>
74
- <TR><TD ALIGN="left"> jug_index: 0</TD></TR>
75
- <TR><TD ALIGN="left"> delta: 0</TD></TR>
76
- <TR><TD ALIGN="left">return None</TD></TR>
77
- </TABLE>>]
78
- 10 [label=<
79
- <TABLE BORDER="1" CELLBORDER="0" CELLSPACING="0" BGCOLOR="#ffcccc">
80
- <TR><TD ALIGN="left">➤Jugs.__len__</TD></TR>
81
- <TR><TD ALIGN="left"> self: 0/3 0/5</TD></TR>
82
- <TR><TD ALIGN="left">return 2</TD></TR>
83
- </TABLE>>]
84
- 11 [label=<
85
- <TABLE BORDER="1" CELLBORDER="0" CELLSPACING="0" BGCOLOR="#ffcccc">
86
- <TR><TD ALIGN="left">➤Jugs.pour_action</TD></TR>
87
- <TR><TD ALIGN="left"> self: 0/3 0/5</TD></TR>
88
- <TR><TD ALIGN="left"> from_jug: 0</TD></TR>
89
- <TR><TD ALIGN="left"> to_jug: 1</TD></TR>
90
- <TR><TD ALIGN="left"> delta: 0</TD></TR>
91
- <TR><TD ALIGN="left">return None</TD></TR>
92
- </TABLE>>]
93
- 12 [label=<
94
- <TABLE BORDER="1" CELLBORDER="0" CELLSPACING="0" BGCOLOR="#ffcccc">
95
- <TR><TD ALIGN="left">➤Jugs.fill_action</TD></TR>
96
- <TR><TD ALIGN="left"> self: 0/3 0/5</TD></TR>
97
- <TR><TD ALIGN="left"> jug_index: 1</TD></TR>
98
- <TR><TD ALIGN="left"> delta: 5</TD></TR>
99
- <TR><TD ALIGN="left">return (1, 5)</TD></TR>
100
- </TABLE>>]
101
- 13 [label=<
102
- <TABLE BORDER="1" CELLBORDER="0" CELLSPACING="0" BGCOLOR="#ffcccc">
103
- <TR><TD ALIGN="left">➤Jugs.empty_action</TD></TR>
104
- <TR><TD ALIGN="left"> self: 0/3 0/5</TD></TR>
105
- <TR><TD ALIGN="left"> jug_index: 1</TD></TR>
106
- <TR><TD ALIGN="left"> delta: 0</TD></TR>
107
- <TR><TD ALIGN="left">return None</TD></TR>
108
- </TABLE>>]
109
- 14 [label=<
110
- <TABLE BORDER="1" CELLBORDER="0" CELLSPACING="0" BGCOLOR="#ffcccc">
111
- <TR><TD ALIGN="left">➤Jugs.__len__</TD></TR>
112
- <TR><TD ALIGN="left"> self: 0/3 0/5</TD></TR>
113
- <TR><TD ALIGN="left">return 2</TD></TR>
114
- </TABLE>>]
115
- 15 [label=<
116
- <TABLE BORDER="1" CELLBORDER="0" CELLSPACING="0" BGCOLOR="#ffcccc">
117
- <TR><TD ALIGN="left">➤Jugs.pour_action</TD></TR>
118
- <TR><TD ALIGN="left"> self: 0/3 0/5</TD></TR>
119
- <TR><TD ALIGN="left"> from_jug: 1</TD></TR>
120
- <TR><TD ALIGN="left"> to_jug: 0</TD></TR>
121
- <TR><TD ALIGN="left"> delta: 0</TD></TR>
122
- <TR><TD ALIGN="left">return None</TD></TR>
123
- </TABLE>>]
124
- 16 [label=<
125
- <TABLE BORDER="1" CELLBORDER="0" CELLSPACING="0" BGCOLOR="#ffcccc">
126
- <TR><TD ALIGN="left">➤Jugs.do_action</TD></TR>
127
- <TR><TD ALIGN="left"> self: 3/3 0/5</TD></TR>
128
- <TR><TD ALIGN="left"> action: (0, 3)</TD></TR>
129
- <TR><TD ALIGN="left"> goal: 4</TD></TR>
130
- <TR><TD ALIGN="left">return False</TD></TR>
131
- </TABLE>>]
132
- 17 [label=<
133
- <TABLE BORDER="1" CELLBORDER="0" CELLSPACING="0" BGCOLOR="#ffcccc">
134
- <TR><TD ALIGN="left">➤Jugs.action_helper</TD></TR>
135
- <TR><TD ALIGN="left"> jug_index: 0</TD></TR>
136
- <TR><TD ALIGN="left"> delta: 3</TD></TR>
137
- <TR><TD ALIGN="left"> goal: 4</TD></TR>
138
- <TR><TD ALIGN="left"> goal_reached: False</TD></TR>
139
- <TR><TD ALIGN="left"> content: 3</TD></TR>
140
- <TR><TD ALIGN="left"> self: 3/3 0/5</TD></TR>
141
- <TR><TD ALIGN="left">return False</TD></TR>
142
- </TABLE>>]
143
- 18 [label=<
144
- <TABLE BORDER="1" CELLBORDER="0" CELLSPACING="0" BGCOLOR="#ccffcc">
145
- <TR><TD ALIGN="left">➤solver_depth_first_recursive</TD></TR>
146
- <TR><TD ALIGN="left"> jugs: 3/3 0/5</TD></TR>
147
- <TR><TD ALIGN="left"> goal: 4</TD></TR>
148
- <TR><TD ALIGN="left"> jugs_hist: {3/3 0/5, 0/3 0/5}</TD></TR>
149
- <TR><TD ALIGN="left"> action_hist: [(0, 3)<FONT COLOR="#ff6666"><B>[-]</B></FONT>]</TD></TR>
150
- <TR><TD ALIGN="left"> actions: [(0, -3), (0, 1, 3), (1, 5)]</TD></TR>
151
- <TR><TD ALIGN="left"> action: (0, <B>1, &#8203;</B>&#8203;3)</TD></TR>
152
- <TR><TD ALIGN="left"> goal_reached: False</TD></TR>
153
- <TR><TD ALIGN="left"> result: False</TD></TR>
154
- </TABLE>>]
155
- 19 [label=<
156
- <TABLE BORDER="1" CELLBORDER="0" CELLSPACING="0" BGCOLOR="#ffcccc">
157
- <TR><TD ALIGN="left">➤Jugs.__hash__</TD></TR>
158
- <TR><TD ALIGN="left"> self: 3/3 0/5</TD></TR>
159
- <TR><TD ALIGN="left">return 2248468952609198383</TD></TR>
160
- </TABLE>>]
161
- 20 [label=<
162
- <TABLE BORDER="1" CELLBORDER="0" CELLSPACING="0" BGCOLOR="#ffcccc">
163
- <TR><TD ALIGN="left">➤Jugs.copy</TD></TR>
164
- <TR><TD ALIGN="left"> self: 3/3 0/5</TD></TR>
165
- <TR><TD ALIGN="left">return 3/3 0/5</TD></TR>
166
- </TABLE>>]
167
- 21 [label=<
168
- <TABLE BORDER="1" CELLBORDER="0" CELLSPACING="0" BGCOLOR="#ffcccc">
169
- <TR><TD ALIGN="left">➤Jugs.__hash__</TD></TR>
170
- <TR><TD ALIGN="left"> self: 3/3 0/5</TD></TR>
171
- <TR><TD ALIGN="left">return 2248468952609198383</TD></TR>
172
- </TABLE>>]
173
- 22 [label=<
174
- <TABLE BORDER="1" CELLBORDER="0" CELLSPACING="0" BGCOLOR="#ffcccc">
175
- <TR><TD ALIGN="left">➤Jugs.all_actions</TD></TR>
176
- <TR><TD ALIGN="left"> self: 3/3 0/5</TD></TR>
177
- <TR><TD ALIGN="left"> actions: [(0, -3), (0, 1, 3), (1, 5)]</TD></TR>
178
- <TR><TD ALIGN="left"> i: 1</TD></TR>
179
- <TR><TD ALIGN="left"> a: None</TD></TR>
180
- <TR><TD ALIGN="left"> j: 1</TD></TR>
181
- <TR><TD ALIGN="left">return [(0, -3), (0, 1, 3), (1, 5)]</TD></TR>
182
- </TABLE>>]
183
- 23 [label=<
184
- <TABLE BORDER="1" CELLBORDER="0" CELLSPACING="0" BGCOLOR="#ffcccc">
185
- <TR><TD ALIGN="left">➤Jugs.__len__</TD></TR>
186
- <TR><TD ALIGN="left"> self: 3/3 0/5</TD></TR>
187
- <TR><TD ALIGN="left">return 2</TD></TR>
188
- </TABLE>>]
189
- 24 [label=<
190
- <TABLE BORDER="1" CELLBORDER="0" CELLSPACING="0" BGCOLOR="#ffcccc">
191
- <TR><TD ALIGN="left">➤Jugs.fill_action</TD></TR>
192
- <TR><TD ALIGN="left"> self: 3/3 0/5</TD></TR>
193
- <TR><TD ALIGN="left"> jug_index: 0</TD></TR>
194
- <TR><TD ALIGN="left"> delta: 0</TD></TR>
195
- <TR><TD ALIGN="left">return None</TD></TR>
196
- </TABLE>>]
197
- 25 [label=<
198
- <TABLE BORDER="1" CELLBORDER="0" CELLSPACING="0" BGCOLOR="#ffcccc">
199
- <TR><TD ALIGN="left">➤Jugs.empty_action</TD></TR>
200
- <TR><TD ALIGN="left"> self: 3/3 0/5</TD></TR>
201
- <TR><TD ALIGN="left"> jug_index: 0</TD></TR>
202
- <TR><TD ALIGN="left"> delta: -3</TD></TR>
203
- <TR><TD ALIGN="left">return (0, -3)</TD></TR>
204
- </TABLE>>]
205
- 26 [label=<
206
- <TABLE BORDER="1" CELLBORDER="0" CELLSPACING="0" BGCOLOR="#ffcccc">
207
- <TR><TD ALIGN="left">➤Jugs.__len__</TD></TR>
208
- <TR><TD ALIGN="left"> self: 3/3 0/5</TD></TR>
209
- <TR><TD ALIGN="left">return 2</TD></TR>
210
- </TABLE>>]
211
- 27 [label=<
212
- <TABLE BORDER="1" CELLBORDER="0" CELLSPACING="0" BGCOLOR="#ffcccc">
213
- <TR><TD ALIGN="left">➤Jugs.pour_action</TD></TR>
214
- <TR><TD ALIGN="left"> self: 3/3 0/5</TD></TR>
215
- <TR><TD ALIGN="left"> from_jug: 0</TD></TR>
216
- <TR><TD ALIGN="left"> to_jug: 1</TD></TR>
217
- <TR><TD ALIGN="left"> delta: 3</TD></TR>
218
- <TR><TD ALIGN="left">return (0, 1, 3)</TD></TR>
219
- </TABLE>>]
220
- 28 [label=<
221
- <TABLE BORDER="1" CELLBORDER="0" CELLSPACING="0" BGCOLOR="#ffcccc">
222
- <TR><TD ALIGN="left">➤Jugs.fill_action</TD></TR>
223
- <TR><TD ALIGN="left"> self: 3/3 0/5</TD></TR>
224
- <TR><TD ALIGN="left"> jug_index: 1</TD></TR>
225
- <TR><TD ALIGN="left"> delta: 5</TD></TR>
226
- <TR><TD ALIGN="left">return (1, 5)</TD></TR>
227
- </TABLE>>]
228
- 29 [label=<
229
- <TABLE BORDER="1" CELLBORDER="0" CELLSPACING="0" BGCOLOR="#ffcccc">
230
- <TR><TD ALIGN="left">➤Jugs.empty_action</TD></TR>
231
- <TR><TD ALIGN="left"> self: 3/3 0/5</TD></TR>
232
- <TR><TD ALIGN="left"> jug_index: 1</TD></TR>
233
- <TR><TD ALIGN="left"> delta: 0</TD></TR>
234
- <TR><TD ALIGN="left">return None</TD></TR>
235
- </TABLE>>]
236
- 30 [label=<
237
- <TABLE BORDER="1" CELLBORDER="0" CELLSPACING="0" BGCOLOR="#ffcccc">
238
- <TR><TD ALIGN="left">➤Jugs.__len__</TD></TR>
239
- <TR><TD ALIGN="left"> self: 3/3 0/5</TD></TR>
240
- <TR><TD ALIGN="left">return 2</TD></TR>
241
- </TABLE>>]
242
- 31 [label=<
243
- <TABLE BORDER="1" CELLBORDER="0" CELLSPACING="0" BGCOLOR="#ffcccc">
244
- <TR><TD ALIGN="left">➤Jugs.pour_action</TD></TR>
245
- <TR><TD ALIGN="left"> self: 3/3 0/5</TD></TR>
246
- <TR><TD ALIGN="left"> from_jug: 1</TD></TR>
247
- <TR><TD ALIGN="left"> to_jug: 0</TD></TR>
248
- <TR><TD ALIGN="left"> delta: 0</TD></TR>
249
- <TR><TD ALIGN="left">return None</TD></TR>
250
- </TABLE>>]
251
- 32 [label=<
252
- <TABLE BORDER="1" CELLBORDER="0" CELLSPACING="0" BGCOLOR="#ffcccc">
253
- <TR><TD ALIGN="left">➤Jugs.do_action</TD></TR>
254
- <TR><TD ALIGN="left"> self: 0/3 0/5</TD></TR>
255
- <TR><TD ALIGN="left"> action: (0, -3)</TD></TR>
256
- <TR><TD ALIGN="left"> goal: 4</TD></TR>
257
- <TR><TD ALIGN="left">return False</TD></TR>
258
- </TABLE>>]
259
- 33 [label=<
260
- <TABLE BORDER="1" CELLBORDER="0" CELLSPACING="0" BGCOLOR="#ffcccc">
261
- <TR><TD ALIGN="left">➤Jugs.action_helper</TD></TR>
262
- <TR><TD ALIGN="left"> jug_index: 0</TD></TR>
263
- <TR><TD ALIGN="left"> delta: -3</TD></TR>
264
- <TR><TD ALIGN="left"> goal: 4</TD></TR>
265
- <TR><TD ALIGN="left"> goal_reached: False</TD></TR>
266
- <TR><TD ALIGN="left"> content: 0</TD></TR>
267
- <TR><TD ALIGN="left"> self: 0/3 0/5</TD></TR>
268
- <TR><TD ALIGN="left">return False</TD></TR>
269
- </TABLE>>]
270
- 34 [label=<
271
- <TABLE BORDER="1" CELLBORDER="0" CELLSPACING="0" BGCOLOR="#ffcccc">
272
- <TR><TD ALIGN="left">➤solver_depth_first_recursive</TD></TR>
273
- <TR><TD ALIGN="left"> jugs: 0/3 0/5</TD></TR>
274
- <TR><TD ALIGN="left"> goal: 4</TD></TR>
275
- <TR><TD ALIGN="left"> jugs_hist: {3/3 0/5, 0/3 0/5}</TD></TR>
276
- <TR><TD ALIGN="left"> action_hist: [(0, 3), (0, -3)]</TD></TR>
277
- <TR><TD ALIGN="left">return False</TD></TR>
278
- </TABLE>>]
279
- 35 [label=<
280
- <TABLE BORDER="1" CELLBORDER="0" CELLSPACING="0" BGCOLOR="#ffcccc">
281
- <TR><TD ALIGN="left">➤Jugs.__hash__</TD></TR>
282
- <TR><TD ALIGN="left"> self: 0/3 0/5</TD></TR>
283
- <TR><TD ALIGN="left">return -8458139203682520985</TD></TR>
284
- </TABLE>>]
285
- 36 [label=<
286
- <TABLE BORDER="1" CELLBORDER="0" CELLSPACING="0" BGCOLOR="#ffcccc">
287
- <TR><TD ALIGN="left">➤Jugs.__eq__</TD></TR>
288
- <TR><TD ALIGN="left"> self: 0/3 0/5</TD></TR>
289
- <TR><TD ALIGN="left"> other: 0/3 0/5</TD></TR>
290
- <TR><TD ALIGN="left">return True</TD></TR>
291
- </TABLE>>]
292
- 37 [label=<
293
- <TABLE BORDER="1" CELLBORDER="0" CELLSPACING="0" BGCOLOR="#ffcccc">
294
- <TR><TD ALIGN="left">➤Jugs.__len__</TD></TR>
295
- <TR><TD ALIGN="left"> self: 0/3 0/5</TD></TR>
296
- <TR><TD ALIGN="left">return 2</TD></TR>
297
- </TABLE>>]
298
- 38 [label=<
299
- <TABLE BORDER="1" CELLBORDER="0" CELLSPACING="0" BGCOLOR="#ffcccc">
300
- <TR><TD ALIGN="left">➤Jugs.__len__</TD></TR>
301
- <TR><TD ALIGN="left"> self: 0/3 0/5</TD></TR>
302
- <TR><TD ALIGN="left">return 2</TD></TR>
303
- </TABLE>>]
304
- 39 [label=<
305
- <TABLE BORDER="1" CELLBORDER="0" CELLSPACING="0" BGCOLOR="#ffcccc">
306
- <TR><TD ALIGN="left">➤Jugs.__len__</TD></TR>
307
- <TR><TD ALIGN="left"> self: 0/3 0/5</TD></TR>
308
- <TR><TD ALIGN="left">return 2</TD></TR>
309
- </TABLE>>]
310
- 40 [label=<
311
- <TABLE BORDER="1" CELLBORDER="0" CELLSPACING="0" BGCOLOR="#ffcccc">
312
- <TR><TD ALIGN="left">➤Jugs.&lt;genexpr&gt;</TD></TR>
313
- <TR><TD ALIGN="left"> .0: &lt;range_iterator object at 0x75aae8b8f570&gt;</TD></TR>
314
- <TR><TD ALIGN="left"> i: 0</TD></TR>
315
- <TR><TD ALIGN="left"> other: 0/3 0/5</TD></TR>
316
- <TR><TD ALIGN="left"> self: 0/3 0/5</TD></TR>
317
- <TR><TD ALIGN="left">return True</TD></TR>
318
- </TABLE>>]
319
- 41 [label=<
320
- <TABLE BORDER="1" CELLBORDER="0" CELLSPACING="0" BGCOLOR="#ffcccc">
321
- <TR><TD ALIGN="left">➤Jugs.&lt;genexpr&gt;</TD></TR>
322
- <TR><TD ALIGN="left"> .0: &lt;range_iterator object at 0x75aae8b8f570&gt;</TD></TR>
323
- <TR><TD ALIGN="left"> i: 1</TD></TR>
324
- <TR><TD ALIGN="left"> other: 0/3 0/5</TD></TR>
325
- <TR><TD ALIGN="left"> self: 0/3 0/5</TD></TR>
326
- <TR><TD ALIGN="left">return True</TD></TR>
327
- </TABLE>>]
328
- 42 [label=<
329
- <TABLE BORDER="1" CELLBORDER="0" CELLSPACING="0" BGCOLOR="#ffcccc">
330
- <TR><TD ALIGN="left">➤Jugs.&lt;genexpr&gt;</TD></TR>
331
- <TR><TD ALIGN="left"> .0: &lt;range_iterator object at 0x75aae8b8f570&gt;</TD></TR>
332
- <TR><TD ALIGN="left"> i: 1</TD></TR>
333
- <TR><TD ALIGN="left"> other: 0/3 0/5</TD></TR>
334
- <TR><TD ALIGN="left"> self: 0/3 0/5</TD></TR>
335
- <TR><TD ALIGN="left">return None</TD></TR>
336
- </TABLE>>]
337
- 43 [label=<
338
- <TABLE BORDER="1" CELLBORDER="0" CELLSPACING="0" BGCOLOR="#ffcccc">
339
- <TR><TD ALIGN="left">➤Jugs.undo_action</TD></TR>
340
- <TR><TD ALIGN="left"> self: 3/3 0/5</TD></TR>
341
- <TR><TD ALIGN="left"> action: (0, -3)</TD></TR>
342
- <TR><TD ALIGN="left">return None</TD></TR>
343
- </TABLE>>]
344
- 44 [label=<
345
- <TABLE BORDER="3" CELLBORDER="0" CELLSPACING="0" BGCOLOR="#ffffff">
346
- <TR><TD ALIGN="left">➤<B>Jugs.do_action</B></TD></TR>
347
- <TR><TD ALIGN="left"> <B>self</B>: <B>3/3 0/5</B></TD></TR>
348
- <TR><TD ALIGN="left"> <B>action</B>: <B>(0, 1, 3)</B></TD></TR>
349
- <TR><TD ALIGN="left"> <B>goal</B>: <B>4</B></TD></TR>
350
- </TABLE>>]
351
- 0 -> 1
352
- 0 -> 2
353
- 2 -> 3
354
- 2 -> 4
355
- 2 -> 5
356
- 2 -> 6
357
- 6 -> 7
358
- 6 -> 8
359
- 6 -> 9
360
- 6 -> 10
361
- 6 -> 11
362
- 6 -> 12
363
- 6 -> 13
364
- 6 -> 14
365
- 6 -> 15
366
- 2 -> 16
367
- 16 -> 17
368
- 2 -> 18
369
- 18 -> 19
370
- 18 -> 20
371
- 18 -> 21
372
- 18 -> 22
373
- 22 -> 23
374
- 22 -> 24
375
- 22 -> 25
376
- 22 -> 26
377
- 22 -> 27
378
- 22 -> 28
379
- 22 -> 29
380
- 22 -> 30
381
- 22 -> 31
382
- 18 -> 32
383
- 32 -> 33
384
- 18 -> 34
385
- 34 -> 35
386
- 34 -> 36
387
- 36 -> 37
388
- 36 -> 38
389
- 36 -> 39
390
- 36 -> 40
391
- 36 -> 41
392
- 36 -> 42
393
- 18 -> 43
394
- 18 -> 44
395
- }