00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 package jpl.fli;
00028
00029 import jpl.JPL;
00030
00031
00032
00033
00082 public final class Prolog {
00083 static {
00084
00085 JPL.loadNativeLibrary();
00086 }
00087
00088
00089 public static final int VARIABLE = 1;
00090 public static final int ATOM = 2;
00091 public static final int INTEGER = 3;
00092 public static final int FLOAT = 4;
00093 public static final int STRING = 5;
00094 public static final int COMPOUND = 6;
00095
00096 public static final int JBOOLEAN = 101;
00097 public static final int JREF = 102;
00098 public static final int JVOID = 103;
00099
00103 public static final int TERM = 6;
00104
00105 public static final int succeed = 1;
00106 public static final int fail = 0;
00107
00108
00109 public static final int Q_NORMAL = 0x02;
00110 public static final int Q_NODEBUG = 0x04;
00111 public static final int Q_CATCH_EXCEPTION = 0x08;
00112 public static final int Q_PASS_EXCEPTION = 0x10;
00113
00114
00115 public static final int CVT_ATOM = 0x0001;
00116 public static final int CVT_STRING = 0x0002;
00117 public static final int CVT_LIST = 0x0004;
00118 public static final int CVT_INTEGER = 0x0008;
00119 public static final int CVT_FLOAT = 0x0010;
00120 public static final int CVT_VARIABLE = 0x0020;
00121 public static final int CVT_NUMBER = (CVT_INTEGER | CVT_FLOAT);
00122 public static final int CVT_ATOMIC = (CVT_NUMBER | CVT_ATOM | CVT_STRING);
00123 public static final int CVT_ALL = 0x00ff;
00124 public static final int BUF_DISCARDABLE = 0x0000;
00125 public static final int BUF_RING = 0x0100;
00126 public static final int BUF_MALLOC = 0x0200;
00127
00128
00129 public static native int compare(term_t t1, term_t t2);
00130
00131
00132 public static native term_t new_term_ref();
00133 public static native term_t new_term_refs(int n);
00134 public static native term_t copy_term_ref(term_t from);
00135
00136
00137 public static native atom_t new_atom(String s);
00138 public static native String atom_chars(atom_t a);
00139 public static native functor_t new_functor(atom_t f, int a);
00140
00141 public static native void unregister_atom(atom_t a);
00142
00143
00144 public static native boolean get_atom_chars(term_t t, StringHolder a);
00145 public static native boolean get_string_chars(term_t t, StringHolder s);
00146 public static native boolean get_integer(term_t t, Int64Holder i);
00147 public static native boolean get_float(term_t t, DoubleHolder d);
00148 public static native boolean get_name_arity(term_t t, StringHolder name, IntHolder arity);
00149 public static native boolean get_arg(int index, term_t t, term_t a);
00150
00151 public static native String object_to_tag(Object obj);
00152 public static native Object tag_to_object(String tag);
00153 public static native boolean is_tag(String tag);
00154
00155
00156 public static native int term_type(term_t t);
00157
00158
00159 public static native void put_variable(term_t t);
00160 public static native void put_integer(term_t t, long i);
00161 public static native void put_float(term_t t, double f);
00162 public static native void put_term(term_t t1, term_t t2);
00163 public static native void put_jref(term_t t, Object ref);
00164
00165
00166 public static native void cons_functor_v(term_t h, functor_t fd, term_t a0);
00167
00168
00169 public static native predicate_t predicate(String name, int arity, String module);
00170
00171
00172 public static native qid_t open_query(module_t m, int flags, predicate_t pred, term_t t0);
00173 public static native boolean next_solution(qid_t qid);
00174 public static native void close_query(qid_t qid);
00175
00176
00177 public static native module_t new_module(atom_t name);
00178
00179
00180 public static native term_t exception(qid_t qid);
00181
00182
00183 public static native String[] get_default_init_args();
00184 public static native boolean set_default_init_args(String argv[]);
00185 public static native boolean initialise();
00186 public static native String[] get_actual_init_args();
00187 public static native void halt(int status);
00188
00189
00190 public static native int thread_self();
00191 public static native engine_t attach_pool_engine();
00192 public static native int release_pool_engine();
00193 public static native engine_t current_engine();
00194 public static native boolean current_engine_is_pool();
00195 public static native int attach_engine(engine_t e);
00196
00197
00198 public static native String get_c_lib_version();
00199
00200
00201 public static native int action_abort();
00202
00203
00204 public static native fid_t open_foreign_frame();
00205 public static native void discard_foreign_frame(fid_t cid);
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243
00244 }
00245
00246