Skip to content

Commit

Permalink
Reset constant property of UnfinishedSequence after drawing
Browse files Browse the repository at this point in the history
  • Loading branch information
emileferreira committed Feb 5, 2024
1 parent 99f13da commit 19a9a92
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions RASP_support/DrawCompFlow.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,11 +464,12 @@ def __init__(self, depth, d_heads, d_ffs, add_tokens_on_ff=False):
ff_parents += ff.get_nonminor_parent_sequences()
ff_parents = list(set(ff_parents))
ff_parents = [p for p in ff_parents if not guarded_contains(d_ffs, p)]
# in the trivial case (no parents and only one ff), the ff is marked as
# constant and should be labelled as 'X'
# in the trivial case (no parents and only one ff), the ff is
# temporarily marked as constant and should be labelled as 'X'
for x in [ff for ff in d_ffs if ff.is_constant()]:
d_ffs.remove(x)
ff_parents.append(x)
x._constant = False
rows_by_type = {RES: d_ffs, VVAR: ff_parents}
rowtype_order = [VVAR, RES]
if add_tokens_on_ff and not contains_tokens(ff_parents):
Expand Down
2 changes: 1 addition & 1 deletion RASP_support/analyse.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def __init__(self, select, sequences, comp_depth):
# filter out non-ffs in the non-trivial case
all_ffs = [m for m in all_ffs if m.from_zipmap]
else:
# mark the sequence as constant in the case of trivial indices or tokens
# temporarily mark the sequence as constant in the trivial case
for ff in all_ffs:
ff.mark_as_constant()
if remove_minors:
Expand Down

0 comments on commit 19a9a92

Please sign in to comment.