-
Issue: How to convert old-fashioned Java code for classic 2p into newer Java (perhaps Kotlin) code for 2p-kt What is needed: the equivalent of basic methods to instantiate a prolog engine and use it from Java (kotlin), such as in the following snapshot: Prolog engine = new Prolog();
Theory t = new Theory(new FileInputStream("exp_parser.pl"));
engine.setTheory(t);
SolveInfo info = engine.solve("evalExpr(" + prologInputString + ",Result).");
if (info.isSuccess()) { Term resultTerm = info.getTerm("Result"); …} |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 16 replies
-
Hello @enrdenti. Here's a complete rewrite of your code. There are a couple of things to be taken into account:
|
Beta Was this translation helpful? Give feedback.
Hello @enrdenti.
Here's a complete rewrite of your code.
There are a couple of things to be taken into account:
you need to have at least modules
:solve-classic
and:parser-theory
(as well as their direct and indirect dependencies) in your classpath, as you need both resolution facilities (term representation + unification + theories + resolution) and parsing facilities (for both terms and theories)you have to…