Example #1
0
        public bool Contains(Key /*!*/ key)
        {
            if (map == null)
            {
                throw new InvalidOperationException();
            }

            return(map.Contains(key));
        }
                public BoxedExpression Rename(APC from, APC to, BoxedExpression state, IFunctionalMap <Variable, Variable> renaming)
                {
                    if (state != null)
                    {
                        Variable v;
                        if (state.TryGetFrameworkVariable(out v))
                        {
                            if (renaming.Contains(v))
                            {
                                var newVar = renaming[v];

                                var result = BoxedExpression.Convert(this.mdriver.Context.ExpressionContext.Refine(to, newVar), this.mdriver.ExpressionDecoder);

                                Log("Renaming {0} to {1}", state.ToString(), result != null? result.ToString(): "<null>");

                                // We use the heuristic of reading variables in the prestate, to get their name at the point we are interested in.
                                // We may lose information because of it, and unable to decompile more complex expressions
                                if (result != null && !result.IsVariable)
                                {
                                    return(ReadInPostState(result, renaming));
                                }

                                return(result);
                            }
                        }
                        int k;
                        if (state.IsConstantInt(out k))
                        {
                            return(state);
                        }
                    }

                    return(null);
                }
 public Domain Rename(IFunctionalMap <SymbolicValue, SymbolicValue> substitution)
 {
     foreach (SymbolicValue v in NonNullValues.Elements)
     {
         if (substitution.Contains(v))
         {
             NonNullValues = NonNullValues.Remove(v).Add(substitution[v]);
         }
     }
     return(this);
 }