简体   繁体   中英

z3 java api using mkOptimize

I am using the optimization option of z3 in the java api via context.mkOptimize(). When I execute my code it will show me the following error:

java.lang.UnsatisfiedLinkError: com.microsoft.z3.Native.INTERNALmkOptimize(J)J

My Code:

Context context = new Context();
Optimize mkOptimize = context.mkOptimize();

IntExpr intTest = context.mkIntConst("test");
IntExpr intTen = context.mkInt(10);
BoolExpr assertInt = context.mkLe(intTest, intTen);

mkOptimize.Add(assertInt);
mkOptimize.MkMaximize(intTest);
mkOptimize.Check();

Am I doing something wrong or is this a bug in the java api? (The exception is thrown when creating the optimize object in the second line)

Found the problem. It was due to the system path which was pointing to two different versions of z3 libraries.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM