GNU Prolog for Java

gnu.prolog.vm.buildins.unification
Class Predicate_unify_with_occurs_check

java.lang.Object
  extended by gnu.prolog.vm.ExecuteOnlyCode
      extended by gnu.prolog.vm.buildins.unification.Predicate_unify_with_occurs_check
All Implemented Interfaces:
Installable, PrologCode

public class Predicate_unify_with_occurs_check
extends ExecuteOnlyCode

Unify two terms occur check


Field Summary
 
Fields inherited from interface gnu.prolog.vm.PrologCode
FAIL, HALT, SUCCESS, SUCCESS_LAST
 
Constructor Summary
Predicate_unify_with_occurs_check()
           
 
Method Summary
 int execute(Interpreter interpreter, boolean backtrackMode, Term[] args)
          this method is used for execution of code
static boolean occurCheck(VariableTerm variable, Term term)
          preform occur check on variable
 
Methods inherited from class gnu.prolog.vm.ExecuteOnlyCode
install, uninstall
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Predicate_unify_with_occurs_check

public Predicate_unify_with_occurs_check()
Method Detail

execute

public int execute(Interpreter interpreter,
                   boolean backtrackMode,
                   Term[] args)
            throws PrologException
Description copied from interface: PrologCode
this method is used for execution of code

Specified by:
execute in interface PrologCode
Specified by:
execute in class ExecuteOnlyCode
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

occurCheck

public static boolean occurCheck(VariableTerm variable,
                                 Term term)
preform occur check on variable

Returns:
true if term does not contains variable

GNU Prolog for Java