#!/usr/bin/python3 import sys import os import glob from fix_verdicts import fix_verdicts from aggregate import aggregate SOLVERS = [ 'Eldarica', 'Golem', 'Z3' ] def main(): groups = {} for file in glob.glob('sleep-threadmodular.*.threadmodular-examples.xml'): # adjust verdicts: mark as sat/unsat and as correct/incorrect fix_verdicts(file) # split off "sleep-threadmodular.." at the beginning and ".threadmodular-examples.xml" at the end name = os.path.basename(file).split('.')[2:-2] # group run configs that have the same name except for the CHC solver suffix if name[-1] in SOLVERS: prefix = tuple(name[:-1]) if prefix not in groups: groups[prefix] = [] groups[prefix].append(file) # aggregate across solvers for group in groups.values(): print("Aggregating files:\n" + '\n'.join([ " - " + file for file in group])) if len(group) != len(SOLVERS): print("Warning: not all solvers present") if len(group) == 1: print("Only one file, skipping aggregation: " + group[0]) continue aggregate(group) print() if __name__ == '__main__': sys.exit(main())