#include <CNormalLogical.h>
List of all members.
Member Typedef Documentation
Constructor & Destructor Documentation
CNormalLogical::CNormalLogical |
( |
| ) |
|
CNormalLogical::~CNormalLogical |
( |
| ) |
[virtual] |
Member Function Documentation
template<typename TYPE >
static void CNormalLogical::cleanSet |
( |
const TemplateSet< TYPE > & |
s | ) |
[inline, static] |
This routine calls delete an all pointers in the set.
template<typename TYPE >
static void CNormalLogical::cleanSetOfSets |
( |
TemplateSetOfSets< TYPE > & |
s | ) |
[inline, static] |
This routine calls cleanSet on all inner sets.
Converts a set of AND combined sets of OR combined elements into a target set of OR combined sets of AND combined elements.
template<typename TYPE >
static void CNormalLogical::copySet |
( |
const TemplateSet< TYPE > & |
source, |
|
|
TemplateSet< TYPE > & |
target |
|
) |
| [inline, static] |
This routine makes a deep copy of all elements in the souce set and appends them to the target set.
This routine makes deep copies of all inner sets and appends them to the target set.
This methods checks wether there is something like A and !A in a set, if such an occurance is found, the whole set is converted to a set with either a false or a true item. For or combined items, this would be true, for and combined sets, it would be false. If there already are sets in the outer set, this set could be eliminated altogether.
bool CNormalLogical::evaluateExpression |
( |
const std::map< CNormalLogicalItem, bool > & |
truthValueMap | ) |
const [protected] |
Given a map that associates each logical element with a truth value, this method evaluates the whole logical expression.
bool CNormalLogical::generateCanonicalDNF |
( |
ItemSetOfSets & |
tmpAndSet | ) |
const [protected] |
This method creates the canonical disjunctive normalform for a logical expression. The expression must not contain choices and no negated item sets or items. Since the method scales with exponentially, the number of logical individual logical items in the expression is limited to 16. The return value is true if the call succeeded and false otherwise.
bool CNormalLogical::isNegated |
( |
| ) |
const |
void CNormalLogical::negate |
( |
| ) |
|
Negates a set of sets with elements. The result of the operation is returned in target. The type of the result depends on the source. If the source was a set of AND combined sets of OR combined elements, the rersult will be a set of OR combined sets with AND combined elements.
template<typename TYPE >
static bool CNormalLogical::negateSets |
( |
const TemplateSet< TYPE > & |
source, |
|
|
TemplateSet< TYPE > & |
target |
|
) |
| [inline, static, protected] |
Negates a set of elements. The result of the operation is returned in target. The type of result depends on the source. If the source was a set of AND combined elements, the result is a set of OR combined elements and vice versa. target set.
Converts a set of AND combined sets of OR combined elements into a target set of OR combined sets of AND combined elements. Negates a set of elements. The result of the operation is returned in target. The type of result depends on the source. If the source was a set of AND combined elements, the result is a set of OR combined elements and vice versa. target set. Negates a set of sets with elements. The result of the operation is returned in target. The type of the result depends on the source. If the source was a set of AND combined sets of OR combined elements, the rersult will be a set of OR combined sets with AND combined elements.
void CNormalLogical::setIsNegated |
( |
bool |
negate | ) |
|
bool CNormalLogical::simplify |
( |
| ) |
[virtual] |
Out of some reason, I can not use the insert method becasuse this seems to lead to different results in certain cases. E.g. I had a itemSetOfSets with 17 entries and if I used the insert, only 15 eneded up in mAndItems, whereas when I copied them in a loop, all 17 ended up in mAndItems. This is strange and unsatisfying, but since sets can't be debuged that well, I didn't feel like digging into this. RG
Implements CNormalBase.
std::string CNormalLogical::toString |
( |
| ) |
const [virtual] |
Member Data Documentation
Flag to specify whether the whole logical expression has to be negated.
The documentation for this class was generated from the following files: