Skip to content

Emit YAML violation witnesses (format 2.3) - #1

Merged
nils-loose merged 1 commit into
mainfrom
feat/yaml-witness-2.3
Oct 15, 2026
Merged

nils-loose merged 1 commit into
mainfrom
feat/yaml-witness-2.3

Conversation

@nils-loose

Copy link
Copy Markdown
Contributor

Adds YAML violation witnesses (format 2.3), required for Java in SV-COMP 2027 (benchmarks). witness.graphml is still written. Refs SWAT-project/SWAT#45.

Format

  • One violation_sequence entry: format_version: "2.3", language: Java, input_file_hashes (sha256 of the inputs as given), specification from the .prp, no data_model
  • One function_return waypoint per Verifier.nondet*() value: location = closing ) of the call, constraint \result == <literal> (java_expression)
  • Final target waypoint at the violating statement (assert / throw / first token), from the innermost stack frame inside the task sources

Details

  • Markers: new fields (call index on the line, type descriptor, source file); legacy 4-field markers still parse. New [WITNESS_TARGET] marker with the throwable's stack trace.
  • Literals: L only when outside int range, char literals, f for floats, Float.isNaN(\result) / \result == Double.POSITIVE_INFINITY, -0.0 preserved, \result.equals("…") with Java escaping
  • Column omitted if the call can't be found on the line (multi-line calls); no target segment if no target marker
  • CLI: --input, --property, --out, --producer-version; legacy positional form still works. Templates are resolved next to the jar.
  • JUnit 5 tests (19)

Testing

  • 40 SV-COMP tasks (all value types, both properties, multi-file, same-line calls, no-nondet): WitnessLint 2.3 31/31 well-formed; target present on 27/27 violations; wit4java on the GraphML twin 23/27 (the 4 misses are no-runtime-exception, unsupported by wit4java)
  • JLiSA-Wit (svcomp27) rejects all 2.3 witnesses, including the official GDart example (expects a mapping root, ignores function_return)

Release

After merge: tag v0.2.0; SWAT bumps WITNESS_CREATOR_VERSION/SHA256 (SWAT-project/SWAT draft PR). The release layout is unchanged.

🤖 Generated with Claude Code

SV-COMP 2027 requires Java violation witnesses in the YAML format,
version 2.3. WitnessCreator now writes witness.yml with one
violation_sequence: a function_return waypoint per recorded
Verifier.nondet*() value (constraint `\result == <java literal>`,
location at the closing parenthesis of the call) and a final target
waypoint at the violating statement. witness.graphml is still written
for the validators that consume the legacy format.

- New marker fields from the executor: call index on the line, type
  descriptor and source file (legacy 4-field markers still parse);
  new [WITNESS_TARGET] marker carrying the uncaught throwable's stack
  trace, resolved to the innermost frame inside the task sources.
- Columns come from the sources: closing `)` of the n-th nondet call
  on the line, `assert`/`throw`/first token of the target statement.
- Literals per type: L suffix only when needed, char literals, f
  suffix for floats, NaN/Infinity via Float/Double, strings via
  `\result.equals("...")` with Java escaping.
- CLI: --input (inputs as given, listed with sha256 hashes),
  --property (specification), --out, --producer-version; the legacy
  positional form keeps working. Templates are found next to the jar.
- JUnit tests for literals, markers, source resolution and the writer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nils-loose
nils-loose merged commit 9ba6192 into main Oct 15, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant