예제 #1
0
파일: DafnyHelper.cs 프로젝트: nhweston/dfy
 public void DocTree()
 {
     ServerUtils.ApplyArgs(args, reporter);
     if (Parse() && Resolve())
     {
         var docTree = new DocTree(dafnyProgram).GetDocTree();
         Console.WriteLine("DOCTREE_START " + ConvertToJson(docTree) + " DOCTREE_END");
     }
     else
     {
         Console.WriteLine("DOCTREE_START [] DOCTREE_END");
     }
 }
예제 #2
0
 public void Symbols()
 {
     ServerUtils.ApplyArgs(args, reporter);
     if (Parse() && Resolve())
     {
         var symbolTable = new SymbolTable(dafnyProgram);
         var symbols     = symbolTable.CalculateSymbols();
         Console.WriteLine("SYMBOLS_START " + ConvertToJson(symbols) + " SYMBOLS_END");
     }
     else
     {
         Console.WriteLine("SYMBOLS_START [] SYMBOLS_END");
     }
 }
예제 #3
0
        public void DotGraph()
        {
            ServerUtils.ApplyArgs(args, reporter);

            if (Parse() && Resolve() && Translate())
            {
                foreach (var boogieProgram in boogiePrograms)
                {
                    BoogieOnce(boogieProgram.Item1, boogieProgram.Item2);

                    foreach (var impl in boogieProgram.Item2.Implementations)
                    {
                        using (StreamWriter sw = new StreamWriter(fname + impl.Name + ".dot")) {
                            sw.Write(boogieProgram.Item2.ProcessLoops(impl).ToDot());
                        }
                    }
                }
            }
        }
예제 #4
0
        public void CounterExample()
        {
            var listArgs = args.ToList();

            listArgs.Add("/mv:" + CounterExampleProvider.ModelBvd);
            ServerUtils.ApplyArgs(listArgs.ToArray(), reporter);
            try {
                if (Parse() && Resolve() && Translate())
                {
                    var counterExampleProvider = new CounterExampleProvider();
                    foreach (var boogieProgram in boogiePrograms)
                    {
                        RemoveExistingModel();
                        BoogieOnce(boogieProgram.Item1, boogieProgram.Item2);
                        var model = counterExampleProvider.LoadCounterModel();
                        Console.WriteLine("COUNTEREXAMPLE_START " + ConvertToJson(model) + " COUNTEREXAMPLE_END");
                    }
                }
            } catch (Exception e) {
                Console.WriteLine("Error collection models: " + e.Message);
            }
        }
예제 #5
0
 public bool Verify()
 {
     ServerUtils.ApplyArgs(args, reporter);
     return(Parse() && Resolve() && Translate() && Boogie());
 }