import jpl.Query; public class CarJPL { public static void main( String argv[] ) { String t1 = "consult('car.pl')"; Query q1 = new Query(t1); System.out.println( t1 + " " + (q1.hasSolution() ? "succeeded" : "failed") ); //-------------------------------------------------- String t2 = "start."; Query q2 = new Query(t2); System.out.println( t2 + " is " + (q2.hasSolution() ? "provable" : "not provable")); } }
Opis uruchomienia kodu (z rozdziału 1):