Hi. I'm using JPL to operate a knowledge base dynamically. However I cannot find any resources that tells me how to do that.
For example, I can use the following code to create a new fact and append it to KB:
Atom a = new Atom("a");
Atom b = new Atom("b");
Compound p = new Compound("parent", new Term[]{a, b});
Query q = new Query(new Compound("assertz", new Term[]{p}));
q.hasSolution();q1.close();
which is the Java version of the following command in swipl:
assertz(parent(a, b)).
But I cannot find a way to add the following rules to KB:
Hi. I'm using JPL to operate a knowledge base dynamically. However I cannot find any resources that tells me how to do that.
For example, I can use the following code to create a new fact and append it to KB:
which is the Java version of the following command in swipl:
But I cannot find a way to add the following rules to KB:
Moreover, I cannot create the following query:
which is simply answered in the terminal version of swipl.
Is there any way to achieve these purposes? If so, please add such methods in tutorial pages. :+1: