私は現在、Alloy Analyzer API を使用してプログラムを作成していますが、奇妙な動作が発生しています。具体的には、ファイルを開いて解析し (CompUtil.parseEverything を使用)、新しいコマンドを作成し、解析したファイルに対して TranslateAlloyToKodkod.execute_command を呼び出し、MiniSat と UNSAT コアを使用して新しく作成したコマンドを呼び出すと、正常に動作します。ただし、後で実行すると、私のプログラムは 2 番目の入力ファイルを解析し (これも CompUtil.parseEverything を使用)、別の世界を取得し、新しいコマンドを作成してから、もう一度 TranslateAlloyToKodkod.execute_command を呼び出そうとすると、次のエラーがスローされます。
ERROR: class edu.mit.csail.sdg.alloy4.ErrorFatal: The required JNI library cannot be found:
java.lang.UnsatisfiedLinkError: no minisatproverx5 in java.library.path
edu.mit.csail.sdg.alloy4compiler.translator.TranslateAlloyToKodkod.execute_command(TranslateAlloyToKodkod.java:390)
なぜこれが2回目にスローされ、最初にスローされないのか、誰にも分かりますか?
要約すると、次のようなものがあります。
Module someWorld = CompUtil.parseEverything_fromFile(rep, null, "someFile.als");
//For the following, "sig" is a sig in someWorld.getAllReachableSigs();
Command command = sig.not();
A4Options options = new A4Options();
options.solver = A4Options.SatSolver.MiniSatProverJNI;
A4Solution ans =
TranslateAlloyToKodkod.execute_command(rep, someWorld, command, options);
//No thrown error
Module someOtherWorld = CompUtil.parseEverything_fromFile(rep, null, "someOtherFile.als");
//For the following, "sig" is a sig in someOtherWorld.getAllReachableSigs();
Command commandTwo = sig.not();
A4Solution ansTwo =
TranslateAlloyToKodkod.execute_command(rep, someOtherWorld, commandTwo, options);
//Thrown error above. Why?