diff --git a/src/java_bytecode/java_bytecode_convert_method.cpp b/src/java_bytecode/java_bytecode_convert_method.cpp index e4f3773b4f5..632c741d629 100644 --- a/src/java_bytecode/java_bytecode_convert_method.cpp +++ b/src/java_bytecode/java_bytecode_convert_method.cpp @@ -2834,6 +2834,11 @@ void java_bytecode_convert_method( "nondetWithNull", "nondetWithoutNull", "notModelled", + "atomicBegin", + "atomicEnd", + "startThread", + "endThread", + "getCurrentThreadID" }; if(std::regex_match( diff --git a/src/java_bytecode/library/src/org/cprover/CProver.java b/src/java_bytecode/library/src/org/cprover/CProver.java index 6aadd228e9e..a040d29f1e5 100644 --- a/src/java_bytecode/library/src/org/cprover/CProver.java +++ b/src/java_bytecode/library/src/org/cprover/CProver.java @@ -4,6 +4,7 @@ public final class CProver { public static boolean enableAssume=true; public static boolean enableNondet=true; + public static boolean enableConcurrency=true; public static boolean nondetBoolean() { @@ -115,6 +116,52 @@ public static T nondetWithoutNull() return null; } + public static void startThread(int id) + { + if(enableConcurrency) + { + throw new RuntimeException( + "Cannot execute program with CProver.startThread()"); + } + } + + public static void endThread(int id) + { + if(enableConcurrency) + { + throw new RuntimeException( + "Cannot execute program with CProver.endThread()"); + } + } + + public static void atomicBegin() + { + if(enableConcurrency) + { + throw new RuntimeException( + "Cannot execute program with CProver.atomicBegin()"); + } + } + + public static void atomicEnd() + { + if(enableConcurrency) + { + throw new RuntimeException( + "Cannot execute program with CProver.atomicEnd()"); + } + } + + public static int getCurrentThreadID() + { + if(enableConcurrency) + { + throw new RuntimeException( + "Cannot execute program with CProver.getCurrentThreadID()"); + } + return 0; + } + public static void assume(boolean condition) { if(enableAssume && !condition)