private MethodDeclarationSyntax ExtractAndAddPmQm(ref CancellationToken cancellationToken,
      Microsoft.CodeAnalysis.Document localDocument, SyntaxNode oldRoot, MethodDeclarationSyntax newExtractedMethod) {
      var newText = oldRoot.ToFullString();

      cancellationToken.ThrowIfCancellationRequested();

      Utils.DumpCSFile("BeforePmQm.cs", newText);

      var newSolution = localDocument.Project.Solution.WithDocumentText(localDocument.Id, SourceText.From(newText));
      //var newSolution = localDocument.Project.Solution.UpdateDocument(localDocument.Id, SourceText.From(newText));
      var newLocalDocument = newSolution.GetDocument(localDocument.Id);

      localDocument = null; // to be sure we do not use it

      var newTree = newLocalDocument.GetSyntaxTree();

      Utils.Trace("Running Clousot to infer <Pm, Qm> and <Pr, Qr>");

      var newRoot = (CompilationUnitSyntax)newTree.GetRoot();
      if (newRoot.ContainsDiagnostics) {
        Utils.Trace("Aborting: the new tree has syntax errors");

        return null;
      }

      // Let Clousot see the rewritten unit
      var connectionToClousot = new RoslynToCCICodeModel.ClousotGlue();

      var results = connectionToClousot.AnalyzeMeAUnit(newLocalDocument, newRoot, cancellationToken, this.options,
        new string[] { "-extractmethodmoderefine", newExtractedMethod.Identifier.ValueText, "-premode", "combined", "-suggest", "methodensures", "-suggest:requires" });

      if (results == null) return null;

      foreach (var result in results)
      {
        cancellationToken.ThrowIfCancellationRequested();

        Utils.Trace("Getting Clousot Result");

        String condition;
        ContractKind kind;
        if (result.Message.TryParseSuggestion(out kind, out condition)) {
          Utils.Trace("Inserting Clousot result. New Condition: " + condition);

          // Parse the condition
          var newContract = SyntaxFactory.ParseStatement(condition + Environment.NewLine);

          if (!newContract.ContainsDiagnostics) {
            newExtractedMethod = newExtractedMethod.InsertStatements(newContract, kind);
          } else {
            Utils.Trace("\tskipped, as it contains syntax errors");
          }
        }
      }

      return newExtractedMethod;
    }
    private MethodDeclarationSyntax ExtractAndAddPsQs(ref CancellationToken cancellationToken, Microsoft.CodeAnalysis.Document localDocument, CompilationUnitSyntax newRoot, MethodDeclarationSyntax newExtractedMethod)
    {
      // Let Clousot see the rewritten unit

      var connectionToClousot = new RoslynToCCICodeModel.ClousotGlue();
      var results = connectionToClousot.AnalyzeMeAUnit(localDocument, newRoot, cancellationToken, this.options,
        new string[] { "-extractmethodmode", "-arrays:arraypurity", "-suggest:requires" /*"-memberNameSelect",*/ });
      if (results == null) return null;
      foreach (var result in results)
      {
        cancellationToken.ThrowIfCancellationRequested();
        Utils.Trace("Getting Clousot Result");

        String condition;
        ContractKind kind;
        if (result.IsExtractMethodSuggestion && result.Message.TryParseSuggestion(out kind, out condition))
        {
          Utils.Trace("Inserting Clousot result. New Condition: " + condition);

          // Parse the condition
          var newContract = SyntaxFactory.ParseStatement(condition + Environment.NewLine);

          newExtractedMethod = newExtractedMethod.InsertStatements(newContract, kind);
        }
        else
        {
          Utils.Trace("Skipped Clousot output : " + result.Message);
        }
      }

      return newExtractedMethod;
    }