|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectaminePlatform.engines.prologPlusCG.interpreter.Resolution
Title : Resolution
Description : Resolution implements the resolution process of Prolog+CG. It is the Core of Prolog+CG interpreter.
Copyright : Copyright (c) Adil KABBAJ 2004-2009
Field Summary | |
(package private) boolean |
atLeastOneSolution
|
ResolutionStack |
backTrackStack
|
int |
cptVarBid
|
Debuger |
debuger
|
(package private) DebugFrame |
debugFrame
|
(package private) static java.lang.String |
fail
|
java.util.HashMap |
globalPrlgPCGObjs
We include in Prolog+CG the possibility to define and use global objects. |
boolean |
goal2RslveFrstRsltion
|
GoalToResolve |
goalToResolve
|
Lexicon |
lexicon
|
java.lang.String |
operation
|
protected Rules |
paquet
|
PPCGBindingContext |
ppcgBindingContext
|
PPCGParser |
ppcgParser
|
java.util.HashMap |
ppcgPrgs
ppcgPrgs will contains the internal representation of not only Prolog+CG program, but also several programs if it is required. |
protected Rule |
request
|
ResolutionStack |
resolutionStack
The three stacks for the resolution process : resolution stack, backtrack stack and unification stack. |
boolean |
stop
|
(package private) boolean |
unifiable
|
UnificationStack |
unificationStack
|
protected java.util.ArrayList |
varsInRequest
|
Constructor Summary | |
Resolution()
|
|
Resolution(java.util.HashMap ppcgPrograms,
Lexicon lexicon)
|
|
Resolution(java.util.HashMap ppcgPrograms,
Lexicon lexicon,
DebugFrame debugFrame)
|
|
Resolution(java.lang.String[] ppcgFilePaths)
|
|
Resolution(java.lang.String ontologyFilePath,
java.lang.String[] ppcgFilePaths)
|
Method Summary | |
void |
clearData()
|
(package private) void |
clearGlobalPrlgPCGObjs()
|
protected boolean |
cut()
|
protected boolean |
execPrimitive(java.lang.String signature)
|
void |
finalize()
|
java.util.ArrayList |
findAllSolutions(boolean debug)
Find all solutions for the current request. |
java.util.ArrayList |
findAllSolutions(java.lang.String request)
Find all solutions for the specified request. |
java.util.HashMap |
findFirstSolution(boolean debug)
Find the first solution for the current request. |
java.util.HashMap |
findNextSolution(boolean debug)
Find the next solution for the current request. |
java.util.HashMap |
getASolution()
|
int |
getCptVarBid()
|
boolean |
getDebug()
Get the debug flag value. |
Debuger |
getDebuger()
|
DebugFrame |
getDebugFrame()
|
Lexicon |
getLexicon()
Get the lexicon of the current resolution |
static java.lang.String |
getPPCGDirPath()
|
java.util.HashMap |
getPPCGPrgs()
|
Rule |
getRequest()
Get the current request. |
UnificationStack |
getUnificationStack()
|
java.lang.Object |
getValOfGlobalObject(Identifier ident)
|
java.util.ArrayList |
getVarsInRequest()
|
boolean |
isGlobalObject(Identifier ident)
|
protected boolean |
isNullTerm(java.lang.Object obj)
|
boolean |
isPrimitive(java.lang.String signature)
|
(package private) boolean |
isUnifiable(Rules paquet)
starting with the position recorded in goalToResolve, search for a rule in the paquet paquet so that the head of the rule could be unified with the current goal (recorded in goalToResolve.goal. |
protected boolean |
reExecPrimitive(java.lang.String signature)
|
void |
setCptVarBid(int nVal)
|
void |
setDebug(boolean debug)
Set the mode of the debugger: if debug is true, then debugger will be actif, otherwise the debugger will not be actif |
void |
setDebuger(Debuger debuger)
|
void |
setDebugFrame(DebugFrame dbgFrame)
|
void |
setLexicon(Lexicon lex)
|
void |
setOneSolution(java.util.HashMap solution)
|
static void |
setPPCGDirPath(java.lang.String ppcgDrPath)
|
void |
setPPCGPrgs(java.util.HashMap ppcgPrgs)
|
void |
setRequest(Rule request)
Set the specified request as the current request to resolve. |
void |
setRequest(java.lang.String request)
Analyze the specified request; from its string form to an internal structure, then determine the variables that are specified in the request and store them in the resolution attribute varsInRequest. |
protected void |
setValOfGlobalObject(Identifier ident,
java.lang.Object val)
|
protected void |
setVarsInRequest(java.util.ArrayList arrVars)
|
void |
stopDebug()
|
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public Lexicon lexicon
public PPCGBindingContext ppcgBindingContext
public PPCGParser ppcgParser
public Debuger debuger
public boolean stop
public java.lang.String operation
boolean unifiable
boolean atLeastOneSolution
DebugFrame debugFrame
public int cptVarBid
public ResolutionStack resolutionStack
public ResolutionStack backTrackStack
public UnificationStack unificationStack
public java.util.HashMap globalPrlgPCGObjs
public java.util.HashMap ppcgPrgs
protected Rule request
protected java.util.ArrayList varsInRequest
protected Rules paquet
public GoalToResolve goalToResolve
public boolean goal2RslveFrstRsltion
static java.lang.String fail
Constructor Detail |
public Resolution()
public Resolution(java.util.HashMap ppcgPrograms, Lexicon lexicon)
public Resolution(java.util.HashMap ppcgPrograms, Lexicon lexicon, DebugFrame debugFrame)
public Resolution(java.lang.String ontologyFilePath, java.lang.String[] ppcgFilePaths)
public Resolution(java.lang.String[] ppcgFilePaths)
Method Detail |
public int getCptVarBid()
public void setCptVarBid(int nVal)
public UnificationStack getUnificationStack()
public java.util.HashMap getPPCGPrgs()
public void setPPCGPrgs(java.util.HashMap ppcgPrgs)
public void clearData()
public void finalize()
void clearGlobalPrlgPCGObjs()
public boolean getDebug()
public void setDebug(boolean debug)
debug
- A booleanpublic void stopDebug()
public Debuger getDebuger()
public void setDebuger(Debuger debuger)
public DebugFrame getDebugFrame()
public void setDebugFrame(DebugFrame dbgFrame)
public Lexicon getLexicon()
public void setLexicon(Lexicon lex)
public java.util.HashMap getASolution()
public void setOneSolution(java.util.HashMap solution)
public boolean isGlobalObject(Identifier ident)
public java.lang.Object getValOfGlobalObject(Identifier ident)
protected void setValOfGlobalObject(Identifier ident, java.lang.Object val)
public java.util.ArrayList getVarsInRequest()
protected void setVarsInRequest(java.util.ArrayList arrVars)
public Rule getRequest()
public void setRequest(java.lang.String request) throws java.lang.Exception
request
- A String that represents the request.
java.lang.Exception
- if problems occur during the analysis of the request.public void setRequest(Rule request) throws java.lang.Exception
request
- A Rule that represents the request.
java.lang.Exception
- if problems occur during the analysis of the request.public static java.lang.String getPPCGDirPath()
public static void setPPCGDirPath(java.lang.String ppcgDrPath)
public java.util.HashMap findFirstSolution(boolean debug) throws java.lang.Exception
debug
- A Boolean that specifies if the debugger will be actif or not.
java.lang.Exception
- if problems occurs during the resolutionpublic java.util.HashMap findNextSolution(boolean debug) throws java.lang.Exception
debug
- A Boolean that specifies if the debugger will be actif or not.
java.lang.Exception
- if problems occurs during the resolutionpublic java.util.ArrayList findAllSolutions(java.lang.String request)
request
- A String that specifies the request to answer.
java.lang.Exception
- if a problem occurs during the resolutionpublic java.util.ArrayList findAllSolutions(boolean debug) throws java.lang.Exception
debug
- A Boolean that specifies if the debugger will be actif or not.
java.lang.Exception
- if a problem occurs during the resolutionprotected boolean isNullTerm(java.lang.Object obj)
public boolean isPrimitive(java.lang.String signature)
protected boolean execPrimitive(java.lang.String signature) throws java.lang.Exception
java.lang.Exception
protected boolean cut()
protected boolean reExecPrimitive(java.lang.String signature) throws java.lang.Exception
java.lang.Exception
boolean isUnifiable(Rules paquet) throws java.lang.Exception
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |