tuProlog unknow behavior
Posted
by
Josh Guzman
on Stack Overflow
See other posts from Stack Overflow
or by Josh Guzman
Published on 2012-04-03T23:25:26Z
Indexed on
2012/04/03
23:29 UTC
Read the original article
Hit count: 235
I'm using tuProlog to integrate Prolog with Java, to do so I'v been defined a .pl file wich contains this code:
go:-write('hello world!'),nl.
In my Java File at NetBeans i Have a Main Class that invokes this:
Prolog engine = new Prolog();
Theory theory = new Theory(new FileInputStream("facultad.pl"));
try { engine.setTheory(theory); } catch (InvalidTheoryException ex) {
}
SolveInfo solution = engine.solve("go.");
if (solution.isSuccess()) {
System.out.println(solution.getSolution());
}
This Code must returns 'hello world', but instead of that it answer 'go', any ideas about this erratic behavior ??
© Stack Overflow or respective owner