예제 #1
0
        public BoogieVerb(IContextGeneratingVerb context, BuildObject bplInput, VerificationRequest.SymDiffMode symdiff)
        {
            if (bplInput.getExtension().Equals(BPL_EXTN))
            {
                this.bplInput = bplInput;
                upstreamVerbs = new List<IVerb>();
                // TODO this will probably break, since we don't know where this bplInput came from. Maybe that's okay, since the verb had to already exist to reach this point.
            }
            else if (symdiff == VerificationRequest.SymDiffMode.NoSymDiff)
            {
                IVerb boogieAsmVerb = new BoogieAsmVerifyVerb(context, bplInput, false);
                this.bplInput = boogieAsmVerb.getOutputs().First();
                upstreamVerbs = new IVerb[] { boogieAsmVerb };
            }
            else
            {
                IVerb workerVerb;
                SymDiffEngine.BuildPipeline(context, bplInput, out this.bplInput, out workerVerb);
                upstreamVerbs = new IVerb[] { workerVerb };
            }

            this.abstractId = new AbstractId(
                this.GetType().Name,
                version,
                bplInput.ToString(),
                concrete: symdiff.ToString());
        }
예제 #2
0
        protected IEnumerable <BoogieVerb> getBoogieVerbs(VerificationRequest verificationRequest)
        {
            if (verificationRequest.verifyMode == VerificationRequest.VerifyMode.NoVerify)
            {
                return(new BoogieVerb[] { });
            }

            BoogieAsmDepBase.BasmModuleAccumulator acc = new BoogieAsmDepBase.BasmModuleAccumulator(context, upstreamObj, includeAllImps());
            List <BuildObject> basmModules             = new List <BuildObject>(acc.basmModules.Where(mod => !mod.isTrusted));

            OrderPreservingSet <BoogieVerb> normal_Boogie  = new OrderPreservingSet <BoogieVerb>();
            OrderPreservingSet <BoogieVerb> SymDiff_Boogie = new OrderPreservingSet <BoogieVerb>();

            foreach (BuildObject basmModule in basmModules)
            {
                if (verificationRequest.verifyMode == VerificationRequest.VerifyMode.SelectiveVerify &&
                    !verificationRequest.selectiveVerifyModuleNames.Contains(basmModule.getFileNameWithoutExtension()))
                {
                    continue;
                }
                normal_Boogie.Add(new BoogieVerb(context, basmModule, symdiff: VerificationRequest.SymDiffMode.NoSymDiff));

                if (verificationRequest.getSymDiffMode() == VerificationRequest.SymDiffMode.UseSymDiff &&
                    BoogieAsmVerifyVerb.needs_symdiff(basmModule))
                {
                    SymDiff_Boogie.Add(new BoogieVerb(context, basmModule, symdiff: VerificationRequest.SymDiffMode.UseSymDiff));
                }
            }

            return(SymDiff_Boogie.Union(normal_Boogie));
        }
예제 #3
0
        public BoogieVerb(IContextGeneratingVerb context, BuildObject bplInput, VerificationRequest.SymDiffMode symdiff)
        {
            if (bplInput.getExtension().Equals(BPL_EXTN))
            {
                this.bplInput = bplInput;
                upstreamVerbs = new List <IVerb>();
                // TODO this will probably break, since we don't know where this bplInput came from. Maybe that's okay, since the verb had to already exist to reach this point.
            }
            else if (symdiff == VerificationRequest.SymDiffMode.NoSymDiff)
            {
                IVerb boogieAsmVerb = new BoogieAsmVerifyVerb(context, bplInput, false);
                this.bplInput = boogieAsmVerb.getOutputs().First();
                upstreamVerbs = new IVerb[] { boogieAsmVerb };
            }
            else
            {
                IVerb workerVerb;
                SymDiffEngine.BuildPipeline(context, bplInput, out this.bplInput, out workerVerb);
                upstreamVerbs = new IVerb[] { workerVerb };
            }

            this.abstractId = new AbstractId(
                this.GetType().Name,
                version,
                bplInput.ToString(),
                concrete: symdiff.ToString());
        }
        public SymDiffExtractVerb(BoogieAsmVerifyVerb basmVerb, Mode mode)
        {
            this.basmVerb = basmVerb;
            this.basmIn   = basmVerb.outputFile();
            this.mode     = mode;

            abstractId = new AbstractId(this.GetType().Name, version, basmIn.ToString(), concrete: mode.ToString());
        }
예제 #5
0
        public SymDiffExtractVerb(BoogieAsmVerifyVerb basmVerb, Mode mode)
        {
            this.basmVerb = basmVerb;
            this.basmIn = basmVerb.outputFile();
            this.mode = mode;

            this.abstractId = new AbstractId(this.GetType().Name, version, this.basmIn.ToString(), concrete: mode.ToString());
        }
예제 #6
0
        public SymDiffMergeVerb(BoogieAsmVerifyVerb basmVerb, SymDiffCombineVerb combiner)
        {
            this.basmVerb = basmVerb;
            this.mutualSummary = basmVerb.getMutualSummary();
            this.combiner = combiner;

            this.abstractId = new AbstractId(this.GetType().Name, version, this.combiner.getOutputFile().ToString()); // String.Format("{0},{1}", One should suffice for uniqueness: mutualSummary, combiner.getOutputFile()));
            this.output = this.basmVerb.outputFile().makeOutputObject(MERGED_EXTN + BoogieVerb.BPL_EXTN);
        }
예제 #7
0
        public SymDiffMergeVerb(BoogieAsmVerifyVerb basmVerb, SymDiffCombineVerb combiner)
        {
            this.basmVerb      = basmVerb;
            this.mutualSummary = basmVerb.getMutualSummary();
            this.combiner      = combiner;

            this.abstractId = new AbstractId(this.GetType().Name, version, this.combiner.getOutputFile().ToString()); // String.Format("{0},{1}", One should suffice for uniqueness: mutualSummary, combiner.getOutputFile()));
            this.output     = this.basmVerb.outputFile().makeOutputObject(MERGED_EXTN + BoogieVerb.BPL_EXTN);
        }
        public SymDiffMergeConfigVerb(BoogieAsmVerifyVerb basmVerb, SymDiffInferVerb inferVerb)
        {
            this.basmVerb       = basmVerb;
            this.mutualSummary  = basmVerb.getMutualSummary();
            this.inferVerb      = inferVerb;
            this.inferredConfig = inferVerb.getOutputFile();

            abstractId = new AbstractId(this.GetType().Name, version, inferredConfig.ToString());  //- One should suffice for uniqueness: String.Format("{0},{1}", mutualSummary,inferredConfig));
            output     = this.basmVerb.outputFile().makeOutputObject(CONFIG_EXTN);
        }
예제 #9
0
        public SymDiffMergeConfigVerb(BoogieAsmVerifyVerb basmVerb, SymDiffInferVerb inferVerb)
        {
            this.basmVerb = basmVerb;
            this.mutualSummary = basmVerb.getMutualSummary();
            this.inferVerb = inferVerb;
            this.inferredConfig = inferVerb.getOutputFile();

            this.abstractId = new AbstractId(this.GetType().Name, version, this.inferredConfig.ToString());  // One should suffice for uniqueness: String.Format("{0},{1}", mutualSummary,inferredConfig));
            this.output = this.basmVerb.outputFile().makeOutputObject(CONFIG_EXTN);
        }
예제 #10
0
        public static void BuildPipeline(IContextGeneratingVerb context, BuildObject input, out BuildObject bplFile, out IVerb workerVerb)
        {
            BoogieAsmVerifyVerb basmVerb = new BoogieAsmVerifyVerb(context, input, true);
            SymDiffExtractVerb left = new SymDiffExtractVerb(basmVerb, SymDiffExtractVerb.Mode.LEFT);
            SymDiffExtractVerb right = new SymDiffExtractVerb(basmVerb, SymDiffExtractVerb.Mode.RIGHT);
            SymDiffInferVerb infer = new SymDiffInferVerb(left, right);
            SymDiffMergeConfigVerb mergeConfig = new SymDiffMergeConfigVerb(basmVerb, infer);
            SymDiffCombineVerb combiner = new SymDiffCombineVerb(left, right, mergeConfig);
            SymDiffMergeVerb merger = new SymDiffMergeVerb(basmVerb, combiner);

            bplFile = merger.getOutputFile();
            workerVerb = merger;
        }
예제 #11
0
        public static void BuildPipeline(IContextGeneratingVerb context, BuildObject input, out BuildObject bplFile, out IVerb workerVerb)
        {
            BoogieAsmVerifyVerb    basmVerb    = new BoogieAsmVerifyVerb(context, input, true);
            SymDiffExtractVerb     left        = new SymDiffExtractVerb(basmVerb, SymDiffExtractVerb.Mode.LEFT);
            SymDiffExtractVerb     right       = new SymDiffExtractVerb(basmVerb, SymDiffExtractVerb.Mode.RIGHT);
            SymDiffInferVerb       infer       = new SymDiffInferVerb(left, right);
            SymDiffMergeConfigVerb mergeConfig = new SymDiffMergeConfigVerb(basmVerb, infer);
            SymDiffCombineVerb     combiner    = new SymDiffCombineVerb(left, right, mergeConfig);
            SymDiffMergeVerb       merger      = new SymDiffMergeVerb(basmVerb, combiner);

            bplFile    = merger.getOutputFile();
            workerVerb = merger;
        }
예제 #12
0
            BuildObject maybeBeat(BuildObject obj, HashSet <IVerb> mutableVerbSet)
            {
                BuildObject result = obj;

                if (BeatVerb.isBeat(obj))
                {
                    BeatVerb beatVerb = new BeatVerb(_contextGenVerb, obj, appLabel: null);
                    IEnumerable <BuildObject> beatOuts = beatVerb.getOutputs();
                    Util.Assert(beatOuts.Count() == 1);
                    mutableVerbSet.Add(beatVerb);
                    result = beatVerb.getOutputs().First();
                }
                else
                {
                    //- No, this thing should already be ready to consume.
                    //-mutableVerbSet.Add(new BoogieAsmVerifyVerb(context, obj));
                }
                Util.Assert(BoogieAsmVerifyVerb.isBasm(result));
                return(result);
            }
 public BoogieAsmVerifyVerb(IContextGeneratingVerb context, BuildObject input, bool buildSymDiffMutualSummary)
     : base(context, input)
 {
     this.buildSymDiffMutualSummary = buildSymDiffMutualSummary;
     this.enableSymdiff             = BoogieAsmVerifyVerb.needs_symdiff(basmInput);
 }