Exemplo n.º 1
0
 public SimpleArrayPropertiesAbstractDomain(SimpleArrayPropertiesAbstractDomain <Variable, Expression> source)
     : base(source)
 {
     this.arrayAbstractor = source.arrayAbstractor;
     this.encoder         = source.encoder;
     this.decoder         = source.decoder;
 }
Exemplo n.º 2
0
        public SimpleArrayPropertiesAbstractDomain <Variable, Expression> Join(SimpleArrayPropertiesAbstractDomain <Variable, Expression> right, Set <Variable> keep)
        {
            // Here we do not have trivial joins as we want to join maps of different cardinality
            if (this.IsBottom)
            {
                return(right);
            }
            if (right.IsBottom)
            {
                return(this);
            }

            var result = this.Factory();

            foreach (var x in this.Keys) // For all the elements in the intersection do the point-wise join
            {
                IArrayAbstraction <Variable, Expression> right_x;

                if (right.TryGetValue(x, out right_x))
                {
                    var join = this[x].Join(right_x);

                    //if (!join.IsTop)
                    { // We keep in the map only the elements that are != top
                      //result[x] = (Codomain)join;
                        result.AddElement(x, (IArrayAbstraction <Variable, Expression>)join);
                    }
                }
                else
                {
                    if (keep.Contains(x))
                    {
                        result.AddElement(x, this[x]);
                    }
                    keep.Remove(x);
                }
            }

            foreach (var x in keep)
            {
                if (!result.ContainsKey(x))
                {
                    result.AddElement(x, right[x]);
                }
            }

            return(result);
        }
Exemplo n.º 3
0
        public override ReducedCartesianAbstractDomain <INumericalAbstractDomain <Variable, Expression>, SimpleArrayPropertiesAbstractDomain <Variable, Expression> > Reduce(INumericalAbstractDomain <Variable, Expression> left, SimpleArrayPropertiesAbstractDomain <Variable, Expression> right)
        {
            if (left.IsBottom)
            {
                return((SimpleArrayAbstractDomain <Variable, Expression>) this.Bottom);
            }

            return(new SimpleArrayAbstractDomain <Variable, Expression>(left, right, this.decoder, this.encoder));
        }
Exemplo n.º 4
0
 protected override ReducedCartesianAbstractDomain <INumericalAbstractDomain <Variable, Expression>, SimpleArrayPropertiesAbstractDomain <Variable, Expression> > Factory(INumericalAbstractDomain <Variable, Expression> left, SimpleArrayPropertiesAbstractDomain <Variable, Expression> right)
 {
     // TODO
     return(new SimpleArrayAbstractDomain <Variable, Expression>(left, right, this.decoder, this.encoder));
 }
Exemplo n.º 5
0
 public SimpleArrayAbstractDomain(INumericalAbstractDomain <Variable, Expression> indexes, SimpleArrayPropertiesAbstractDomain <Variable, Expression> contents, IExpressionDecoder <Variable, Expression> decoder, IExpressionEncoder <Variable, Expression> encoder)
     : base(indexes, contents)
 {
     this.encoder = encoder;
     this.decoder = decoder;
 }
Exemplo n.º 6
0
 public SimpleArrayAbstractDomain(INumericalAbstractDomain <Variable, Expression> indexes, SimpleArrayPropertiesAbstractDomain <Variable, Expression> contents)
     : base(indexes, contents)
 {
 }
Exemplo n.º 7
0
        public override SimpleArrayPropertiesAbstractDomain <Variable, Expression> Join(SimpleArrayPropertiesAbstractDomain <Variable, Expression> right)
        {
            //// Here we do not have trivial joins as we want to join maps of different cardinality
            //if (this.IsBottom)
            //  return right;
            //if (right.IsBottom)
            //  return (SimpleArrayPropertiesAbstractDomain<Variable, Expression>)this;

            //SimpleArrayPropertiesAbstractDomain<Variable, Expression> result = this.Factory();

            //foreach (var x in this.Keys)       // For all the elements in the intersection do the point-wise join
            //{
            //  IArrayAbstraction<Variable, Expression> right_x;

            //  if (right.TryGetValue(x, out right_x))
            //  {
            //    var join = this[x].Join(right_x);

            //    //if (!join.IsTop)
            //    { // We keep in the map only the elements that are != top
            //      //result[x] = (Codomain)join;
            //      result.AddElement(x, (IArrayAbstraction<Variable, Expression>)join);
            //    }
            //  }
            //}

            //return result;
            return(this.Join(right, new Set <Variable>()));
        }