hyspirit.engines
Class HyFVPDatalogEngine

java.lang.Object
  extended by hyspirit.engines.HyEngine
      extended by hyspirit.engines.HyInferenceEngine
          extended by hyspirit.engines.HyFVPDatalogEngine
All Implemented Interfaces:
java.lang.Runnable

public class HyFVPDatalogEngine
extends HyInferenceEngine


Field Summary
 
Fields inherited from class hyspirit.engines.HyInferenceEngine
deleteQueryProgram, retrieveProgram
 
Fields inherited from class hyspirit.engines.HyEngine
argumentString, LOG, stdin, TIME_PREFIX
 
Constructor Summary
HyFVPDatalogEngine()
          This constructor must be used if you are going to start your own engine process (client/server mode).
HyFVPDatalogEngine(HySpiritProperties hyspirit)
          This constructor must be used if you are going to start your own engine process (client/server mode).
HyFVPDatalogEngine(java.lang.String hostname, int port)
          This constructor must be used if you use an engine server (client mode).
 
Method Summary
protected  java.lang.String[] buildCommand()
          Builds the command from the parameters.
 void CWAPostfix(java.lang.String CWAPostfix)
          Postfix used for dynamic relations for closed world assumption.
 void hyPRAOpts(java.lang.String hyPRAOpts)
          Sets option to be passed to hy_pra directly.
 void negPrefix(java.lang.String negPrefix)
          Specification of the prefixes for the relations that contain positive negative (false and inconsistent) propositions, respecitively.
 void OWAPostfix(java.lang.String OWAPostfix)
          Postfix used for dynamic relations for open world assumption.
 void posPrefix(java.lang.String posPrefix)
          Specification of the prefixes for the relations that contain positive (true and inconsistent) propositions.
 void reset()
          Resets all parameters of the engine after destroying a possibly running process.
 void setCWA(boolean cwa)
          Sets open world assumption (cwa = false) or closed world assumption (cwa = true).
 void setDynamic(boolean dynamic)
          Specify static or dynamic for CWA or OWA.
 void setPosNeg(boolean posneg)
          With this option, HyFVPD supports reasoning with partly inconsistent knowledge.
 void toPD()
          Tells to translate a FVPD program to PD.
 void toPRA()
          Tells to translate a FVPD program to PRA.
 
Methods inherited from class hyspirit.engines.HyInferenceEngine
deleteQuery, deleteQueryProgram, echo, echoSpecial, eval, evalFile, getStreamEndMessage, nextTuple, retrieve, retrieveProgram, runProgram
 
Methods inherited from class hyspirit.engines.HyEngine
closeSTDIN, destroy, exitValue, getCommand, getEngineName, getInputReader, getOutputWriter, getPercentageCPU, getRealTime, getSTDERR, getSTDIN, getSTDOUT, getSysTime, getUserTime, hasNext, isInClientMode, isRunning, kb, kb, kb, next, readFromSTDIN, restart, run, send, send, sendAndReceive, sendFile, setArgumentString, setLogger, start, suppressSTDERR, takesTime, takeTime, waitFor, waitTillRunning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HyFVPDatalogEngine

public HyFVPDatalogEngine()
                   throws HySpiritException
This constructor must be used if you are going to start your own engine process (client/server mode).

Throws:
HySpiritException - if we can't determine the environment

HyFVPDatalogEngine

public HyFVPDatalogEngine(HySpiritProperties hyspirit)
                   throws HySpiritException
This constructor must be used if you are going to start your own engine process (client/server mode).

Parameters:
hyspirit - the HySpirit properties containing the environment
Throws:
HySpiritException - if we can't determine the environment

HyFVPDatalogEngine

public HyFVPDatalogEngine(java.lang.String hostname,
                          int port)
                   throws HySpiritException
This constructor must be used if you use an engine server (client mode).

Parameters:
hostname - the server host name
port - the server port
Throws:
HySpiritException - if we can't determine the environment
Method Detail

toPRA

public void toPRA()
Tells to translate a FVPD program to PRA.


toPD

public void toPD()
Tells to translate a FVPD program to PD.


setCWA

public void setCWA(boolean cwa)
Sets open world assumption (cwa = false) or closed world assumption (cwa = true). See hy_fvpd manual for further details.

Parameters:
cwa - flag if closed or open world assumption

setDynamic

public void setDynamic(boolean dynamic)
Specify static or dynamic for CWA or OWA. With static (dynamic = false), world assumptions can not be altered. See also methods CWAPostfix() and OWAPostFix(). See hy_fvpd manual for further details.

Parameters:
dynamic - true if dynamic, false if static

CWAPostfix

public void CWAPostfix(java.lang.String CWAPostfix)
Postfix used for dynamic relations for closed world assumption.

Parameters:
CWAPostfix - the CWA postfix

OWAPostfix

public void OWAPostfix(java.lang.String OWAPostfix)
Postfix used for dynamic relations for open world assumption.

Parameters:
OWAPostfix - the OWA postfix

setPosNeg

public void setPosNeg(boolean posneg)
With this option, HyFVPD supports reasoning with partly inconsistent knowledge. See hy_fvpd manual for further details.

Parameters:
posneg - true or false

posPrefix

public void posPrefix(java.lang.String posPrefix)
Specification of the prefixes for the relations that contain positive (true and inconsistent) propositions. Ignored if closed world assumption is set (see setCWA()) or posneg is not set (see setPosNeg()). See hy_fvpd manual for further details.

Parameters:
posPrefix - prefix for positive relations

negPrefix

public void negPrefix(java.lang.String negPrefix)
Specification of the prefixes for the relations that contain positive negative (false and inconsistent) propositions, respecitively. Ignored if closed world assumption is set (see setCWA()) or posneg is not set (see setPosNeg()). See hy_fvpd manual for further details.

Parameters:
negPrefix - prefix for negative relations

hyPRAOpts

public void hyPRAOpts(java.lang.String hyPRAOpts)
Sets option to be passed to hy_pra directly.

Parameters:
hyPRAOpts - the hy_pra options. See hy_pra manual for further details.

reset

public void reset()
Resets all parameters of the engine after destroying a possibly running process. You have to restart the process with run().

Overrides:
reset in class HyEngine

buildCommand

protected java.lang.String[] buildCommand()
Description copied from class: HyEngine
Builds the command from the parameters. If subclasses support other parameters, they have to override the buildCommand and reset methods. Be sure that you place the support for new, additional parameters somewhere. This means the block
   if (this.argumentString != null) {
     StringTokenizer strTok= new StringTokenizer(this.argumentString);
     while (strTok.hasMoreTokens()) commandVec.add(strTok.nextToken());
  }
  
should appear somewhere in your buildCommand implementation.

The output of this method is used in the run() method.

Overrides:
buildCommand in class HyEngine
Returns:
the command string array