environment
Context
Bases: ABC
Source code in src/finch/symbolic/environment.py
130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 | |
block()
Create a new block. Preambles and epilogues will stay within this block.
Source code in src/finch/symbolic/environment.py
149 150 151 152 153 154 155 156 157 158 | |
emit()
abstractmethod
Emit the code in this context.
Source code in src/finch/symbolic/environment.py
160 161 162 163 164 165 | |
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
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | |
freshen(*tags)
Generate a fresh variable name based on the provided tags.
Source code in src/finch/symbolic/environment.py
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | |
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
56 57 58 59 60 61 62 | |
ScopedDict
Bases: Generic[T]
A dictionary that allows for scoped variable resolution.
Source code in src/finch/symbolic/environment.py
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 | |
scope()
Create a new scoped dictionary that inherits from this one.
Source code in src/finch/symbolic/environment.py
115 116 117 118 119 | |