Skip to content

Commit

Permalink
Fix Code Mode: Formatted notice messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Yiannis128 committed Apr 18, 2024
1 parent 86a590b commit 47098ad
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions esbmc_ai/commands/fix_code_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def print_raw_conversation() -> None:
break

# Print verbose lvl 2
printvv("\nGeneration:")
printvv("\nESBMC-AI Notice: Source Code Generation:")
print_horizontal_line(2)
printvv(source_code)
print_horizontal_line(2)
Expand All @@ -120,6 +120,7 @@ def print_raw_conversation() -> None:
self.anim.stop()

# Print verbose lvl 2
printvv("\nESBMC-AI Notice: ESBMC Output:")
print_horizontal_line(2)
printvv(esbmc_output)
print_horizontal_line(2)
Expand All @@ -131,7 +132,7 @@ def print_raw_conversation() -> None:
if config.raw_conversation:
print_raw_conversation()

printv("ESBMC-AI Notice: Successfully verified code")
printv("ESBMC-AI Notice: Successfuly verified code")

return False, source_code

Expand All @@ -146,11 +147,17 @@ def print_raw_conversation() -> None:
except SourceCodeParseError:
pass
except ESBMCTimedOutException:
print("error: ESBMC has timed out...")
if config.raw_conversation:
print_raw_conversation()
print("ESBMC-AI Notice: error: ESBMC has timed out...")
sys.exit(1)

# Failure case
print(f"ESBMC-AI Notice: Failure {idx+1}/{max_retries}: Retrying...")
print(
f"ESBMC-AI Notice: Failure {idx+1}/{max_retries}" + ": Retrying..."
if idx != max_retries - 1
else ""
)

# Update state
solution_generator.update_state(source_code, esbmc_output)
Expand Down

0 comments on commit 47098ad

Please sign in to comment.