Exemple #1
0
        bool IMutableVertexAndEdgeSet <TVertex, TEdge> .AddVerticesAndEdge(TEdge edge)
        {
            IMutableVertexAndEdgeSet <TVertex, TEdge> ithis = this;

            Contract.Requires(edge != null);
            Contract.Ensures(ithis.ContainsEdge(edge));
            Contract.Ensures(ithis.AllowParallelEdges || Contract.Result <bool>() == Contract.OldValue(!ithis.ContainsEdge(edge)));
            Contract.Ensures(ithis.EdgeCount == Contract.OldValue(ithis.EdgeCount) + (Contract.Result <bool>() ? 1 : 0));

            return(default(bool));
        }
        bool IMutableVertexAndEdgeSet <TVertex, TEdge> .AddVerticesAndEdge(TEdge edge)
        {
            IMutableVertexAndEdgeSet <TVertex, TEdge> ithis = this;

            Contract.Requires(edge != null);
            Contract.Ensures(ithis.ContainsEdge(edge));
            // MJ: This doesn't work, because the check for ContainsEdge bugs out
            // Contract.Ensures(ithis.AllowParallelEdges || Contract.Result<bool>() == Contract.OldValue(!ithis.ContainsVertex(edge.Source) || !ithis.ContainsEdge(edge)));
            Contract.Ensures(ithis.EdgeCount == Contract.OldValue(ithis.EdgeCount) + (Contract.Result <bool>() ? 1 : 0));

            return(default(bool));
        }