org.qedeq.kernel.bo.logic.model
Class DynamicDirectInterpreter

java.lang.Object
  extended by org.qedeq.kernel.bo.logic.model.DynamicDirectInterpreter

public class DynamicDirectInterpreter
extends java.lang.Object

This class calculates a new truth value for a given formula for a given interpretation.

Author:
Michael Meyling

Constructor Summary
DynamicDirectInterpreter(KernelQedeqBo qedeq, DynamicModel model)
          Constructor.
DynamicDirectInterpreter(KernelQedeqBo qedeq, DynamicModel model, SubjectVariableInterpreter subjectVariableInterpreter, PredicateVariableInterpreter predicateVariableInterpreter, FunctionVariableInterpreter functionVariableInterpreter)
          Constructor.
 
Method Summary
 Entity calculateFunctionValue(FunctionConstant constant, Entity[] entities)
          Calculate function value.
 boolean calculatePredicateValue(PredicateConstant constant, Entity[] entities)
          Calculate function value.
 Entity calculateTerm(ModuleContext moduleContext, Element term)
          Calculate the term value of a given term.
 boolean calculateValue(ModuleContext moduleContext, Element formula)
          Calculate the truth value of a given formula is a tautology.
 void clearVariables()
          Clear all variable settings.
 DynamicModel getModel()
          Get model.
protected  ModuleContext getModuleContext()
           
 boolean hasFunctionConstant(ModelFunctionConstant constant)
          Is the given function constant already defined?
 boolean hasPredicateConstant(ModelPredicateConstant constant)
          Is the given predicate constant already defined?
 boolean next()
          Change to next valuation.
protected  void setLocationWithinModule(java.lang.String localContext)
           
protected  void setModuleContext(KernelQedeqBo qedeq)
           
 java.lang.String stripReference(java.lang.String operator)
          Strips the reference to external modules.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DynamicDirectInterpreter

public DynamicDirectInterpreter(KernelQedeqBo qedeq,
                                DynamicModel model)
Constructor.

Parameters:
qedeq - We work with this module.
model - We work with this model.

DynamicDirectInterpreter

public DynamicDirectInterpreter(KernelQedeqBo qedeq,
                                DynamicModel model,
                                SubjectVariableInterpreter subjectVariableInterpreter,
                                PredicateVariableInterpreter predicateVariableInterpreter,
                                FunctionVariableInterpreter functionVariableInterpreter)
Constructor.

Parameters:
qedeq - We work with this module.
model - We work with this model.
subjectVariableInterpreter - Subject variable interpreter.
predicateVariableInterpreter - Predicate variable interpreter.
functionVariableInterpreter - Function variable interpreter.
Method Detail

calculateFunctionValue

public Entity calculateFunctionValue(FunctionConstant constant,
                                     Entity[] entities)
                              throws HeuristicException
Calculate function value.

Parameters:
constant - This is the function definition.
entities - Function arguments.
Returns:
Result of calculation;
Throws:
HeuristicException - Calculation of function value failed.

calculatePredicateValue

public boolean calculatePredicateValue(PredicateConstant constant,
                                       Entity[] entities)
                                throws HeuristicException
Calculate function value.

Parameters:
constant - This is the predicate definition.
entities - Function arguments.
Returns:
Result of calculation;
Throws:
HeuristicException - Calculation failed.

calculateValue

public boolean calculateValue(ModuleContext moduleContext,
                              Element formula)
                       throws HeuristicException
Calculate the truth value of a given formula is a tautology. This is done by checking with a model and certain variable values.

Parameters:
moduleContext - Where we are within an module.
formula - Formula.
Returns:
Truth value of formula.
Throws:
HeuristicException - We couldn't calculate the value.

calculateTerm

public Entity calculateTerm(ModuleContext moduleContext,
                            Element term)
                     throws HeuristicException
Calculate the term value of a given term. This is done by checking with a model and certain variable values.

Parameters:
moduleContext - Where we are within an module.
term - Term.
Returns:
Entity of model.
Throws:
HeuristicException - We couldn't calculate the value.

getModuleContext

protected ModuleContext getModuleContext()

setModuleContext

protected void setModuleContext(KernelQedeqBo qedeq)

setLocationWithinModule

protected void setLocationWithinModule(java.lang.String localContext)

next

public boolean next()
Change to next valuation.

Returns:
Is there a next new valuation?

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

stripReference

public java.lang.String stripReference(java.lang.String operator)
Strips the reference to external modules.

Parameters:
operator - Might have reference to an external module.
Returns:
Operator as local reference.

hasPredicateConstant

public boolean hasPredicateConstant(ModelPredicateConstant constant)
Is the given predicate constant already defined?

Parameters:
constant - Predicate constant to check for.
Returns:
Is the given predicate constant already defined?

hasFunctionConstant

public boolean hasFunctionConstant(ModelFunctionConstant constant)
Is the given function constant already defined?

Parameters:
constant - Function constant to check for.
Returns:
Is the given function constant already defined?

clearVariables

public void clearVariables()
Clear all variable settings.


getModel

public DynamicModel getModel()
Get model.

Returns:
Model we work with.


Copyright © 2014. All Rights Reserved.