Skip to content

Commit

Permalink
Merge pull request #382 from EvgSkv/ti2023
Browse files Browse the repository at this point in the history
Use -1 in recursion depth for infinity.
  • Loading branch information
EvgSkv authored Sep 27, 2024
2 parents 579722b + 6d1102c commit 7ad2da9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
13 changes: 9 additions & 4 deletions common/concertina_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,12 +246,17 @@ def ActionShape(self, a):
return 'diamond'
return 'box'

def IterationRepetitionsSymbol(self, iteration):
if self.iteration_repetitions[iteration] > 1000000:
return '∞'
return '%d' % self.iteration_repetitions[iteration]

def AsGraphViz(self):
def NodeText(node):
if node in self.action_iteration:
maybe_iteration_info = ' %d / %d' % (
maybe_iteration_info = ' %d / %s' % (
self.action_iterations_complete[node],
self.iteration_repetitions[self.action_iteration[node]]
self.IterationRepetitionsSymbol(self.action_iteration[node])
)
if node in self.action_stopped:
maybe_iteration_info += ' / stop.'
Expand Down Expand Up @@ -282,9 +287,9 @@ def AsNodesAndEdges(self):
"""Nodes and edges to display in terminal."""
def ColoredNode(node):
if node in self.action_iteration:
maybe_iteration_info = ' %d / %d' % (
maybe_iteration_info = ' %d / %s' % (
self.action_iterations_complete[node],
self.iteration_repetitions[self.action_iteration[node]]
self.IterationRepetitionsSymbol(self.action_iteration[node])
)
if node in self.action_stopped:
maybe_iteration_info += ' / stop.'
Expand Down
2 changes: 2 additions & 0 deletions compiler/functors.py
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,8 @@ def RecursiveAnalysis(self, depth_map, default_iterative, default_depth):
p = min(c & deep)
else:
p = min(c)
if depth_map.get(p, {}).get('1', default_depth) == -1:
depth_map[p]['1'] = 1000000000
# Iterate if explicitly requested or unspecified
# and number of steps is greater than 20.
if (depth_map.get(p, {}).get('iterative', default_iterative) or
Expand Down

0 comments on commit 7ad2da9

Please sign in to comment.