if var in D.dependencies: guards += D.dependencies[var] R.types[R.Typ.GUARD] += guards for typ in R.types: for var in R.types[typ]: if var.name.startswith("REF") or var.name.startswith("TMP"): R.types[typ].remove(var) to_delete = [] for var in D.dependencies: if var.name.startswith("REF") or var.name.startswith("TMP"): to_delete.append(var) else: to_delete2 = [] for var2 in D.dependencies[var]: if var2.name.startswith("REF") or var2.name.startswith("TMP"): to_delete2.append(var2) for x in to_delete2: D.dependencies[var].remove(x) if len(D.dependencies[var]) == 0: to_delete.append(var) for x in to_delete: D.dependencies.pop(x, None) R.types[R.Typ.WRITTEN] = D.dependencies.keys() R.types[R.Typ.READ] = [x for vals in D.dependencies.values() for x in vals] R.pprint_refinement() D.pprint_dependency(funcA)