Exemplo 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);
            }
        }
Exemplo n.º 2
0
        /*
         * Member Methods
         */

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

            return(d.CompareLessThan(this));
        }
Exemplo 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);
        }
Exemplo n.º 4
0
 public override StateDependency Merge(StateDependency d)
 {
     if (d.Compare(this) == Dependency.Comparison.Same)
     {
         return(this);
     }
     else
     {
         return(null);
     }
 }
Exemplo n.º 5
0
        public override StateDependency Merge(StateDependency d)
        {
            Dependency.Comparison r = Compare(d);

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

            default:
                return(d);
            }
        }
Exemplo 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);
        }
Exemplo 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);
            }
        }
Exemplo n.º 8
0
 public abstract StateDependency Merge(StateDependency d);
Exemplo n.º 9
0
        /*
         * Abstract Methods
         */

        public abstract Dependency.Comparison Compare(StateDependency d);