Skip to content
Snippets Groups Projects
Commit f1f2faee authored by Martin Bauer's avatar Martin Bauer
Browse files

Merge branch 'AssignmentCollection.free-bound_fields' into 'master'

Add AssignmentCollection.{free_fields,bound_fields}

See merge request pycodegen/pystencils!57
parents dcf2c6f4 4c225c82
Branches
Tags
No related merge requests found
Pipeline #18382 passed with warnings with stage
in 4 minutes and 22 seconds
......@@ -111,6 +111,15 @@ class AssignmentCollection:
"Not in SSA form - same symbol assigned multiple times"
return bound_symbols_set
def free_fields(self):
"""All fields accessed in the assignment collection, which do not occur as left hand sides in any assignment."""
return {s.field for s in self.free_symbols if hasattr(s, 'field')}
@property
def bound_fields(self):
"""All field accessed on the left hand side of a main assignment or a subexpression."""
return {s.field for s in self.bound_symbols if hasattr(s, 'field')}
@property
def defined_symbols(self) -> Set[sp.Symbol]:
"""All symbols which occur as left-hand-sides of one of the main equations"""
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment