Skip to content

How can I use the Solver with Java language? #422

Answered by gciatto
giuseppeboezio asked this question in Q&A
Discussion options

You must be logged in to vote

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.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by giuseppeboezio
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants