minimizer.py
def run(graph, linearizations, depth):
    """ Run reduction through glucose and interpret """

    # Collect reduction into a stream
    with io.StringIO() as reduction:
        gen_cnf.output_cnf(reduction, linearizations, depth, graph)
        cnf = reduction.getvalue()

    proc = subprocess.Popen([GLUCOSE, "-model"], stdin=subprocess.PIPE,
                            stdout=subprocess.PIPE)
    sat_result = proc.communicate(cnf.encode("utf-8"))[0].decode("utf-8")
    assignment = sat_result.splitlines()[-1]

    if assignment == "s UNSATISFIABLE":
        return False, None
    else:
        variables = interpret.text2vars(assignment, linearizations, graph)
        lin_vars, dtuple_vars = interpret.split_vars(variables)
        lins = interpret.get_linearizations(lin_vars, linearizations, graph)
        return True, lins
 Run reduction through glucose and interpret 
Run reduction through glucose and interpret
Run reduction through glucose and interpret
def run(graph, linearizations, depth):
    with io.StringIO() as reduction:
        gen_cnf.output_cnf(reduction, linearizations, depth, graph)
        cnf = reduction.getvalue()
    proc = subprocess.Popen([GLUCOSE, "-model"], stdin=subprocess.PIPE,
                            stdout=subprocess.PIPE)
    sat_result = proc.communicate(cnf.encode("utf-8"))[0].decode("utf-8")
    assignment = sat_result.splitlines()[-1]
    if assignment == "s UNSATISFIABLE":
        return False, None
    else:
        variables = interpret.text2vars(assignment, linearizations, graph)
        lin_vars, dtuple_vars = interpret.split_vars(variables)
        lins = interpret.get_linearizations(lin_vars, linearizations, graph)
        return True, lins
def run ( graph , linearizations , depth ) : with io . StringIO ( ) as reduction : gen_cnf . output_cnf ( reduction , linearizations , depth , graph ) cnf = reduction . getvalue ( ) proc = subprocess . Popen ( [ GLUCOSE , "-model" ] , stdin = subprocess . PIPE , stdout = subprocess . PIPE ) sat_result = proc . communicate ( cnf . encode ( "utf-8" ) ) [ 0 ] . decode ( "utf-8" ) assignment = sat_result . splitlines ( ) [ - 1 ] if assignment == "s UNSATISFIABLE" : return False , None else : variables = interpret . text2vars ( assignment , linearizations , graph ) lin_vars , dtuple_vars = interpret . split_vars ( variables ) lins = interpret . get_linearizations ( lin_vars , linearizations , graph ) return True , lins
Run reduction through glucose and interpret
Run reduction through glucose and interpret
""" Run reduction through glucose and interpret """ # Collect reduction into a stream
graph
linearizations
depth