private VariableState CreateNewInputVariableState(VersionedVariable variable, ISymbolicHeapContext context, bool canBeNull)
                {
                    var newVar   = context.CreateVariable(Sort.Int, variable.ToString());
                    var newState = VariableState.CreateInput(this.nextVariableStateId, newVar, canBeNull);

                    this.nextVariableStateId++;
                    return(newState);
                }
                public void AssignReference(
                    VersionedVariable result,
                    VersionedVariable value,
                    ISymbolicHeapContext context)
                {
                    this.cachedState = null;

                    var resultState = this.GetVariableStateOrNull(result);
                    var valueState  = this.GetVariableStateOrNull(value);

                    if (resultState != null && valueState != null)
                    {
                        Contract.Assert(resultState.IsInput);

                        context.AddAssertion(resultState.Representation == valueState.Representation);
                        this.MapToVariableState(result, valueState);
                    }
                    else if (resultState == null && valueState == null)
                    {
                        var newVar   = context.CreateVariable(Sort.Int, value.Variable.ToString());
                        var newState = VariableState.CreateInput(this.nextVariableStateId, newVar, true);
                        this.nextVariableStateId++;

                        this.MapToVariableState(result, newState);
                        this.MapToVariableState(value, newState);
                    }
                    else if (resultState != null)
                    {
                        Contract.Assert(valueState == null);

                        this.MapToVariableState(value, resultState);
                    }
                    else
                    {
                        Contract.Assert(valueState != null && resultState == null);

                        this.MapToVariableState(result, valueState);
                    }
                }