示例#1
0
        public override bool sourcesCompleteGTTINoLGTTs(int gtti)
        {
            var gttd = gtts.getTD(gtti);

            #region gtis
            if (gttd.gtiT.Length > 0)
            {
                foreach (var pgtA in FU.makeOptions((from gti in gttd.gtiT select pu.depthFilterStrict(gts.getTD(gti).pgts)).ToArray()))
                {
                    GTT pgtt;
                    if (su.termRepository.tryGetGTT(pgtA, out pgtt))
                    {
                        if (pu.hasGTT(pgtt))
                        {
                            Debug.Assert(pu.upToDate(pgtt));
                            Debug.Assert(gttd.hasPGTT(pgtt) || pu.gttRevision(pgtt) >= su.predecessorLastRevision);
                        }
                        else
                        {
                            Debug.Assert(pu.hasRGTT(pgtt));
                        }
                    }
                }
            }
            #endregion gtis
            #region pgtts
            foreach (var pgtt in gttd.pgtts)
            {
                Debug.Assert(pu.upToDate(pgtt));
            }
            #endregion pgtts

            return(true);
        }
示例#2
0
        public override bool sourcesCompleteGTTINoLGTTs(int gtti)
        {
            base.sourcesCompleteGTTINoLGTTs(gtti);
            var gttd = gtts.getTD(gtti);

            #region gtiT
            if (gttd.gtiT.Length > 0)
            {
                #region gtis
                foreach (var j in js)
                {
                    var pu = pus[j];
                    foreach (var pgtA in FU.makeOptions((from gti in gttd.gtiT select pu.depthFilterStrict(from pgt in gts.getTD(gti).jgts(j) select pgt)).ToArray()))
                    {
                        GTT pgtt;
                        if (ju.termRepository.tryGetGTT(pgtA, out pgtt))
                        {
                            if (pu.hasGTT(pgtt))
                            {
                                Debug.Assert(pu.upToDate(pgtt));
                                Debug.Assert(gttd.hasJGTT(j, pgtt) || pu.gttRevision(pgtt) >= ju.predecessorLastRevisions[j]);
                            }
                            else
                            {
                                Debug.Assert(pu.hasRGTT(pgtt));
                            }
                        }
                        else
                        {
                            Debug.Assert(false);
                        }
                    }
                }
                #endregion gtis
            }
            #endregion gtiT

            #region jgtts
            foreach (var j in js)
            {
                foreach (var jgtt in gttd.jgtts(j))
                {
                    Debug.Assert(pus[j].upToDate(jgtt));
                }
            }
            #endregion jgtts

            var jgttsA = (from j in js select new HashSet <GTT>(gtts.getJTs(j, gtti))).ToArray();

            #region empty gtt
            if (getGTTIGTIs(gtti).Count == 0)
            {
                foreach (var j in js)
                {
                    Debug.Assert(jgttsA[j].Count == 1 && jgttsA[j].Contains(ju.emptyGTT));
                }
            }
            #endregion empty gtt

            #region sources
            if (ju.jn == 2)
            {
                foreach (var j in js)
                {
                    var ju = this.ju.pus[j];
                    if (getGTTIGTIs(gtti).Count > 0)
                    {
                        var jgtsA  = ju.depthFilterStrict(from gt in getGTTIGTIs(gtti) select gts.getJTs(j, gt));
                        var pjgtts = from jgtA in FU.makeOptions(jgtsA) select ju.getGTT(jgtA);

                        foreach (var pjgtt in pjgtts)
                        {
                            if (!ju.hasGTT(pjgtt))
                            {
                                Debug.Assert(ju.hasRGTT(pjgtt));
                            }
                            else
                            if (this.ju.predecessorLastRevisions[j] > ju.gttRevision(pjgtt))
                            {
                                Debug.Assert(jgttsA[j].Contains(pjgtt));
                            }
                        }
                    }
                }
            }
            #endregion sources
            return(true);
        }
示例#3
0
        public override bool sourcesCompleteGTINoLGTs(int gti)
        {
            base.sourcesCompleteGTINoLGTs(gti);
            var gtd = gts.getTD(gti);

            #region gfas
            foreach (var gfa in gtd.gfas)
            {
                foreach (var j in js)
                {
                    var pu = pus[j];
                    if (pu.inScope(gfa.Item1))
                    {
                        var f    = gfa.Item1;
                        var gtti = gfa.Item2;
                        var gttd = gtts.getTD(gtti);
                        foreach (var pgtt in gttd.jgtts(j))
                        {
                            if (pu.inDepthBoundStrict(pgtt))
                            {
                                GFA pgfa;
                                if (pu.tryGetGFA(f, pgtt, out pgfa))
                                {
                                    Debug.Assert(gtd.hasJGT(j, pgfa.gt) || pu.gtRevision(pgfa.gt) >= ju.predecessorLastRevisions[j]);
                                }
                                else
                                {
                                    Debug.Assert(pu.hasRGFA(f, pgtt));
                                }
                            }
                        }
                    }
                }
            }
            #endregion gfas

            #region pgts
            foreach (var j in js)
            {
                foreach (var jgt in gtd.jgts(j))
                {
                    Debug.Assert(pus[j].upToDate(jgt));
                }
            }
            if (gtd.depth > minDepth)
            {
                var gfaMap = new Dictionary <Function, ISet <GTT>[]>();
                foreach (var j in js)
                {
                    foreach (var pgt in gtd.jgts(j))
                    {
                        foreach (var pgfa in pgt.gfas)
                        {
                            if (ju.inScope(pgfa.function))
                            {
                                gfaMap.insert(jn, pgfa.function, j, pgfa.gtt);
                            }
                        }
                    }
                }
                foreach (var kv in gfaMap)
                {
                    foreach (var jgttA in FU.makeOptions((from j in js select kv.Value[j]).ToArray()))
                    {
                        Debug.Assert(gtd.hasGFA(kv.Key, getJGTTAGTTI(jgttA)));
                    }
                }
            }
            #endregion pgts
            return(true);
        }
示例#4
0
        protected override sealed void propagateUsed(JGTSD gtd, ISet <JGTSD> todoGTDs, ISet <JGTSD> usedGTDs, ISet <JGTTSD> todoGTTDs, ISet <JGTTSD> usedGTTDs)
        {
            if (gtd.depth != topDepth && gtd.depth > minDepth)
            {
                if (jn == 1)
                {
                    foreach (var pgt in gtd.jgts(0))
                    {
                        foreach (var pgfa in pgt.gfas)
                        {
                            if (ju.inScope(pgfa.function))
                            {
                                var gttds = from gtti in gtts.getJTJEC(0, pgfa.gtt).tis select gtts.getTD(gtti);

                                foreach (var gttd in gttds)
                                {
                                    if (usedGTTDs.Add(gttd))
                                    {
                                        todoGTTDs.Add(gttd);
                                    }
                                }
                            }
                        }
                    }
                }
                else
                {
                    Debug.Assert(jn == 2);
                    #region jgtxjgt
                    var jgtA = (from j in js select gtd.jgts(j)).ToArray();
                    var jfA  = (from j in js select new HashSet <Function>(from jgt in jgtA[j] from f in jgt.gfasByFunction.Keys select f)).ToArray();
                    foreach (var f in FU.intersection(jfA))
                    {
                        foreach (var jecgttT in
                                 FU.makeOptions(
                                     (from j in js
                                      select new HashSet <JECGTT>(
                                          from jgt in jgtA[j] from jgfa in jgt.getGFAsByFunction(f) select gtts.getJTJEC(j, jgfa.gtt))).ToArray()))
                        {
                            var gttd = gtts.getJECATD(jecgttT);
                            if (usedGTTDs.Add(gttd))
                            {
                                todoGTTDs.Add(gttd);
                            }
                        }
                    }
                    #endregion jgtxjgt
                    #region jgtxgfa + gfaxjgt
                    foreach (var j in js)
                    {
                        foreach (var f in jfA[j])
                        {
                            if (gtd.hasGFAFunction(f))
                            {
                                foreach (var jecgttT in
                                         FU.makeOptions(
                                             (from j2 in js
                                              select j == j2
                                         ? new HashSet <JECGTT>(from jgt in jgtA[j2] from jgfa in jgt.getGFAsByFunction(f) select gtts.getJTJEC(j2, jgfa.gtt))
                                         : new HashSet <JECGTT>(from gtti in gtd.getGFAs(f) select gtts.getTD(gtti).jecA[j2])
                                             ).ToArray()))
                                {
                                    var gttd = gtts.getJECATD(jecgttT);
                                    if (usedGTTDs.Add(gttd))
                                    {
                                        todoGTTDs.Add(gttd);
                                    }
                                }
                            }
                        }
                    }
                    #endregion jgtxgfa + gfaxjgt
                }
            }
            base.propagateUsed(gtd, todoGTDs, usedGTDs, todoGTTDs, usedGTTDs);
        }
示例#5
0
        public override bool sourcesCompleteGTINoLGTs(int gti)
        {
            var gtd = gts.getTD(gti);

            #region gfas
            foreach (var gfa in gtd.gfas)
            {
                if (pu.inScope(gfa.Item1))
                {
                    var f    = gfa.Item1;
                    var gtti = gfa.Item2;
                    var gttd = gtts.getTD(gtti);
                    foreach (var pgtt in gttd.pgtts)
                    {
                        if (pu.inDepthBoundStrict(pgtt))
                        {
                            GFA pgfa;
                            if (pu.tryGetGFA(f, pgtt, out pgfa))
                            {
                                Debug.Assert(gtd.hasPGT(pgfa.gt) || pu.gtRevision(pgfa.gt) >= su.predecessorLastRevision);
                            }
                            else
                            {
                                Debug.Assert(pu.hasRGFA(f, pgtt));
                            }
                        }
                    }
                }
            }
            #endregion gfas

            #region pgts
            foreach (var pgt in gtd.pgts)
            {
                Debug.Assert(pu.upToDate(pgt));
            }
            if (gtd.depth > minDepth)
            {
                foreach (var pgt in gtd.pgts)
                {
                    Debug.Assert(pu.upToDate(pgt));
                    foreach (var pgfa in pgt.gfas)
                    {
                        if (su.inScope(pgfa.function) && pu.gttRevision(pgfa.gtt) < su.predecessorLastRevision)
                        {
                            Debug.Assert(gtd.hasGFA(pgfa.function, gtts.getPTTI(pgfa.gtt)));
                        }
                    }
                }
            }
            #endregion pgts

            #region rgtts
            foreach (var lgt in gtd.lgts)
            {
                foreach (var rgtt in su.getGTRGTTs(lgt))
                {
                    var pgtsT = (from gt in rgtt.gtT select pu.depthFilterStrict(gts.getLTTD(gt).pgts)).ToArray();
                    var pgtTs = FU.makeOptions(pgtsT);
                    var pgtts = (from pgtT in pgtTs select pu.getGTT(pgtT));
                    foreach (var pgtt in pgtts)
                    {
                        Debug.Assert(pu.hasGTT(pgtt) || pu.hasRGTT(pgtt));
                    }
                }
            }
            #endregion rgtts

            return(true);
        }