public override IEnumerable <BuildObject> getDependencies(out DependencyDisposition ddisp)
        {
            ddisp = DependencyDisposition.Complete;

            OrderPreservingSet <BuildObject> deps = new OrderPreservingSet <BuildObject>();

            //- Things we need to stitch the interface:
            deps.Add(genericStitch);
            deps.Add(appSpecificStitch);
            deps.AddRange(mainBeatVerb.getOutputs());

            //- Things we need to stitch the imports into the imp file:
            deps.Add(entryImpInput);
            deps.Add(context.getContextOutput());
            IIncludePathContext pathContext = context.fetchIfAvailable(ref ddisp);

            if (pathContext != null)
            {
                dafnyMainIfcInput = pathContext.search("dafny_Main_i", ModPart.Ifc);
                Util.Assert(dafnyMainIfcInput != null);
                deps.Add(dafnyMainIfcInput);
                dafnyMainImpInput = pathContext.search("dafny_Main_i", ModPart.Ifc);
                Util.Assert(dafnyMainImpInput != null);
                deps.Add(dafnyMainImpInput);
            }
            return(deps);
        }
            public BasmModuleAccumulator(IContextGeneratingVerb contextGenVerb, BuildObject upstreamObj, bool linkMode)
            {
                this._contextGenVerb = contextGenVerb;
                this._mutableVerbSet = new HashSet <IVerb>();
                //- NB preserve module definition-dependency order
                this._basmModules   = new OrderPreservingSet <BuildObject>();
                this._auxiliaryDeps = new HashSet <BuildObject>();
                _ddisp = DependencyDisposition.Complete;

                //-try
                //-{
                _mutableVerbSet.Add(contextGenVerb);
                _auxiliaryDeps.UnionWith(contextGenVerb.getOutputs());

                context = contextGenVerb.fetchIfAvailable(ref _ddisp);

                if (context != null)
                {
                    OrderPreservingSet <BuildObject> deps;
                    if (!linkMode)
                    {
                        deps = BeatExtensions.getBeatFlavoredShallowDependencies(
                            contextGenVerb, upstreamObj, out _ddisp, BeatIncludes.ImportFilter.ForBasmOnly);
                    }
                    else
                    {
                        deps = BeatExtensions.getBasmFlavoredTransitiveDependencies(contextGenVerb, upstreamObj, out _ddisp);
                        _mutableVerbSet.Add(BeatExtensions.getBasmFlavoredTransitiveDepVerb(_contextGenVerb, upstreamObj));
                    }
                    string  targetModName = upstreamObj.getFileNameWithoutExtension();
                    ModPart targetModPart = BeatExtensions.whichPart(upstreamObj);

                    //- NB security policy note: When verifying X.imp, we must be sure to supply X.ifc
                    //- to BoogieAsm, so that we know that we're actually verifying the promises
                    //- that other modules are relying on when they say "X" (which is how X got on
                    //- the verification obligation list). That property happens automatically here,
                    //- because we make a list of modules (ignoring ifc/imp part), such as {A,B,X},
                    //- and include *every* .ifc. If we're verifying X.imp, a conditional test
                    //- includes it at the time we consider module X.

                    foreach (BuildObject dep in deps)
                    {
                        string depExtn = dep.getExtension();
                        if (depExtn == null ||
                            depExtn.EndsWith(TransitiveDepsVerb.TDEP_EXTN) ||
                            depExtn.EndsWith(ContextGeneratingVerb.CONTEXT_EXTN))
                        {
                            _auxiliaryDeps.Add(dep);
                        }
                        else
                        {
                            Util.Assert(depExtn.Equals(BeatExtensions.BEATIFC_EXTN) ||
                                        depExtn.Equals(BeatExtensions.BEATIMP_EXTN) ||
                                        depExtn.Equals(BASMIFC_EXTN) ||
                                        depExtn.Equals(BASMIMP_EXTN)); //- Burned too many times by this silly filter-out strategy.
                            string  modName = dep.getFileNameWithoutExtension();
                            ModPart modPart = BeatExtensions.whichPart(dep);
                            getBasmModule(modName, ModPart.Ifc);
                            if ((dep.Equals(upstreamObj) && modPart == ModPart.Imp) || linkMode)
                            {
                                getBasmModule(modName, ModPart.Imp);
                            }
                        }
                    }
                }
                //-}
                //-catch (ObjNotReadyException)
                //-{
                //-
                //-    _ddisp = DependencyDisposition.Incomplete;
                //-}
                //-catch (ObjFailedException)
                //-{
                //-    _ddisp = DependencyDisposition.Failed;
                //-}
            }
            public BasmModuleAccumulator(IContextGeneratingVerb contextGenVerb, BuildObject upstreamObj, bool linkMode)
            {
                this._contextGenVerb = contextGenVerb;
                this._mutableVerbSet = new HashSet<IVerb>();

                // NB preserve module definition-dependency order.
                this._basmModules = new OrderPreservingSet<BuildObject>();
                this._auxiliaryDeps = new HashSet<BuildObject>();
                _ddisp = DependencyDisposition.Complete;

                ////try
                ////{
                _mutableVerbSet.Add(contextGenVerb);
                _auxiliaryDeps.UnionWith(contextGenVerb.getOutputs());

                context = contextGenVerb.fetchIfAvailable(ref _ddisp);

                if (context != null)
                {
                    OrderPreservingSet<BuildObject> deps;
                    if (!linkMode)
                    {
                        deps = BeatExtensions.getBeatFlavoredShallowDependencies(
                            contextGenVerb, upstreamObj, out _ddisp, BeatIncludes.ImportFilter.ForBasmOnly);
                    }
                    else
                    {
                        deps = BeatExtensions.getBasmFlavoredTransitiveDependencies(contextGenVerb, upstreamObj, out _ddisp);
                        _mutableVerbSet.Add(BeatExtensions.getBasmFlavoredTransitiveDepVerb(_contextGenVerb, upstreamObj));
                    }

                    // REVIEW: The following two variables are unused.  Remove?
                    string targetModName = upstreamObj.getFileNameWithoutExtension();
                    ModPart targetModPart = BeatExtensions.whichPart(upstreamObj);

                    // NB security policy note: When verifying X.imp, we must be sure to supply X.ifc
                    // to BoogieAsm, so that we know that we're actually verifying the promises
                    // that other modules are relying on when they say "X" (which is how X got on
                    // the verification obligation list). That property happens automatically here,
                    // because we make a list of modules (ignoring ifc/imp part), such as {A,B,X},
                    // and include *every* .ifc. If we're verifying X.imp, a conditional test
                    // includes it at the time we consider module X.

                    foreach (BuildObject dep in deps)
                    {
                        string depExtn = dep.getExtension();
                        if (depExtn == null
                            || depExtn.EndsWith(TransitiveDepsVerb.TDEP_EXTN)
                            || depExtn.EndsWith(ContextGeneratingVerb.CONTEXT_EXTN))
                        {
                            _auxiliaryDeps.Add(dep);
                        }
                        else
                        {
                            Util.Assert(depExtn.Equals(BeatExtensions.BEATIFC_EXTN)
                                || depExtn.Equals(BeatExtensions.BEATIMP_EXTN)
                                || depExtn.Equals(BASMIFC_EXTN)
                                || depExtn.Equals(BASMIMP_EXTN));   // Burned too many times by this silly filter-out strategy.
                            string modName = dep.getFileNameWithoutExtension();
                            ModPart modPart = BeatExtensions.whichPart(dep);
                            getBasmModule(modName, ModPart.Ifc);
                            if ((dep.Equals(upstreamObj) && modPart == ModPart.Imp) || linkMode)
                            {
                                getBasmModule(modName, ModPart.Imp);
                            }
                        }
                    }
                }

                ////}
                ////catch (ObjNotReadyException)
                ////{
                ////    // oh, we don't even have the context object yet.
                ////    _ddisp = DependencyDisposition.Incomplete;
                ////}
                ////catch (ObjFailedException)
                ////{
                ////    _ddisp = DependencyDisposition.Failed;
                ////}
            }