Пример #1
0
        public void SmallReproWithIf(MethodContract m)
        {
            var i = 0;

            if (i < m.RequiresCount)
            {
                var foo = m.Requires[i];
            }
        }
Пример #2
0
        public void SmallReproWithWhile(MethodContract m)
        {
            for (var i = 0; i < m.RequiresCount; i++)
            {
                // We can prove all of this asserts, they are here only to make it explicit
                // We commented for *not* helping the analysis

                /*
                 * Contract.Assert(m.RequiresCount > 0);
                 * Contract.Assert(i < m.RequiresCount);
                 *
                 * Contract.Assert(m.Requires.Count > 0);
                 */

                //Contract.Assert(m.Requires.Count == m.RequiresCount);
                //Contract.Assert(i < m.Requires.Count);

                // to prove it, we should infer the equality m.Requires.Count == m.RequiresCount
                // At this aim, we need the combination of Karr and LT abstract domains
                var foo = m.Requires[i];
            }
        }