Exemplo n.º 1
0
 public static List<Statement> FindSingleTactic(Program program, MemberDecl target,
   UpdateStmt chosenTacticCall, ErrorReporterDelegate erd, Program unresolvedProgram)
 {
   Contract.Requires(program != null);
   Contract.Requires(target != null);
   var i = new Interpreter(program, unresolvedProgram);
   _errorReporterDelegate = erd;
   var list = i.FindSingleTacticApplication(target, chosenTacticCall);
   _errorReporterDelegate = null;
   return list;
 }
Exemplo n.º 2
0
 public static MemberDecl FindAndApplyTactic(Program program, MemberDecl target, ErrorReporterDelegate erd, Program unresolvedProgram = null) {
   Contract.Requires(program != null);
   Contract.Requires(target != null);
   // TODO Re-Enable with more permanent solution
   // Currently, if the interpreter is the same, static across calls, each time the interpreter is
   //   needed, it will just re-use the previous proof states, frames etc. Which will likely cause
   //   problems in the extension, where it is called many times consecutively.
   //if (_i == null) {
     _i = new Interpreter(program, unresolvedProgram);
   //}
   _errorReporterDelegate = erd;
   var result = _i.FindTacticApplication(target);
   _errorReporterDelegate = null;
   return result;
 }
Exemplo n.º 3
0
    /// <summary>
    /// 
    /// </summary>
    /// <param name="program"></param>
    /// <param name="target"></param>
    /// <param name="erd"></param>
    ///  only used this to report error, local errors which are genereaed during searching should not use this

    /// <param name="r"></param>
    /// <returns></returns>
    public static MemberDecl FindAndApplyTactic(Program program, MemberDecl target, ErrorReporterDelegate erd, Resolver r = null) {
      Contract.Requires(program != null);
      Contract.Requires(target != null);
      Stopwatch watch = new Stopwatch();
      watch.Start();
      _i = new Interpreter(program);
      _errorReporterDelegate = erd;

      var result = _i.EvalTacticApplication(target, r);

      var p = new Printer(Console.Out);
      p.PrintMembers(new List<MemberDecl>() { result }, 0, "");

      watch.Stop();
      Console.WriteLine("Time Used: " + watch.Elapsed.TotalSeconds.ToString());

      _errorReporterDelegate = null;
      return result;
    }