.createTCGDisjunctiveNormalForm();
if (in_oExpression == null)
return oDNF;
if (in_oExpression instanceof TCGOCLOperation) {
TCGOCLOperation oOpExp = (TCGOCLOperation) in_oExpression;
// TODO f�r alle andere booleschen Operatoren erweitern
if (oOpExp.getOperationName().compareTo("and") == 0) {
TCGDisjunctiveNormalForm oLeftDNF = createDisjunctiveNormalForm(oOpExp
.getLeft(), in_bSplitInequations);
TCGDisjunctiveNormalForm oRightDNF = createDisjunctiveNormalForm(oOpExp
.getRight(), in_bSplitInequations);
return connectTwoDNFWithAnd(oLeftDNF, oRightDNF);
}
if (oOpExp.getOperationName().compareTo("or") == 0) {
// TCGDisjunctiveNormalForm oLeftDNF = createDisjunctiveNormalForm(oOpExp
// .getLeft(), in_bSplitInequations);
// TCGDisjunctiveNormalForm oRightDNF = createDisjunctiveNormalForm(oOpExp
// .getRight(), in_bSplitInequations);
// return connectTwoDNFWithOr(oLeftDNF, oRightDNF);
TCGDisjunctiveNormalForm oFirstDNF = null;
{
TCGOCLExpression oFirstExp =
TCGOCLExpressionHelperClass.copyExpression(oOpExp.getLeft());
TCGOCLExpression oSecondExp =
TCGOCLExpressionHelperClass.copyExpression(oOpExp.getRight());
oFirstDNF = connectTwoDNFWithAnd(
createDisjunctiveNormalForm(oFirstExp, in_bSplitInequations),
createDisjunctiveNormalForm(oSecondExp, in_bSplitInequations));
}
TCGDisjunctiveNormalForm oSecondDNF = null;
{
TCGOCLExpression oFirstExp =
TCGOCLExpressionHelperClass.copyExpression(oOpExp.getLeft());
oFirstExp = net.sf.parteg.base.testcasegraph.helperclasses.TCGOCLExpressionHelperClass.negateLogicalTCGOCLExpression(oFirstExp);
TCGOCLExpression oSecondExp =
TCGOCLExpressionHelperClass.copyExpression(oOpExp.getRight());
oSecondDNF = connectTwoDNFWithAnd(
createDisjunctiveNormalForm(oFirstExp, in_bSplitInequations),
createDisjunctiveNormalForm(oSecondExp, in_bSplitInequations));
}
TCGDisjunctiveNormalForm oThirdDNF = null;
{
TCGOCLExpression oFirstExp =
TCGOCLExpressionHelperClass.copyExpression(oOpExp.getLeft());
TCGOCLExpression oSecondExp =
TCGOCLExpressionHelperClass.copyExpression(oOpExp.getRight());
oSecondExp = net.sf.parteg.base.testcasegraph.helperclasses.TCGOCLExpressionHelperClass.negateLogicalTCGOCLExpression(oSecondExp);
oThirdDNF = connectTwoDNFWithAnd(
createDisjunctiveNormalForm(oFirstExp, in_bSplitInequations),
createDisjunctiveNormalForm(oSecondExp, in_bSplitInequations));
}
return connectTwoDNFWithOr(oFirstDNF,
connectTwoDNFWithOr(oSecondDNF, oThirdDNF));
}
if (oOpExp.getOperationName().compareTo("not") == 0) {
// negation has to be applicated to all sub-expressions
// TODO: introduce unary operation - which side holds the
// information?
TCGOCLExpression oNegatedExpression = null;
if (oOpExp.getLeft() != null) {
oNegatedExpression = oOpExp.getLeft();
} else if (oOpExp.getRight() != null) {
oNegatedExpression = oOpExp.getRight();
}
if(TCGOCLExpressionHelperClass.isBooleanAtom(oNegatedExpression)) {
oDNF.getConjunctions().add(
GeneratedFactory.eINSTANCE.createTCGConjunction());
oDNF.getConjunctions().get(0).getExpressions().add(