You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I'm thinking off making a hybrid application in Rust, calling Prolog clauses.
This kind of architecture already exists for java. Using JPL7.
The idea is to load prolog files and construct queries within Rust.
Next I show some examples of the kind of code I would like to create, but in Java:
Query q1 = new Query(
"consult",
new Term[] {new Atom("test.pl")}
);
Query q3 =
new Query(
"descendent_of",
new Term[] {new Atom("steve"),new Atom("ralf")}
);
System.out.println(
"descendent_of(joe,ralf) is " +
( q3.hasSolution() ? "provable" : "not provable" )
);
Variable Y = new Variable();
Query q5 =
new Query(
"descendent_of",
new Term[] {X,Y}
);
while ( q5.hasMoreSolutions() ){
solution = q5.nextSolution();
System.out.println( "X = " + solution.get("X") + ", Y = " + solution.get("Y"));
}
I know that JPL7 is not a prolog implementation such as scryer-prolog. Instead it uses Java Native Interface to create an interface with SWI-Prolog. But I think that it would also be possible to create an API in Rust to take advantage of this prolog implementation to create the kind of queries I listed above.
My question is what would be the most straightforward way to implement such API for this project, since you already have a fully working WAM? Or maybe, if you know of any existing project which already implements what I'm asking for?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello, I'm thinking off making a hybrid application in Rust, calling Prolog clauses.
This kind of architecture already exists for java. Using JPL7.
The idea is to load prolog files and construct queries within Rust.
Next I show some examples of the kind of code I would like to create, but in Java:
I know that JPL7 is not a prolog implementation such as scryer-prolog. Instead it uses Java Native Interface to create an interface with SWI-Prolog. But I think that it would also be possible to create an API in Rust to take advantage of this prolog implementation to create the kind of queries I listed above.
My question is what would be the most straightforward way to implement such API for this project, since you already have a fully working WAM? Or maybe, if you know of any existing project which already implements what I'm asking for?
Thank you
Beta Was this translation helpful? Give feedback.
All reactions