JIProlog

 

JIProlog does not seem to respect ordinary prolog syntax

1/12/2016 8:57:42 AM
Gravatar
Total Posts 1

JIProlog does not seem to respect ordinary prolog syntax

I'm loading a prolog file I have tested using other prolog installations via an inputStream in the JIPEngine

InputStream stream = PolicyLogic.class.getResourceAsStream(resourcePath);
 jip.consultStream(stream, resourcePath);

 

I am executing queries that run in other installations which return results but JIProlog returns nothing as follows:

Map<String, Map<String, String> > results = new HashMap< > ();
        JIPQuery jipQuery = jip.openSynchronousQuery(query);
      
        // Loop while there is another solution
        while (jipQuery.hasMoreChoicePoints())
        {
         JIPTerm solution = jipQuery.nextSolution();
         if(solution != null){
          Map<String, String> varsMap = new HashMap<>();
          JIPVariable[] vars = solution.getVariables();
             for (JIPVariable var : vars) {
              varsMap.put(var.getName(), var.toString(jip));
             }
             results.put(solution.toString(jip), varsMap);
         }
        }
        jipQuery.close();
        return results;

9/12/2016 5:47:56 PM
Gravatar
Total Posts 11

Re: JIProlog does not seem to respect ordinary prolog syntax

JIProlog is fully compliant with ISO standard.

Are you running a non-ISO query? Many of other commercial Prolog interpreter have several not-standard extensions and predicates.

You don't specify anything about what you are trying to do. You simply say: "It doesn't work"

Please, post more details about your problem: the file that you consulted, the query that you are running etc.