import java.util.concurrent.atomic.AtomicBoolean;
public class Simple {
public static void main(String[] args) {
AtomicBoolean b = new AtomicBoolean(true);
assert(b.get() == true);
}
}
JBMC fails to verify the assert() statement although the assertion obviously holds and executing the program with
java -ea Simple
Gives no Assertion violation in 100% of the cases.
Interpretation:
Since the same program using a boolean verifies, my guess is that JBMC does not support AtomicBoolean.
Is it possible to provide an annotated interface for this class to allow ModelChecking simple programs like this?
CBMC version: 5.95.1
Operating system: MS Windows 11 Enterprise Version 22H2, Build 22621.3447
Exact command line resulting in the issue: "C:\Program Files\cbmc\bin\jbmc.exe" Simple
What behaviour did you expect: I would have expected the assertion to verify.
What happened instead: JBMC reports a FAILURE.
The command needs to be: jbmc Simple --classpath .:jbmc/lib/java-models-library/target/core-models.jar:jbmc/lib/java-models-library/target/cprover-api.jar
Observation: In the following java program:
JBMC fails to verify the assert() statement although the assertion obviously holds and executing the program with
java -ea Simple
Gives no Assertion violation in 100% of the cases.
Interpretation: Since the same program using a boolean verifies, my guess is that JBMC does not support AtomicBoolean. Is it possible to provide an annotated interface for this class to allow ModelChecking simple programs like this?
CBMC version: 5.95.1 Operating system: MS Windows 11 Enterprise Version 22H2, Build 22621.3447 Exact command line resulting in the issue: "C:\Program Files\cbmc\bin\jbmc.exe" Simple What behaviour did you expect: I would have expected the assertion to verify. What happened instead: JBMC reports a FAILURE.