Examples of TCGConjunction


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

          new ArrayList<TCGConjunction>();
        ArrayList<TCGConjunction> colConjunctionsToTheEnd =
          new ArrayList<TCGConjunction>();
       
        // conjunction list is empty -> add a default conjunction to allow to add conditions
        TCGConjunction oTemporalConjunction = null;
        if(oDNF.getConjunctions().isEmpty()) {
          oTemporalConjunction = GeneratedFactory.eINSTANCE.createTCGConjunction();
          oDNF.getConjunctions().add(oTemporalConjunction);
        }
       
        // check all conjunctions if they determine exactly one target state
        for(TCGConjunction oConjunction : oDNF.getConjunctions()) {
//          List<TCGTransition> colTransitions =
//            TCGTransitionHelperClass.findResultingTransitions(
//              oNode, oEvent, oConjunction);
//          abc: �berpr�fen, ob es mehrere m�gliche Kandidaten f�r die resultierende Transition gibt
//          Gibt es daf�r nicht schon ein Beispiel? Siehe FreightElevator!
//          if(colTransitions.size() != 1) { // TODO : AAA: ok?
          // no unique match found - get non-contradicting guards
          List<TCGConjunction> colNonContradictingTransitionGuards =
            TCGTransitionHelperClass.findNonContradictingTransitionGuards(
              oNode, oEvent, oConjunction);
         
          // is empty? -> do nothing -> all outgoing transitions are contradicting
          // is not empty: create alternative conjunctions and add them before
          // the original, ambiguous conjunction
          if(!colNonContradictingTransitionGuards.isEmpty()) {
            colConjunctionsToTheEnd.add(oConjunction);
            for(TCGConjunction oNonConConjunction : colNonContradictingTransitionGuards) {
              boolean bAddNewConjunctionToFront = false;
              TCGConjunction oNewConjunction =
                TCGConjunctionHelperClass.copyConjunctionDeep(oNonConConjunction);

              // old expression values should be added to new conjunction?
              // -> check if the old expression contains values that are not in the new conjunction
              for(TCGOCLExpression oExp : oConjunction.getExpressions()) {
                // add new expression only if it is not already contained
                // or references the same original OCL expression
                // or can be transformed into each other
                if(!ObjectComparator.contains(oNonConConjunction.getExpressions(), oExp) &&
                    !TCGOCLExpressionHelperClass.containsElementWithSameOCLReference(
                        oNonConConjunction.getExpressions(), oExp) &&
                        !TCGOCLExpressionHelperClass.containsTransformableExpression(
                            oNonConConjunction.getExpressions(), oExp)) {
                  oNewConjunction.getExpressions().add(
                    TCGOCLExpressionHelperClass.copyExpression(oExp));
                }
              }

              // new conjunction should be added to conjunctionsToTheFront?
View Full Code Here

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

              colRetValues.addAll(TCGConjunctionHelperClass.copyConjunctionListDeep(colNewConjunctions));
            }
            else {
              for(TCGConjunction oNewConjunction : colNewConjunctions) {
                for(TCGConjunction oOldConjunction : colConjunctions) {
                  TCGConjunction oCombinedConjunction =
                    TCGConjunctionHelperClass.copyConjunctionDeep(oNewConjunction);
                  for(TCGOCLExpression oExp : oOldConjunction.getExpressions()) {
                    oCombinedConjunction.getExpressions().add(
                        TCGOCLExpressionHelperClass.copyExpression(oExp));
                  }
                  colRetValues.add(oCombinedConjunction);
                }
              }
View Full Code Here

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

//    System.out.println("process transition from >" + in_oPair.getSecond().getSourceNode().getName()
//        + "< to >" + in_oPair.getSecond().getTargetNode().getName() + "<");
   
    ExpressionChangeLog oExpressionChangeLog = new ExpressionChangeLog();
    TCGDisjunctiveNormalForm oPostDNF = in_oPair.getSecond().getPostcondition();
    TCGConjunction oPostConjunction = GeneratedFactory.eINSTANCE.createTCGConjunction();
   
    if(!transformPreconditionAccordingToPostcondition(
        oExpressionChangeLog, oPostDNF, oPostConjunction)) {
      // conflict occurred ... return
      return;
View Full Code Here

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

   
    if(in_oPostDNF != null && !in_oPostDNF.getConjunctions().isEmpty()) {
      LateEvaluationGroup oNewGroup = new LateEvaluationGroup();
      // TODO: consider non-determinism in postconditions: several groups of groups for alternatives ???
      // TODO hack: only consider the first conjunction -> change!
      TCGConjunction oConjunction = in_oPostDNF.getConjunctions().get(0);
      for(TCGOCLExpression oExpression : oConjunction.getExpressions()) {
        List<TCGOCLAtom> colChangeableParameters =
          TCGOCLExpressionHelperClass.getPassiveDependentVariablesAndInputParameters(oExpression);
        // postconditions can never be added as conditions to be satisfied!
//        if(colChangeableParameters.size() == 1) {
//          // just one changeable parameter
View Full Code Here

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

      }
      // add negated first expressions to second conjunction
      // add a copy of the second conjunction to each conjunction of the new DNF
      for(TCGConjunction oConjunction : oResultingDNF.getConjunctions())
      {
        TCGConjunction oCopyOfFirstConjunction =
          TCGConjunctionHelperClass.copyConjunctionDeep(in_oSecondConjunction);
        oConjunction.getExpressions().
            addAll(oCopyOfFirstConjunction.getExpressions());
        oConjunction.setPositiveSubExpressionOfOriginal(
            in_oSecondConjunction.isPositiveSubExpressionOfOriginal());
        // add all resulting conjunctions to the second DNF
        if(!TCGConjunctionHelperClass.conditionsInConjunctionAreContradicting(oConjunction).isEmpty())
          io_colConjunctionsToBeAddedToSecondConjunction.add(oConjunction);
View Full Code Here

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

      TransitionInstance in_oTransitionInstance,
      TCGDisjunctiveNormalForm in_oDNF)
  {
    // TODO Refactoring: TransitionInstances halten eine Conjunction und nicht eine Menge von Expressions!
    TCGDisjunctiveNormalForm oDNF = GeneratedFactory.eINSTANCE.createTCGDisjunctiveNormalForm();
    TCGConjunction oConjunction = GeneratedFactory.eINSTANCE.createTCGConjunction();
    oDNF.getConjunctions().add(oConjunction);
    // 1) collect all used preconditions backwards in the line of transition instances
    // until an event was called
    // 2) the guard condition of the test goal must be satisfied by the
    // guard conditions of the transition instances
    TransitionInstance oTransitionInstance = in_oTransitionInstance;
    // add all conditions of the very transition
    oConjunction.getExpressions().addAll(oTransitionInstance.getUsedPreConditions());

    // if no explicit trigger is given: collect guard conditions until explicit trigger
    while((oTransitionInstance.getCalledEvent() == null ||
        oTransitionInstance.getCalledEvent().isDefaultEvent())) {
     
      oTransitionInstance = oTransitionInstance.getPrecedingTransitionInstance();
      if(oTransitionInstance == null)
        break;
     
      oConjunction.getExpressions().addAll(oTransitionInstance.getUsedPreConditions());
    }
   
    return TCGDisjunctiveNormalFormHelperClass.firstDNFIsSatisfiedBySecondDNF(
        in_oDNF, oDNF, false);
  }
View Full Code Here

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

    boolean bTruthValue = DecisionTableRowEvaluator.evaluateExpressionWithValueAssignment(
        oNewExpression, oNewRow);
   
    // create new dummy DNF with one conjunction
    TCGDisjunctiveNormalForm oDNF = GeneratedFactory.eINSTANCE.createTCGDisjunctiveNormalForm();
    TCGConjunction oConjunction = GeneratedFactory.eINSTANCE.createTCGConjunction();
    oConjunction.setPositiveSubExpressionOfOriginal(bTruthValue);
    oDNF.getConjunctions().add(oConjunction);
    // now create a "resricted" DNF that has (almost) no disjunctions
    // the "restricted" DNF is more or less just a conjunction of expressions
    // matching the current value selection row
    TCGDisjunctiveNormalFormHelperClass.createRestrictedDisjunctiveNormalForm(
View Full Code Here

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

      TCGDisjunctiveNormalForm oNewDNF = GeneratedFactory.eINSTANCE
        .createTCGDisjunctiveNormalForm();
     
      for(TCGOCLExpression oExpression : colExpressions)
      {
        TCGConjunction oConjunction = GeneratedFactory.eINSTANCE
          .createTCGConjunction();
        oConjunction.getExpressions().add(oExpression);
        oNewDNF.getConjunctions().add(oConjunction);
      }
      return oNewDNF;
    }
    return null;
View Full Code Here

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

      int in_nCurrentIndex,
      ArrayList<TCGOCLExpression> io_colCurrentCombinedExpressions) {
   
    if (in_nCurrentIndex >= io_colNewExpressions.size()) {
      // assemble the conjunctions of io_colCurrentCombinedConjunction
      TCGConjunction oNewConjunction = GeneratedFactory.eINSTANCE
          .createTCGConjunction();
      for (TCGOCLExpression oExpression : io_colCurrentCombinedExpressions) {
        oNewConjunction.getExpressions().add(oExpression);
      }
      // just assembled conjunction
      io_colCombinedConjunctions.add(oNewConjunction);
    } else {
      for (TCGOCLExpression oCurrentExpression : io_colNewExpressions
View Full Code Here

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

public class TCGConjunctionHelperClass {

  public static TCGConjunction copyConjunction(TCGConjunction in_oConjunction)
  {
    TCGConjunction oConjunction = GeneratedFactory.eINSTANCE.createTCGConjunction();
    oConjunction.getExpressions().addAll(in_oConjunction.getExpressions());
    oConjunction.setPositiveSubExpressionOfOriginal(in_oConjunction.isPositiveSubExpressionOfOriginal());
    return oConjunction;
  }
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.