This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
yap-6.3/LGPL/JPL/java/jpl/test/FetchBigTree.java
vsc 31ff28d3ee upgrade JPL
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1936 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2007-09-27 15:25:34 +00:00

19 lines
506 B
Java

package jpl.test;
import jpl.Query;
import jpl.Term;
public class FetchBigTree {
public static void main(String[] args) {
// Prolog.set_default_init_args(new String[] { "libpl.dll", "-f", "D:/pcm/bin/pcm.ini", "-g", "pcm_2000" });
(new Query("consult('jpl/test/test.pl')")).oneSolution();
Term t = (Term)((new Query("p(18,T)")).oneSolution().get("T"));
int i = 1;
while ( t.hasFunctor("a", 2)){
t = t.arg(2);
i = i+1;
}
System.err.println("got a tree of " + i+" generations");
}
}