Add smtlib.py
This commit is contained in:
committed by
Jakob Stoklund Olesen
parent
eadb4cd39a
commit
b5e1e4d454
@@ -156,19 +156,19 @@ class Var(Expr):
|
||||
Values that are defined only in the destination pattern.
|
||||
"""
|
||||
|
||||
def __init__(self, name):
|
||||
# type: (str) -> None
|
||||
def __init__(self, name, typevar=None):
|
||||
# type: (str, TypeVar) -> None
|
||||
self.name = name
|
||||
# The `Def` defining this variable in a source pattern.
|
||||
self.src_def = None # type: Def
|
||||
# The `Def` defining this variable in a destination pattern.
|
||||
self.dst_def = None # type: Def
|
||||
# TypeVar representing the type of this variable.
|
||||
self.typevar = None # type: TypeVar
|
||||
self.typevar = typevar # type: TypeVar
|
||||
# The original 'typeof(x)' type variable that was created for this Var.
|
||||
# This one doesn't change. `self.typevar` above may be changed to
|
||||
# another typevar by type inference.
|
||||
self.original_typevar = None # type: TypeVar
|
||||
self.original_typevar = self.typevar # type: TypeVar
|
||||
|
||||
def __str__(self):
|
||||
# type: () -> str
|
||||
|
||||
@@ -72,7 +72,7 @@ class Rtl(object):
|
||||
# type: () -> Set[Var]
|
||||
""" Return the set of free Vars used in self"""
|
||||
def flow_f(s, d):
|
||||
# type: (Set[Var], Def): Set[Var]
|
||||
# type: (Set[Var], Def) -> Set[Var]
|
||||
"""Compute the change in the set of free vars across a Def"""
|
||||
s = s.difference(set(d.defs))
|
||||
return s.union(set(a for a in d.expr.args if isinstance(a, Var)))
|
||||
|
||||
Reference in New Issue
Block a user