Skip to content

Commit

Permalink
bring back model output in solve_end_to_end
Browse files Browse the repository at this point in the history
  • Loading branch information
karmacoma-eth committed Jan 9, 2025
1 parent de13931 commit b7bc1f6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/halmos/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,7 @@ def log_future_result(future: Future):
break
elapsed = timedelta(seconds=int(timer.elapsed()))
status.update(f"[{elapsed}] solving queries: {done} / {total}")

time.sleep(0.1)

ctx.thread_pool.shutdown(wait=True)
Expand Down
7 changes: 6 additions & 1 deletion src/halmos/solve.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from halmos.config import Config as HalmosConfig
from halmos.constants import VERBOSITY_TRACE_COUNTEREXAMPLE, VERBOSITY_TRACE_PATHS
from halmos.logs import (
COUNTEREXAMPLE_INVALID,
COUNTEREXAMPLE_UNKNOWN,
debug,
error,
Expand All @@ -18,7 +19,7 @@
)
from halmos.processes import PopenExecutor, PopenFuture, TimeoutExpired
from halmos.sevm import Exec, SMTQuery
from halmos.utils import con, stringify
from halmos.utils import con, red, stringify


@dataclass
Expand Down Expand Up @@ -467,13 +468,17 @@ def solve_end_to_end(ctx: PathContext) -> None:
return

if model.is_valid:
print(red(f"Counterexample: {model}"))
fun_ctx.valid_counterexamples.append(model)

# we have a valid counterexample, so we are eligible for early exit
if args.early_exit:
debug(f"Shutting down {fun_ctx.info.name}'s solver executor")
fun_ctx.solver_executor.shutdown(wait=False)
else:
warn_str = f"Counterexample (potentially invalid): {model}"
warn_code(COUNTEREXAMPLE_INVALID, warn_str)

fun_ctx.invalid_counterexamples.append(model)


Expand Down

0 comments on commit b7bc1f6

Please sign in to comment.