Пример #1
0
            public ProgramState PushWithConstraint()
            {
                var refEquals       = new ReferenceEqualsSymbolicValue(valueLeft, valueRight);
                var newProgramState = programState.PushValue(refEquals);

                return(SetConstraint(refEquals, newProgramState));
            }
Пример #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);
            }