GNU Prolog for Java

gnu.prolog.vm
Interface PrologCode

All Superinterfaces:
Installable
All Known Implementing Classes:
DateTimePrologCode, ExecuteOnlyCode, InterpretedByteCode, Predicate_abolish, Predicate_append, Predicate_arg, Predicate_assert, Predicate_asserta, Predicate_assertz, Predicate_at_end_of_stream, Predicate_atom, Predicate_atom_chars, Predicate_atom_codes, Predicate_atom_concat, Predicate_atom_length, Predicate_atomic, Predicate_bagof, Predicate_call, Predicate_char_code, Predicate_char_conversion, Predicate_clause, Predicate_close, Predicate_compare, Predicate_compound, Predicate_confirm, Predicate_copy_term, Predicate_current_char_conversion, Predicate_current_functor, Predicate_current_input, Predicate_current_op, Predicate_current_output, Predicate_current_predicate, Predicate_current_prolog_flag, Predicate_date_time_stamp, Predicate_date_time_value, Predicate_debugging, Predicate_dialog, Predicate_ensure_loaded, Predicate_equal, Predicate_file_open, Predicate_file_save, Predicate_findall, Predicate_float, Predicate_flush_output, Predicate_format_time, Predicate_functor, Predicate_get_byte, Predicate_get_char, Predicate_get_time, Predicate_greater_than, Predicate_greater_than_or_equal, Predicate_halt, Predicate_integer, Predicate_is, Predicate_is_list, Predicate_java_classname, Predicate_java_object, Predicate_java_to_string, Predicate_length, Predicate_less_than, Predicate_less_than_or_equal, Predicate_listing, Predicate_member, Predicate_message, Predicate_msort, Predicate_nonvar, Predicate_nospy, Predicate_nospyall, Predicate_not_equal, Predicate_not_unifiable, Predicate_notrace, Predicate_number, Predicate_number_chars, Predicate_number_codes, Predicate_op, Predicate_open, Predicate_parse_time, Predicate_peek_byte, Predicate_peek_char, Predicate_predsort, Predicate_prompt, Predicate_put_byte, Predicate_put_char, Predicate_read_term, Predicate_retract, Predicate_set_input, Predicate_set_output, Predicate_set_prolog_flag, Predicate_set_stream_position, Predicate_setof, Predicate_sort, Predicate_spy, Predicate_stacktrace, Predicate_stamp_date_time, Predicate_stream_property, Predicate_sub_atom, Predicate_term_greater_then, Predicate_term_greater_then_or_equal, Predicate_term_identical, Predicate_term_less_then, Predicate_term_less_then_or_equal, Predicate_term_not_identical, Predicate_trace, Predicate_tracing, Predicate_unify, Predicate_unify_with_occurs_check, Predicate_univ, Predicate_uuid, Predicate_uuid_compare, Predicate_uuid_variant, Predicate_uuid_version, Predicate_uuid3, Predicate_uuid4, Predicate_var, Predicate_write_term, UndefinedPredicateCode

public interface PrologCode
extends Installable

prolog code


Field Summary
static int FAIL
          predicate failed
static int HALT
          returned by the interpreter when it was halted, should never be returned by prolog code
static int SUCCESS
          predicate was returned with success, backtrack info was created, and re-execute is possible.
static int SUCCESS_LAST
          predicate was returned with success, backtrack info was not created
 
Method Summary
 int execute(Interpreter interpreter, boolean backtrackMode, Term[] args)
          this method is used for execution of code
 
Methods inherited from interface gnu.prolog.vm.Installable
install, uninstall
 

Field Detail

SUCCESS

static final int SUCCESS
predicate was returned with success, backtrack info was created, and re-execute is possible.

See Also:
Constant Field Values

SUCCESS_LAST

static final int SUCCESS_LAST
predicate was returned with success, backtrack info was not created

See Also:
Constant Field Values

FAIL

static final int FAIL
predicate failed

See Also:
Constant Field Values

HALT

static final int HALT
returned by the interpreter when it was halted, should never be returned by prolog code

See Also:
Constant Field Values
Method Detail

execute

int execute(Interpreter interpreter,
            boolean backtrackMode,
            Term[] args)
            throws PrologException
this method is used for execution of code

Parameters:
interpreter - interpreter in which context code is executed
backtrackMode - true if predicate is called on backtracking and false otherwise
args - arguments of code
Returns:
either SUCCESS, SUCCESS_LAST, or FAIL.
Throws:
PrologException

GNU Prolog for Java