@@ -0,0 +1,2104 @@
+import re%0Aimport os%0Aimport sys%0Aimport subprocess%0Afrom natsort import natsort_keygen, ns%0A%0Aif len(sys.argv) %3C 2:%0A    print('python3 validator_all.py testbenchDir')%0A    exit(0)%0A%0Asolver = './yasat' if len(sys.argv)%3C3 else sys.argv%5B2%5D%0A%0ASAT = 0%0AUNSAT = 0%0AERROR = 0%0ATIMEOUT = 0%0A%0A%0Adef check(cnfFile, result):%0A%0A    assignment = set(str(result).split()%5B2:-1%5D)%0A%0A    ok = True%0A    clsok = False%0A    with open(cnfFile) as cnf:%0A        for line in cnf:%0A            clause = line.split()%0A            if len(clause)==0 or clause%5B0%5D == 'p' or clause%5B0%5D == 'c':%0A                continue%0A            for v in clause:%0A                if v == '0':%0A                    if not clsok:%0A                        ok = False%0A                    clsok = False%0A                elif v in assignment:%0A                    clsok = True%0A%0A    return ok%0A%0A%0Afor dirname, dirnames, filenames in os.walk(sys.argv%5B1%5D):%0A%0A    filenames.sort(key=lambda x: natsort_keygen(alg=ns.IGNORECASE)(x))%0A    for filename in filenames:%0A        %0A        # Run only .cnf files%0A        if filename.find('.cnf') == -1:%0A            continue%0A        cnfFile = os.path.join(dirname, filename)%0A        print(os.path.join(filename).ljust(20, %22 %22), end='')%0A        proc = subprocess.Popen(%5B%0A            solver, '-stdout', '-statistic',%0A            cnfFile%5D,%0A            stdout=subprocess.PIPE,%0A            stderr=subprocess.PIPE,)%0A        try:%0A            outs, errs = proc.communicate(input=None, timeout=1200)%0A        except subprocess.TimeoutExpired:%0A            proc.kill()%0A            outs, errs = proc.communicate()%0A            TIMEOUT += 1%0A            print('TIMEOUT%5Cn')%0A            continue%0A        result = str(outs)%0A%0A        if proc.returncode != 0:%0A            print('ERROR')%0A            ERROR = ERROR + 1%0A        elif result.find('UNSATISFIABLE') != -1:%0A            print('UNSAT')%0A            UNSAT = UNSAT + 1%0A        else:%0A            print('SAT', 'AC' if check(cnfFile, result) else 'WA')%0A            SAT = SAT + 1%0A%0A%0Aprint(%22 statistic %22.center(70, %22-%22))%0Aprint('SAT', SAT, '/ UNSAT', UNSAT, '/ ERROR', ERROR, '/ TIMEOUT', TIMEOUT)%0Aprint(%22%22.center(70, %22=%22))%0A

Add validator for all testcase in dir