From 4be2ab852c127558c04119958fd0b462ff2e6493 Mon Sep 17 00:00:00 2001 From: wuestholz Date: Mon, 22 Jul 2013 21:33:35 -0700 Subject: Use 'All' and 'Any' instead of 'Contract.ForAll' and 'Contract.Exists' in code (as opposed to contracts). --- Source/VCExpr/Clustering.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Source/VCExpr/Clustering.cs') diff --git a/Source/VCExpr/Clustering.cs b/Source/VCExpr/Clustering.cs index 1efc3606..1ab10107 100644 --- a/Source/VCExpr/Clustering.cs +++ b/Source/VCExpr/Clustering.cs @@ -6,6 +6,7 @@ using System; using System.Text; using System.IO; +using System.Linq; using System.Collections; using System.Collections.Generic; using System.Diagnostics.Contracts; @@ -398,12 +399,12 @@ namespace Microsoft.Boogie.Clustering { public bool RepresentationIsRenaming(IDictionary/*!*/ globalVars) { Contract.Requires(cce.NonNullDictionaryAndValues(globalVars)); - if (!Contract.ForAll(Representation, pair => pair.Key.Expr0 is VCExprVar && pair.Key.Expr1 is VCExprVar && !globalVars.ContainsKey(cce.NonNull((VCExprVar)pair.Key.Expr0)) && !globalVars.ContainsKey(cce.NonNull((VCExprVar/*!*/)pair.Key.Expr1)))) + if (!Representation.Any(pair => pair.Key.Expr0 is VCExprVar && pair.Key.Expr1 is VCExprVar && !globalVars.ContainsKey(cce.NonNull((VCExprVar)pair.Key.Expr0)) && !globalVars.ContainsKey(cce.NonNull((VCExprVar/*!*/)pair.Key.Expr1)))) return false; // check that all substituted variables are distinct // TODO: optimise return - Contract.ForAll(Representation, pair1 => Contract.ForAll(Representation, pair2 => pair1.Value.Equals(pair2.Value) || !pair1.Key.Expr0.Equals(pair2.Key.Expr0) && !pair1.Key.Expr1.Equals(pair2.Key.Expr1))); + Representation.All(pair1 => Representation.All(pair2 => pair1.Value.Equals(pair2.Value) || !pair1.Key.Expr0.Equals(pair2.Key.Expr0) && !pair1.Key.Expr1.Equals(pair2.Key.Expr1))); } public void RepresentationSize(IDictionary/*!*/ globalVars, out int expr0Size, out int expr1Size) { -- cgit v1.2.3