public SimpleArrayPropertiesAbstractDomain(SimpleArrayPropertiesAbstractDomain <Variable, Expression> source) : base(source) { this.arrayAbstractor = source.arrayAbstractor; this.encoder = source.encoder; this.decoder = source.decoder; }
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); }
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)); }
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)); }
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; }
public SimpleArrayAbstractDomain(INumericalAbstractDomain <Variable, Expression> indexes, SimpleArrayPropertiesAbstractDomain <Variable, Expression> contents) : base(indexes, contents) { }
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>())); }