diff --git a/analyze.py b/analyze.py index 52e124acc1edf51735c720579acad27d52b6354d_YW5hbHl6ZS5weQ==..4811155ef54d4ebaf18db544b0f8e2ca35b94d16_YW5hbHl6ZS5weQ== 100644 --- a/analyze.py +++ b/analyze.py @@ -32,6 +32,11 @@ self.scons = [] self.output = StringIO() + def debug(self): + print "Domains:", self.domains + print "Constraints:", self.constraints + print "Scons:", self.scons + def get_output(self): return self.output.getvalue() @@ -135,6 +140,13 @@ self.all_values = set() # this gets turned into a list later self.idx_domains = [] # maps var index -> list of val index + + def debug(self): + print "Domains:", self.domains + print "Ops:", self.op + print "Variables:", self.variables + print "Values:", self.values + def get_output(self): return "" def solve(self): @@ -250,6 +262,7 @@ [mapping from relation to function taking rhs value as argument and returning an entity type]. """ + self.debug = 0 self.set_schema(schema) if uid_func_mapping is None: self.uid_func_mapping = {} @@ -270,6 +283,4 @@ if self.debug > 1: print "- AN1 -"+'-'*80 print node - print "DOMAINS:" - pprint(domains) print "CONSTRAINTS:" @@ -275,5 +286,5 @@ print "CONSTRAINTS:" - pprint(constraints.scons) + constraints.debug() sols = constraints.solve() @@ -450,8 +461,6 @@ samevar = True else: rhsvars.append(v.name) - else: - return True if rhsvars: s2 = '=='.join(rhsvars) res = [] @@ -519,4 +528,3 @@ if isinstance(child, nodes.Relation) and \ not self.schema.rschema(child.r_type).is_final(): return True -