Skip to content

Commit

Permalink
Merge branch 'sosy-lab:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
rmetta authored Nov 2, 2023
2 parents cfd1f0b + b7dcb59 commit bede804
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
14 changes: 13 additions & 1 deletion benchexec/tools/abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,24 @@ class Tool(benchexec.tools.template.BaseTool2):
URL: https://people.eecs.berkeley.edu/~alanmi/abc/
"""

REQUIRED_PATHS = ["bin/", "abc.rc"]

def executable(self, tool_locator):
return tool_locator.find_executable("abc", subdir="bin")

def name(self):
return "ABC"

def version(self, executable):
return self._version_from_tool(
executable, arg="-q version", line_prefix="UC Berkeley, ABC"
)

def program_files(self, executable):
return self._program_files_from_executable(
executable, self.REQUIRED_PATHS, parent_dir=True
)

def cmdline(self, executable, options, task, rlimits):
# The default read method in ABC cannot process uninitialized registers properly.
# Therefore, a new read method `&r` (`&read`) is invoked here.
Expand All @@ -39,7 +51,7 @@ def determine_result(self, run):
"""
if run.was_timeout:
return result.RESULT_TIMEOUT
for line in run.output:
for line in run.output[::-1]:
if line.startswith("Property proved") or line.startswith(
"Networks are equivalent"
):
Expand Down
9 changes: 8 additions & 1 deletion benchexec/tools/avr.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import benchexec.result as result
import benchexec.tools.template
from math import ceil


class Tool(benchexec.tools.template.BaseTool2):
Expand All @@ -15,13 +16,19 @@ class Tool(benchexec.tools.template.BaseTool2):
URL: https://github.com/aman-goel/avr
"""

REQUIRED_PATHS = ["build/"]

def executable(self, tool_locator):
return tool_locator.find_executable("avr.py")

def name(self):
return "AVR"

def cmdline(self, executable, options, task, rlimits):
if rlimits.cputime and "--timeout" not in options:
options += ["--timeout", str(rlimits.cputime)]
if rlimits.memory and "--memout" not in options:
options += ["--memout", str(ceil(rlimits.memory / 1000000.0))]
return [executable] + options + [task.single_input_file]

def determine_result(self, run):
Expand All @@ -30,7 +37,7 @@ def determine_result(self, run):
"""
if run.was_timeout:
return result.RESULT_TIMEOUT
for line in run.output:
for line in run.output[::-1]:
# skip the lines that do not contain verification result
if not line.startswith("Verification result:"):
continue
Expand Down

0 comments on commit bede804

Please sign in to comment.