All Downloads are FREE. Search and download functionalities are using the official Maven repository.

alice.tuprologx.runtime.tcp.Test Maven / Gradle / Ivy

package alice.tuprologx.runtime.tcp;

import alice.tuprolog.*;

import java.io.*;

public class Test
{
    public static void main(String args[])
    {
        if (args.length<2){
            System.err.println("args:   ");
            System.exit(-1);
        }
        try{

            alice.tuprologx.runtime.tcp.Prolog engine = new Proxy(args[0]);
            /*
            engine.loadLibrary("alice.tuprolog.lib.JavaLibrary");
            engine.addTheory(new Theory(new FileInputStream("test.pl")));
             */
            SolveInfo info=engine.solve(args[1]);
            if (info.isSuccess())
                System.out.println("yes: "+info.getSolution());
            else
                System.out.println("no.");
            //engine.solve("out <- println('ciccio').");
        } catch(Exception e) {
            System.err.println("ERROR: " + e);
            e.printStackTrace(System.out);
        }
    }
}








































© 2015 - 2025 Weber Informatics LLC | Privacy Policy