Package org.prolog4j.swi.impl
Class SWIPrologProver
- java.lang.Object
-
- org.prolog4j.AbstractProver
-
- org.prolog4j.swi.impl.SWIPrologProver
-
- All Implemented Interfaces:
Serializable
,Prover
public class SWIPrologProver 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 SWIPrologProver(ConversionPolicy conversionPolicy)
Creates an SWI-Prolog 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.void
loadLibrary(String className)
Loads in a Prolog library of the specified name.void
loadTheory(String filename)
Loads a Prolog theory from a string.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
-
SWIPrologProver
public SWIPrologProver(ConversionPolicy conversionPolicy)
Creates an SWI-Prolog prover.
-
-
Method Detail
-
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(String filename)
Description copied from interface:Prover
Loads a Prolog theory from a string.- Specified by:
loadTheory
in interfaceProver
- Overrides:
loadTheory
in classAbstractProver
- Parameters:
filename
- the string
-
addTheory
public void addTheory(String theory)
Description copied from interface:Prover
Adds a Prolog theory to the knowledge base.- Parameters:
theory
- the Prolog theory
-
-