Esempio n. 1
0
def cnf_test(lines):
    s = solver.msat_solver()

    for l in lines:
        if l and l[0] in 'pc%0':
            pass  # comment
        else:
            # skip trailing 0
            cl = [int(i) for i in l.split()[0:-1]]
            if cl and not s.add_clause(cl):
                return False
    # create new copy of solver instance to test copy code
    n = solver.msat_solver(s)
    del s  # force gc of old solver instance
    return n.solve([])
Esempio n. 2
0
def cnf_test(lines):
        s = solver.msat_solver()
        
        for l in lines:
                if l and l[0] in 'pc%0':
                        pass # comment
                else:
                        # skip trailing 0
                        cl = [int(i) for i in l.split()[0:-1]]
                        if cl and not s.add_clause(cl):
                                return False
        # create new copy of solver instance to test copy code
        n = solver.msat_solver(s)
        del s # force gc of old solver instance
        return n.solve([])