InterpretedFormula Class Reference
[SAT Problem]

#include <Formula.h>

Inheritance diagram for InterpretedFormula:

Inheritance graph
[legend]
Collaboration diagram for InterpretedFormula:

Collaboration graph
[legend]

List of all members.


Detailed Description

Interpreted formula implementation.

Note:
Implementation of this class is not the Fastest one, but there hasn't been any request for a better implementation yet.

Definition at line 88 of file Formula.h.


Public Member Functions

 InterpretedFormula ()
 ~InterpretedFormula ()
int parse (Token token)
 Parse given token.

Parameters:
token Token to parse
Returns:
Returns zero, if no fatal error occurs.
Note:
Parase error is not fatal in this context.

bool isValid ()
 
Returns:
Return true if formula is valid.

Note:
Invalid formulas should be never evaluated.

bool eval (ISatItem *data)
 
Returns:
Return true if formula is satisfied for given data.

Parameters:
data Evaluation data to use for evaluation. Consider ISatItem interface for detail.


Classes

struct  Private

Constructor & Destructor Documentation

InterpretedFormula (  ) 

Definition at line 268 of file Formula.cpp.

References InterpretedFormula::Private::errorDetected, InterpretedFormula::Private::parserStack, ParserStack::push(), and FastSatSolver::T_STACK_BOTTOM.

~InterpretedFormula (  ) 

Definition at line 275 of file Formula.cpp.


Member Function Documentation

int parse ( Token  token  )  [virtual]

Parse given token.

Parameters:
token Token to parse
Returns:
Returns zero, if no fatal error occurs.
Note:
Parase error is not fatal in this context.

Parameters:
token 

Implements IFormulaBuilder.

Definition at line 282 of file Formula.cpp.

References InterpretedFormula::Private::cmdList, InterpretedFormula::Private::errorDetected, ParserStack::insertLt(), InterpretedFormula::isValid(), Token::m_token, InterpretedFormula::Private::parserStack, ParserStack::pop(), ParserStack::popAndCompare(), ParserStack::push(), FastSatSolver::T_EOF, FastSatSolver::T_ERR_EXPR, FastSatSolver::T_FALSE, FastSatSolver::T_LPAR, FastSatSolver::T_NOT, FastSatSolver::T_PARSER_EQ, FastSatSolver::T_PARSER_EXPR, FastSatSolver::T_PARSER_GT, FastSatSolver::T_PARSER_INV, FastSatSolver::T_PARSER_LT, FastSatSolver::T_RPAR, FastSatSolver::T_TRUE, FastSatSolver::T_VARIABLE, FastSatSolver::tableLookup(), and ParserStack::topTerm().

Referenced by ScannerFormulaHandler::readNext().

bool isValid (  )  [virtual]

Returns:
Return true if formula is valid.

Note:
Invalid formulas should be never evaluated.

Returns:
bool

Implements IFormulaBuilder.

Definition at line 418 of file Formula.cpp.

References InterpretedFormula::Private::errorDetected, InterpretedFormula::Private::parserStack, FastSatSolver::T_PARSER_EXPR, FastSatSolver::T_STACK_BOTTOM, ParserStack::top(), and ParserStack::topTerm().

Referenced by InterpretedFormula::parse(), and ScannerFormulaHandler::readNext().

bool eval ( ISatItem data  )  [virtual]

Returns:
Return true if formula is satisfied for given data.

Parameters:
data Evaluation data to use for evaluation. Consider ISatItem interface for detail.

Parameters:
data 

Implements IFormulaEvaluator.

Definition at line 437 of file Formula.cpp.

References InterpretedFormula::Private::cmdList, and CmdList::execute().


The documentation for this class was generated from the following files:
Generated on Wed Nov 5 22:30:22 2008 for Fast SAT Solver by  doxygen 1.5.4