private Pair<Statement, string> PreparePurityWarning(VariableEffect vEffect) { Pair<Statement, string> res = null; // Add the path (decorated with text) to the set of warnings to inform to the developer string path = vEffect.ToString(); Label lb = vEffect.Label; Variable v = vEffect.Variable; Statement stat = lb.Statement; if (stat != null) { if (vEffect.Variable is Parameter) { Parameter p = (Parameter)vEffect.Variable; if (p.IsOut) { return res; } } string msg; if (method.Equals(Method)) msg = string.Format("Cannot prove this statement does not modify {0} in declared pure method {1}", path, Method.Name); else msg = string.Format("Cannot prove this statement does not (indirectly) modify {0} in declared pure method {1}", path, Method.Name); // Constructor are allowed to modify the "this" parameter if (!isConstructor(Method) || !v.Equals(Method.ThisParameter)) { res = new Pair<Statement, string>(stat, msg); } string statementString = stat.SourceContext.SourceText; if (stat.SourceContext.SourceText == null) { statementString = CodePrinter.StatementToString(stat); } //Console.Out.WriteLine("({0},{1}) {2} {3}. Statement:{4}", // stat.SourceContext.StartLine, // stat.SourceContext.StartColumn, // method.Equals(Method) ? "modifies" : "is modified in this call", // path, // statementString); } return res; }