upgrade JPL
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1936 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
//*****************************************************************************/
|
||||
// Project: jpl
|
||||
//
|
||||
// File: $Id: Prolog.java,v 1.1 2004-08-27 20:27:56 vsc Exp $
|
||||
// Date: $Date: 2004-08-27 20:27:56 $
|
||||
// File: $Id: Prolog.java,v 1.2 2007-09-27 15:25:32 vsc Exp $
|
||||
// Date: $Date: 2007-09-27 15:25:32 $
|
||||
// Author: Fred Dushin <fadushin@syr.edu>
|
||||
//
|
||||
//
|
||||
@@ -26,6 +26,7 @@
|
||||
//*****************************************************************************/
|
||||
package jpl.fli;
|
||||
|
||||
|
||||
//----------------------------------------------------------------------/
|
||||
// Prolog
|
||||
/**
|
||||
@@ -34,7 +35,7 @@ package jpl.fli;
|
||||
* (almost) strict 1-1 correspondence with the functions in the Prolog
|
||||
* FLI by the same name (except without the PL_, SQ_, etc. prefixes).<p>
|
||||
*
|
||||
* See the file jpl_fli_Prolog.c for the native implementations of these
|
||||
* See the file jpl.c for the native (ANSI C) implementations of these
|
||||
* methods. Refer to your local Prolog FLI documentations for the meanings
|
||||
* of these methods, and observe the following:<p>
|
||||
*
|
||||
@@ -74,7 +75,7 @@ package jpl.fli;
|
||||
* GNU Library Public License for more details.<p>
|
||||
* </i><hr>
|
||||
* @author Fred Dushin <fadushin@syr.edu>
|
||||
* @version $Revision: 1.1 $
|
||||
* @version $Revision: 1.2 $
|
||||
*/
|
||||
public final class Prolog {
|
||||
static {
|
||||
@@ -127,91 +128,48 @@ public final class Prolog {
|
||||
/* Creating and destroying term-refs */
|
||||
public static native term_t new_term_ref();
|
||||
public static native term_t new_term_refs(int n);
|
||||
public static native term_t copy_term_ref(term_t from);
|
||||
public static native void reset_term_refs(term_t r);
|
||||
public static native term_t copy_term_ref(term_t from); // NOT USED
|
||||
|
||||
/* Constants */
|
||||
public static native atom_t new_atom(String s);
|
||||
public static native String atom_chars(atom_t a);
|
||||
public static native functor_t new_functor(atom_t f, int a);
|
||||
public static native atom_t functor_name(functor_t f);
|
||||
public static native int functor_arity(functor_t f);
|
||||
|
||||
public static native void unregister_atom(atom_t a); // called from atom_t's finalize()
|
||||
|
||||
/* Get Java-values from Prolog terms */
|
||||
public static native boolean get_atom(term_t t, atom_t a);
|
||||
public static native boolean get_atom_chars(term_t t, StringHolder a);
|
||||
public static native boolean get_string_chars(term_t t, StringHolder s);
|
||||
public static native boolean get_integer(term_t t, IntHolder i);
|
||||
public static native boolean get_pointer(term_t t, PointerHolder ptr);
|
||||
public static native boolean get_integer(term_t t, Int64Holder i);
|
||||
public static native boolean get_float(term_t t, DoubleHolder d);
|
||||
public static native boolean get_functor(term_t t, functor_t f);
|
||||
public static native boolean get_name_arity(term_t t, StringHolder name, IntHolder arity);
|
||||
public static native boolean get_module(term_t t, module_t module);
|
||||
public static native boolean get_arg(int index, term_t t, term_t a);
|
||||
|
||||
public static native boolean get_jref(term_t t, ObjectHolder obj);
|
||||
public static native boolean get_jboolean(term_t t, BooleanHolder b);
|
||||
public static native String object_to_tag(Object obj);
|
||||
|
||||
/* Verify types */
|
||||
public static native int term_type(term_t t);
|
||||
public static native boolean is_variable(term_t t);
|
||||
public static native boolean is_atom(term_t t);
|
||||
public static native boolean is_integer(term_t t);
|
||||
public static native boolean is_float(term_t t);
|
||||
public static native boolean is_compound(term_t t);
|
||||
public static native boolean is_functor(term_t t, functor_t f);
|
||||
public static native boolean is_atomic(term_t t);
|
||||
public static native boolean is_number(term_t t);
|
||||
|
||||
/* Assign to term-references */
|
||||
public static native void put_variable(term_t t);
|
||||
public static native void put_atom(term_t t, atom_t a);
|
||||
public static native void put_integer(term_t t, long i);
|
||||
public static native void put_pointer(term_t t, PointerHolder ptr);
|
||||
public static native void put_float(term_t t, double f);
|
||||
public static native void put_functor(term_t t, functor_t functor);
|
||||
public static native void put_term(term_t t1, term_t t2);
|
||||
public static native void put_jref(term_t t, Object ref);
|
||||
public static native void put_jboolean(term_t t, boolean b);
|
||||
public static native void put_jvoid(term_t t);
|
||||
|
||||
/* ... */
|
||||
public static native void cons_functor_v(term_t h, functor_t fd, term_t a0);
|
||||
public static native void cons_list(term_t l, term_t h, term_t t);
|
||||
|
||||
// unification:
|
||||
// public static native int unify(term_t t1, term_t t2);
|
||||
|
||||
// predicates:
|
||||
public static native predicate_t pred(functor_t f, module_t m);
|
||||
public static native predicate_t predicate(String name, int arity, String module);
|
||||
public static native int predicate_info(predicate_t pred, atom_t name, IntHolder arity, module_t module);
|
||||
|
||||
// querying (general):
|
||||
public static native qid_t open_query(module_t m, int flags, predicate_t pred, term_t t0);
|
||||
public static native boolean next_solution(qid_t qid);
|
||||
public static native void close_query(qid_t qid);
|
||||
public static native void cut_query(qid_t qid);
|
||||
|
||||
// querying (simplified):
|
||||
public static native boolean call(term_t t, module_t m);
|
||||
public static native boolean call_predicate(module_t m, int debug, predicate_t pred, term_t t0);
|
||||
|
||||
// foreign frames:
|
||||
public static native fid_t open_foreign_frame();
|
||||
public static native void close_foreign_frame(fid_t cid);
|
||||
public static native void discard_foreign_frame(fid_t cid);
|
||||
|
||||
// modules:
|
||||
public static native module_t context();
|
||||
public static native atom_t module_name(module_t module);
|
||||
public static native module_t new_module(atom_t name);
|
||||
public static native int strip_module(term_t in, module_t m, term_t out);
|
||||
|
||||
// not yet mapped: raise_exception()
|
||||
// not yet mapped: throw()
|
||||
|
||||
// exceptions:
|
||||
public static native term_t exception(qid_t qid);
|
||||
@@ -229,12 +187,51 @@ public final class Prolog {
|
||||
public static native int release_pool_engine();
|
||||
public static native engine_t current_engine();
|
||||
public static native boolean current_engine_is_pool();
|
||||
public static native int attach_engine(engine_t e);
|
||||
|
||||
// misc.
|
||||
public static native String get_c_lib_version();
|
||||
|
||||
public static native int action_abort();
|
||||
public static native int attach_engine(engine_t e);
|
||||
public static native int pool_engine_id(engine_t e);
|
||||
|
||||
// not used:
|
||||
// public static native void reset_term_refs(term_t r);
|
||||
// public static native atom_t functor_name(functor_t f);
|
||||
// public static native int functor_arity(functor_t f);
|
||||
// public static native boolean get_atom(term_t t, atom_t a);
|
||||
// public static native boolean get_pointer(term_t t, PointerHolder ptr);
|
||||
// public static native boolean get_functor(term_t t, functor_t f);
|
||||
// public static native boolean get_module(term_t t, module_t module);
|
||||
// public static native boolean get_jref(term_t t, ObjectHolder obj);
|
||||
// public static native boolean get_jboolean(term_t t, BooleanHolder b);
|
||||
// public static native boolean get_jpl_term(term_t t, ObjectHolder obj); // withdrawn 17/Oct/2004
|
||||
// public static native boolean is_variable(term_t t);
|
||||
// public static native boolean is_atom(term_t t);
|
||||
// public static native boolean is_integer(term_t t);
|
||||
// public static native boolean is_float(term_t t);
|
||||
// public static native boolean is_compound(term_t t);
|
||||
// public static native boolean is_functor(term_t t, functor_t f);
|
||||
// public static native boolean is_atomic(term_t t);
|
||||
// public static native boolean is_number(term_t t);
|
||||
// public static native void put_atom(term_t t, atom_t a);
|
||||
// public static native void put_pointer(term_t t, PointerHolder ptr);
|
||||
// public static native void put_functor(term_t t, functor_t functor);
|
||||
// public static native void put_jboolean(term_t t, boolean b);
|
||||
// public static native void put_jvoid(term_t t);
|
||||
// public static native void cons_list(term_t l, term_t h, term_t t);
|
||||
// public static native int unify(term_t t1, term_t t2);
|
||||
// public static native predicate_t pred(functor_t f, module_t m);
|
||||
// public static native int predicate_info(predicate_t pred, atom_t name, IntHolder arity, module_t module);
|
||||
// public static native void cut_query(qid_t qid);
|
||||
// public static native boolean call(term_t t, module_t m);
|
||||
// public static native boolean call_predicate(module_t m, int debug, predicate_t pred, term_t t0);
|
||||
// public static native fid_t open_foreign_frame(); // NOT USED
|
||||
// public static native void close_foreign_frame(fid_t cid); // NOT USED
|
||||
// public static native void discard_foreign_frame(fid_t cid); // NOT USED
|
||||
// public static native module_t context();
|
||||
// public static native atom_t module_name(module_t module);
|
||||
// public static native int strip_module(term_t in, module_t m, term_t out);
|
||||
// public static native int pool_engine_id(engine_t e);
|
||||
}
|
||||
|
||||
//345678901234567890123456789012346578901234567890123456789012345678901234567890
|
||||
|
Reference in New Issue
Block a user