help='Optionally pick which columns per benchmarks we want') p.add_argument( "--exp-columns", nargs='+', choices=all_exp_cols, help='Optionally pick which columns per experience level we want') p.add_argument("--timeout", type=int, help="Z3 timeout") p.add_argument( "--lvlset", required=True, help="Include lvlset invs; may specify multiple items (unset = any)") args = p.parse_args() filter_args = {} lvlset, lvls = loadBoogieLvlSet(args.lvlset) if args.experiments: filter_args['enames'] = args.experiments if args.lvlids: filter_args['lvls'] = args.lvlids if args.lvl_columns is not None: assert args.stat == 'lvl_stats' lvl_cols = args.lvl_columns else: lvl_cols = all_lvl_cols if args.exp_columns is not None: assert args.stat in [ 'math_exp_stats', 'prog_exp_stats', 'ave_exp_stats', 'max_exp_stats', 'sum_exp_stats'
help="lvl to use for generating traces") p.add_argument("--write", action="store_true") p.add_argument("--length", type=int, default=10, help="try find traces of length (defualt 10)") p.add_argument("--limit", type=int, default=100, help="max numer of traces found (defualt 100)") args = p.parse_args() # Process arguments lvlset_path: str = args.lvlset curLevelSetName, lvls = loadBoogieLvlSet(lvlset_path) lvl: BoogieTraceLvl = lvls[args.lvl] trace_dir: Optional[str] = None if args.write: trace_dir = lvl["path"][0][:-4] + ".new_fuzz_traces" print("Making trace directory:", trace_dir) try: assert trace_dir is not None os.mkdir(trace_dir) except OSError: pass print() print("=== LEVEL ===") print(lvl)
#signal(SIGALRM, handler); if (__name__ == "__main__"): p = argparse.ArgumentParser(description="run ICE on a levelset") p.add_argument('--lvlset', type=str, \ help='Path to lvlset file', required=True) p.add_argument('--csv-table', action="store_true", \ default=True, help='Print results as a csv table') p.add_argument('--time-limit', type=int, default=300, \ help='Time limit for ICE') p.add_argument('--waitEnter', action="store_true", \ default=False, help='Wait for user to perss Enter before continuing (great for debug)') args = p.parse_args() if args.waitEnter: eval(input("Press Enter to continue...")) lvlSetName, lvls = loadBoogieLvlSet(args.lvlset) res = {} conf = {} for lvlName, lvl in lvls.items(): boogieFile = lvl["path"][2] error("Running ", lvlName) res[lvlName] = runICE(boogieFile, args.time_limit) solved, loopHeaderLbl, loopInvs, rawOutput = res[lvlName] conf_status = "N/A" if (solved): error("z3 invs: ", len(loopInvs), loopInvs)
from pyboogie.eval import evalPred import pyboogie.ast as bast from pyboogie.z3_embed import Unknown, unsatisfiable, expr_to_z3, \ AllIntTypeEnv, env_to_expr from lib.invgame_server.vc_check import tryAndVerifyLvl from re import compile as reComp from lib.common.util import unique from os.path import exists import os p = argparse.ArgumentParser(description="check a lvlset is correctly built") p.add_argument("--lvlset", type=str, help="lvlset to checl", required=True) p.add_argument("--timeout", type=int, help="timeout on z3 queries") args = p.parse_args() curLevelSetName, lvls = levels.loadBoogieLvlSet(args.lvlset) def verify(aLvl, aInvs): ((aOverfit, aOverfit2), (aNonind, aNonind2), aSound, aViolations) =\ tryAndVerifyLvl(aLvl, set(aInvs), set(), args.timeout, addSPs = False, useSplitters = False, generalizeUserInvs = False); assert (len(aOverfit2) == 0 and len(aNonind2) == 0) return (aOverfit, aNonind, aSound, aViolations) print("Checking paths...") for lvl_name, lvl in list(lvls.items()): paths = lvl["path"] if (len(paths) < 3): print("Missing original boogie path for ", lvl_name) else: if (not(exists(paths[2]))):