Esempio n. 1
0
 private bool EqualUpToRenaming(Cluster a, Cluster b)
 {
   AntiUnificationVisitor /*!*/
     visitor = new AntiUnificationVisitor(Gen);
   visitor.AntiUnify(a.Generator, b.Generator);
   return visitor.RepresentationIsRenaming(GlobalVariables);
 }
Esempio n. 2
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;
    }
Esempio n. 3
0
 private Cluster Merge(Cluster a, Cluster b)
 {
   AntiUnificationVisitor /*!*/
     visitor = new AntiUnificationVisitor(Gen);
   VCExpr /*!*/
     generator = visitor.AntiUnify(a.Generator, b.Generator);
   Contract.Assert(generator != null);
   VCExprNAry generatorNAry = generator as VCExprNAry;
   Contract.Assert(generatorNAry != null && Op.Equals(generatorNAry.Op));
   return new Cluster(generatorNAry, a.Size + b.Size);
 }
Esempio n. 4
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;
        }