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 void
addTheory(String theory)
Adds a Prolog theory to the knowledge base.void
addTheory(String... theory)
Adds a Prolog theory to the knowledge base.alice.tuprolog.Prolog
getEngine()
Returns the tuProlog engine used by the prover.protected void
loadDefaultLibraries()
void
loadLibrary(String className)
Loads in a Prolog library of the specified name.void
loadTheory(InputStream input)
Loads a Prolog theory from a stream.Query
query(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:Prover
Creates 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:Prover
Loads 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:Prover
Loads a Prolog theory from a stream.- Specified by:
loadTheory
in interfaceProver
- Overrides:
loadTheory
in classAbstractProver
- Parameters:
input
- the stream- Throws:
IOException
-
addTheory
public void addTheory(String theory)
Description copied from interface:Prover
Adds a Prolog theory to the knowledge base.- Parameters:
theory
- the Prolog theory
-
-