Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ jobs:

- name: Install WitnessLint
run: |
git clone --depth 1 https://gitlab.com/sosy-lab/benchmarking/sv-witnesses.git "$RUNNER_TEMP/sv-witnesses"
# WitnessLint 2.4 ("Release 2.4"), the version SV-COMP 2027 validates with. master has
# unreleased checks (e.g. rejecting witnesses without a target waypoint).
git clone https://gitlab.com/sosy-lab/benchmarking/sv-witnesses.git "$RUNNER_TEMP/sv-witnesses"
git -C "$RUNNER_TEMP/sv-witnesses" checkout --quiet 28d273853e11cfeb0ddc7ef26f84f2a3c6fd2d20
python -m pip install -r "$RUNNER_TEMP/sv-witnesses/linter/requirements.txt"
echo "WITNESSLINT=python $RUNNER_TEMP/sv-witnesses/linter/witnesslinter.py" >> "$GITHUB_ENV"

Expand Down
2 changes: 1 addition & 1 deletion src/witnesscreator/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.1.0"
__version__ = "1.1.1"
5 changes: 4 additions & 1 deletion src/witnesscreator/literals.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,10 @@ def floating_constraint(value: str, is_float: bool) -> str:
box = "Float" if is_float else "Double"
v = value.strip()
if v == "NaN":
return f"{box}.isNaN({RESULT})"
# NaN is the only value not equal to itself. Validators that read a single
# value from the constraint (e.g. JLiSA-Wit) accept this form but not
# ``Float.isNaN(\result)``; ``\result == Float.NaN`` would be always false.
return f"{RESULT} != {RESULT}"
if v == "Infinity":
return f"{RESULT} == {box}.POSITIVE_INFINITY"
if v == "-Infinity":
Expand Down
2 changes: 1 addition & 1 deletion tests/test_e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def test_float_special_values(tmp_path, witnesslint):
entry, (_, _, edges) = write(task_for(task_dir), values, violation, tmp_path)
wps = waypoints(entry)
assert [wp["constraint"]["value"] for wp in wps[:-1]] == [
"\\result == Float.NEGATIVE_INFINITY", "Float.isNaN(\\result)", "\\result == -0.0f",
"\\result == Float.NEGATIVE_INFINITY", "\\result != \\result", "\\result == -0.0f",
"\\result == Float.POSITIVE_INFINITY", "\\result == 10000000000.0f", "\\result == -0.0012512209359556437f",
"\\result == 0.10000000149011612f",
]
Expand Down
4 changes: 2 additions & 2 deletions tests/test_literals.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ def test_floating_point():
assert result_constraint("-0.0", "D") == "\\result == -0.0"
assert result_constraint("-0.0", "F") == "\\result == -0.0f"
assert result_constraint("10000000000", "D") == "\\result == 10000000000.0"
assert result_constraint("NaN", "float") == "Float.isNaN(\\result)"
assert result_constraint("NaN", "D") == "Double.isNaN(\\result)"
assert result_constraint("NaN", "float") == "\\result != \\result"
assert result_constraint("NaN", "D") == "\\result != \\result"
assert result_constraint("Infinity", "double") == "\\result == Double.POSITIVE_INFINITY"
assert result_constraint("-Infinity", "float") == "\\result == Float.NEGATIVE_INFINITY"
assert result_constraint("1.5f", "F") == "\\result == 1.5f"
Expand Down
Loading