public class TheoryManager extends Object implements Serializable
Theory
,
Serialized FormConstructor and Description |
---|
TheoryManager() |
Modifier and Type | Method and Description |
---|---|
boolean |
abolish(Struct pi)
removing from dbase all the clauses corresponding to the
predicate indicator passed as a parameter
|
void |
addStartGoal(Struct g)
add a goal eventually defined by last parsed theory.
|
void |
assertA(Struct clause,
boolean dyn,
String libName,
boolean backtrackable)
inserting of a clause at the head of the dbase
|
void |
assertZ(Struct clause,
boolean dyn,
String libName,
boolean backtrackable)
inserting of a clause at the end of the dbase
|
void |
clear()
Clears the clause dbase.
|
void |
consult(Theory theory,
boolean dynamicTheory,
String libName)
Consults a theory.
|
List<ClauseInfo> |
find(Term headt)
Returns a family of clauses with functor and arity equals
to the functor and arity of the term passed as a parameter
Reviewed by Paolo Contessi: modified according to new ClauseDatabase
implementation
|
Theory |
getLastConsultedTheory()
Gets last consulted theory
|
String |
getTheory(boolean onlyDynamic)
Gets current theory
|
void |
initialize(Prolog vm) |
void |
rebindPrimitives()
Binds clauses in the database with the corresponding
primitive predicate, if any
|
void |
removeLibraryTheory(String libName)
remove all the clauses of lib theory
|
ClauseInfo |
retract(Struct cl)
removing from dbase the first clause with head unifying with clause
|
void |
solveTheoryGoal() |
public void initialize(Prolog vm)
public void assertA(Struct clause, boolean dyn, String libName, boolean backtrackable)
public void assertZ(Struct clause, boolean dyn, String libName, boolean backtrackable)
public ClauseInfo retract(Struct cl)
public boolean abolish(Struct pi)
public List<ClauseInfo> find(Term headt)
public void consult(Theory theory, boolean dynamicTheory, String libName) throws InvalidTheoryException
theory
- theory to adddynamicTheory
- if it is true, then the clauses are marked as dynamiclibName
- if it not null, then the clauses are marked to belong to the specified libraryInvalidTheoryException
public void rebindPrimitives()
public void clear()
public void removeLibraryTheory(String libName)
public void solveTheoryGoal()
public void addStartGoal(Struct g)
public String getTheory(boolean onlyDynamic)
onlyDynamic
- if true, fetches only dynamic clausespublic Theory getLastConsultedTheory()