Package org.prolog4j.tuprolog.impl
Class TuPrologProver
- java.lang.Object
-
- org.prolog4j.AbstractProver
-
- org.prolog4j.tuprolog.impl.TuPrologProver
-
- All Implemented Interfaces:
Serializable,Prover
public class TuPrologProver extends AbstractProver
Represents a Prolog knowledge base and provides methods for solving queries on it. The prover itself is not responsible for processing the solutions.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description TuPrologProver(ConversionPolicy conversionPolicy)Creates a tuProlog prover.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddTheory(String theory)Adds a Prolog theory to the knowledge base.voidaddTheory(String... theory)Adds a Prolog theory to the knowledge base.alice.tuprolog.ProloggetEngine()Returns the tuProlog engine used by the prover.protected voidloadDefaultLibraries()voidloadLibrary(String className)Loads in a Prolog library of the specified name.voidloadTheory(InputStream input)Loads a Prolog theory from a stream.Queryquery(String goal)Creates a Prolog query that can be solved later.-
Methods inherited from class org.prolog4j.AbstractProver
assertz, getConversionPolicy, loadTheory, retract, solve
-
-
-
-
Constructor Detail
-
TuPrologProver
public TuPrologProver(ConversionPolicy conversionPolicy)
Creates a tuProlog prover.
-
-
Method Detail
-
loadDefaultLibraries
protected void loadDefaultLibraries()
-
getEngine
public alice.tuprolog.Prolog getEngine()
Returns the tuProlog engine used by the prover.- Returns:
- the tuProlog engine
-
query
public Query query(String goal)
Description copied from interface:ProverCreates a Prolog query that can be solved later.- Parameters:
goal- the Prolog goal- Returns:
- a query object to be solved later
-
loadLibrary
public void loadLibrary(String className)
Description copied from interface:ProverLoads in a Prolog library of the specified name.- Parameters:
className- the name of the library
-
loadTheory
public void loadTheory(InputStream input) throws IOException
Description copied from interface:ProverLoads a Prolog theory from a stream.- Specified by:
loadTheoryin interfaceProver- Overrides:
loadTheoryin classAbstractProver- Parameters:
input- the stream- Throws:
IOException
-
addTheory
public void addTheory(String theory)
Description copied from interface:ProverAdds a Prolog theory to the knowledge base.- Parameters:
theory- the Prolog theory
-
-