fold/bench/svcomp/tool_info.py
trvon 3f1234f7bb
fold: bounded symbolic SAST for C++
Clang LibTooling + Z3 BV-64 encoding.
11 detectors: clone, equiv, class-dup, dead, null-deref,
div-by-zero, int-overflow, oob, int-truncation,
sign-conversion, taint-track.

Interfaces: CLI, MCP (JSON-RPC 2.0), LSP.
Output: SARIF 2.1.0, JSON, Markdown.
2026-05-14 23:14:54 -04:00

43 lines
1.1 KiB
Python

#!/usr/bin/env python3
"""BenchExec tool-info module for fold SV-COMP runs."""
# pyright: reportMissingImports=false
from __future__ import annotations
from pathlib import Path
import benchexec.tools.template # type: ignore[import-not-found]
RUNNER = Path(__file__).resolve().parents[1] / "run_svcomp.py"
class Tool(benchexec.tools.template.BaseTool2):
def executable(self, tool_locator):
return tool_locator.find_executable("python3")
def name(self):
return "fold"
def cmdline(self, executable, options, task, rlimits):
return [
executable,
str(RUNNER),
"--benchexec-task",
task.single_input_file,
*options,
]
def determine_result(self, run):
output = "\n".join(run.output)
marker = "SVCOMP_RESULT="
for line in reversed(output.splitlines()):
if not line.startswith(marker):
continue
verdict = line[len(marker):].strip()
if verdict:
return verdict
if run.was_timeout:
return "TIMEOUT"
return "ERROR"