JPL Exception
Pavan Kumar <[email protected]> Mon, 21 Apr 2014 18:24:37 -0500
| Newsgroups | gmane.comp.ai.prolog.swi |
|---|---|
| Message-ID | <CAFVqwvg1pjvVh=RH=kgjX2Jr92m0sDdt_KKpiye6Xxr5W-meCA@mail.gmail.com> |
I am trying to use JPL to Pass a Query to SWI-Prolog from Java. I get the
Following Exception while running the program in Java.
Query is = Arithmetic_Expression#=X*Y+X+1,[Y, X] ins
0..100500,Arithmetic_Expression in *1..5\/10\/12*.
Exception in thread "main" jpl.PrologException: PrologException:
error(syntax_error(operator_expected),
string('Arithmetic_Expression#=X*Y+X+1,[Y, X] ins
0..100500,Arithmetic_Expression in *1..5\\/10\\/12*. ', 21))
at jpl.Query.get1(Query.java:336)
at jpl.Query.getSubstWithNameVars(Query.java:390)
at jpl.Util.textToTerm(Util.java:163)
at jpl.Query.<init>(Query.java:198)
As you can see, My java Program is generating the Query as Union of Ranges
from 1..5 \/ 10 \/ 12. But SWI-Prolog is taking it as *1..5\\/10\\/12*. Not
sure why is this happening? I guess this might be the reason for my error.
Could anyone help me with this error?
Here is my Java Code for reference.
if(R.to-R.from!=0)
Rangestmt.append("\\/"+R.from+".."+R.to);
else
Rangestmt.append("\\/"+R.from);
I am appending \\/ because in Windows \\ will be given as '\' and thus my
Query is generated as 1..5\/10\/12.
Why is this prorogating to SWI-Prolog?
hanks,
Pavan.
-------------- next part --------------
HTML attachment scrubbed and removed