我有一个Edge.java班。当我在OpenJML中运行它时,会发生这样的情况:
error: An internal JML error occurred, possibly recoverable. Please report the bug with as much information as you can. Reason: com.sun.tools.javac.code.Symbol$TypeSymbol cannot be cast to com.sun.tools.javac.code.Symbol$ClassSymbol
奇怪的是,我还没有开始使用jml符号。
我的jdk是1.7,openjml是当前的(重新下载两者以确保)。
这是用于运行openjml的命令(遵循站点中的示例):java -jar "E:\Downloads\openjml\openjml.jar" -esc -prover z3_4_3 -exec "E:\Downloads\z3-4.3.0-x64\bin\z3.exe" -noPurityCheck Test.java
编辑:我可以确认,即使是带有泛型的非常简单的类也会导致此错误:
public class Test<T> {
T i;
}Edge.java
public class Edge<K> implements Comparable<Edge<K>> {
public K n1, n2;
public int weight;
public final int tiebreaker;
public static int nextTiebreaker = 0;
public Edge(K n1, K n2, int weight) {
this.n1 = n1;
this.n2 = n2;
this.weight = weight;
tiebreaker = nextTiebreaker++;
}
@Override
public int compareTo(Edge<K> o) {
if(this.weight > o.weight) return +1;
if(this.weight < o.weight) return -1;
return tiebreaker - o.tiebreaker; //Same cost, pick one to be the "larger"
}
}发布于 2014-05-07 15:06:13
我找到的解决办法是删除-esc选项(运行扩展静态检查)。不确定解决这个问题的正确方法。
发布于 2016-01-29 07:07:33
我也面临着类似的问题,但是在-esc目录下对B.java文件使用temp_release选项。
java -jar openjml.jar -noPurityCheck -esc -progress -exec /Library/bin/z3 -prover z3_4_3 B.java
Proving methods in B
Starting proof of B.B() with prover z3_4_3
error: An internal JML error occurred, possibly recoverable. Please report the bug with as much information as you can.
Reason: Unexpected result when querying SMT solver for reason for an unknown result: success
Completed proof of B.B() with prover z3_4_3 - with warningsB.Java是
public class B { /*@ invariant true; */ }.
Completed proving methods in Bhttps://stackoverflow.com/questions/23489994
复制相似问题