Esempio n. 1
0
 public static bool Verify(Program dafnyProgram, ResolverTagger resolver, string uniqueIdPrefix, string requestId, ErrorReporterDelegate er, Program unresolvedProgram)
 {
   var translator = new Translator(dafnyProgram.reporter, er)
   {
     InsertChecksums = true,
     UniqueIdPrefix = uniqueIdPrefix
   };
   var boogieProgram = translator.Translate(dafnyProgram, unresolvedProgram);
   resolver.ReInitializeVerificationErrors(requestId, boogieProgram.Implementations);
   var outcome = BoogiePipeline(boogieProgram, 1 < CommandLineOptions.Clo.VerifySnapshots ? uniqueIdPrefix : null, requestId, er);
   return outcome == PipelineOutcome.Done || outcome == PipelineOutcome.VerificationCompleted;
 }
Esempio n. 2
0
        public static bool Verify(Program dafnyProgram, ResolverTagger resolver, string uniqueIdPrefix, string requestId, ErrorReporterDelegate er, Program unresolvedProgram)
        {
            var translator = new Translator(dafnyProgram.reporter, er)
            {
                InsertChecksums = true,
                UniqueIdPrefix  = uniqueIdPrefix
            };
            var boogieProgram = translator.Translate(dafnyProgram, unresolvedProgram);

            resolver.ReInitializeVerificationErrors(requestId, boogieProgram.Implementations);
            var outcome = BoogiePipeline(boogieProgram, 1 < CommandLineOptions.Clo.VerifySnapshots ? uniqueIdPrefix : null, requestId, er);

            return(outcome == PipelineOutcome.Done || outcome == PipelineOutcome.VerificationCompleted);
        }
Esempio n. 3
0
        public bool Verify(Ivy.Program ivyProgram, ResolverTagger resolver, string uniqueIdPrefix, string requestId, ErrorReporterDelegate er)
        {
            Ivy.Translator translator      = new Ivy.Translator(ivyProgram.reporter);
            var            translatorFlags = new Ivy.Translator.TranslatorFlags()
            {
                InsertChecksums = true, UniqueIdPrefix = uniqueIdPrefix
            };


            var boogiePrograms = Ivy.Translator.Translate(ivyProgram, ivyProgram.reporter, translatorFlags);

            var impls = boogiePrograms.SelectMany(p => p.Item2.Implementations);

            resolver.ReInitializeVerificationErrors(requestId, impls);

            bool success   = false;
            var  errorSink = new ErrorSink(this);

            foreach (var kv in boogiePrograms)
            {
                var boogieProgram = kv.Item2;

                // TODO(wuestholz): Maybe we should use a fixed program ID to limit the memory overhead due to the program cache in Boogie.
                PipelineOutcome oc = BoogiePipeline(boogieProgram, 1 < Ivy.DafnyOptions.Clo.VerifySnapshots ? uniqueIdPrefix : null, requestId, errorSink, er);
                switch (oc)
                {
                case PipelineOutcome.Done:
                case PipelineOutcome.VerificationCompleted:
                    // TODO:  This would be the place to proceed to compile the program, if desired
                    success = true;
                    break;

                case PipelineOutcome.FatalError:
                default:
                    return(false);
                }
            }
            return(success);
        }
Esempio n. 4
0
        public static bool Verify(Dafny.Program dafnyProgram, ResolverTagger resolver, string uniqueIdPrefix, string requestId, ErrorReporterDelegate er)
        {
            Dafny.Translator translator = new Dafny.Translator(dafnyProgram.reporter);
              var translatorFlags = new Dafny.Translator.TranslatorFlags() { InsertChecksums = true, UniqueIdPrefix = uniqueIdPrefix };

              var boogiePrograms = Dafny.Translator.Translate(dafnyProgram, dafnyProgram.reporter, translatorFlags);

              var impls = boogiePrograms.SelectMany(p => p.Item2.Implementations);
              resolver.ReInitializeVerificationErrors(requestId, impls);

              bool success = false;

              foreach (var kv in boogiePrograms) {
            var boogieProgram = kv.Item2;

            // TODO(wuestholz): Maybe we should use a fixed program ID to limit the memory overhead due to the program cache in Boogie.
            PipelineOutcome oc = BoogiePipeline(boogieProgram, 1 < Dafny.DafnyOptions.Clo.VerifySnapshots ? uniqueIdPrefix : null, requestId, er);
            switch (oc) {
              case PipelineOutcome.Done:
              case PipelineOutcome.VerificationCompleted:
            // TODO:  This would be the place to proceed to compile the program, if desired
            success = true;
            break;
              case PipelineOutcome.FatalError:
              default:
            return false;
            }
              }
              return success;
        }
Esempio n. 5
0
    public static bool Verify(Dafny.Program dafnyProgram, ResolverTagger resolver, string uniqueIdPrefix, string requestId, ErrorReporterDelegate er) {
      Dafny.Translator translator = new Dafny.Translator();
      translator.InsertChecksums = true;
      translator.UniqueIdPrefix = uniqueIdPrefix;
      Bpl.Program boogieProgram = translator.Translate(dafnyProgram);

      resolver.ReInitializeVerificationErrors(requestId, boogieProgram.Implementations);

      // TODO(wuestholz): Maybe we should use a fixed program ID to limit the memory overhead due to the program cache in Boogie.
      PipelineOutcome oc = BoogiePipeline(boogieProgram, 1 < Dafny.DafnyOptions.Clo.VerifySnapshots ? uniqueIdPrefix : null, requestId, er);
      switch (oc) {
        case PipelineOutcome.Done:
        case PipelineOutcome.VerificationCompleted:
          // TODO:  This would be the place to proceed to compile the program, if desired
          return true;
        case PipelineOutcome.FatalError:
        default:
          return false;
      }
    }