upgrade JPL

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1936 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc
2007-09-27 15:25:34 +00:00
parent 5f9555baa4
commit 31ff28d3ee
70 changed files with 12020 additions and 9030 deletions

View File

@@ -2,8 +2,8 @@
//*****************************************************************************/
// Project: jpl
//
// File: $Id: BooleanHolder.java,v 1.1 2004-08-27 20:27:56 vsc Exp $
// Date: $Date: 2004-08-27 20:27:56 $
// File: $Id: BooleanHolder.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>
//
//
@@ -47,7 +47,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 $
*/
// Implementation notes:
//

View File

@@ -2,8 +2,8 @@
//*****************************************************************************/
// Project: jpl
//
// File: $Id: DoubleHolder.java,v 1.1 2004-08-27 20:27:56 vsc Exp $
// Date: $Date: 2004-08-27 20:27:56 $
// File: $Id: DoubleHolder.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>
//
//
@@ -47,7 +47,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 $
*/
// Implementation notes:
//

View File

@@ -0,0 +1,34 @@
package jpl.fli;
//----------------------------------------------------------------------/
//Int64Holder
/**
* An Int64Holder is merely a Holder class for an int64 value.
*
* <hr><i>
* Copyright (C) 2005 Paul Singleton<p>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.<p>
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Library Public License for more details.<p>
* </i><hr>
* @author Paul Singleton <paul@jbgb.com>
* @version $Revision: 1.1 $
*/
//Implementation notes:
//
//----------------------------------------------------------------------/
public class Int64Holder
{
public long value;
}
//345678901234567890123456789012346578901234567890123456789012345678901234567890

View File

@@ -2,8 +2,8 @@
//*****************************************************************************/
// Project: jpl
//
// File: $Id: IntHolder.java,v 1.1 2004-08-27 20:27:56 vsc Exp $
// Date: $Date: 2004-08-27 20:27:56 $
// File: $Id: IntHolder.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>
//
//
@@ -47,7 +47,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 $
*/
// Implementation notes:
//

View File

@@ -2,8 +2,8 @@
//*****************************************************************************/
// Project: jpl
//
// File: $Id: LongHolder.java,v 1.1 2004-08-27 20:27:56 vsc Exp $
// Date: $Date: 2004-08-27 20:27:56 $
// File: $Id: LongHolder.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>
//
//
@@ -45,7 +45,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 $
*/
// Implementation notes:
//

View File

@@ -2,8 +2,8 @@
//*****************************************************************************/
// Project: jpl
//
// File: $Id: ObjectHolder.java,v 1.1 2004-08-27 20:27:56 vsc Exp $
// Date: $Date: 2004-08-27 20:27:56 $
// File: $Id: ObjectHolder.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>
//
//
@@ -47,7 +47,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 $
*/
// Implementation notes:
//

View File

@@ -2,8 +2,8 @@
//*****************************************************************************/
// Project: jpl
//
// File: $Id: PointerHolder.java,v 1.1 2004-08-27 20:27:56 vsc Exp $
// Date: $Date: 2004-08-27 20:27:56 $
// File: $Id: PointerHolder.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>
//
//
@@ -49,7 +49,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 $
*/
// Implementation notes:
// There could be issues in the future with signedness, since Java

View File

@@ -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

View File

@@ -2,8 +2,8 @@
//*****************************************************************************/
// Project: jpl
//
// File: $Id: StringHolder.java,v 1.1 2004-08-27 20:27:56 vsc Exp $
// Date: $Date: 2004-08-27 20:27:56 $
// File: $Id: StringHolder.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>
//
//
@@ -47,7 +47,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 $
*/
// Implementation notes:
//

View File

@@ -2,8 +2,8 @@
//*****************************************************************************/
// Project: jpl
//
// File: $Id: atom_t.java,v 1.1 2004-08-27 20:27:56 vsc Exp $
// Date: $Date: 2004-08-27 20:27:56 $
// File: $Id: atom_t.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>
//
//
@@ -48,7 +48,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 $
*/
// Implementation notes:
//

View File

@@ -2,8 +2,8 @@
//*****************************************************************************/
// Project: jpl
//
// File: $Id: engine_t.java,v 1.1 2004-08-27 20:27:56 vsc Exp $
// Date: $Date: 2004-08-27 20:27:56 $
// File: $Id: engine_t.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>
//
//
@@ -45,7 +45,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 $
*/
// Implementation notes: Note that a engine_t is not a term,
// consistent with the treatment in the Prolog FLI.

View File

@@ -2,8 +2,8 @@
//*****************************************************************************/
// Project: jpl
//
// File: $Id: fid_t.java,v 1.1 2004-08-27 20:27:56 vsc Exp $
// Date: $Date: 2004-08-27 20:27:56 $
// File: $Id: fid_t.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>
//
//
@@ -47,7 +47,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 $
*/
// Implementation notes:
//

View File

@@ -2,8 +2,8 @@
//*****************************************************************************/
// Project: jpl
//
// File: $Id: functor_t.java,v 1.1 2004-08-27 20:27:56 vsc Exp $
// Date: $Date: 2004-08-27 20:27:56 $
// File: $Id: functor_t.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>
//
//
@@ -48,7 +48,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 $
*/
// Implementation notes: Note that a functor_t is not a term,
// consistent with the treatment in the Prolog FLI.

View File

@@ -2,8 +2,8 @@
//*****************************************************************************/
// Project: jpl
//
// File: $Id: module_t.java,v 1.1 2004-08-27 20:27:56 vsc Exp $
// Date: $Date: 2004-08-27 20:27:56 $
// File: $Id: module_t.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>
//
//
@@ -48,7 +48,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 $
*/
// Implementation notes:
//

View File

@@ -2,8 +2,8 @@
//*****************************************************************************/
// Project: jpl
//
// File: $Id: predicate_t.java,v 1.1 2004-08-27 20:27:56 vsc Exp $
// Date: $Date: 2004-08-27 20:27:56 $
// File: $Id: predicate_t.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>
//
//
@@ -48,7 +48,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 $
*/
// Implementation notes:
//

View File

@@ -2,8 +2,8 @@
//*****************************************************************************/
// Project: jpl
//
// File: $Id: qid_t.java,v 1.1 2004-08-27 20:27:56 vsc Exp $
// Date: $Date: 2004-08-27 20:27:56 $
// File: $Id: qid_t.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>
//
//
@@ -47,7 +47,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 $
*/
// Implementation notes:
//

View File

@@ -2,8 +2,8 @@
//*****************************************************************************/
// Project: jpl
//
// File: $Id: term_t.java,v 1.1 2004-08-27 20:27:56 vsc Exp $
// Date: $Date: 2004-08-27 20:27:56 $
// File: $Id: term_t.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>
//
//
@@ -50,7 +50,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 $
*/
// Implementation notes:
//