00001
00002
00003 import jpl.fli.Prolog;
00004 import jpl.*;
00005
00006 public class Exceptions2
00007 {
00008 public static void
00009 main( java.lang.String argv[] )
00010 {
00011
00012 Prolog.set_default_init_args(
00013 new String[] {
00014 "libpl.dll",
00015 "-f", "none",
00016 "-g", "set_prolog_flag(debug_on_error,false)",
00017 "-q"
00018 }
00019 );
00020
00021 System.out.print( "Calling\n\n");
00022 System.out.print( "?- X is Y.\n\n");
00023 System.out.print( "in Prolog to force an 'instantiation_error' exception,\n" );
00024 System.out.print( "whose getMessage() will be println-ed to System.out.\n\n" );
00025
00026 try {
00027 (new Query("X is Y")).hasSolution();
00028 } catch (jpl.PrologException e) {
00029 System.out.println( e.getMessage());
00030 }
00031
00032 }
00033
00034 }