How can I use the Solver with Java language? #422
-
I am trying to use the Solver with Java language, I have a custom Library called ClpFDLibrary and I want to activate the flag for tracking interesting variables. Solver solver = ClassicSolverFactory.solverOf(
ClpFDLibrary.toRuntime(),
FlagStore.EMPTY + TrackVariables { ON },
theory
); How can I fix the code in order to work with Java language? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Quick answer: import it.unibo.tuprolog.solve.Solver;
import it.unibo.tuprolog.solve.flags.TrackVariables;
import it.unibo.tuprolog.solve.library.Runtime;
import package.of.MyLibrary; // assuming this is a Kotlin object
Solver solver = Solver.prolog().newBuilder()
.runtime(Runtime.of(MyLibrary.INSTANCE))
.flag(TrackVariables.INSTANCE, TrackVariables.ON)
.staticKb(theory)
.build(); An explanation will follow. |
Beta Was this translation helpful? Give feedback.
-
Explanation:
|
Beta Was this translation helpful? Give feedback.
Quick answer:
An explanation will follow.