GNU Prolog for Java

gnu.prolog.vm.buildins.allsolutions
Class Predicate_findall

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

public class Predicate_findall
extends ExecuteOnlyCode

prolog code


Field Summary
 
Fields inherited from interface gnu.prolog.vm.PrologCode
FAIL, HALT, SUCCESS, SUCCESS_LAST
 
Constructor Summary
Predicate_findall()
           
 
Method Summary
static void checkList(Term list)
          Check that list is a valid Prolog list (including an uninstantiated variable)
 int execute(Interpreter interpreter, boolean backtrackMode, Term[] args)
          this method is used for execution of code
static int findall(Interpreter interpreter, boolean backtrackMode, Term template, Term goal, List<Term> list)
           
 
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_findall

public Predicate_findall()
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

findall

public static int findall(Interpreter interpreter,
                          boolean backtrackMode,
                          Term template,
                          Term goal,
                          List<Term> list)
                   throws PrologException
Parameters:
interpreter - interpreter in which context code is executed
backtrackMode - true if predicate is called on backtracking and false otherwise
template -
goal -
list -
Returns:
either PrologCode.SUCCESS_LAST or PrologCode.FAIL
Throws:
PrologException

checkList

public static void checkList(Term list)
                      throws PrologException
Check that list is a valid Prolog list (including an uninstantiated variable)

Parameters:
list - the term to check to see if it is a list
Throws:
PrologException - for the various errors when it is not a list.

GNU Prolog for Java