Example #1
0
 public BeatVerb(IContextGeneratingVerb contextVerb, BuildObject beatobj, string appLabel)
 {
     this.contextVerb = contextVerb;
     this.beatobj = beatobj;
     this.appLabel = appLabel;
     this.abstractId = new AbstractId(this.GetType().Name, version, beatobj.ToString(), contextVerb.getPoundDefines(), concrete: appLabel);
 }
Example #2
0
        public SymDiffInferVerb(SymDiffExtractVerb left, SymDiffExtractVerb right)
        {
            this.left = left;
            this.right = right;

            this.abstractId = new AbstractId(this.GetType().Name, version, left.getOutputFile().ToString().ToString());      // Left should suffice to uniquely ID.
        }
Example #3
0
 public BeatVerb(IContextGeneratingVerb contextVerb, BuildObject beatobj, string appLabel)
 {
     this.contextVerb = contextVerb;
     this.beatobj     = beatobj;
     this.appLabel    = appLabel;
     this.abstractId  = new AbstractId(this.GetType().Name, version, beatobj.ToString(), contextVerb.getPoundDefines(), concrete: appLabel);
 }
Example #4
0
        public BatchVerifyVerb(SourcePath batch_file, BatchMode mode, VerificationRequest verificationRequest, DafnyCCVerb.FramePointerMode useFramePointer)
        {
            this.mode = mode;

            this.producers = new HashSet<IObligationsProducer>();
            foreach (string line in File.ReadAllLines(IronRootDirectory.PathTo(batch_file)))
            {
                if (line.Equals("") || line[0] == '#')
                {
                    continue;
                }

                SourcePath src = new SourcePath(line);
                switch (mode)
                {
                    case BatchMode.DAFNY:
                        if (verificationRequest.verifyMode != VerificationRequest.VerifyMode.Verify)
                        {
                            throw new UserError("BatchVerify DAFNY only supports full verification (but maybe we should add selective?)");
                        }

                        this.producers.Add(new DafnyVerifyTreeVerb(src));
                        break;
                    case BatchMode.APP:
                        this.producers.Add(new IroncladAppVerb(src, IroncladAppVerb.TARGET.BARE_METAL, useFramePointer, verificationRequest));
                        break;
                    default:
                        throw new Exception("Unknown batch file type");
                }
            }

            string parameters = mode.ToString() + "," + verificationRequest.ToString();
            this.outputObject = batch_file.makeLabeledOutputObject(parameters, BATCH_EXTN + VerificationObligationList.VOL_EXTN);
            this.abstractId = new AbstractId(this.GetType().Name, version, batch_file.ToString(), concrete: parameters);
        }
        /// <summary>
        /// Initializes a new instance of the IronfleetAppVerb class.
        /// </summary>
        /// <param name="input">Main dafny file for the application.</param>
        public IronfleetAppVerb(SourcePath input, VerificationRequest verificationRequest, bool releaseBuild = false)
        {
            if (input == null)
            {
                throw new ArgumentNullException("input");
            }

            this.abstractId = new AbstractId(GetType().Name, Version, input.ToString() + verificationRequest.ToString());
            this.input      = input;
            // this.buildVerb = new VSSolutionVerb(new SourcePath(@"src\IronfleetTestDriver\IronfleetTestDriver.sln"), input, releaseBuild);
            this.buildVerb = new VSSolutionVerb(new SourcePath(@"src/IronfleetTestDriver/IronfleetTestDriver.sln"), input, releaseBuild);

            if (verificationRequest.verifyMode == VerificationRequest.VerifyMode.NoVerify)
            {
                this.exeOutput  = this.input.makeOutputObject(UnverifiedExeExt);
                this.verifyVerb = null;
                this.verbs      = new IVerb[] { this.buildVerb };
            }
            else
            {
                this.exeOutput  = this.input.makeOutputObject(VerifiedExeExt);
                this.verifyVerb = new VerificationResultSummaryVerb(new DafnyVerifyTreeVerb(input));
                this.verbs      = new IVerb[] { this.verifyVerb, this.buildVerb };
            }

            this.otherOutputs = new List <BuildObject>();
            var ohs = this.buildVerb.getOutputs().ToList();

            ohs.RemoveAll(o => o.getExtension() == ".exe");
            foreach (var o in ohs)
            {
                this.otherOutputs.Add(RelocateBuildObjectToExeDirectory(o));
            }
        }
Example #6
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());
        }
Example #7
0
        public BootableAppVerb(SourcePath dfyroot, DafnyCCVerb.FramePointerMode useFramePointer, VerificationRequest verificationRequest)
        {
            this.dfyroot = dfyroot;
            this.verificationRequest = verificationRequest;
            string concreteId = verificationRequest.ToString() + "," + useFramePointer.ToString();
            this.abstractId = new AbstractId(this.GetType().Name, version, dfyroot.ToString(), concrete: concreteId);

            string targetDirectory = Path.Combine(
                BuildEngine.theEngine.getObjRoot(),
                dfyroot.getDirPath(),
                "bootable-" + verificationRequest.ToString());
            this.bootIniFile = new BuildObject(Path.Combine(targetDirectory, "safeos\\boot.ini"));

            // TODO: Create the bootloader verb.

            this.loaderVerb = new IroncladAppVerb(new SourcePath(LOADER_DFY), IroncladAppVerb.TARGET.BARE_METAL, useFramePointer, verificationRequest);
            this.appVerb = new IroncladAppVerb(dfyroot, IroncladAppVerb.TARGET.BARE_METAL, useFramePointer, verificationRequest);

            this.batchVerb = new BatchVerifyVerb(dfyroot, new HashSet<IObligationsProducer>() { this.appVerb, this.loaderVerb }, BatchVerifyVerb.BatchMode.APP);
            this.batchSummaryVerb = new VerificationResultSummaryVerb(this.batchVerb);

            this.loaderCopy = new BuildObject(Path.Combine(targetDirectory, this.targetExecutableName(this.loaderVerb)));
            this.bootloaderCopy = new BuildObject(Path.Combine(targetDirectory, this.bootloader.getFileName()));
            this.appExecutableCopy = new BuildObject(Path.Combine(targetDirectory, this.targetExecutableName(this.appVerb)));
        }
Example #8
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 SymDiffInferVerb(SymDiffExtractVerb left, SymDiffExtractVerb right)
        {
            this.left  = left;
            this.right = right;

            this.abstractId = new AbstractId(this.GetType().Name, version, left.getOutputFile().ToString().ToString());      // Left should suffice to uniquely ID.
        }
Example #10
0
 public DafnyCCVerb(SourcePath dfyroot, string appLabel, FramePointerMode useFramePointer)
     : base(dfyroot, appLabel)
 {
     this.useFramePointer            = useFramePointer;
     this.abstractId                 = new AbstractId(this.GetType().Name, this.getVersion() + version, dfyroot.ToString(), concrete: useFramePointer.ToString());
     this.dafnyCCBuildExecutableVerb = new VSSolutionVerb(new SourcePath("tools\\DafnyCC\\DafnyCC.sln", SourcePath.SourceType.Tools));
 }
Example #11
0
        public BatchVerifyVerb(BuildObject batch_label, HashSet<IObligationsProducer> producers, BatchMode mode) {            
            this.mode = mode;
            this.producers = producers;

            outputObject = batch_label.makeOutputObject(BATCH_EXTN + VerificationObligationList.VOL_EXTN);
            abstractId = new AbstractId(this.GetType().Name, version, batch_label.ToString(), concrete:mode.ToString());            
        }
Example #12
0
        public BatchVerifyVerb(SourcePath batch_file, BatchMode mode, VerificationRequest verificationRequest, DafnyCCVerb.FramePointerMode useFramePointer)
        {
            this.mode = mode;

            this.producers = new HashSet<IObligationsProducer>();
            foreach (string line in File.ReadAllLines(batch_file.getFilesystemPath())) {
                if (line[0] == '#')
                {
                    continue;
                }
                SourcePath src = new SourcePath(line);
                switch (mode) {
                    case BatchMode.DAFNY:
                        if (verificationRequest.verifyMode != VerificationRequest.VerifyMode.Verify)
                        {
                            throw new UserError("BatchVerify DAFNY only supports full verification (but maybe we should add selective?)");
                        }
                        this.producers.Add(new DafnyVerifyTreeVerb(src));
                        break;
                    case BatchMode.APP:
                        this.producers.Add(new IroncladAppVerb(src, IroncladAppVerb.TARGET.BARE_METAL, useFramePointer, verificationRequest));
                        break;
                    default:
                        throw new Exception("Unknown batch file type");
                }
            }

            string parameters = mode.ToString() + "," + verificationRequest.ToString();
            outputObject = batch_file.makeLabeledOutputObject(parameters, BATCH_EXTN + VerificationObligationList.VOL_EXTN);
            abstractId = new AbstractId(this.GetType().Name, version, batch_file.ToString(), concrete:parameters);
        }
Example #13
0
        /// <summary>
        /// Initializes a new instance of the IronfleetAppVerb class.
        /// </summary>
        /// <param name="input">Main dafny file for the application.</param>
        public IronfleetAppVerb(SourcePath input, VerificationRequest verificationRequest, bool releaseBuild = false)
        {
            if (input == null)
            {
                throw new ArgumentNullException("input");
            }

            this.abstractId = new AbstractId(GetType().Name, Version, input.ToString() + verificationRequest.ToString());
            this.input = input;
            this.buildVerb = new VSSolutionVerb(new SourcePath(@"src\IronfleetTestDriver\IronfleetTestDriver.sln"), input, releaseBuild);

            if (verificationRequest.verifyMode == VerificationRequest.VerifyMode.NoVerify)
            {
                this.exeOutput = this.input.makeOutputObject(UnverifiedExeExt);
                this.verifyVerb = null;
                this.verbs = new IVerb[] { this.buildVerb };
            }
            else
            {
                this.exeOutput = this.input.makeOutputObject(VerifiedExeExt);
                this.verifyVerb = new VerificationResultSummaryVerb(new DafnyVerifyTreeVerb(input));
                this.verbs = new IVerb[] { this.verifyVerb, this.buildVerb };
            }

            this.otherOutputs = new List<BuildObject>();
            var ohs = this.buildVerb.getOutputs().ToList();
            ohs.RemoveAll(o => o.getExtension() == ".exe");
            foreach (var o in ohs)
            {
                this.otherOutputs.Add(RelocateBuildObjectToExeDirectory(o));
            }
        }
        public BootableAppVerb(SourcePath dfyroot, DafnyCCVerb.FramePointerMode useFramePointer, VerificationRequest verificationRequest)
        {
            this.dfyroot             = dfyroot;
            this.verificationRequest = verificationRequest;
            string concreteId = verificationRequest.ToString() + "," + useFramePointer.ToString();

            this.abstractId = new AbstractId(this.GetType().Name, version, dfyroot.ToString(), concrete: concreteId);

            string targetDirectory = Path.Combine(
                BuildEngine.theEngine.getObjRoot(),
                dfyroot.getDirPath(),
                "bootable-" + verificationRequest.ToString());

            this.bootIniFile = new BuildObject(Path.Combine(targetDirectory, "safeos\\boot.ini"));

            // TODO: Create the bootloader verb.

            this.loaderVerb = new IroncladAppVerb(new SourcePath(LOADER_DFY), IroncladAppVerb.TARGET.BARE_METAL, useFramePointer, verificationRequest);
            this.appVerb    = new IroncladAppVerb(dfyroot, IroncladAppVerb.TARGET.BARE_METAL, useFramePointer, verificationRequest);

            this.batchVerb = new BatchVerifyVerb(dfyroot, new HashSet <IObligationsProducer>()
            {
                this.appVerb, this.loaderVerb
            }, BatchVerifyVerb.BatchMode.APP);
            this.batchSummaryVerb = new VerificationResultSummaryVerb(this.batchVerb);

            this.loaderCopy        = new BuildObject(Path.Combine(targetDirectory, this.targetExecutableName(this.loaderVerb)));
            this.bootloaderCopy    = new BuildObject(Path.Combine(targetDirectory, this.bootloader.getFileName()));
            this.appExecutableCopy = new BuildObject(Path.Combine(targetDirectory, this.targetExecutableName(this.appVerb)));
        }
Example #15
0
 public DafnyCCVerb(SourcePath dfyroot, string appLabel, FramePointerMode useFramePointer)
     : base(dfyroot, appLabel)
 {
     this.useFramePointer = useFramePointer;
     this.abstractId = new AbstractId(this.GetType().Name, this.getVersion() + version, dfyroot.ToString(), concrete: useFramePointer.ToString());
     this.dafnyCCBuildExecutableVerb = new VSSolutionVerb(new SourcePath("tools\\DafnyCC\\DafnyCC.sln", SourcePath.SourceType.Tools));
 }
        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());
        }
 public VerificationResultSummaryVerb(IObligationsProducer producer)
 {
     this.producer = producer;
     BuildObject id = producer.getObligationSet(); ////producer.getIdentifier();
     this.outputObject = id.makeOutputObject(id.getExtension() + SUMMARY_EXTN);
     this.abstractId = new AbstractId(this.GetType().Name, version, id.ToString());
     this.verificationResults = null;
 }
Example #18
0
 public override AbstractId getAbstractIdentifier()
 {
     if (this.abstractId == null)
     {
         this.abstractId = new AbstractId(this.GetType().Name, getVersion() + version, this.upstreamObj.ToString(), context.getPoundDefines(), getExtraAbstractID());
     }
     return(abstractId);
 }
Example #19
0
        public BatchVerifyVerb(BuildObject batch_label, HashSet<IObligationsProducer> producers, BatchMode mode)
        {
            this.mode = mode;
            this.producers = producers;

            this.outputObject = batch_label.makeOutputObject(BATCH_EXTN + VerificationObligationList.VOL_EXTN);
            this.abstractId = new AbstractId(this.GetType().Name, version, batch_label.ToString(), concrete: mode.ToString());
        }
Example #20
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());
        }
Example #21
0
        public MasmVerb(IAsmProducer asmVerb)
        {
            this.asmVerb = asmVerb;
            this.asmFile = asmVerb.getAsmFile();

            this.abstractId = new AbstractId(this.GetType().Name, version, this.asmFile.ToString());
            this.outputObject = this.asmFile.makeOutputObject(OBJ_EXTN);
        }
Example #22
0
        public MasmVerb(IAsmProducer asmVerb)
        {
            this.asmVerb = asmVerb;
            this.asmFile = asmVerb.getAsmFile();

            this.abstractId   = new AbstractId(this.GetType().Name, version, this.asmFile.ToString());
            this.outputObject = this.asmFile.makeOutputObject(OBJ_EXTN);
        }
Example #23
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 AsmRewriterVerb(BoogieAsmLinkVerb asmVerb)
        {
            this.asmVerb    = asmVerb;
            this.asmFileIn  = asmVerb.getAsmFile();
            this.asmFileOut = this.asmFileIn.makeOutputObject(WASM_EXTN);

            this.abstractId   = new AbstractId(this.GetType().Name, version, this.asmFileOut.ToString());
            this.pythonScript = new SourcePath("tools\\scripts\\build-standalone-asm.py", SourcePath.SourceType.Tools);
        }
Example #25
0
        public AsmRewriterVerb(BoogieAsmLinkVerb asmVerb)
        {
            this.asmVerb = asmVerb;
            this.asmFileIn = asmVerb.getAsmFile();
            this.asmFileOut = this.asmFileIn.makeOutputObject(WASM_EXTN);

            this.abstractId = new AbstractId(this.GetType().Name, version, this.asmFileOut.ToString());
            this.pythonScript = new SourcePath("tools\\scripts\\build-standalone-asm.py", SourcePath.SourceType.Tools);
        }
        public VerificationResultSummaryVerb(IObligationsProducer producer)
        {
            this.producer = producer;
            BuildObject id = producer.getObligationSet(); //-producer.getIdentifier();

            outputObject         = id.makeOutputObject(id.getExtension() + SUMMARY_EXTN);
            abstractId           = new AbstractId(this.GetType().Name, version, id.ToString());
            verification_results = null;
        }
Example #27
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();

            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);
        }
        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);
        }
        public SymDiffCombineVerb(SymDiffExtractVerb left, SymDiffExtractVerb right, SymDiffMergeConfigVerb merger)
        {
            this.left   = left;
            this.right  = right;
            this.merger = merger;

            abstractId = new AbstractId(this.GetType().Name, version, left.getOutputFile().ToString());      //- Naming one of the files should be sufficient to uniquely identify the combiner



            outputFile = mkOutputFile();
        }
Example #31
0
        public DafnyCompileOneVerb(SourcePath input)
        {
            if (input == null)
            {
                throw new ArgumentNullException("input");
            }

            this.abstractId = new AbstractId(GetType().Name, Version, input.ToString());
            this.input = input;
            this.output = input.makeOutputObject(CSharpExt);
            this.transitiveDepsVerb = new DafnyTransitiveDepsVerb(input);
            this.verbs = new IVerb[] { this.transitiveDepsVerb };
        }
Example #32
0
        public DafnyCompileOneVerb(SourcePath input)
        {
            if (input == null)
            {
                throw new ArgumentNullException("input");
            }

            this.abstractId         = new AbstractId(GetType().Name, Version, input.ToString());
            this.input              = input;
            this.output             = input.makeOutputObject(CSharpExt);
            this.transitiveDepsVerb = new DafnyTransitiveDepsVerb(input);
            this.verbs              = new IVerb[] { this.transitiveDepsVerb };
        }
        public SymDiffCombineVerb(SymDiffExtractVerb left, SymDiffExtractVerb right, SymDiffMergeConfigVerb merger)
        {
            this.left   = left;
            this.right  = right;
            this.merger = merger;

            // Naming one of the files should be sufficient to uniquely identify the combiner.
            this.abstractId = new AbstractId(this.GetType().Name, version, left.getOutputFile().ToString());
            ////abstractId = String.Format("{0}(#{1},{2},{3},{4})",
            ////    this.GetType().Name,
            ////    version,
            ////    left.getOutputFile(),
            ////    right.getOutputFile(),
            ////    merger.getOutputFile());
            this.outputFile = this.mkOutputFile();
        }
Example #34
0
        /// <summary>
        /// Initializes a new instance of the VSSolutionVerb class.
        /// </summary>
        /// <param name="solutionFile">Solution file to build.</param>
        /// <param name="optionalDafnyInput">Optional dafny-derived-CSharp dependency.</param>
        public VSSolutionVerb(SourcePath solutionFile, SourcePath optionalDafnyInput = null, bool releaseBuild = false)
        {
            this.solutionFile = solutionFile;
            this.abstractId   = new AbstractId(this.GetType().Name, VSSolutionVerb.Version, this.solutionFile.ToString());
            this.releaseBuild = releaseBuild;

            // Parse the solution file (and project files contained in the solution).
            this.solutionParser = new VSSolutionParser(this.solutionFile);

            this.outputPathSuffix = Path.Combine(BuildEngine.theEngine.getObjRoot(), this.solutionFile.getDirPath());

            if (optionalDafnyInput != null)
            {
                this.dafnyCompileOneVerb = new DafnyCompileOneVerb(optionalDafnyInput);
            }
        }
Example #35
0
 public override bool Equals(object obj)
 {
     if (obj is AbstractId)
     {
         AbstractId other = (AbstractId)obj;
         return(verb_name == other.verb_name &&
                version == other.version &&
                abstract_only == other.abstract_only &&
                poundDefines.Equals(other.poundDefines) &&
                concrete == other.concrete);
     }
     else
     {
         return(false);
     }
 }
Example #36
0
        public SymDiffCombineVerb(SymDiffExtractVerb left, SymDiffExtractVerb right, SymDiffMergeConfigVerb merger)
        {
            this.left = left;
            this.right = right;
            this.merger = merger;

            // Naming one of the files should be sufficient to uniquely identify the combiner.
            this.abstractId = new AbstractId(this.GetType().Name, version, left.getOutputFile().ToString());
            ////abstractId = String.Format("{0}(#{1},{2},{3},{4})",
            ////    this.GetType().Name,
            ////    version,
            ////    left.getOutputFile(),
            ////    right.getOutputFile(),
            ////    merger.getOutputFile());
            this.outputFile = this.mkOutputFile();
        }
Example #37
0
        /// <summary>
        /// Initializes a new instance of the VSSolutionVerb class.
        /// </summary>
        /// <param name="solutionFile">Solution file to build.</param>
        /// <param name="optionalDafnyInput">Optional dafny-derived-CSharp dependency.</param>
        public VSSolutionVerb(SourcePath solutionFile, SourcePath optionalDafnyInput = null, bool releaseBuild = false)
        {
            this.solutionFile = solutionFile;
            this.abstractId = new AbstractId(this.GetType().Name, VSSolutionVerb.Version, this.solutionFile.ToString());
            this.releaseBuild = releaseBuild;

            // Parse the solution file (and project files contained in the solution).
            this.solutionParser = new VSSolutionParser(this.solutionFile);

            this.outputPathSuffix = Path.Combine(BuildEngine.theEngine.getObjRoot(), this.solutionFile.getDirPath());

            if (optionalDafnyInput != null)
            {
                this.dafnyCompileOneVerb = new DafnyCompileOneVerb(optionalDafnyInput);
            }
        }
Example #38
0
        public NmakeVerb(SourcePath makefile)
        {
            this.makefile = makefile;
            this.abstractId = new AbstractId(this.GetType().Name, version, this.makefile.ToString());

            // Generate output path.
            this.outputPath = ".";
            int depth = this.makefile.getDirPath().Split(@"\/".ToCharArray(), StringSplitOptions.RemoveEmptyEntries).Length;
            for (int i = 0; i < depth; i++)
            {
                this.outputPath = Path.Combine(this.outputPath, "..");
            }

            this.outputPathSuffix = Path.Combine(BuildEngine.theEngine.getObjRoot(), this.makefile.getDirPath());
            this.outputPath = Path.Combine(this.outputPath, this.outputPathSuffix);
            this.customManifest = new CustomManifestParser(this.makefile);
        }
Example #39
0
        public override bool Equals(object obj)
        {
            AbstractId other = obj as AbstractId;

            if (other != null)
            {
                return(this.verbName == other.verbName &&
                       this.version == other.version &&
                       this.abstractOnly == other.abstractOnly &&
                       this.poundDefines.Equals(other.poundDefines) &&
                       this.concrete == other.concrete);
            }
            else
            {
                return(false);
            }
        }
Example #40
0
        public NmakeVerb(SourcePath makefile)
        {
            this.makefile   = makefile;
            this.abstractId = new AbstractId(this.GetType().Name, version, this.makefile.ToString());

            // Generate output path.
            this.outputPath = ".";
            int depth = this.makefile.getDirPath().Split(@"\/".ToCharArray(), StringSplitOptions.RemoveEmptyEntries).Length;

            for (int i = 0; i < depth; i++)
            {
                this.outputPath = Path.Combine(this.outputPath, "..");
            }

            this.outputPathSuffix = Path.Combine(BuildEngine.theEngine.getObjRoot(), this.makefile.getDirPath());
            this.outputPath       = Path.Combine(this.outputPath, this.outputPathSuffix);
            this.customManifest   = new CustomManifestParser(this.makefile);
        }
Example #41
0
        public VSSolutionVerb(SourcePath solutionFile)
        {
            _solutionFile = solutionFile;
            _abstractId   = new AbstractId(this.GetType().Name, version, _solutionFile.ToString());

            //- Parse the solution file
            _solutionParser = new VSSolutionParser(_solutionFile);

            //- Generate output path
            _outputPath = ".";
            int depth = _solutionFile.getDirPath().Split(@"\/".ToCharArray(), StringSplitOptions.RemoveEmptyEntries).Length;

            for (int i = 0; i < depth; i++)
            {
                _outputPath = Path.Combine(_outputPath, "..");
            }

            _outputPathSuffix = Path.Combine(BuildEngine.theEngine.getObjRoot(), _solutionFile.getDirPath());
            _outputPath       = Path.Combine(_outputPath, _outputPathSuffix);
        }
Example #42
0
        public LinkerVerb(MasmVerb masmVerb, bool isLoader)
        {
            this.masmVerb = masmVerb;
            this.isLoader = isLoader;
            this.objFile = masmVerb.getObj();

            this.abstractId = new AbstractId(this.GetType().Name, version + this.getVersion(), this.objFile.ToString(), concrete: isLoader ? "Loader" : "NonLoader");
            this.outputObject = this.objFile.makeOutputObject(this.outputExtension());

            // Default settings for the apps.
            this.maxExeSize = 1 * 1024 * 1024;  // 1 MB.
            this.entryPoint = "?AppEntryPoint";
            this.baseAddr = 0x340000;

            if (this.isLoader)
            {
                // Override the settings above with loader-specific values.
                this.maxExeSize = 58 * 1024;  // 58 KB
                this.entryPoint = "?LoaderEntryPoint";
                this.baseAddr = 0x300000;
            }
        }
Example #43
0
        public LinkerVerb(MasmVerb masmVerb, bool isLoader)
        {
            this.masmVerb = masmVerb;
            this.isLoader = isLoader;
            this.objFile  = masmVerb.getObj();

            abstractId   = new AbstractId(this.GetType().Name, version + getVersion(), objFile.ToString(), concrete: isLoader ? "Loader" : "NonLoader");
            outputObject = objFile.makeOutputObject(outputExtension());

            //- Default settings for the apps
            maxExeSize = 1 * 1024 * 1024; //- 1 MB
            entryPoint = "?AppEntryPoint";
            baseAddr   = 0x340000;

            if (isLoader)
            {
                //- Override the settings above with loader-specific values
                maxExeSize = 58 * 1024;  //- 58 KB
                entryPoint = "?LoaderEntryPoint";
                baseAddr   = 0x300000;
            }
        }
Example #44
0
 public DafnyVerifyTreeVerb(SourcePath root)
 {
     this.displayRoot = root;
     this.obligations = root.makeOutputObject(DFYTREE_EXTN + VerificationObligationList.VOL_EXTN);
     this.abstractId = new AbstractId(this.GetType().Name, version, root.ToString());
 }
Example #45
0
        public override AbstractId getAbstractIdentifier()
        {
            if (this.abstractId == null)
            {
                this.abstractId = new AbstractId(this.GetType().Name, getVersion() + version, this.upstreamObj.ToString(), context.getPoundDefines(), getExtraAbstractID());
            }

            return abstractId;
        }
        public IroncladAppVerb(SourcePath dfyroot, TARGET target, DafnyCCVerb.FramePointerMode framePointerMode, VerificationRequest verificationRequest)
        {
            this.dfyroot = dfyroot;

            // TODO this is the only #define we support just yet, so I'm stuffing it in here.
            // We'll need to plumb more carefully when we want to add x64.
            if (dfyroot.getDirPath().Split(Path.DirectorySeparatorChar).Last().Equals("AppLoader"))
            {
                this.poundDefines = new PoundDefines(new string[] { "AppLoader" });
            }
            else
            {
                this.poundDefines = PoundDefines.empty();
            }

            this.verificationRequest = verificationRequest;
            this.abstractId          = new AbstractId(
                this.GetType().Name,
                version,
                dfyroot.ToString(),
                this.poundDefines,
                concrete: string.Format(
                    "{0},{1},{2}",
                    target,
                    framePointerMode.ToString(),
                    verificationRequest.ToString()));
            this.appLabel      = dfyroot.getDirPath().Split(Path.DirectorySeparatorChar).Last();
            this.dafnyspecVerb = new DafnySpecVerb(dfyroot, this.appLabel);
            this.dafnyccVerb   = new DafnyCCVerb(dfyroot, this.appLabel, framePointerMode);

            bool isLoader = dfyroot.getRelativePath().Equals(BootableAppVerb.LOADER_DFY);

            // NB we keep dafnyccVerb as the lowest-priority context, so that our hand-written
            // beat impls will override its output.
            IContextGeneratingVerb contextWithDafny = new ConcatContextVerb(
                BuildEngine.theEngine.getVerveContextVerb(this.poundDefines),
                new VerbOutputsContextVerb(this.dafnyspecVerb, false),
                new VerbOutputsContextVerb(this.dafnyccVerb, true),
                this.poundDefines);

            this.stitcherVerb = new EntryStitcherVerb(contextWithDafny, this.appLabel);
            IContextGeneratingVerb contextWithDafnyAndEntry = new ConcatContextVerb(
                new VerbOutputsContextVerb(this.stitcherVerb, false),
                contextWithDafny,
                this.poundDefines);

            BuildObject       entryImpObj = this.stitcherVerb.getEntryImpOutput();
            BoogieAsmLinkVerb entryVerb   = new BoogieAsmLinkVerb(contextWithDafnyAndEntry, entryImpObj);

            if (target == TARGET.BARE_METAL)
            {
                MasmVerb masmVerb = new MasmVerb(entryVerb);
                this.linkerVerb = new LinkerVerb(masmVerb, isLoader);
            }
            else if (target == TARGET.WINDOWS)
            {     // Rewrite the asm that comes out of entryVerb before linking it
                AsmRewriterVerb rewriter = new AsmRewriterVerb(entryVerb);
                MasmVerb        masmVerb = new MasmVerb(rewriter);
                this.linkerVerb = new WinLinkerVerb(masmVerb, isLoader);
            }

            BoogieAsmVerificationObligationListVerb bavolVerb =
                new BoogieAsmVerificationObligationListVerb(contextWithDafnyAndEntry, entryImpObj, verificationRequest);

            this.verifyResultsVerb = new VerificationResultSummaryVerb(bavolVerb);

            this.srcObject = this.linkerVerb.getUntrustedExe();
            if (verificationRequest.isComplete())
            {
                this.exeObject    = dfyroot.makeOutputObject(TRUSTED_EXE_EXTN);
                this.outputObject = this.exeObject;
            }
            else
            {
                this.exeObject    = this.srcObject;
                this.outputObject = dfyroot.makeVirtualObject(UNVERIFIED_SENTINEL_EXTENSION);
            }
        }
Example #47
0
 public DafnySpecVerb(SourcePath dfyroot, string appLabel)
     : base(dfyroot, appLabel)
 {
     this.abstractId = new AbstractId(this.GetType().Name, this.getVersion() + version, dfyroot.ToString());
     this.dafnySpecBuildExecutableVerb = new VSSolutionVerb(new SourcePath("tools\\DafnySpec\\DafnySpec.sln", SourcePath.SourceType.Tools));
 }
Example #48
0
 public DafnySpecVerb(SourcePath dfyroot, string appLabel)
     : base(dfyroot, appLabel)
 {
     this.abstractId = new AbstractId(this.GetType().Name, this.getVersion() + version, dfyroot.ToString());
     this.dafnySpecBuildExecutableVerb = new VSSolutionVerb(new SourcePath("tools\\DafnySpec\\DafnySpec.sln", SourcePath.SourceType.Tools));
 }
 public DafnySpecVerb(SourcePath dfyroot, string appLabel)
     : base(dfyroot, appLabel)
 {
     abstractId = new AbstractId(this.GetType().Name, getVersion() + version, dfyroot.ToString());
 }
Example #50
0
 public DafnyVerifyTreeVerb(SourcePath root)
 {
     this.displayRoot = root;
     obligations      = root.makeOutputObject(DFYTREE_EXTN + VerificationObligationList.VOL_EXTN);
     abstractId       = new AbstractId(this.GetType().Name, version, root.ToString());
 }
Example #51
0
 public DafnyVerifyOneVerb(SourcePath dfysource)
 {
     this.dfysource = dfysource;
     this.abstractId = new AbstractId(this.GetType().Name, version, dfysource.ToString());                
 }
Example #52
0
 public DafnyVerifyOneVerb(SourcePath dfysource)
 {
     this.dfysource  = dfysource;
     this.abstractId = new AbstractId(this.GetType().Name, version, dfysource.ToString());
 }
Example #53
0
        public IroncladAppVerb(SourcePath dfyroot, TARGET target, DafnyCCVerb.FramePointerMode framePointerMode, VerificationRequest verificationRequest)
        {
            this.dfyroot = dfyroot;

            // TODO this is the only #define we support just yet, so I'm stuffing it in here.
            // We'll need to plumb more carefully when we want to add x64.
            if (dfyroot.getDirPath().Split(Path.DirectorySeparatorChar).Last().Equals("AppLoader"))
            {
                this.poundDefines = new PoundDefines(new string[] { "AppLoader" });
            }
            else
            {
                this.poundDefines = PoundDefines.empty();
            }

            this.verificationRequest = verificationRequest;
            this.abstractId = new AbstractId(
                this.GetType().Name,
                version,
                dfyroot.ToString(),
                this.poundDefines,
                concrete: string.Format(
                    "{0},{1},{2}",
                    target,
                    framePointerMode.ToString(),
                    verificationRequest.ToString()));
            this.appLabel = dfyroot.getDirPath().Split(Path.DirectorySeparatorChar).Last();
            this.dafnyspecVerb = new DafnySpecVerb(dfyroot, this.appLabel);
            this.dafnyccVerb = new DafnyCCVerb(dfyroot, this.appLabel, framePointerMode);

            bool isLoader = dfyroot.getRelativePath().Equals(BootableAppVerb.LOADER_DFY);

            // NB we keep dafnyccVerb as the lowest-priority context, so that our hand-written
            // beat impls will override its output.
            IContextGeneratingVerb contextWithDafny = new ConcatContextVerb(
                BuildEngine.theEngine.getVerveContextVerb(this.poundDefines),
                new VerbOutputsContextVerb(this.dafnyspecVerb, false),
                new VerbOutputsContextVerb(this.dafnyccVerb, true),
                this.poundDefines);
            this.stitcherVerb = new EntryStitcherVerb(contextWithDafny, this.appLabel);
            IContextGeneratingVerb contextWithDafnyAndEntry = new ConcatContextVerb(
                new VerbOutputsContextVerb(this.stitcherVerb, false),
                contextWithDafny,
                this.poundDefines);

            BuildObject entryImpObj = this.stitcherVerb.getEntryImpOutput();
            BoogieAsmLinkVerb entryVerb = new BoogieAsmLinkVerb(contextWithDafnyAndEntry, entryImpObj);
            if (target == TARGET.BARE_METAL)
            {
                MasmVerb masmVerb = new MasmVerb(entryVerb);
                this.linkerVerb = new LinkerVerb(masmVerb, isLoader);
            }
            else if (target == TARGET.WINDOWS)
            {     // Rewrite the asm that comes out of entryVerb before linking it
                AsmRewriterVerb rewriter = new AsmRewriterVerb(entryVerb);
                MasmVerb masmVerb = new MasmVerb(rewriter);
                this.linkerVerb = new WinLinkerVerb(masmVerb, isLoader);
            }

            BoogieAsmVerificationObligationListVerb bavolVerb =
                new BoogieAsmVerificationObligationListVerb(contextWithDafnyAndEntry, entryImpObj, verificationRequest);

            this.verifyResultsVerb = new VerificationResultSummaryVerb(bavolVerb);

            this.srcObject = this.linkerVerb.getUntrustedExe();
            if (verificationRequest.isComplete())
            {
                this.exeObject = dfyroot.makeOutputObject(TRUSTED_EXE_EXTN);
                this.outputObject = this.exeObject;
            }
            else
            {
                this.exeObject = this.srcObject;
                this.outputObject = dfyroot.makeVirtualObject(UNVERIFIED_SENTINEL_EXTENSION);
            }
        }
Example #54
0
 public DafnyCCVerb(SourcePath dfyroot, string appLabel, FramePointerMode useFramePointer)
     : base(dfyroot, appLabel)
 {
     this.useFramePointer = useFramePointer;
     abstractId           = new AbstractId(this.GetType().Name, getVersion() + version, dfyroot.ToString(), concrete: useFramePointer.ToString());
 }