From 80775944da10d62a10b736419a6a1c655061724c Mon Sep 17 00:00:00 2001 From: Po-Chun Chien Date: Tue, 10 Dec 2024 17:48:21 +0100 Subject: [PATCH] Create a tool-info module for rIC3 --- benchexec/tools/ric3.py | 47 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 benchexec/tools/ric3.py diff --git a/benchexec/tools/ric3.py b/benchexec/tools/ric3.py new file mode 100644 index 000000000..409a60f2a --- /dev/null +++ b/benchexec/tools/ric3.py @@ -0,0 +1,47 @@ +# This file is part of BenchExec, a framework for reliable benchmarking: +# https://github.com/sosy-lab/benchexec +# +# SPDX-FileCopyrightText: 2007-2020 Dirk Beyer +# +# SPDX-License-Identifier: Apache-2.0 + +import benchexec.result as result +import benchexec.tools.template + + +class Tool(benchexec.tools.template.BaseTool2): + """ + Tool info for rIC3 + """ + + def executable(self, tool_locator): + return tool_locator.find_executable("rIC3") + + def name(self): + return "rIC3" + + def version(self, executable): + version_string = self._version_from_tool(executable, line_prefix="rIC3 ") + commit_hash = self._version_from_tool(executable, line_prefix="commit_hash:") + if commit_hash: + # Different commits of rIC3 could have the same version number. + # Therefore, the commit hash is appended to get a more precise version information. + version_string += f" ({commit_hash})" + return version_string + + def project_url(self): + return "https://github.com/gipsyh/rIC3" + + def cmdline(self, executable, options, task, rlimits): + return [executable] + options + [task.single_input_file] + + def determine_result(self, run): + for line in run.output[::-1]: + # skip the lines that do not contain verification result + if not line.startswith("result:"): + continue + if "true" in line: + return result.RESULT_TRUE_PROP + elif "false" in line: + return result.RESULT_FALSE_PROP + return result.RESULT_ERROR