environment
Context
¶
Bases: ABC
Source code in src/finch/symbolic/environment.py
block()
¶
Create a new block. Preambles and epilogues will stay within this block.
Source code in src/finch/symbolic/environment.py
NamedTerm
¶
Namespace
¶
Namespace
A namespace for managing variable names and aesthetic fresh variable
generation. You can construct a namespace from an existing tree of Terms
to avoid name collisions.
Source code in src/finch/symbolic/environment.py
freshen(*tags)
¶
Generate a fresh variable name based on the provided tags.
Source code in src/finch/symbolic/environment.py
resolve(*names)
¶
Resolve a list of namespaced variable names to a unique name.
e.g. resolve("a", "b") might return a_b_1 if a_b has already been
used in scope.
Source code in src/finch/symbolic/environment.py
ScopedDict
¶
Bases: Generic[T]
A dictionary that allows for scoped variable resolution.