aboutsummaryrefslogtreecommitdiff
path: root/pyecsca/sca/re/tree.py
diff options
context:
space:
mode:
Diffstat (limited to 'pyecsca/sca/re/tree.py')
-rw-r--r--pyecsca/sca/re/tree.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/pyecsca/sca/re/tree.py b/pyecsca/sca/re/tree.py
index 2ae7945..4e9cf3e 100644
--- a/pyecsca/sca/re/tree.py
+++ b/pyecsca/sca/re/tree.py
@@ -199,7 +199,7 @@ class Map:
"Rows: {len(self.mapping)}, ({self.mapping.memory_usage(index=True).sum():_} bytes)",
"Inputs: {len(self.domain)}",
"Codomain: {len(self.codomain)}",
- "None in codomain: {None in self.codomain}"
+ "None in codomain: {None in self.codomain}",
)
)
@@ -264,6 +264,11 @@ class Tree:
"""Get the size of the tree (number of nodes)."""
return self.root.size
+ @property
+ def precise(self) -> bool:
+ """Whether the tree is precise (all leaves have only a single configuration)."""
+ return all(len(leaf.cfgs) == 1 for leaf in self.leaves)
+
def render(self) -> str:
"""Render the tree."""
style = AbstractStyle("\u2502 ", "\u251c\u2500\u2500", "\u2514\u2500\u2500")