From 6a95ef33c861f83e2a1df0240020b515e8c33d08 Mon Sep 17 00:00:00 2001 From: "N. Engelhardt" Date: Wed, 13 May 2020 18:15:33 +0200 Subject: [PATCH] fix trace summary printing --- sbysrc/sby_engine_btor.py | 5 ++--- sbysrc/sby_engine_smtbmc.py | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/sbysrc/sby_engine_btor.py b/sbysrc/sby_engine_btor.py index d306230..b8d538e 100644 --- a/sbysrc/sby_engine_btor.py +++ b/sbysrc/sby_engine_btor.py @@ -70,15 +70,14 @@ def run(mode, job, engine_idx, engine): job.log("engine_{}: Status returned by engine: {}".format(engine_idx, task_status)) job.summary.append("engine_{} ({}) returned {}".format(engine_idx, " ".join(engine), task_status)) - common_state.produced_traces.sort() if len(common_state.produced_traces) == 0: job.log("engine_{}: Engine did not produce a counter example.".format(engine_idx)) - elif len(common_state.produced_traces) < common_state.print_traces_max: + elif len(common_state.produced_traces) <= common_state.print_traces_max: job.summary.extend(common_state.produced_traces) else: job.summary.extend(common_state.produced_traces[:common_state.print_traces_max]) excess_traces = len(common_state.produced_traces) - common_state.print_traces_max - job.summary.append("and {} further trace{}".format(excess_traces, "s" if excess_traces > 1 else {})) + job.summary.append("and {} further trace{}".format(excess_traces, "s" if excess_traces > 1 else "")) job.terminate() diff --git a/sbysrc/sby_engine_smtbmc.py b/sbysrc/sby_engine_smtbmc.py index b94ea45..b419472 100644 --- a/sbysrc/sby_engine_smtbmc.py +++ b/sbysrc/sby_engine_smtbmc.py @@ -192,7 +192,7 @@ def run(mode, job, engine_idx, engine): while os.path.exists("{}/engine_{}/trace{}.vcd".format(job.workdir, engine_idx, print_traces_max + excess_traces)): excess_traces += 1 if excess_traces > 0: - job.summary.append("and {} further trace{}".format(excess_traces, "s" if excess_traces > 1 else {})) + job.summary.append("and {} further trace{}".format(excess_traces, "s" if excess_traces > 1 else "")) job.terminate() -- 2.30.2