Ejemplo n.º 1
0
            public ProgramState PushWithConstraint()
            {
                var refEquals       = new ReferenceEqualsSymbolicValue(valueLeft, valueRight);
                var newProgramState = programState.PushValue(refEquals);

                return(SetConstraint(refEquals, newProgramState));
            }
Ejemplo n.º 2
0
            private ProgramState SetConstraint(ReferenceEqualsSymbolicValue refEquals, ProgramState programState)
            {
                if (AreBothArgumentsNull())
                {
                    return(refEquals.SetConstraint(BoolConstraint.True, programState));
                }

                if (IsAnyArgumentNonNullValueType() ||
                    ArgumentsHaveDifferentNullability())
                {
                    return(refEquals.SetConstraint(BoolConstraint.False, programState));
                }

                if (valueLeft == valueRight)
                {
                    return(refEquals.SetConstraint(BoolConstraint.True, programState));
                }

                return(programState);
            }