Esempio n. 1
0
        protected void changeIndexWindow(Dependency d)
        {
            try
            {
                if (d.IsFormula())
                {
                    IEnumerator e = ((Formula)d).GetDependencies();
                    while (e.MoveNext())
                    {
                        changeIndexWindow((Dependency)e.Current);
                    }
                }
                else if (d is StateDependency)
                {
                    StateDependency sd = (StateDependency)d;

                    changeIndexWindow(sd.StateWindow);

                    if (sd is StateValueDependency && ((StateValueDependency)sd).IsReference)
                    {
                        changeIndexWindow(((StateValueDependency)sd).ReferenceWindow);
                    }
                }
            }
            catch (NullReferenceException e)
            {
                throw new PUC.Parsers.SpecParseException(d.LineNumber, "A dependency within an apply-over block does not refer to a variable within the referenced list group.", e);
            }
        }
Esempio n. 2
0
        /*
         * Member Methods
         */

        public override PUC.Dependency.Comparison Compare(StateDependency d)
        {
            if (d.State != State)
            {
                return(Comparison.Disjoint);
            }

            return(d.CompareLessThan(this));
        }
Esempio n. 3
0
        /*
         * Member Methods
         */

        public override PUC.Dependency.Comparison Compare(StateDependency d)
        {
            if (d.State == State && d is UndefinedDependency)
            {
                return(Dependency.Comparison.Same);
            }

            return(Dependency.Comparison.Disjoint);
        }
Esempio n. 4
0
 public override StateDependency Merge(StateDependency d)
 {
     if (d.Compare(this) == Dependency.Comparison.Same)
     {
         return(this);
     }
     else
     {
         return(null);
     }
 }
Esempio n. 5
0
        public override StateDependency Merge(StateDependency d)
        {
            Dependency.Comparison r = Compare(d);

            switch (r)
            {
            case Comparison.Disjoint:
                return(null);

            default:
                return(d);
            }
        }
Esempio n. 6
0
        public override Dependency.Comparison Compare(StateDependency d)
        {
            if (d.State != State ||
                d is UndefinedDependency)
            {
                return(Dependency.Comparison.Disjoint);
            }

            if (d is WholeSetDependency)
            {
                return(Dependency.Comparison.Same);
            }

            return(Dependency.Comparison.Overlap);
        }
Esempio n. 7
0
        public override StateDependency Merge(StateDependency d)
        {
            Comparison r = Compare(d);

            switch (r)
            {
            case Comparison.Same:
                return(d);

            case Comparison.Overlap:
                if (d is EqualsDependency)
                {
                    return(this);
                }
                else if (d is GreaterThanDependency)
                {
                    return(new WholeSetDependency(State));
                }
                else if (d is WholeSetDependency)
                {
                    return(d);
                }
                else if (d is LessThanDependency)
                {
                    if (State.Type.ValueSpace.CompareValues(((LessThanDependency)d).Value, this.Value) == -1)
                    {
                        return(d);
                    }
                    else
                    {
                        return(this);
                    }
                }
                else
                {
                    return(null);
                }

            default:
                return(null);
            }
        }
Esempio n. 8
0
 public abstract StateDependency Merge(StateDependency d);
Esempio n. 9
0
        /*
         * Abstract Methods
         */

        public abstract Dependency.Comparison Compare(StateDependency d);