Examples of TCGOCLExpression


Examples of net.sf.parteg.base.testcasegraph.generated.TCGOCLExpression

  }
 
  public static TCGOCLExpression convertDNFToExpression(
      TCGDisjunctiveNormalForm in_oDNF) {
    if (!in_oDNF.getConjunctions().isEmpty()) {
      TCGOCLExpression oExpression = TCGConjunctionHelperClass.convertConjunctionToExpression(in_oDNF
          .getConjunctions().get(0));
      for (int i = 1; i < in_oDNF.getConjunctions().size(); ++i) {
        TCGOCLOperation oNewOperation = GeneratedFactory.eINSTANCE
            .createTCGOCLOperation();
        oNewOperation.setLeft(oExpression);
        oNewOperation.setOperationName("or");
        TCGOCLExpression oCurrentExpression = TCGConjunctionHelperClass.convertConjunctionToExpression(in_oDNF
            .getConjunctions().get(i));
        oNewOperation.setRight(oCurrentExpression);
        oExpression = oNewOperation;
      }
      return oExpression;
View Full Code Here

Examples of net.sf.parteg.base.testcasegraph.generated.TCGOCLExpression

        createRestrictedDisjunctiveNormalForm(
            oOpExp.getRight(), in_oRow, in_bSplitInequations, out_oDNF);
        return;
      }
      else if(oOpExp.getOperationName().equals("not")) {
        TCGOCLExpression oTmpExp = TCGOCLExpressionHelperClass.removeDoubleNots(oOpExp);
        if(oTmpExp instanceof TCGOCLOperation) {
          oOpExp = (TCGOCLOperation)oTmpExp;

          // removed double nots - still not?
          if(oOpExp.getOperationName().equals("not") &&
View Full Code Here

Examples of net.sf.parteg.base.testcasegraph.generated.TCGOCLExpression

      Namespace in_oNamespace,
      org.eclipse.uml2.uml.Class in_oContextClass,
      String in_sOCLKind,
      boolean in_bSplitInequations)
  {
    TCGOCLExpression oTCGOCLExp = TransformOCLToTCGOCL.transformExpression(
        in_oOCLExpression, in_sOCLKind, in_oNamespace, in_oContextClass);
    // transform to DNF
    TCGDisjunctiveNormalForm oDNF =
      createDisjunctiveNormalForm(oTCGOCLExp, in_bSplitInequations);
    oTCGOCLExp = TCGOCLExpressionHelperClass.pushDownNots(oTCGOCLExp);
View Full Code Here

Examples of net.sf.parteg.base.testcasegraph.generated.TCGOCLExpression

                oRightSubClassificator.getClassifiedElementsInExpression(
                    VariableClassification.INPUT_PARAMETER);
             
              if((!colPassiveDependentSubExpression.isEmpty()) ||
                  (!colInputParameterSubExpression.isEmpty())) {
                TCGOCLExpression oNewExp = TCGOCLExpressionHelperClass.connectPreconditionAndPostcondition(in_oPrecondition, oPostCondition);
                if(oNewExp != null)
                  in_colNewExpressions.add(oNewExp);
              } else { // does the right side contain just independent elements?
                // compare the expressions of both elements!
                ValueTypeRange oPostConditionRange =
View Full Code Here

Examples of net.sf.parteg.base.testcasegraph.generated.TCGOCLExpression

                    VariableClassification.INPUT_PARAMETER);
             
              if((!colPassiveDependentSubExpression.isEmpty()) ||
                  (!colInputParameterSubExpression.isEmpty()))
              {
                TCGOCLExpression oNewExpression = TCGOCLExpressionHelperClass.connectPreconditionAndPostcondition(
                    in_oPrecondition, oPostCondition);
                if(oNewExpression != null) {
                  in_colNewExpressions.add(oNewExpression);
                }
                io_oPostConjunction.getExpressions().addAll(
View Full Code Here

Examples of net.sf.parteg.base.testcasegraph.generated.TCGOCLExpression

        in_oRow.put(in_oExpression, bValue);
        return bValue;
      }
      if(oOperation.getOperationName().equals("not"))
      {
        TCGOCLExpression oNegatedExp = oOperation.getLeft();
        if(oNegatedExp == null) {
          oNegatedExp = oOperation.getRight();
        }
        bValue = !evaluateExpressionWithValueAssignment(oNegatedExp, in_oRow);
        in_oRow.put(in_oExpression, bValue);
View Full Code Here

Examples of net.sf.parteg.base.testcasegraph.generated.TCGOCLExpression

  public void check(TCGOCLExpression in_oExpression) {
    if(isBooleanOperation(in_oExpression))
    {
      // add simple boolean negations as atomar expression
      if(((TCGOCLOperation)in_oExpression).getOperationName().equals("not")) {
        TCGOCLExpression oNegatedExp = ((TCGOCLOperation)in_oExpression).getLeft();
        if(oNegatedExp == null)
          oNegatedExp = ((TCGOCLOperation)in_oExpression).getRight();
        if(!isBooleanOperation(oNegatedExp)) {
          m_colExpressions.add(in_oExpression);
        }
View Full Code Here

Examples of net.sf.parteg.base.testcasegraph.generated.TCGOCLExpression

 
  public static boolean exchangeSidesOfExpression(TCGOCLOperation in_oOpExp)
  {
    // relational operation
    if(sm_colCorrespondingRelations.get(in_oOpExp.getOperationName()) != null) {
      TCGOCLExpression o1 = in_oOpExp.getLeft();
      in_oOpExp.setLeft(in_oOpExp.getRight());
      in_oOpExp.setRight(o1);
      in_oOpExp.setOperationName(sm_colCorrespondingRelations.get(in_oOpExp.getOperationName()));
      return true;
    }
    else if(in_oOpExp.getOperationName().equals("*") ||
        in_oOpExp.getOperationName().equals("+") ||
        in_oOpExp.getOperationName().equals("-")) {
      TCGOCLExpression o1 = in_oOpExp.getLeft();
      in_oOpExp.setLeft(in_oOpExp.getRight());
      in_oOpExp.setRight(o1);
      if(in_oOpExp.getOperationName().equals("-")) {
        in_oOpExp.setOperationName(sm_colCorrespondingOperations.get(in_oOpExp.getOperationName()));
        in_oOpExp.setLeft(negateArithmeticalTCGOCLExpression(
View Full Code Here

Examples of net.sf.parteg.base.testcasegraph.generated.TCGOCLExpression

  {
    if(in_oExpression instanceof TCGOCLOperation) {
      TCGOCLOperation oOpExp = (TCGOCLOperation)in_oExpression;
      // unary minus
      if(isUnaryMinus(oOpExp)) {
        TCGOCLExpression oLeftOrRightExp =
          TCGOCLExpressionHelperClass.getNonNullLeftOrRight(oOpExp);
        if(!(oLeftOrRightExp instanceof TCGOCLAtom)) {
          return TCGOCLExpressionHelperClass.
            negateArithmeticalTCGOCLExpression(oLeftOrRightExp);
        }
View Full Code Here

Examples of net.sf.parteg.base.testcasegraph.generated.TCGOCLExpression

        // try to shift the variable to the left side of the left expression
        // variable is on local right side of the left expression
        // -> exchange on left hand side left and right
        if(!oVisitor.isFound()) {
          // exchange sides
          TCGOCLExpression oLeftSide = oOpLeftExp.getLeft();
          oOpLeftExp.setLeft(oOpLeftExp.getRight());
          oOpLeftExp.setRight(oLeftSide);
         
          // influence relation operator correspondingly
          if(oOpLeftExp.getOperationName().equals("+") ||
              oOpLeftExp.getOperationName().equals("*")) {
            // nothing - written just for completeness
          }
          else if(oOpLeftExp.getOperationName().equals("-")) {
            in_oOpExp.setOperationName(
                sm_colCorrespondingRelations.get(
                    in_oOpExp.getOperationName()));
            in_oOpExp.setRight(
                TCGOCLExpressionHelperClass.negateArithmeticalTCGOCLExpression(
                    in_oOpExp.getRight()));
          }
          else if(oOpLeftExp.getOperationName().equals("/"))
          {
            // TODO #### Fallunterscheidung einbauen und evtl. mehrere m�gliche
            // Ausdr�cke zur�ckgeben
          }
          // check again
          OCLTreeExpressionIterator.run(oOpLeftExp.getLeft(), oVisitor);
        }
       
        // not "else" -> value is computed again at the last statement
       
        // variable is on local left side of the left expression
        // -> transfer local right side of left expression to the right expression
        if(oVisitor.isFound()) {
          TCGOCLExpression oLeftSide = oOpLeftExp.getLeft();
          oOpLeftExp.setLeft(in_oOpExp.getRight());
          in_oOpExp.setRight(oOpLeftExp);
          in_oOpExp.setLeft(oLeftSide);
          // exclude the case that we work with an unary minus or a not
          if(!(oOpLeftExp.getRight() == null &&
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.