def __init__(self, varList, pred, expr, node, env): from constraintsolver import compute_constrained_domains if USE_RPYTHON_CODE: from rpython_interp import interpret else: from interp import interpret SymbolicSet.__init__(self, env) self.variable_list = varList self.predicate = pred self.expression = expr self.node = node self.interpret = interpret self.domain_generator = compute_constrained_domains self.explicit_set_computed = False
def __eq__(self, other): # check importent special case first # %(x,y).(x:S & y:T|y) = prj2(S,T) if isinstance(other, SymbolicLambda): if not len(other.variable_list)==2: return False if isinstance(other.predicate, AConjunctPredicate): belong_pred0 = other.predicate.children[0] belong_pred1 = other.predicate.children[1] if isinstance(belong_pred0, AMemberPredicate) and isinstance(belong_pred1, AMemberPredicate): x = other.variable_list[0].idName y = other.variable_list[1].idName xx = belong_pred0.children[0] yy = belong_pred1.children[0] if USE_RPYTHON_CODE: from rpython_interp import interpret else: from interp import interpret if isinstance(xx, AIdentifierExpression) and xx.idName==x: S = interpret(belong_pred0.children[1], self.env) if isinstance(yy, AIdentifierExpression) and yy.idName==y: T = interpret(belong_pred1.children[1], self.env) if isinstance(other.expression, AIdentifierExpression): # else: maybe equal. try: if self.left_set==S and self.right_set==T and y==other.expression.idName: return True except NameError: pass # maybe equal. use brute-force in symbolic set return SymbolicSet.__eq__(self, other)
def __init__(self, relation, env, node): SymbolicSet.__init__(self, env) self.relation = relation self.node = node
def __init__(self, function, env, node): SymbolicSet.__init__(self, env) self.function = function self.node = node
def __init__(self, arelation0, arelation1, env, node): SymbolicSet.__init__(self, env) self.left_relation = arelation0 self.right_relation = arelation1 self.node = node
def __init__(self, aset0, aset1, env, node): SymbolicSet.__init__(self, env) self.left_set = aset0 self.right_set = aset1 self.node = node
def __eq__(self, other): # TODO: handle empty set and maybe more sp. cases return SymbolicSet.__eq__(self, other)
def __init__(self, aset, env, node): SymbolicSet.__init__(self, env) self.aset = aset self.node = node