def clause_to_z3(clause): z3_literals = [literal_to_z3(lit) for lit in clause] z3_formula = z3.Or(z3_literals) variables = sorted(used_variables_clause(clause)) if len(variables) == 0: return z3_formula else: z3_variables = [term_to_z3(v) for v in variables] return z3.ForAll(z3_variables, z3_formula)