Esempio n. 1
0
        public override void Verify(string fileName, TransHelper.TransEnv env, Microsoft.FSharp.Collections.FSharpList <CAST.Top> decls)
        {
            // this really only dumps the code to the .bpl file
            Init(env, fileName);
            decls = env.ApplyTransformers(decls);
            if (options.NoVerification)
            {
                return;
            }

            if (env.ShouldContinue)
            {
                if (env.Options.AggressivePruning && env.Options.Functions.Count() > 0)
                {
                    decls = TransUtil.pruneBy(env, env.Options.Functions.First(), decls);
                }

                var boogieDecls = Translator.translate(null, env, () => VccCommandLineHost.StandardPrelude(options), decls);
                var p           = TranslateToBoogie(boogieDecls);
                if (env.ShouldContinue)
                {
                    try {
                        swSaveBPL.Start();
                        CommandLineOptions.Install(new CommandLineOptions());
                        using (var writer = new TokenTextWriter(AddOutputDirIfRequested(Path.ChangeExtension(fileName, ".bpl")))) {
                            p.Emit(writer);
                        }
                    } finally {
                        swSaveBPL.Stop();
                    }
                }
            }
        }
Esempio n. 2
0
 internal VccFunctionVerifier(VccPlugin parent, Microsoft.FSharp.Collections.FSharpList <CAST.Top> currentDecls, TransHelper.TransEnv env)
     : base(env, currentDecls)
 {
     this.currentDecls = currentDecls;
     this.parent       = parent;
     this.env          = env;
     if (!this.InitBoogie())
     {
         this.env.Error(Token.NoToken, 1000, "Boogie initialization failed.");
     }
 }
Esempio n. 3
0
        private void Init(TransHelper.TransEnv env, string filename)
        {
            RegisterStopwatches();
            foreach (var s in env.Stopwatches)
            {
                this.RegisterStopwatch(s);
            }

            Transformers.init(env);
            Transformers.processPipeOptions(env);
            options = ((VccOptionWrapper)env.Options).VccOptions;
            this.BvdModelFileName = options.SaveModelForBvd ? AddOutputDirIfRequested(Path.ChangeExtension(filename, "model")) : null;
        }
Esempio n. 4
0
 internal VccFunctionVerifier(VccPlugin parent, Microsoft.FSharp.Collections.FSharpList<CAST.Top> currentDecls, TransHelper.TransEnv env)
     : base(env, currentDecls)
 {
     this.currentDecls = currentDecls;
       this.parent = parent;
       this.env = env;
       if (!this.InitBoogie()) this.env.Error(Token.NoToken, 1000, "Boogie initialization failed.");
 }
Esempio n. 5
0
 public override FunctionVerifier GetFunctionVerifier(string fileName, TransHelper.TransEnv env, Microsoft.FSharp.Collections.FSharpList <CAST.Top> decls)
 {
     Init(env, fileName);
     decls = env.ApplyTransformers(decls);
     return(new VccFunctionVerifier(this, decls, env));
 }
Esempio n. 6
0
 public abstract VC.ConditionGeneration.Outcome VerifyImpl(TransHelper.TransEnv env, VC.VCGen vcgen, Implementation impl, Program prog, VerifierCallback reporter);