Exemple #1
0
    private int Distance(Cluster a, Cluster b)
    {
      AntiUnificationVisitor /*!*/
        visitor = new AntiUnificationVisitor(Gen);
      visitor.AntiUnify(a.Generator, b.Generator);

      visitor.RepresentationSize(GlobalVariables, out var reprSizeA, out var reprSizeB);
      return (a.Size - 1) * reprSizeA + (b.Size - 1) * reprSizeB;
    }
Exemple #2
0
        public Distance(Cluster a, Cluster b, IDictionary<VCExprVar /*!*/, VCExprVar /*!*/> /*!*/ globalVars,
          VCExpressionGenerator gen)
        {
          Contract.Requires(gen != null);
          Contract.Requires(cce.NonNullDictionaryAndValues(globalVars));
          AntiUnificationVisitor /*!*/
            visitor = new AntiUnificationVisitor(gen);
          Generator = (VCExprNAry) visitor.AntiUnify(a.Generator, b.Generator);

          visitor.RepresentationSize(globalVars, out var reprSizeA, out var reprSizeB);
          Dist = (a.Size - 1) * reprSizeA + (b.Size - 1) * reprSizeB;
        }