Skip to content

Commit ff38f87

Browse files
Merge pull request sosy-lab#1141 from Po-Chun-Chien/ric3-tool-info
Add a tool-info module for rIC3
2 parents fe51d28 + 8077594 commit ff38f87

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

benchexec/tools/ric3.py

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# This file is part of BenchExec, a framework for reliable benchmarking:
2+
# https://github.com/sosy-lab/benchexec
3+
#
4+
# SPDX-FileCopyrightText: 2007-2020 Dirk Beyer <https://www.sosy-lab.org>
5+
#
6+
# SPDX-License-Identifier: Apache-2.0
7+
8+
import benchexec.result as result
9+
import benchexec.tools.template
10+
11+
12+
class Tool(benchexec.tools.template.BaseTool2):
13+
"""
14+
Tool info for rIC3
15+
"""
16+
17+
def executable(self, tool_locator):
18+
return tool_locator.find_executable("rIC3")
19+
20+
def name(self):
21+
return "rIC3"
22+
23+
def version(self, executable):
24+
version_string = self._version_from_tool(executable, line_prefix="rIC3 ")
25+
commit_hash = self._version_from_tool(executable, line_prefix="commit_hash:")
26+
if commit_hash:
27+
# Different commits of rIC3 could have the same version number.
28+
# Therefore, the commit hash is appended to get a more precise version information.
29+
version_string += f" ({commit_hash})"
30+
return version_string
31+
32+
def project_url(self):
33+
return "https://github.com/gipsyh/rIC3"
34+
35+
def cmdline(self, executable, options, task, rlimits):
36+
return [executable] + options + [task.single_input_file]
37+
38+
def determine_result(self, run):
39+
for line in run.output[::-1]:
40+
# skip the lines that do not contain verification result
41+
if not line.startswith("result:"):
42+
continue
43+
if "true" in line:
44+
return result.RESULT_TRUE_PROP
45+
elif "false" in line:
46+
return result.RESULT_FALSE_PROP
47+
return result.RESULT_ERROR

0 commit comments

Comments
 (0)