Skip to content

Commit

Permalink
Remove unnecessary globals in normalizer
Browse files Browse the repository at this point in the history
Signed-off-by: Anqur <[email protected]>
  • Loading branch information
anqurvanillapy committed Mar 4, 2024
1 parent 235a76d commit b0b92fa
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion lyzh/abstract/normalize.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
@dataclasses.dataclass
class Normalizer:
ids: core.IDs
globals: ast.Globals
# env 在学术里又叫做 rho, ρ, evaluation context, evaluation environment 等等,
# 要时刻注意这里的映射值的结构是 ast.Term, 和 ast.Locals 不同, 它可以是类型 (type term),
# 也可以是值 (value term), 因为这里要做的事情无非就是变量替换 (substitution).
Expand Down
2 changes: 1 addition & 1 deletion lyzh/abstract/unify.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ def unify(self, lhs: ast.Term, rhs: ast.Term) -> bool:
return False

def nf(self) -> normalize.Normalizer:
return normalize.Normalizer(self.ids, self.globals)
return normalize.Normalizer(self.ids)
2 changes: 1 addition & 1 deletion lyzh/concrete/elab.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def guarded_infer(

def nf(self) -> normalize.Normalizer:
"""获取求值器."""
return normalize.Normalizer(self.ids, self.globals)
return normalize.Normalizer(self.ids)

def unify(self, lhs: ast.Term, rhs: ast.Term) -> bool:
"""检查两个值是否相等."""
Expand Down

0 comments on commit b0b92fa

Please sign in to comment.