JPL problem (newbie)



import jpl.*;
public class Test01 {

public static void main(String[] args) {
JPL.init();
Query q1 =
new Query(
"consult",
new Term[] {new Atom("test.pl")}
);
System.out.println( "consult " + (q1.query() ? "succeeded" :
"failed"));
Variable X = new Variable();

Query q4 =
new Query(
"descendent_of",
new Term[] {X,new Atom("ralf")}
);

java.util.Hashtable solution;

solution = q4.oneSolution();

System.out.println( "first solution of descendent_of(X, ralf)");
System.out.println( "X = " + solution.get(X));
}
}



With the example from "Getting started":

child_of(joe, ralf).
child_of(mary, joe).
child_of(steve, joe).

descendent_of(X, Y) :-
child_of(X, Y).
descendent_of(X, Y) :-
child_of(Z, Y),
descendent_of(X, Z).


The output:

consult succeeded
first solution of descendent_of(X, ralf)
X = null
% test.pl compiled 0.00 sec, 2,500 bytes
.



Relevant Pages

  • Re: Query for accounts that will expire
    ... If I may -- go ahead and post one Joe, ... Dean Wells [MVP / Directory Services] ... doing this query in .NET is particularly easy too. ... Please post back if 1) you're interested in the script and 2) you ...
    (microsoft.public.windows.server.active_directory)
  • Re: Password problem
    ... Log on as joe; ... question - who is (joe is the current owner of all tables, ... Double click the relevant query - what error occurs? ... See if the user from step 3., has full permissions to ...
    (microsoft.public.access.formscoding)
  • RE: Cant get data entry with a form based on a query
    ... If you run query 1, not the form, can you make changes in the fields? ... "Joe" wrote: ... > Then I used the wizard to create forms... ... >> First, if you have only one table, it really isn't a database, it is more ...
    (microsoft.public.access.forms)
  • Re: TRICKY SQL
    ... Thanks Hugo and everyone who helped me in solving this issue. ... > Hi Joe, ... > If you had this table, solving your query would be simple. ...
    (microsoft.public.sqlserver.server)
  • Re: TRICKY SQL
    ... Thanks Hugo and everyone who helped me in solving this issue. ... > Hi Joe, ... > If you had this table, solving your query would be simple. ...
    (microsoft.public.sqlserver.programming)