Package org.prolog4j
Class AbstractProver
- java.lang.Object
-
- org.prolog4j.AbstractProver
-
- All Implemented Interfaces:
Serializable,Prover
- Direct Known Subclasses:
SWIPrologProver,TuPrologProver
public abstract class AbstractProver extends Object implements Prover, Serializable
Serves as base class for prover implementation.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AbstractProver(ConversionPolicy conversionPolicy)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidassertz(String fact, Object... args)Asserts a Prolog fact or rule to the knowledge base.ConversionPolicygetConversionPolicy()Returns the conversion policy used by the prover.voidloadTheory(InputStream input)Loads a Prolog theory from a stream.voidloadTheory(String input)Loads a Prolog theory from a string.voidretract(String fact)Retracts a Prolog fact or rule from the knowledge base.<A> Solution<A>solve(String goal, Object... actualArgs)Solves a Prolog goal and returns an object using which the individual solutions can be iterated over.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.prolog4j.Prover
addTheory, addTheory, loadLibrary, query
-
-
-
-
Constructor Detail
-
AbstractProver
public AbstractProver(ConversionPolicy conversionPolicy)
-
-
Method Detail
-
solve
public final <A> Solution<A> solve(String goal, Object... actualArgs)
Description copied from interface:ProverSolves a Prolog goal and returns an object using which the individual solutions can be iterated over. It is equivalent with the following:query(goal).solve(actualArgs)- Specified by:
solvein interfaceProver- Type Parameters:
A- the type of an element of the solutions- Parameters:
goal- the Prolog goalactualArgs- the actual arguments of the goal- Returns:
- an object for traversing the solutions
- See Also:
Query.solve(Object...)
-
assertz
public void assertz(String fact, Object... args)
Description copied from interface:ProverAsserts a Prolog fact or rule to the knowledge base.
-
retract
public void retract(String fact)
Description copied from interface:ProverRetracts a Prolog fact or rule from the knowledge base.
-
loadTheory
public void loadTheory(InputStream input) throws IOException
Description copied from interface:ProverLoads a Prolog theory from a stream.- Specified by:
loadTheoryin interfaceProver- Parameters:
input- the stream- Throws:
IOException
-
loadTheory
public void loadTheory(String input)
Description copied from interface:ProverLoads a Prolog theory from a string.- Specified by:
loadTheoryin interfaceProver- Parameters:
input- the string
-
getConversionPolicy
public ConversionPolicy getConversionPolicy()
Description copied from interface:ProverReturns the conversion policy used by the prover.- Specified by:
getConversionPolicyin interfaceProver- Returns:
- the conversion policy
-
-