|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--com.svincent.moksa.WamObject
|
+--com.svincent.moksa.PrologEngine
Global context for everything, plus a public interface for users.
| Inner Class Summary | |
class |
PrologEngine.AddHandler
|
static class |
PrologEngine.ArithmeticHandler
|
class |
PrologEngine.NegateHandler
|
class |
PrologEngine.SubtractHandler
|
| Field Summary | |
boolean |
debug
|
boolean |
debugUnify
|
boolean |
trace
Debug flags inlined for speed and comfort. |
| Constructor Summary | |
PrologEngine()
Make a new PrologEngine. |
|
| Method Summary | |
void |
addArithmeticHandler(PrologEngine.ArithmeticHandler ah)
|
void |
asserta(PrologTerm term)
Asserts a new clause before all clauses of the definition of the given predicate. |
void |
asserta(Rule rule)
Asserts a new clause before all clauses of the definition of the given predicate. |
void |
assertz(PrologTerm term)
Asserts a new clause after all clauses of the definition of the given predicate. |
void |
assertz(Rule rule)
Asserts a new clause after all clauses of the definition of the given predicate. |
Rule |
compileRule(PrologTerm term)
|
PrologFactory |
getFactory()
Retrieve the new object Factory used in this PrologEngine. |
void |
installArithmeticHandlers()
|
void |
installBuiltins()
Install all the builtin rules. |
boolean |
invoke(CompoundTerm goal)
Utility method from outside. |
void |
loadModule(java.lang.String moduleName)
|
IndentPrintWriter |
log()
Retrieve the current output log. |
PrologEngine.ArithmeticHandler |
lookupArithmeticHandler(java.lang.String name)
|
Variable[] |
solve(CompoundTerm goal)
Utility method from outside. |
| Methods inherited from class com.svincent.moksa.WamObject |
tag,
tag |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Field Detail |
public boolean trace
public boolean debug
public boolean debugUnify
| Constructor Detail |
public PrologEngine()
| Method Detail |
public PrologFactory getFactory()
public IndentPrintWriter log()
public void asserta(PrologTerm term)
throws PrologException
public void assertz(PrologTerm term)
throws PrologException
public void asserta(Rule rule)
public void assertz(Rule rule)
public Variable[] solve(CompoundTerm goal)
throws PrologException
public boolean invoke(CompoundTerm goal)
throws PrologException
public void installBuiltins()
Install all the builtin rules.
There are big issues with this, particularly w.r.t. memory consumption. Rather, I should load things dynamically (maybe have a lookup table of modules that can be loaded by function name or something...)
XXX when we do modules, there can be a dynamic module called 'java', which allows builtin classes to be dynamically loaded. Much nicer.
public void installArithmeticHandlers()
public void addArithmeticHandler(PrologEngine.ArithmeticHandler ah)
public PrologEngine.ArithmeticHandler lookupArithmeticHandler(java.lang.String name)
public Rule compileRule(PrologTerm term)
throws PrologException
public void loadModule(java.lang.String moduleName)
throws PrologException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
This is documentation for Moksa Prolog, which can be found at http://www.svincent.com/moksa/
Copyright © 1999 Shawn P. Vincent.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.