Package org.jpl7.fli

Class Prolog


  • public final class Prolog
    extends java.lang.Object
    This class consists only of constants (static finals) and static native methods. The constants and methods defined herein are in (almost) strict 1-1 correspondence with the functions in the Prolog FLI by the same name (except without the PL_, SQ_, etc. prefixes).

    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:

  • The types and signatures of the following methods are almost in 1-1 correspondence with the Prolog FLI. The Prolog types term_t, atom_t, functor_t, etc. are mirrored in this package with classes by the same name, making the C and Java uses of these interfaces similar.
  • As term_t, functor_t, etc. types are Java classes, they are passed to these methods by value; however, calling these methods on such class instances does have side effects. In general, the value fields of these instances will be modified, in much the same way the term_t, functor_t, etc. Prolog instances would be modified.
  • The exceptions to this rule occur when maintaining the same signature would be impossible, e.g., when the Prolog FLI functions require pointers; in this case, the signatures have been modified to take *Holder classes (Int, Double, String, etc.), to indicate a call by reference parameter.
  • Functions which take variable-length argument lists in C take arrays in Java; from Java 1.1 onwards, anonymous arrays can be used e.g. Term[] { new Atom("a"), new Atom ("b") }

  • Copyright (C) 1998 Fred Dushin

    Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

    1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
    2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


    • Constructor Detail

      • Prolog

        public Prolog()
    • Method Detail

      • compare

        public static int compare​(term_t t1,
                                  term_t t2)
      • new_term_ref

        public static term_t new_term_ref()
      • new_term_refs

        public static term_t new_term_refs​(int n)
      • copy_term_ref

        public static term_t copy_term_ref​(term_t from)
      • new_atom

        public static atom_t new_atom​(java.lang.String s)
      • atom_chars

        public static java.lang.String atom_chars​(atom_t a)
      • unregister_atom

        public static void unregister_atom​(atom_t a)
      • get_string_chars

        public static boolean get_string_chars​(term_t t,
                                               StringHolder s)
      • get_arg

        public static boolean get_arg​(int index,
                                      term_t t,
                                      term_t a)
      • object_to_tag

        public static java.lang.String object_to_tag​(java.lang.Object obj)
      • tag_to_object

        public static java.lang.Object tag_to_object​(java.lang.String tag)
      • is_tag

        public static boolean is_tag​(java.lang.String tag)
      • term_type

        public static int term_type​(term_t t)
      • put_variable

        public static void put_variable​(term_t t)
      • put_integer

        public static void put_integer​(term_t t,
                                       long i)
      • put_integer_big

        public static void put_integer_big​(term_t t,
                                           java.lang.String i)
      • put_float

        public static void put_float​(term_t t,
                                     double f)
      • put_term

        public static void put_term​(term_t t1,
                                    term_t t2)
      • put_jref

        public static void put_jref​(term_t t,
                                    java.lang.Object ref)
      • put_atom_chars

        public static void put_atom_chars​(term_t t,
                                          java.lang.String name)
      • put_nil

        public static void put_nil​(term_t t)
      • predicate

        public static predicate_t predicate​(java.lang.String name,
                                            int arity,
                                            java.lang.String module)
      • next_solution

        public static boolean next_solution​(qid_t qid)
      • close_query

        public static void close_query​(qid_t qid)
      • current_query

        public static qid_t current_query()
      • exception

        public static term_t exception​(qid_t qid)
      • get_default_init_args

        public static java.lang.String[] get_default_init_args()
      • set_default_init_args

        public static boolean set_default_init_args​(java.lang.String[] argv)
      • initialise

        public static boolean initialise()
      • get_actual_init_args

        public static java.lang.String[] get_actual_init_args()
      • halt

        public static void halt​(int status)
      • thread_self

        public static int thread_self()
      • attach_pool_engine

        public static engine_t attach_pool_engine()
      • release_pool_engine

        public static int release_pool_engine()
      • current_engine

        public static engine_t current_engine()
      • current_engine_is_pool

        public static boolean current_engine_is_pool()
      • attach_engine

        public static int attach_engine​(engine_t e)
      • get_c_lib_version

        public static java.lang.String get_c_lib_version()
      • action_abort

        public static int action_abort()
      • open_foreign_frame

        public static fid_t open_foreign_frame()
      • discard_foreign_frame

        public static void discard_foreign_frame​(fid_t cid)
      • get_syntax

        public static int get_syntax()