From f3d17bbca84c237400698f3ecd887863371eaadb Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Fri, 2 Aug 2024 15:00:53 +0200 Subject: [PATCH] Rename cce to Cce --- Source/AbstractInterpretation/Traverse.cs | 38 ++-- Source/BaseTypes/BigNum.cs | 2 +- Source/BaseTypes/Set.cs | 4 +- Source/BoogieDriver/BoogieDriver.cs | 2 +- Source/CodeContractsExtender/cce.cs | 6 +- Source/Concurrency/CivlCoreTypes.cs | 4 +- Source/Concurrency/CivlUtil.cs | 4 +- Source/Core/AST/Absy.cs | 32 +-- Source/Core/AST/AbsyCmd.cs | 78 ++++---- Source/Core/AST/AbsyQuant.cs | 10 +- Source/Core/AST/AbsyType.cs | 100 +++++----- Source/Core/AST/Block.cs | 8 +- Source/Core/AST/CallCmd.cs | 40 ++-- Source/Core/AST/Expression/AbsyExpr.cs | 140 +++++++------- Source/Core/AST/Expression/FunctionCall.cs | 2 +- Source/Core/AST/Implementation.cs | 36 ++-- Source/Core/AST/Program.cs | 20 +- Source/Core/AlphaEquality.cs | 4 +- Source/Core/BoogiePL.atg | 20 +- Source/Core/DeadVarElim.cs | 148 +++++++------- Source/Core/Duplicator.cs | 22 +-- Source/Core/Helpers.cs | 8 +- Source/Core/Inline.cs | 56 +++--- Source/Core/LambdaHelper.cs | 2 +- Source/Core/LoopUnroll.cs | 24 +-- Source/Core/MaxHolesLambdaLifter.cs | 4 +- Source/Core/Monomorphization.cs | 6 +- Source/Core/OOLongUtil.cs | 16 +- Source/Core/Parser.cs | 20 +- Source/Core/ParserHelper.cs | 6 +- Source/Core/ResolutionContext.cs | 12 +- Source/Core/StandardVisitor.cs | 62 +++--- Source/Core/TypeAmbiguitySeeker.cs | 4 +- Source/Core/Xml.cs | 56 +++--- .../CommandLineOptionEngine.cs | 14 +- Source/ExecutionEngine/CommandLineOptions.cs | 32 +-- Source/ExecutionEngine/ExecutionEngine.cs | 16 +- Source/Graph/Graph.cs | 14 +- Source/Provers/SMTLib/ProverContext.cs | 6 +- Source/Provers/SMTLib/ProverInterface.cs | 6 +- Source/Provers/SMTLib/ProverUtil.cs | 24 +-- Source/Provers/SMTLib/SMTLibLineariser.cs | 6 +- .../SMTLib/SMTLibProcessTheoremProver.cs | 8 +- Source/Provers/SMTLib/SMTLibSolverOptions.cs | 2 +- Source/Provers/SMTLib/TypeDeclCollector.cs | 4 +- Source/VCExpr/BigLiteralAbstracter.cs | 2 +- Source/VCExpr/Boogie2VCExpr.cs | 182 +++++++++--------- Source/VCExpr/Clustering.cs | 36 ++-- Source/VCExpr/LetBindingSorter.cs | 12 +- Source/VCExpr/MutatingVCExprVisitor.cs | 22 +-- Source/VCExpr/OpTypeEraserPremisses.cs | 10 +- Source/VCExpr/ScopedNamer.cs | 8 +- Source/VCExpr/TypeErasure/HelperFuns.cs | 22 +-- .../TypeErasure/MapTypeAbstractionBuilder.cs | 2 +- Source/VCExpr/TypeErasure/OpTypeEraser.cs | 4 +- Source/VCExpr/TypeErasure/TypeAxiomBuilder.cs | 26 +-- Source/VCExpr/TypeErasure/TypeEraser.cs | 10 +- .../VCExpr/TypeErasure/TypeEraserPremisses.cs | 28 +-- Source/VCExpr/TypeErasure/TypeErasure.cs | 16 +- .../TypeErasure/TypeErasureArguments.cs | 46 ++--- .../TypeErasure/TypeErasurePremisses.cs | 126 ++++++------ Source/VCExpr/TypeErasure/VariableBindings.cs | 12 +- .../TypeErasure/VariableCastCollector.cs | 4 +- Source/VCExpr/VCExprAST.cs | 90 ++++----- Source/VCExpr/VCExprASTPrinter.cs | 8 +- Source/VCExpr/VCExprASTVisitors.cs | 52 ++--- Source/VCExpr/VCExpressionGenerator.cs | 66 +++---- Source/VCGeneration/BlockStats.cs | 4 +- Source/VCGeneration/Checker.cs | 4 +- Source/VCGeneration/ConditionGeneration.cs | 34 ++-- Source/VCGeneration/Counterexample.cs | 10 +- Source/VCGeneration/LoopExtractor.cs | 8 +- Source/VCGeneration/ManualSplitFinder.cs | 2 +- Source/VCGeneration/SmokeTester.cs | 32 +-- Source/VCGeneration/Split.cs | 42 ++-- Source/VCGeneration/SplitAndVerifyWorker.cs | 4 +- .../VerificationConditionGenerator.cs | 46 ++--- .../VerificationResultCollector.cs | 4 +- Source/VCGeneration/Wlp.cs | 14 +- 79 files changed, 1058 insertions(+), 1058 deletions(-) diff --git a/Source/AbstractInterpretation/Traverse.cs b/Source/AbstractInterpretation/Traverse.cs index 483766d3d..8e3c9252f 100644 --- a/Source/AbstractInterpretation/Traverse.cs +++ b/Source/AbstractInterpretation/Traverse.cs @@ -18,44 +18,44 @@ public class WidenPoints public static void Compute(Program program) { Contract.Requires(program != null); - cce.BeginExpose(program); + Cce.BeginExpose(program); foreach (var impl in program.Implementations) { if (impl.Blocks != null && impl.Blocks.Count > 0) { - Contract.Assume(cce.IsConsistent(impl)); - cce.BeginExpose(impl); + Contract.Assume(Cce.IsConsistent(impl)); + Cce.BeginExpose(impl); Block start = impl.Blocks[0]; Contract.Assume(start != null); - Contract.Assume(cce.IsConsistent(start)); + Contract.Assume(Cce.IsConsistent(start)); Visit(start); // We reset the state... foreach (Block b in impl.Blocks) { - cce.BeginExpose(b); + Cce.BeginExpose(b); b.TraversingStatus = Block.VisitState.ToVisit; - cce.EndExpose(); + Cce.EndExpose(); } - cce.EndExpose(); + Cce.EndExpose(); } } - cce.EndExpose(); + Cce.EndExpose(); } static void Visit(Block b) { Contract.Requires(b != null); - Contract.Assume(cce.IsExposable(b)); + Contract.Assume(Cce.IsExposable(b)); if (b.TraversingStatus == Block.VisitState.BeingVisited) { - cce.BeginExpose(b); + Cce.BeginExpose(b); // we got here through a back-edge b.widenBlock = true; - cce.EndExpose(); + Cce.EndExpose(); } else if (b.TraversingStatus == Block.VisitState.AlreadyVisited) { @@ -66,15 +66,15 @@ static void Visit(Block b) Contract.Assert(b.TraversingStatus == Block.VisitState.ToVisit); GotoCmd g = (GotoCmd) b.TransferCmd; - cce.BeginExpose(b); + Cce.BeginExpose(b); - cce.BeginExpose(g); //PM: required for the subsequent expose (g.labelTargets) + Cce.BeginExpose(g); //PM: required for the subsequent expose (g.labelTargets) b.TraversingStatus = Block.VisitState.BeingVisited; // labelTargets is made non-null by Resolve, which we assume // has already called in a prior pass. Contract.Assume(g.labelTargets != null); - cce.BeginExpose(g.labelTargets); + Cce.BeginExpose(g.labelTargets); foreach (Block succ in g.labelTargets) // invariant b.currentlyTraversed; //PM: The following loop invariant will work once properties are axiomatized @@ -84,7 +84,7 @@ static void Visit(Block b) Visit(succ); } - cce.EndExpose(); + Cce.EndExpose(); Contract.Assert(b.TraversingStatus == Block.VisitState.BeingVisited); // System.Diagnostics.Debug.Assert(b.currentlyTraversed); @@ -94,7 +94,7 @@ static void Visit(Block b) //PM: The folowing assumption is needed because we cannot prove that a simple field update //PM: leaves the value of a property unchanged. Contract.Assume(g.labelNames == null || g.labelNames.Count == g.labelTargets.Count); - cce.EndExpose(); + Cce.EndExpose(); } else { @@ -113,7 +113,7 @@ public static List ComputeLoopBodyFrom(Block block) { Contract.Requires(block.widenBlock); Contract.Requires(block != null); - Contract.Ensures(cce.NonNullElements(Contract.Result>())); + Contract.Ensures(Cce.NonNullElements(Contract.Result>())); Contract.Assert(rootBlock == null); rootBlock = block; @@ -141,8 +141,8 @@ public static List ComputeLoopBodyFrom(Block block) private static void DoDFSVisit(Block block, List path, List blocksInPath) { Contract.Requires(block != null); - Contract.Requires(cce.NonNullElements(path)); - Contract.Requires(cce.NonNullElements(path)); + Contract.Requires(Cce.NonNullElements(path)); + Contract.Requires(Cce.NonNullElements(path)); #region case 1. We visit the root => We are done, "path" is a path inside the loop diff --git a/Source/BaseTypes/BigNum.cs b/Source/BaseTypes/BigNum.cs index e2ed5dab8..5b73fe1ff 100644 --- a/Source/BaseTypes/BigNum.cs +++ b/Source/BaseTypes/BigNum.cs @@ -148,7 +148,7 @@ public override int GetHashCode() public override string /*!*/ ToString() { Contract.Ensures(Contract.Result() != null); - return cce.NonNull(val.ToString()); + return Cce.NonNull(val.ToString()); } ////////////////////////////////////////////////////////////////////////////// diff --git a/Source/BaseTypes/Set.cs b/Source/BaseTypes/Set.cs index 24f6615e7..ebdbc8786 100644 --- a/Source/BaseTypes/Set.cs +++ b/Source/BaseTypes/Set.cs @@ -273,7 +273,7 @@ public virtual int Count Contract.Ensures(Contract.Result>() != null); //Contract.Ensures(Contract.ForAll(result, x => a[x] && b[x] )); GSet /*!*/ - res = (GSet /*!*/) cce.NonNull(a.Clone()); + res = (GSet /*!*/) Cce.NonNull(a.Clone()); res.Intersect(b); return res; } @@ -286,7 +286,7 @@ public virtual int Count Contract.Ensures(Contract.Result>() != null); // Contract.Ensures(Contract.ForAll(result, x => a[x] || b[x] )); GSet /*!*/ - res = (GSet /*!*/) cce.NonNull(a.Clone()); + res = (GSet /*!*/) Cce.NonNull(a.Clone()); res.AddRange(b); return res; } diff --git a/Source/BoogieDriver/BoogieDriver.cs b/Source/BoogieDriver/BoogieDriver.cs index 979806a68..3abe8c10a 100644 --- a/Source/BoogieDriver/BoogieDriver.cs +++ b/Source/BoogieDriver/BoogieDriver.cs @@ -9,7 +9,7 @@ public class OnlyBoogie { public static int Main(string[] args) { - Contract.Requires(cce.NonNullElements(args)); + Contract.Requires(Cce.NonNullElements(args)); var options = new CommandLineOptions(Console.Out, new ConsolePrinter()) { diff --git a/Source/CodeContractsExtender/cce.cs b/Source/CodeContractsExtender/cce.cs index 9eac9546b..54e7db6e9 100644 --- a/Source/CodeContractsExtender/cce.cs +++ b/Source/CodeContractsExtender/cce.cs @@ -6,7 +6,7 @@ /// /// A class containing static methods to extend the functionality of Code Contracts /// -public static class cce +public static class Cce { //[Pure] //public static bool NonNullElements(Microsoft.Dafny.Graph collection) { @@ -29,7 +29,7 @@ public static bool NonNullElements(IEnumerable collection) where T : class [Pure] public static bool NonNullDictionaryAndValues(IDictionary collection) where TValue : class { - return collection != null && cce.NonNullElements(collection.Values); + return collection != null && Cce.NonNullElements(collection.Values); } //[Pure] @@ -46,7 +46,7 @@ public static bool NonNullDictionaryAndValues(IDictionary(IEnumerable collection, bool nullability) where T : class { - return (nullability && collection == null) || cce.NonNullElements(collection); + return (nullability && collection == null) || Cce.NonNullElements(collection); //Should be the same as: /*if(nullability&&collection==null) * return true; diff --git a/Source/Concurrency/CivlCoreTypes.cs b/Source/Concurrency/CivlCoreTypes.cs index 70003d765..9430d2fc4 100644 --- a/Source/Concurrency/CivlCoreTypes.cs +++ b/Source/Concurrency/CivlCoreTypes.cs @@ -390,7 +390,7 @@ private List HoistAsserts(Implementation impl, ConcurrencyOptions opt } else { - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } } return wlps[impl.Blocks[0]].Select(assertCmd => Forall(impl.LocVars.Union(impl.OutParams), assertCmd)).ToList(); @@ -435,7 +435,7 @@ private List HoistAsserts(List cmds, List postconditi } else { - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } } cmds.RemoveAll(cmd => cmd is AssertCmd); diff --git a/Source/Concurrency/CivlUtil.cs b/Source/Concurrency/CivlUtil.cs index e2f330361..b1ba3e373 100644 --- a/Source/Concurrency/CivlUtil.cs +++ b/Source/Concurrency/CivlUtil.cs @@ -36,7 +36,7 @@ public void Compute() } else { - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } } } @@ -108,7 +108,7 @@ private HashSet Propagate(Cmd cmd, HashSet liveVars) liveVars.ExceptWith(stateCmd.Locals); return liveVars; } - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } } diff --git a/Source/Core/AST/Absy.cs b/Source/Core/AST/Absy.cs index 483652543..342b79b69 100644 --- a/Source/Core/AST/Absy.cs +++ b/Source/Core/AST/Absy.cs @@ -85,7 +85,7 @@ public virtual Absy Clone() { Contract.Ensures(Contract.Result() != null); Absy /*!*/ - result = cce.NonNull((Absy /*!*/) this.MemberwiseClone()); + result = Cce.NonNull((Absy /*!*/) this.MemberwiseClone()); result.UniqueId = System.Threading.Interlocked.Increment(ref CurrentAbsyNodeId); // BUGBUG?? if (InternalNumberedMetadata != null) @@ -762,7 +762,7 @@ public NamedDeclaration(IToken tok, string name) [Pure] public override string ToString() { - return cce.NonNull(Name); + return Cce.NonNull(Name); } public virtual bool MayRename => true; @@ -1128,7 +1128,7 @@ public override void Typecheck(TypecheckingContext tc) public static void ResolveTypeSynonyms(List /*!*/ synonymDecls, ResolutionContext /*!*/ rc) { - Contract.Requires(cce.NonNullElements(synonymDecls)); + Contract.Requires(Cce.NonNullElements(synonymDecls)); Contract.Requires(rc != null); // then discover all dependencies between type synonyms IDictionary /*!*/> /*!*/ @@ -1196,7 +1196,7 @@ private static void FindDependencies(Type /*!*/ type, List typeParams, } protected DeclWithFormals(DeclWithFormals that) - : base(that.tok, cce.NonNull(that.Name)) + : base(that.tok, Cce.NonNull(that.Name)) { Contract.Requires(that != null); this.TypeParameters = that.TypeParameters; - this.inParams = cce.NonNull(that.InParams); - this.outParams = cce.NonNull(that.OutParams); + this.inParams = Cce.NonNull(that.InParams); + this.outParams = Cce.NonNull(that.OutParams); } public byte[] MD5Checksum_; @@ -1938,7 +1938,7 @@ protected void EmitSignature(TokenTextWriter stream, bool shortRet) { Contract.Assert(OutParams.Count == 1); stream.Write(" : "); - cce.NonNull(OutParams[0]).TypedIdent.Type.Emit(stream); + Cce.NonNull(OutParams[0]).TypedIdent.Type.Emit(stream); } else if (OutParams.Count > 0) { @@ -2240,11 +2240,11 @@ public override void Typecheck(TypecheckingContext tc) { Contract.Assert(DefinitionBody == null); Body.Typecheck(tc); - if (!cce.NonNull(Body.Type).Unify(cce.NonNull(OutParams[0]).TypedIdent.Type)) + if (!Cce.NonNull(Body.Type).Unify(Cce.NonNull(OutParams[0]).TypedIdent.Type)) { tc.Error(Body, "function body with invalid type: {0} (expected: {1})", - Body.Type, cce.NonNull(OutParams[0]).TypedIdent.Type); + Body.Type, Cce.NonNull(OutParams[0]).TypedIdent.Type); } } else if (DefinitionBody != null) @@ -2253,11 +2253,11 @@ public override void Typecheck(TypecheckingContext tc) // We are matching the type of the function body with output param, and not the type // of DefinitionBody, which is always going to be bool (since it is of the form func_call == func_body) - if (!cce.NonNull(DefinitionBody.Args[1].Type).Unify(cce.NonNull(OutParams[0]).TypedIdent.Type)) + if (!Cce.NonNull(DefinitionBody.Args[1].Type).Unify(Cce.NonNull(OutParams[0]).TypedIdent.Type)) { tc.Error(DefinitionBody.Args[1], "function body with invalid type: {0} (expected: {1})", - DefinitionBody.Args[1].Type, cce.NonNull(OutParams[0]).TypedIdent.Type); + DefinitionBody.Args[1].Type, Cce.NonNull(OutParams[0]).TypedIdent.Type); } } } @@ -3692,7 +3692,7 @@ public static class Emitter public static void Emit(this List /*!*/ decls, TokenTextWriter stream) { Contract.Requires(stream != null); - Contract.Requires(cce.NonNullElements(decls)); + Contract.Requires(Cce.NonNullElements(decls)); bool first = true; foreach (Declaration d in decls) { @@ -4041,7 +4041,7 @@ public static RE Transform(Block b) Contract.Assume(g.labelTargets != null); if (g.labelTargets.Count == 1) { - return new Sequential(new AtomicRE(b), Transform(cce.NonNull(g.labelTargets[0]))); + return new Sequential(new AtomicRE(b), Transform(Cce.NonNull(g.labelTargets[0]))); } else { @@ -4060,7 +4060,7 @@ public static RE Transform(Block b) else { Contract.Assume(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } } } diff --git a/Source/Core/AST/AbsyCmd.cs b/Source/Core/AST/AbsyCmd.cs index 3583e68b5..e49822bbc 100644 --- a/Source/Core/AST/AbsyCmd.cs +++ b/Source/Core/AST/AbsyCmd.cs @@ -162,7 +162,7 @@ public IEnumerable /*!*/ Labels { get { - Contract.Ensures(cce.NonNullElements(Contract.Result /*!*/>())); + Contract.Ensures(Cce.NonNullElements(Contract.Result /*!*/>())); return this.labels.AsEnumerable(); } } @@ -171,14 +171,14 @@ public IEnumerable /*!*/ Labels void ObjectInvariant() { Contract.Invariant(EndCurly != null); - Contract.Invariant(cce.NonNullElements(this.bigBlocks)); - Contract.Invariant(cce.NonNullElements(this.labels)); + Contract.Invariant(Cce.NonNullElements(this.bigBlocks)); + Contract.Invariant(Cce.NonNullElements(this.labels)); } public StmtList(IList /*!*/ bigblocks, IToken endCurly) { Contract.Requires(endCurly != null); - Contract.Requires(cce.NonNullElements(bigblocks)); + Contract.Requires(Cce.NonNullElements(bigblocks)); Contract.Requires(bigblocks.Count > 0); this.bigBlocks = new List(bigblocks); this.EndCurly = endCurly; @@ -192,7 +192,7 @@ public void Emit(TokenTextWriter stream, int level) foreach (BigBlock b in BigBlocks) { Contract.Assert(b != null); - Contract.Assume(cce.IsPeerConsistent(b)); + Contract.Assume(Cce.IsPeerConsistent(b)); if (needSeperator) { stream.WriteLine(); @@ -219,7 +219,7 @@ public bool PrefixFirstBlock([Captured] List prefixCmds, ref string suggest Contract.Requires(suggestedLabel != null); Contract.Requires(prefixCmds != null); Contract.Ensures(Contract.Result() || - cce.Owner.None(prefixCmds)); // "prefixCmds" is captured only on success + Cce.Owner.None(prefixCmds)); // "prefixCmds" is captured only on success Contract.Assume(PrefixCommands == null); // prefix has not been used BigBlock bb0 = BigBlocks[0]; @@ -272,7 +272,7 @@ public class StmtListBuilder [ContractInvariantMethod] void ObjectInvariant() { - Contract.Invariant(cce.NonNullElements(bigBlocks)); + Contract.Invariant(Cce.NonNullElements(bigBlocks)); } void Dump(StructuredCmd scmd, TransferCmd tcmd) @@ -377,9 +377,9 @@ int FreshAnon() void ObjectInvariant() { Contract.Invariant(stmtList != null); - Contract.Invariant(cce.NonNullElements(blocks, true)); + Contract.Invariant(Cce.NonNullElements(blocks, true)); Contract.Invariant(prefix != null); - Contract.Invariant(cce.NonNullElements(allLabels, true)); + Contract.Invariant(Cce.NonNullElements(allLabels, true)); Contract.Invariant(errorHandler != null); } @@ -438,7 +438,7 @@ public List /*!*/ Blocks { get { - Contract.Ensures(cce.NonNullElements(Contract.Result>())); + Contract.Ensures(Cce.NonNullElements(Contract.Result>())); if (blocks == null) { blocks = new List(); @@ -539,7 +539,7 @@ void CheckLegalLabels(StmtList stmtList, StmtList parentContext, BigBlock parent if (b.tc is GotoCmd) { GotoCmd g = (GotoCmd) b.tc; - foreach (string /*!*/ lbl in cce.NonNull(g.labelNames)) + foreach (string /*!*/ lbl in Cce.NonNull(g.labelNames)) { Contract.Assert(lbl != null); /* @@ -569,7 +569,7 @@ void CheckLegalLabels(StmtList stmtList, StmtList parentContext, BigBlock parent bool found = false; for (StmtList sl = stmtList; sl.ParentBigBlock != null; sl = sl.ParentContext) { - cce.LoopInvariant(sl != null); + Cce.LoopInvariant(sl != null); BigBlock bb = sl.ParentBigBlock; if (bcmd.Label == null) @@ -1105,14 +1105,14 @@ public class WhileCmd : StructuredCmd void ObjectInvariant() { Contract.Invariant(Body != null); - Contract.Invariant(cce.NonNullElements(Invariants)); + Contract.Invariant(Cce.NonNullElements(Invariants)); } public WhileCmd(IToken tok, [Captured] Expr guard, List invariants, List yields, StmtList body) : base(tok) { - Contract.Requires(cce.NonNullElements(invariants)); + Contract.Requires(Cce.NonNullElements(invariants)); Contract.Requires(body != null); Contract.Requires(tok != null); this.Guard = guard; @@ -1416,7 +1416,7 @@ public static AssignCmd SimpleAssign(IToken tok, IdentifierExpr lhs, Expr rhs) foreach (Expr e in indexes) { - indexesList.Add(cce.NonNull(e)); + indexesList.Add(Cce.NonNull(e)); } lhss.Add(new MapAssignLhs(map.tok, @@ -1447,13 +1447,13 @@ public static AssignCmd SimpleAssign(IToken tok, IdentifierExpr lhs, Expr rhs) for (int i = 0; i < args.Length - 1; ++i) { - indexesList.Add(cce.NonNull(args[i])); + indexesList.Add(Cce.NonNull(args[i])); } lhss.Add(new MapAssignLhs(map.tok, new SimpleAssignLhs(map.tok, map), indexesList)); - rhss.Add(cce.NonNull(args[args.Length - 1])); + rhss.Add(Cce.NonNull(args[args.Length - 1])); return new AssignCmd(tok, lhss, rhss); } @@ -1554,13 +1554,13 @@ public IList Lhss { get { - Contract.Ensures(cce.NonNullElements(Contract.Result>())); + Contract.Ensures(Cce.NonNullElements(Contract.Result>())); Contract.Ensures(Contract.Result>().IsReadOnly); return this._lhss.AsReadOnly(); } set { - Contract.Requires(cce.NonNullElements(value)); + Contract.Requires(Cce.NonNullElements(value)); this._lhss = new List(value); } } @@ -1579,13 +1579,13 @@ public IList Rhss { get { - Contract.Ensures(cce.NonNullElements(Contract.Result>())); + Contract.Ensures(Cce.NonNullElements(Contract.Result>())); Contract.Ensures(Contract.Result>().IsReadOnly); return this._rhss.AsReadOnly(); } set { - Contract.Requires(cce.NonNullElements(value)); + Contract.Requires(Cce.NonNullElements(value)); this._rhss = new List(value); } } @@ -1601,16 +1601,16 @@ internal void SetRhs(int index, Expr rhs) [ContractInvariantMethod] void ObjectInvariant() { - Contract.Invariant(cce.NonNullElements(this._lhss)); - Contract.Invariant(cce.NonNullElements(this._rhss)); + Contract.Invariant(Cce.NonNullElements(this._lhss)); + Contract.Invariant(Cce.NonNullElements(this._rhss)); } public AssignCmd(IToken tok, IList lhss, IList rhss, QKeyValue kv) : base(tok) { Contract.Requires(tok != null); - Contract.Requires(cce.NonNullElements(rhss)); - Contract.Requires(cce.NonNullElements(lhss)); + Contract.Requires(Cce.NonNullElements(rhss)); + Contract.Requires(Cce.NonNullElements(lhss)); this._lhss = new List(lhss); this._rhss = new List(rhss); this.Attributes = kv; @@ -1620,8 +1620,8 @@ public AssignCmd(IToken tok, IList lhss, IList rhss) : base(tok) { Contract.Requires(tok != null); - Contract.Requires(cce.NonNullElements(rhss)); - Contract.Requires(cce.NonNullElements(lhss)); + Contract.Requires(Cce.NonNullElements(rhss)); + Contract.Requires(Cce.NonNullElements(lhss)); this._lhss = new List(lhss); this._rhss = new List(rhss); } @@ -1681,7 +1681,7 @@ public override void Resolve(ResolutionContext rc) { for (int j = i + 1; j < Lhss.Count; ++j) { - if (cce.NonNull(Lhss[i].DeepAssignedVariable).Equals( + if (Cce.NonNull(Lhss[i].DeepAssignedVariable).Equals( Lhss[j].DeepAssignedVariable)) { rc.Error(Lhss[j], @@ -1971,7 +1971,7 @@ public List /*!*/ void ObjectInvariant() { Contract.Invariant(Map != null); - Contract.Invariant(cce.NonNullElements(Indexes)); + Contract.Invariant(Cce.NonNullElements(Indexes)); } @@ -2014,7 +2014,7 @@ public MapAssignLhs(IToken tok, AssignLhs map, List /*!*/ indexes) { Contract.Requires(map != null); Contract.Requires(tok != null); - Contract.Requires(cce.NonNullElements(indexes)); + Contract.Requires(Cce.NonNullElements(indexes)); Map = map; Indexes = indexes; @@ -2049,7 +2049,7 @@ public override void Typecheck(TypecheckingContext tc) } TypeAttr = - MapSelect.Typecheck(cce.NonNull(Map.Type), Map, + MapSelect.Typecheck(Cce.NonNull(Map.Type), Map, selectArgs, out var tpInsts, tc, tok, "map assignment"); TypeParameters = tpInsts; } @@ -2638,7 +2638,7 @@ protected Variable CreateTemporaryVariable(List tempVars, Variable lik default: { Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } // unexpected kind } @@ -2968,12 +2968,12 @@ public IEnumerable Expressions { get { - Contract.Ensures(cce.NonNullElements(Contract.Result>())); + Contract.Ensures(Cce.NonNullElements(Contract.Result>())); return this.exprList.AsReadOnly(); } set { - Contract.Requires(cce.NonNullElements(value)); + Contract.Requires(Cce.NonNullElements(value)); this.exprList = new List(value); } } @@ -2983,13 +2983,13 @@ public IEnumerable Expressions void ObjectInvariant() { Contract.Invariant(this._reason != null); - Contract.Invariant(cce.NonNullElements(this.exprList)); + Contract.Invariant(Cce.NonNullElements(this.exprList)); } public EEDTemplate(string reason, List /*!*/ exprList) { Contract.Requires(reason != null); - Contract.Requires(cce.NonNullElements(exprList)); + Contract.Requires(Cce.NonNullElements(exprList)); this._reason = reason; this.exprList = exprList; } @@ -3516,7 +3516,7 @@ public GotoCmd(IToken /*!*/ tok, List /*!*/ labelSeq, List /*!*/ Debug.Assert(labelSeq.Count == blockSeq.Count); for (int i = 0; i < labelSeq.Count; i++) { - Debug.Assert(Equals(labelSeq[i], cce.NonNull(blockSeq[i]).Label)); + Debug.Assert(Equals(labelSeq[i], Cce.NonNull(blockSeq[i]).Label)); } this.labelNames = labelSeq; @@ -3532,7 +3532,7 @@ public GotoCmd(IToken /*!*/ tok, List /*!*/ blockSeq) List labelSeq = new List(); for (int i = 0; i < blockSeq.Count; i++) { - labelSeq.Add(cce.NonNull(blockSeq[i]).Label); + labelSeq.Add(Cce.NonNull(blockSeq[i]).Label); } this.labelNames = labelSeq; @@ -3552,7 +3552,7 @@ public void AddTarget(Block b) public void AddTargets(IEnumerable blocks) { Contract.Requires(blocks != null); - Contract.Requires(cce.NonNullElements(blocks)); + Contract.Requires(Cce.NonNullElements(blocks)); Contract.Requires(this.labelTargets != null); Contract.Requires(this.labelNames != null); foreach (var block in blocks) diff --git a/Source/Core/AST/AbsyQuant.cs b/Source/Core/AST/AbsyQuant.cs index 301a3bf70..ab2e0083e 100644 --- a/Source/Core/AST/AbsyQuant.cs +++ b/Source/Core/AST/AbsyQuant.cs @@ -346,7 +346,7 @@ public void AddParam(object p) public void AddParams(IEnumerable ps) { - Contract.Requires(cce.NonNullElements(ps)); + Contract.Requires(Cce.NonNullElements(ps)); this._params.AddRange(ps); } @@ -359,7 +359,7 @@ public IList Params { get { - Contract.Ensures(cce.NonNullElements(Contract.Result>())); + Contract.Ensures(Cce.NonNullElements(Contract.Result>())); Contract.Ensures(Contract.Result>().IsReadOnly); return this._params.AsReadOnly(); } @@ -371,7 +371,7 @@ public IList Params void ObjectInvariant() { Contract.Invariant(Key != null); - Contract.Invariant(cce.NonNullElements(this._params)); + Contract.Invariant(Cce.NonNullElements(this._params)); } public QKeyValue(IToken tok, string key, IList /*!*/ parameters, QKeyValue next) @@ -379,7 +379,7 @@ public QKeyValue(IToken tok, string key, IList /*!*/ parameters, Q { Contract.Requires(key != null); Contract.Requires(tok != null); - Contract.Requires(cce.NonNullElements(parameters)); + Contract.Requires(Cce.NonNullElements(parameters)); Key = key; this._params = new List(parameters); Next = next; @@ -965,7 +965,7 @@ public override Expr VisitNAryExpr(NAryExpr node) //Contract.Requires(node != null); Contract.Ensures(Contract.Result() != null); FunctionCall fn = node.Fun as FunctionCall; - if (fn != null && cce.NonNull(fn.Func).NeverTrigger) + if (fn != null && Cce.NonNull(fn.Func).NeverTrigger) { parent.Triggers = new Trigger(fn.Func.tok, false, new List {node}, parent.Triggers); } diff --git a/Source/Core/AST/AbsyType.cs b/Source/Core/AST/AbsyType.cs index 335fb48ff..8839fe0c9 100644 --- a/Source/Core/AST/AbsyType.cs +++ b/Source/Core/AST/AbsyType.cs @@ -116,7 +116,7 @@ public abstract bool Unify(Type /*!*/ that, [Pure] public static bool IsIdempotent(IDictionary /*!*/ unifier) { - Contract.Requires(cce.NonNullDictionaryAndValues(unifier)); + Contract.Requires(Cce.NonNullDictionaryAndValues(unifier)); return unifier.Values.All(val => val.FreeVariables.All(var => !unifier.ContainsKey(var))); } @@ -248,7 +248,7 @@ public virtual TypeVariable /*!*/ AsVariable { Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } // Type.AsVariable should never be called } } @@ -266,7 +266,7 @@ public virtual CtorType /*!*/ AsCtor { Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } // Type.AsCtor should never be called } } @@ -284,7 +284,7 @@ public virtual MapType /*!*/ AsMap { Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } // Type.AsMap should never be called } } @@ -295,7 +295,7 @@ public virtual int MapArity { { Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } // Type.MapArity should never be called } } @@ -313,7 +313,7 @@ public virtual UnresolvedTypeIdentifier /*!*/ AsUnresolved { Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } // Type.AsUnresolved should never be called } } @@ -329,7 +329,7 @@ public virtual int FloatExponent { { Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } // Type.FloatExponent should never be called } } @@ -340,7 +340,7 @@ public virtual int FloatSignificand { { Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } // Type.FloatSignificand should never be called } } @@ -356,7 +356,7 @@ public virtual int BvBits { { Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } // Type.BvBits should never be called } } @@ -436,9 +436,9 @@ static public FloatType GetFloatType(int sig, int exp) Contract.Requires(tc != null); Contract.Requires(formalArgs.Count == actualArgs.Count); Contract.Requires((formalOuts == null) == (actualOuts == null)); - Contract.Requires(formalOuts == null || formalOuts.Count == cce.NonNull(actualOuts).Count); + Contract.Requires(formalOuts == null || formalOuts.Count == Cce.NonNull(actualOuts).Count); Contract.Requires(tc == null || opName != null); //Redundant - Contract.Ensures(cce.NonNullDictionaryAndValues(Contract.Result>())); + Contract.Ensures(Cce.NonNullDictionaryAndValues(Contract.Result>())); // requires "actualArgs" and "actualOuts" to have been type checked @@ -453,7 +453,7 @@ static public FloatType GetFloatType(int sig, int exp) for (int i = 0; i < formalArgs.Count; i++) { Type formal = formalArgs[i].Substitute(subst); - Type actual = cce.NonNull(cce.NonNull(actualArgs[i]).Type); + Type actual = Cce.NonNull(Cce.NonNull(actualArgs[i]).Type); // if the type variables to be matched occur in the actual // argument types, something has gone very wrong Contract.Assert( @@ -463,7 +463,7 @@ static public FloatType GetFloatType(int sig, int exp) { Contract.Assume(tc != null); // caller expected no errors Contract.Assert(opName != null); // follows from precondition - tc.Error(cce.NonNull(actualArgs[i]), + tc.Error(Cce.NonNull(actualArgs[i]), "invalid type for argument {0} in {1}: {2} (expected: {3})", i, opName, actual, formalArgs[i]); } @@ -474,7 +474,7 @@ static public FloatType GetFloatType(int sig, int exp) for (int i = 0; i < formalOuts.Count; ++i) { Type formal = formalOuts[i].Substitute(subst); - Type actual = cce.NonNull(cce.NonNull(actualOuts)[i].Type); + Type actual = Cce.NonNull(Cce.NonNull(actualOuts)[i].Type); // if the type variables to be matched occur in the actual // argument types, something has gone very wrong Contract.Assert(Contract.ForAll(0, typeParams.Count, var => !actual.FreeVariables.Contains(typeParams[var]))); @@ -515,7 +515,7 @@ public static List CheckArgumentTypes(List /*!*/ typeParams, Contract.Requires(actualIns != null); Contract.Requires(typeCheckingSubject != null); Contract.Requires(opName != null); - Contract.Ensures(cce.NonNullElements(Contract.ValueAtReturn(out actualTypeParams))); + Contract.Ensures(Cce.NonNullElements(Contract.ValueAtReturn(out actualTypeParams))); actualTypeParams = new List(); if (formalIns.Count != actualIns.Count) @@ -540,7 +540,7 @@ public static List CheckArgumentTypes(List /*!*/ typeParams, IDictionary subst = MatchArgumentTypes(typeParams, formalIns, actualIns, actualOuts != null ? formalOuts : null, actualOuts, opName, tc); - Contract.Assert(cce.NonNullDictionaryAndValues(subst)); + Contract.Assert(Cce.NonNullDictionaryAndValues(subst)); foreach (TypeVariable /*!*/ var in typeParams) { Contract.Assert(var != null); @@ -596,7 +596,7 @@ public static List CheckArgumentTypes(List /*!*/ typeParams, IDictionary /*!*/ subst = InferTypeParameters(typeParams, formalArgs, actualArgs); - Contract.Assert(cce.NonNullDictionaryAndValues(subst)); + Contract.Assert(Cce.NonNullDictionaryAndValues(subst)); Type /*!*/ res = formalResult.Substitute(subst); @@ -622,7 +622,7 @@ public static List CheckArgumentTypes(List /*!*/ typeParams, Contract.Requires(formalArgs != null); Contract.Requires(actualArgs != null); Contract.Requires(formalArgs.Count == actualArgs.Count); - Contract.Ensures(cce.NonNullDictionaryAndValues(Contract.Result>())); + Contract.Ensures(Cce.NonNullDictionaryAndValues(Contract.Result>())); List proxies = new List(); @@ -779,7 +779,7 @@ public override List FreeProxies { get { - Contract.Ensures(cce.NonNullElements(Contract.Result>())); + Contract.Ensures(Cce.NonNullElements(Contract.Result>())); throw new NotImplementedException(); } } @@ -795,7 +795,7 @@ public override List FreeVariables public override Type Clone(IDictionary varMap) { - Contract.Requires(cce.NonNullDictionaryAndValues(varMap)); + Contract.Requires(Cce.NonNullDictionaryAndValues(varMap)); Contract.Ensures(Contract.Result() != null); throw new NotImplementedException(); @@ -827,7 +827,7 @@ public override bool Unify(Type that, List unifiableVariables, { Contract.Requires(that != null); Contract.Requires(unifiableVariables != null); - Contract.Requires(cce.NonNullDictionaryAndValues(unifier)); + Contract.Requires(Cce.NonNullDictionaryAndValues(unifier)); Contract.Requires(Contract.ForAll(unifier.Keys, key => unifiableVariables.Contains(key))); Contract.Requires(IsIdempotent(unifier)); throw new NotImplementedException(); @@ -835,7 +835,7 @@ public override bool Unify(Type that, List unifiableVariables, public override Type Substitute(IDictionary subst) { - Contract.Requires(cce.NonNullDictionaryAndValues(subst)); + Contract.Requires(Cce.NonNullDictionaryAndValues(subst)); Contract.Ensures(Contract.Result() != null); throw new NotImplementedException(); @@ -926,7 +926,7 @@ public override string ToString() Debug.Assert(false, "bad type " + T); { Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } // make compiler happy } @@ -1027,7 +1027,7 @@ public override List /*!*/ FreeProxies { get { - Contract.Ensures(cce.NonNullElements(Contract.Result>())); + Contract.Ensures(Cce.NonNullElements(Contract.Result>())); return new List(); } } @@ -1210,7 +1210,7 @@ public override List /*!*/ FreeProxies { get { - Contract.Ensures(cce.NonNullElements(Contract.Result>())); + Contract.Ensures(Cce.NonNullElements(Contract.Result>())); return new List(); } } @@ -1374,7 +1374,7 @@ public override List /*!*/ FreeProxies { get { - Contract.Ensures(cce.NonNullElements(Contract.Result>())); + Contract.Ensures(Cce.NonNullElements(Contract.Result>())); return new List(); } } @@ -1496,7 +1496,7 @@ public override bool Unify(Type that, //Contract.Requires(that != null); { Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } // UnresolvedTypeIdentifier.Unify should never be called } @@ -1508,7 +1508,7 @@ public override Type Substitute(IDictionary /*!* Contract.Ensures(Contract.Result() != null); { Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } // UnresolvedTypeIdentifier.Substitute should never be called } @@ -1520,7 +1520,7 @@ public override int GetHashCode(List boundVariables) //Contract.Requires(boundVariables != null); { Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } // UnresolvedTypeIdentifier.GetHashCode should never be called } @@ -1711,7 +1711,7 @@ public override List /*!*/ FreeProxies { get { - Contract.Ensures(cce.NonNullElements(Contract.Result>())); + Contract.Ensures(Cce.NonNullElements(Contract.Result>())); return new List(); } } @@ -1877,7 +1877,7 @@ private bool addSubstitution(IDictionary /*!*/ o // the type that "this" is instantiated with Type /*!*/ newSubst) { - Contract.Requires(cce.NonNullDictionaryAndValues(oldSolution)); + Contract.Requires(Cce.NonNullDictionaryAndValues(oldSolution)); Contract.Requires(newSubst != null); Contract.Requires(!oldSolution.ContainsKey(this)); @@ -1976,7 +1976,7 @@ public override List /*!*/ FreeProxies { get { - Contract.Ensures(cce.NonNullElements(Contract.Result>())); + Contract.Ensures(Cce.NonNullElements(Contract.Result>())); return new List(); } } @@ -2266,7 +2266,7 @@ public override List /*!*/ FreeProxies { get { - Contract.Ensures(cce.NonNullElements(Contract.Result>())); + Contract.Ensures(Cce.NonNullElements(Contract.Result>())); Type p = ProxyFor; if (p != null) { @@ -2542,7 +2542,7 @@ public class BvTypeProxy : ConstrainedProxy [ContractInvariantMethod] void ObjectInvariant() { - Contract.Invariant(cce.NonNullElements(constraints, true)); + Contract.Invariant(Cce.NonNullElements(constraints, true)); } class BvTypeConstraint @@ -2605,7 +2605,7 @@ private BvTypeProxy(BvTypeProxy p, int minBits) private BvTypeProxy(IToken token, string name, int minBits, List constraints) : base(token, name, "") { - Contract.Requires(cce.NonNullElements(constraints, true)); + Contract.Requires(Cce.NonNullElements(constraints, true)); Contract.Requires(name != null); Contract.Requires(token != null); this.MinBits = minBits; @@ -2893,7 +2893,7 @@ public Constraint(List arguments, Type result) public Constraint Clone(IDictionary /*!*/ varMap) { - Contract.Requires(cce.NonNullDictionaryAndValues(varMap)); + Contract.Requires(Cce.NonNullDictionaryAndValues(varMap)); List /*!*/ args = new List(); foreach (Type /*!*/ t in Arguments) @@ -2913,7 +2913,7 @@ public bool Unify(MapType that, IDictionary /*!*/ result) { Contract.Requires(unifiableVariables != null); - Contract.Requires(cce.NonNullDictionaryAndValues(result)); + Contract.Requires(Cce.NonNullDictionaryAndValues(result)); Contract.Requires(that != null); Contract.Requires(Arguments.Count == that.Arguments.Count); Dictionary /*!*/ @@ -3200,7 +3200,7 @@ public override MapType /*!*/ AsMap { { Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } // what to do now? } } @@ -3428,7 +3428,7 @@ public override List /*!*/ FreeProxies { get { - Contract.Ensures(cce.NonNullElements(Contract.Result>())); + Contract.Ensures(Cce.NonNullElements(Contract.Result>())); return ExpandedType.FreeProxies; } } @@ -3926,7 +3926,7 @@ public override Type Clone(IDictionary / new Dictionary(); foreach (KeyValuePair p in varMap) { - Contract.Assert(cce.NonNullElements(p)); + Contract.Assert(Cce.NonNullElements(p)); if (!TypeParameters.Contains(p.Key)) { newVarMap.Add(p); @@ -4109,7 +4109,7 @@ public override bool Unify(Type /*!*/ that, // ... and in the resulting unifier of type variables foreach (KeyValuePair pair in result) { - Contract.Assert(cce.NonNullElements(pair)); + Contract.Assert(Cce.NonNullElements(pair)); freeVars = pair.Value.FreeVariables; foreach (TypeVariable fr in freshies) { @@ -4129,7 +4129,7 @@ public override bool Unify(Type /*!*/ that, [Pure] private bool collisionsPossible(IDictionary /*!*/ subst) { - Contract.Requires(cce.NonNullDictionaryAndValues(subst)); + Contract.Requires(Cce.NonNullDictionaryAndValues(subst)); // PR: could be written more efficiently return TypeParameters.Any(param => subst.ContainsKey(param) || subst.Values.Any(val => val.FreeVariables.Contains(param))); @@ -4403,7 +4403,7 @@ public List FormalTypeParams { get { - Contract.Ensures(cce.NonNullElements(Contract.Result>())); + Contract.Ensures(Cce.NonNullElements(Contract.Result>())); throw new NotImplementedException(); } } @@ -4431,7 +4431,7 @@ private readonly List /*!*/ [ContractInvariantMethod] void TypeParamsInvariantMethod() { - Contract.Invariant(cce.NonNullElements(TypeParams)); + Contract.Invariant(Cce.NonNullElements(TypeParams)); } private readonly IDictionary /*!*/ @@ -4440,14 +4440,14 @@ void TypeParamsInvariantMethod() [ContractInvariantMethod] void InstantiationsInvariantMethod() { - Contract.Invariant(cce.NonNullDictionaryAndValues(Instantiations)); + Contract.Invariant(Cce.NonNullDictionaryAndValues(Instantiations)); } public SimpleTypeParamInstantiation(List /*!*/ typeParams, IDictionary /*!*/ instantiations) { - Contract.Requires(cce.NonNullElements(typeParams)); - Contract.Requires(cce.NonNullDictionaryAndValues(instantiations)); + Contract.Requires(Cce.NonNullElements(typeParams)); + Contract.Requires(Cce.NonNullDictionaryAndValues(instantiations)); this.TypeParams = typeParams; this.Instantiations = instantiations; } @@ -4455,7 +4455,7 @@ public SimpleTypeParamInstantiation(List /*!*/ typeParams, public static TypeParamInstantiation /*!*/ From(List typeParams, List /*!*/ actualTypeParams) { - Contract.Requires(cce.NonNullElements(actualTypeParams)); + Contract.Requires(Cce.NonNullElements(actualTypeParams)); Contract.Requires(typeParams != null); Contract.Requires(typeParams.Count == actualTypeParams.Count); Contract.Ensures(Contract.Result() != null); @@ -4487,7 +4487,7 @@ public List /*!*/ FormalTypeParams { get { - Contract.Ensures(cce.NonNullElements(Contract.Result>())); + Contract.Ensures(Cce.NonNullElements(Contract.Result>())); return TypeParams; } } @@ -4523,7 +4523,7 @@ void ObjectInvariant() { Contract.Invariant(Proxy != null); Contract.Invariant(ArgumentsResult != null); - Contract.Invariant(Instantiations == null || cce.NonNullDictionaryAndValues(Instantiations)); + Contract.Invariant(Instantiations == null || Cce.NonNullDictionaryAndValues(Instantiations)); } diff --git a/Source/Core/AST/Block.cs b/Source/Core/AST/Block.cs index 3e4aa3277..d15d399aa 100644 --- a/Source/Core/AST/Block.cs +++ b/Source/Core/AST/Block.cs @@ -43,7 +43,7 @@ public IEnumerable Exits() { if (TransferCmd is GotoCmd g) { - return cce.NonNull(g.labelTargets); + return Cce.NonNull(g.labelTargets); } return new List(); } @@ -85,7 +85,7 @@ public IEnumerable liveVarsBefore { get { - Contract.Ensures(cce.NonNullElements(Contract.Result>(), true)); + Contract.Ensures(Cce.NonNullElements(Contract.Result>(), true)); if (this._liveVarsBefore == null) { return null; @@ -97,7 +97,7 @@ public IEnumerable liveVarsBefore } set { - Contract.Requires(cce.NonNullElements(value, true)); + Contract.Requires(Cce.NonNullElements(value, true)); if (value == null) { this._liveVarsBefore = null; @@ -114,7 +114,7 @@ void ObjectInvariant() { Contract.Invariant(this.label != null); Contract.Invariant(this.cmds != null); - Contract.Invariant(cce.NonNullElements(this._liveVarsBefore, true)); + Contract.Invariant(Cce.NonNullElements(this._liveVarsBefore, true)); } public bool IsLive(Variable v) diff --git a/Source/Core/AST/CallCmd.cs b/Source/Core/AST/CallCmd.cs index 12646a965..ca266862e 100644 --- a/Source/Core/AST/CallCmd.cs +++ b/Source/Core/AST/CallCmd.cs @@ -662,7 +662,7 @@ public override void Typecheck(TypecheckingContext tc) { if (Ins[i] != null) { - formalInTypes.Add(cce.NonNull(Proc.InParams[i]).TypedIdent.Type); + formalInTypes.Add(Cce.NonNull(Proc.InParams[i]).TypedIdent.Type); actualIns.Add(Ins[i]); } } @@ -671,7 +671,7 @@ public override void Typecheck(TypecheckingContext tc) { if (Outs[i] != null) { - formalOutTypes.Add(cce.NonNull(Proc.OutParams[i]).TypedIdent.Type); + formalOutTypes.Add(Cce.NonNull(Proc.OutParams[i]).TypedIdent.Type); actualOuts.Add(Outs[i]); } } @@ -684,7 +684,7 @@ public override void Typecheck(TypecheckingContext tc) this.tok, "call to " + callee, tc); - Contract.Assert(cce.NonNullElements(actualTypeParams)); + Contract.Assert(Cce.NonNullElements(actualTypeParams)); TypeParameters = SimpleTypeParamInstantiation.From(Proc.TypeParameters, actualTypeParams); @@ -728,7 +728,7 @@ private LayerRange FormalLayerRange(YieldProcedureDecl callerDecl, Variable call private IDictionary /*!*/ TypeParamSubstitution() { - Contract.Ensures(cce.NonNullDictionaryAndValues(Contract.Result>())); + Contract.Ensures(Cce.NonNullDictionaryAndValues(Contract.Result>())); Contract.Assume(TypeParameters != null); IDictionary /*!*/ res = new Dictionary(); @@ -780,7 +780,7 @@ protected override Cmd ComputeDesugaring(PrintOptions options) for (int i = 0; i < this.Proc.InParams.Count; ++i) { Variable /*!*/ - param = cce.NonNull(this.Proc.InParams[i]); + param = Cce.NonNull(this.Proc.InParams[i]); bool isWildcard = this.Ins[i] == null; Type /*!*/ @@ -793,7 +793,7 @@ protected override Cmd ComputeDesugaring(PrintOptions options) { // during type checking, we have ensured that the type of the actual // parameter Ins[i] is correct, so we can use it here - actualType = cce.NonNull(cce.NonNull(Ins[i]).Type); + actualType = Cce.NonNull(Cce.NonNull(Ins[i]).Type); } Variable cin = CreateTemporaryVariable(tempVars, param, actualType, @@ -821,11 +821,11 @@ protected override Cmd ComputeDesugaring(PrintOptions options) for (int i = 0, n = this.Ins.Count; i < n; i++) { IdentifierExpr /*!*/ - cin_exp = new IdentifierExpr(cce.NonNull(cins[i]).tok, cce.NonNull(cins[i])); + cin_exp = new IdentifierExpr(Cce.NonNull(cins[i]).tok, Cce.NonNull(cins[i])); Contract.Assert(cin_exp != null); if (this.Ins[i] != null) { - AssignCmd assign = Cmd.SimpleAssign(Token.NoToken, cin_exp, cce.NonNull(this.Ins[i])); + AssignCmd assign = Cmd.SimpleAssign(Token.NoToken, cin_exp, Cce.NonNull(this.Ins[i])); newBlockBody.Add(assign); } else @@ -848,7 +848,7 @@ protected override Cmd ComputeDesugaring(PrintOptions options) for (int i = 0; i < this.Proc.Requires.Count; i++) { Requires /*!*/ - req = cce.NonNull(this.Proc.Requires[i]); + req = Cce.NonNull(this.Proc.Requires[i]); if (!req.Free && !IsFree) { if (hasWildcard) @@ -866,7 +866,7 @@ protected override Cmd ComputeDesugaring(PrintOptions options) else { Requires /*!*/ - reqCopy = (Requires /*!*/) cce.NonNull(req.Clone()); + reqCopy = (Requires /*!*/) Cce.NonNull(req.Clone()); reqCopy.Condition = Substituter.Apply(s, req.Condition); AssertCmd /*!*/ a = new AssertRequiresCmd(this, reqCopy); @@ -875,7 +875,7 @@ protected override Cmd ComputeDesugaring(PrintOptions options) if (Attributes != null) { // Inherit attributes of call. - var attrCopy = (QKeyValue) cce.NonNull(Attributes.Clone()); + var attrCopy = (QKeyValue) Cce.NonNull(Attributes.Clone()); attrCopy = Substituter.Apply(s, attrCopy); a.Attributes = attrCopy; } @@ -923,7 +923,7 @@ protected override Cmd ComputeDesugaring(PrintOptions options) if (Attributes != null) { // Inherit attributes of call. - var attrCopy = (QKeyValue) cce.NonNull(Attributes.Clone()); + var attrCopy = (QKeyValue) Cce.NonNull(Attributes.Clone()); attrCopy = Substituter.Apply(s, attrCopy); a.Attributes = attrCopy; } @@ -942,11 +942,11 @@ protected override Cmd ComputeDesugaring(PrintOptions options) for (int i = 0; i < this.Proc.Requires.Count; i++) { Requires /*!*/ - req = cce.NonNull(this.Proc.Requires[i]); + req = Cce.NonNull(this.Proc.Requires[i]); if (!req.Free) { Requires /*!*/ - reqCopy = (Requires /*!*/) cce.NonNull(req.Clone()); + reqCopy = (Requires /*!*/) Cce.NonNull(req.Clone()); reqCopy.Condition = Substituter.Apply(s, req.Condition); AssumeCmd /*!*/ a = new AssumeCmd(tok, reqCopy.Condition); @@ -989,7 +989,7 @@ protected override Cmd ComputeDesugaring(PrintOptions options) for (int i = 0; i < this.Proc.OutParams.Count; ++i) { Variable /*!*/ - param = cce.NonNull(this.Proc.OutParams[i]); + param = Cce.NonNull(this.Proc.OutParams[i]); bool isWildcard = this.Outs[i] == null; Type /*!*/ @@ -1002,7 +1002,7 @@ protected override Cmd ComputeDesugaring(PrintOptions options) { // during type checking, we have ensured that the type of the actual // out parameter Outs[i] is correct, so we can use it here - actualType = cce.NonNull(cce.NonNull(Outs[i]).Type); + actualType = Cce.NonNull(Cce.NonNull(Outs[i]).Type); } Variable cout = CreateTemporaryVariable(tempVars, param, actualType, @@ -1024,7 +1024,7 @@ protected override Cmd ComputeDesugaring(PrintOptions options) Expr w = param.TypedIdent.WhereExpr; if (w != null) { - IdentifierExpr ie = (IdentifierExpr /*!*/) cce.NonNull(substMap[param]); + IdentifierExpr ie = (IdentifierExpr /*!*/) Cce.NonNull(substMap[param]); Contract.Assert(ie.Decl != null); ie.Decl.TypedIdent.WhereExpr = Substituter.Apply(Substituter.SubstitutionFromDictionary(substMap), w); } @@ -1082,11 +1082,11 @@ protected override Cmd ComputeDesugaring(PrintOptions options) if (this.Outs[i] != null) { Variable /*!*/ - param_i = cce.NonNull(this.Proc.OutParams[i]); + param_i = Cce.NonNull(this.Proc.OutParams[i]); Expr /*!*/ - cout_exp = new IdentifierExpr(cce.NonNull(couts[i]).tok, cce.NonNull(couts[i])); + cout_exp = new IdentifierExpr(Cce.NonNull(couts[i]).tok, Cce.NonNull(couts[i])); Contract.Assert(cout_exp != null); - AssignCmd assign = Cmd.SimpleAssign(param_i.tok, cce.NonNull(this.Outs[i]), cout_exp); + AssignCmd assign = Cmd.SimpleAssign(param_i.tok, Cce.NonNull(this.Outs[i]), cout_exp); if (callId is not null) { Attributes = new QKeyValue(param_i.tok, "id", new List(){ $"{callId}$out{i}" }, Attributes); } diff --git a/Source/Core/AST/Expression/AbsyExpr.cs b/Source/Core/AST/Expression/AbsyExpr.cs index 06305894f..233f221b4 100644 --- a/Source/Core/AST/Expression/AbsyExpr.cs +++ b/Source/Core/AST/Expression/AbsyExpr.cs @@ -135,7 +135,7 @@ public override void Typecheck(TypecheckingContext tc) // The reason for mentioning the method here at all is to give TypeCheck a postcondition for all expressions. { Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } } @@ -289,14 +289,14 @@ public static Expr Not(Expr e1) UnaryOperator op = (UnaryOperator) nary.Fun; if (op.Op == UnaryOperator.Opcode.Not) { - return cce.NonNull(nary.Args[0]); + return Cce.NonNull(nary.Args[0]); } } else if (nary.Fun is BinaryOperator) { BinaryOperator op = (BinaryOperator) nary.Fun; - Expr arg0 = cce.NonNull(nary.Args[0]); - Expr arg1 = cce.NonNull(nary.Args[1]); + Expr arg0 = Cce.NonNull(nary.Args[0]); + Expr arg1 = Cce.NonNull(nary.Args[1]); if (op.Op == BinaryOperator.Opcode.Eq) { return Neq(arg0, arg1); @@ -508,7 +508,7 @@ public static NAryExpr Select(Expr map, params Expr[] args) public static NAryExpr Select(Expr map, List /*!*/ args) { Contract.Requires(map != null); - Contract.Requires(cce.NonNullElements(args)); + Contract.Requires(Cce.NonNullElements(args)); Contract.Ensures(Contract.Result() != null); return Select(map, args.ToArray()); } @@ -545,7 +545,7 @@ public static NAryExpr Store(Expr map, List /*!*/ indexes, Expr rhs) { Contract.Requires(rhs != null); Contract.Requires(map != null); - Contract.Requires(cce.NonNullElements(indexes)); + Contract.Requires(Cce.NonNullElements(indexes)); Contract.Ensures(Contract.Result() != null); Expr[] /*!*/ allArgs = new Expr[indexes.Count + 1]; @@ -886,11 +886,11 @@ public override void Emit(TokenTextWriter stream, int contextBindingStrength, bo } else if (Type.IsString) { - stream.Write("\"" + cce.NonNull(this.Val.ToString()) + "\""); + stream.Write("\"" + Cce.NonNull(this.Val.ToString()) + "\""); } else { - stream.Write(cce.NonNull(this.Val.ToString())); + stream.Write(Cce.NonNull(this.Val.ToString())); } } @@ -951,7 +951,7 @@ public override Type /*!*/ ShallowType { { Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } // like, where did this value come from?! } } @@ -983,7 +983,7 @@ public BigNum asBigNum get { Contract.Assert(isBigNum); - return (BigNum) cce.NonNull(Val); + return (BigNum) Cce.NonNull(Val); } } @@ -1002,7 +1002,7 @@ public BigDec asBigDec get { Contract.Assert(isBigDec); - return (BigDec) cce.NonNull(Val); + return (BigDec) Cce.NonNull(Val); } } @@ -1011,7 +1011,7 @@ public BigFloat asBigFloat get { Contract.Assert(isBigFloat); - return (BigFloat) cce.NonNull(Val); + return (BigFloat) Cce.NonNull(Val); } } @@ -1025,7 +1025,7 @@ public bool asBool get { Contract.Assert(isBool); - return (bool) cce.NonNull(Val); + return (bool) Cce.NonNull(Val); } } @@ -1039,7 +1039,7 @@ public BvConst asBvConst get { Contract.Assert(isBvConst); - return (BvConst) cce.NonNull(Val); + return (BvConst) Cce.NonNull(Val); } } @@ -1053,7 +1053,7 @@ public RoundingMode asRoundingMode get { Contract.Assert(isRoundingMode); - return (RoundingMode) cce.NonNull(Val); + return (RoundingMode) Cce.NonNull(Val); } } @@ -1067,7 +1067,7 @@ public String asString get { Contract.Assert(isString); - return (String) cce.NonNull(Val); + return (String) Cce.NonNull(Val); } } @@ -1104,7 +1104,7 @@ public string ToReadableString() Contract.Ensures(Contract.Result() != null); if (Value > BigNum.FromInt(10000)) { - string val = cce.NonNull(Value.ToString("x")); + string val = Cce.NonNull(Value.ToString("x")); int pos = val.Length % 4; string res = "0x" + val.Substring(0, pos); Contract.Assert(res != null); @@ -1233,7 +1233,7 @@ public IdentifierExpr(IToken /*!*/ tok, Variable /*!*/ d, bool immutable = false { Contract.Requires(tok != null); Contract.Requires(d != null); - _Name = cce.NonNull(d.Name); + _Name = Cce.NonNull(d.Name); _Decl = d; Type = d.TypedIdent.Type; if (immutable) @@ -1340,7 +1340,7 @@ public override void Typecheck(TypecheckingContext tc) Name, Type, Decl.TypedIdent.Type); { Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } } @@ -1443,7 +1443,7 @@ public IdentifierExpr /*!*/ IdentifierExpr } private static IList /*!*/ - emptyArgs = ArrayList.ReadOnly(cce.NonNull((IList /*!*/) new ArrayList())); + emptyArgs = ArrayList.ReadOnly(Cce.NonNull((IList /*!*/) new ArrayList())); public IList /*!*/ Arguments { @@ -1917,7 +1917,7 @@ public void Emit(IList args, TokenTextWriter stream, int contextBindingStr } stream.Write(FunctionName); - cce.NonNull(args[0]).Emit(stream, opBindingStrength, false); + Cce.NonNull(args[0]).Emit(stream, opBindingStrength, false); if (parensNeeded) { stream.Write(")"); @@ -1948,7 +1948,7 @@ public Type Typecheck(IList args, out TypeParamInstantiation tpInstantiati Contract.Assume(args.Count == 1); tpInstantiation = SimpleTypeParamInstantiation.EMPTY; - Type arg0type = cce.NonNull(cce.NonNull(args[0]).Type); + Type arg0type = Cce.NonNull(Cce.NonNull(args[0]).Type); switch (this.op) { case Opcode.Neg: @@ -1978,7 +1978,7 @@ public Type Typecheck(IList args, out TypeParamInstantiation tpInstantiati System.Diagnostics.Debug.Fail("unknown unary operator: " + op.ToString()); { Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } BAD_TYPE: tc.Error(this.tok, "invalid argument type ({1}) to unary operator {0}", @@ -1993,13 +1993,13 @@ public Type ShallowType(IList args) switch (this.op) { case Opcode.Neg: - return cce.NonNull(cce.NonNull(args[0]).Type); + return Cce.NonNull(Cce.NonNull(args[0]).Type); case Opcode.Not: return Type.Bool; default: { Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } // unexpected unary operator } } @@ -2249,10 +2249,10 @@ public void Emit(IList args, TokenTextWriter stream, int contextBindingStr stream.Write("("); } - cce.NonNull(args[0]).Emit(stream, opBindingStrength, fragileLeftContext); + Cce.NonNull(args[0]).Emit(stream, opBindingStrength, fragileLeftContext); stream.sep(); stream.Write(" {0} ", FunctionName); - cce.NonNull(args[1]).Emit(stream, opBindingStrength, fragileRightContext); + Cce.NonNull(args[1]).Emit(stream, opBindingStrength, fragileRightContext); if (parensNeeded) { stream.Write(")"); @@ -2319,10 +2319,10 @@ public Type Typecheck(IList args, out TypeParamInstantiation tpInstantiati // the default; the only binary operator with a type parameter is equality, but right // we don't store this parameter because it does not appear necessary tpInstantiation = SimpleTypeParamInstantiation.EMPTY; - Expr arg0 = cce.NonNull(args[0]); - Expr arg1 = cce.NonNull(args[1]); - Type arg0type = cce.NonNull(arg0.Type); - Type arg1type = cce.NonNull(arg1.Type); + Expr arg0 = Cce.NonNull(args[0]); + Expr arg1 = Cce.NonNull(args[1]); + Type arg0type = Cce.NonNull(arg0.Type); + Type arg1type = Cce.NonNull(arg1.Type); switch (this.op) { case Opcode.Add: @@ -2443,7 +2443,7 @@ public Type Typecheck(IList args, out TypeParamInstantiation tpInstantiati System.Diagnostics.Debug.Fail("unknown binary operator: " + op.ToString()); { Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } BAD_TYPE: tc.Error(this.tok, "invalid argument types ({1} and {2}) to binary operator {0}", this.FunctionName, arg0type, @@ -2460,7 +2460,7 @@ public Type ShallowType(IList args) case Opcode.Add: case Opcode.Sub: case Opcode.Mul: - return cce.NonNull(args[0]).ShallowType; + return Cce.NonNull(args[0]).ShallowType; case Opcode.Div: case Opcode.Mod: @@ -2485,7 +2485,7 @@ public Type ShallowType(IList args) default: { Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } // unexpected binary operator } } @@ -2500,8 +2500,8 @@ public void ResolveOverloading(NAryExpr expr) return; } - Expr arg0 = cce.NonNull(expr.Args[0]); - Expr arg1 = cce.NonNull(expr.Args[1]); + Expr arg0 = Cce.NonNull(expr.Args[0]); + Expr arg1 = Cce.NonNull(expr.Args[1]); switch (op) { case Opcode.Eq: @@ -2795,7 +2795,7 @@ public void Emit(IList /*!*/ args, TokenTextWriter /*!*/ stream, stream.Write("("); } - cce.NonNull(args[0]).Emit(stream, opBindingStrength, false); + Cce.NonNull(args[0]).Emit(stream, opBindingStrength, false); stream.Write("{0} ", FunctionName); Type.Emit(stream, 0); @@ -2830,10 +2830,10 @@ public Type Typecheck(IList /*!*/ args, Contract.Assume(args.Count == 1); tpInstantiation = SimpleTypeParamInstantiation.EMPTY; - if (!this.Type.Unify(cce.NonNull(cce.NonNull(args[0]).Type))) + if (!this.Type.Unify(Cce.NonNull(Cce.NonNull(args[0]).Type))) { tc.Error(this.tok, "{0} cannot be coerced to {1}", - cce.NonNull(args[0]).Type, this.Type); + Cce.NonNull(args[0]).Type, this.Type); } return this.Type; @@ -2953,9 +2953,9 @@ public virtual Type Typecheck(IList args, out TypeParamInstantiation tpIns tpInstantiation = SimpleTypeParamInstantiation.EMPTY; - if (!cce.NonNull(cce.NonNull(args[0]).Type).Unify(argType)) + if (!Cce.NonNull(Cce.NonNull(args[0]).Type).Unify(argType)) { - tc.Error(this.tok, "argument type {0} does not match expected type {1}", cce.NonNull(args[0]).Type, + tc.Error(this.tok, "argument type {0} does not match expected type {1}", Cce.NonNull(args[0]).Type, this.argType); } @@ -3050,7 +3050,7 @@ public static void Emit(IList /*!*/ args, TokenTextWriter /*!*/ stream, stream.Write("("); } - cce.NonNull(args[0]).Emit(stream, opBindingStrength, false); + Cce.NonNull(args[0]).Emit(stream, opBindingStrength, false); stream.Write("["); string sep = ""; @@ -3059,13 +3059,13 @@ public static void Emit(IList /*!*/ args, TokenTextWriter /*!*/ stream, { stream.Write(sep); sep = ", "; - cce.NonNull(args[i]).Emit(stream); + Cce.NonNull(args[i]).Emit(stream); } if (withRhs) { stream.Write(" := "); - cce.NonNull(args.Last()).Emit(stream); + Cce.NonNull(args.Last()).Emit(stream); } stream.Write("]"); @@ -3157,7 +3157,7 @@ public Type Typecheck(IList args, out TypeParamInstantiation tpInstantiati actualArgs.Add(args[i]); } - return Typecheck(cce.NonNull(cce.NonNull(args[0]).Type), cce.NonNull(args[0]), + return Typecheck(Cce.NonNull(Cce.NonNull(args[0]).Type), Cce.NonNull(args[0]), actualArgs, out tpInstantiation, tc, this.tok, "map select"); } @@ -3168,7 +3168,7 @@ public Type ShallowType(IList args) { //Contract.Requires(args != null); Contract.Ensures(Contract.Result() != null); - Expr a0 = cce.NonNull(args[0]); + Expr a0 = Cce.NonNull(args[0]); Type a0Type = a0.ShallowType; if (a0Type == null || !a0Type.IsMap) { @@ -3180,7 +3180,7 @@ public Type ShallowType(IList args) List actualArgTypes = new List(); for (int i = 1; i < args.Count; ++i) { - actualArgTypes.Add(cce.NonNull(args[i]).ShallowType); + actualArgTypes.Add(Cce.NonNull(args[i]).ShallowType); } return Type.InferValueType(mapType.TypeParameters, mapType.Arguments, mapType.Result, actualArgTypes); @@ -3284,7 +3284,7 @@ public static Type Typecheck(IList /*!*/ args, out TypeParamInstantiation } Type resultType = - MapSelect.Typecheck(cce.NonNull(cce.NonNull(args[0]).Type), cce.NonNull(args[0]), + MapSelect.Typecheck(Cce.NonNull(Cce.NonNull(args[0]).Type), Cce.NonNull(args[0]), selectArgs, out tpInstantiation, tc, typeCheckingSubject, opName); // check the the rhs has the right type @@ -3294,16 +3294,16 @@ public static Type Typecheck(IList /*!*/ args, out TypeParamInstantiation return null; } - Type rhsType = cce.NonNull(cce.NonNull(args.Last()).Type); + Type rhsType = Cce.NonNull(Cce.NonNull(args.Last()).Type); if (!resultType.Unify(rhsType)) { - tc.Error(cce.NonNull(args.Last()).tok, + tc.Error(Cce.NonNull(args.Last()).tok, "right-hand side in {0} with wrong type: {1} (expected: {2})", opName, rhsType, resultType); return null; } - return cce.NonNull(args[0]).Type; + return Cce.NonNull(args[0]).Type; } public Type Typecheck(IList /*!*/ args, @@ -3325,7 +3325,7 @@ public Type ShallowType(IList args) { //Contract.Requires(args != null); Contract.Ensures(Contract.Result() != null); - return cce.NonNull(args[0]).ShallowType; + return Cce.NonNull(args[0]).ShallowType; } public T Dispatch(IAppliableVisitor visitor) @@ -3403,13 +3403,13 @@ public void Emit(IList args, TokenTextWriter stream, int contextBindingStr Contract.Assert(args.Count == 3); stream.push(); stream.Write("(if "); - cce.NonNull(args[0]).Emit(stream, 0x00, false); + Cce.NonNull(args[0]).Emit(stream, 0x00, false); stream.sep(); stream.Write(" then "); - cce.NonNull(args[1]).Emit(stream, 0x00, false); + Cce.NonNull(args[1]).Emit(stream, 0x00, false); stream.sep(); stream.Write(" else "); - cce.NonNull(args[2]).Emit(stream, 0x00, false); + Cce.NonNull(args[2]).Emit(stream, 0x00, false); stream.Write(")"); stream.pop(); } @@ -3436,15 +3436,15 @@ public Type Typecheck(IList args, out TypeParamInstantiation tpInstantiati // the default; the only binary operator with a type parameter is equality, but right // we don't store this parameter because it does not appear necessary tpInstantiation = SimpleTypeParamInstantiation.EMPTY; - Expr arg0 = cce.NonNull(args[0]); - Expr arg1 = cce.NonNull(args[1]); - Expr arg2 = cce.NonNull(args[2]); + Expr arg0 = Cce.NonNull(args[0]); + Expr arg1 = Cce.NonNull(args[1]); + Expr arg2 = Cce.NonNull(args[2]); - if (!cce.NonNull(arg0.Type).Unify(Type.Bool)) + if (!Cce.NonNull(arg0.Type).Unify(Type.Bool)) { tc.Error(this.tok, "the first argument to if-then-else should be bool, not {0}", arg0.Type); } - else if (!cce.NonNull(arg1.Type).Unify(cce.NonNull(arg2.Type))) + else if (!Cce.NonNull(arg1.Type).Unify(Cce.NonNull(arg2.Type))) { tc.Error(this.tok, "branches of if-then-else have incompatible types {0} and {1}", arg1.Type, arg2.Type); } @@ -3463,7 +3463,7 @@ public Type ShallowType(IList args) { //Contract.Requires(args != null); Contract.Ensures(Contract.Result() != null); - return cce.NonNull(args[1]).ShallowType; + return Cce.NonNull(args[1]).ShallowType; } public T Dispatch(IAppliableVisitor visitor) @@ -3544,7 +3544,7 @@ public void Emit(IList args, TokenTextWriter stream, int contextBindingStr { stream.Write("("); } - cce.NonNull(args[0]).Emit(stream, opBindingStrength, false); + Cce.NonNull(args[0]).Emit(stream, opBindingStrength, false); stream.Write("->{0}", FieldName); if (parensNeeded) { @@ -3563,7 +3563,7 @@ public void Resolve(ResolutionContext rc, Expr subjectForErrorReporting) public Type Typecheck(IList args, out TypeParamInstantiation tpInstantiation, TypecheckingContext tc) { Contract.Assert(args.Count == 1); - return Typecheck(cce.NonNull(args[0]).Type, tc, out tpInstantiation); + return Typecheck(Cce.NonNull(args[0]).Type, tc, out tpInstantiation); } public Type Typecheck(Type type, TypecheckingContext tc, out TypeParamInstantiation tpInstantiation) @@ -3714,9 +3714,9 @@ public void Emit(IList args, TokenTextWriter stream, int contextBindingStr { stream.Write("("); } - cce.NonNull(args[0]).Emit(stream, opBindingStrength, false); + Cce.NonNull(args[0]).Emit(stream, opBindingStrength, false); stream.Write("->({0} := ", fieldAccess.FieldName); - cce.NonNull(args[1]).Emit(stream, opBindingStrength, false); + Cce.NonNull(args[1]).Emit(stream, opBindingStrength, false); stream.Write(")"); if (parensNeeded) { @@ -3735,7 +3735,7 @@ public void Resolve(ResolutionContext rc, Expr subjectForErrorReporting) public Type Typecheck(IList args, out TypeParamInstantiation tpInstantiation, TypecheckingContext tc) { Contract.Assert(args.Count == 2); - return Typecheck(cce.NonNull(args[0]).Type, cce.NonNull(args[1]).Type, tc, out tpInstantiation); + return Typecheck(Cce.NonNull(args[0]).Type, Cce.NonNull(args[1]).Type, tc, out tpInstantiation); } public Type Typecheck(Type datatype, Type fieldType, TypecheckingContext tc, out TypeParamInstantiation tpInstantiation) @@ -3826,7 +3826,7 @@ public void Emit(IList args, TokenTextWriter stream, int contextBindingStr { stream.Write("("); } - cce.NonNull(args[0]).Emit(stream, opBindingStrength, false); + Cce.NonNull(args[0]).Emit(stream, opBindingStrength, false); stream.Write(" is {0}", ConstructorName); if (parensNeeded) { @@ -3845,7 +3845,7 @@ public void Resolve(ResolutionContext rc, Expr subjectForErrorReporting) public Type Typecheck(IList args, out TypeParamInstantiation tpInstantiation, TypecheckingContext tc) { Contract.Assert(args.Count == 1); - return Typecheck(cce.NonNull(args[0]).Type, tc, out tpInstantiation); + return Typecheck(Cce.NonNull(args[0]).Type, tc, out tpInstantiation); } public Type Typecheck(Type type, TypecheckingContext tc, out TypeParamInstantiation tpInstantiation) @@ -3896,14 +3896,14 @@ public List /*!*/ void ObjectInvariant() { Contract.Invariant(LocVars != null); - Contract.Invariant(cce.NonNullElements(Blocks)); + Contract.Invariant(Cce.NonNullElements(Blocks)); } public CodeExpr(List /*!*/ localVariables, List /*!*/ blocks, bool immutable = false) : base(Token.NoToken, immutable) { Contract.Requires(localVariables != null); - Contract.Requires(cce.NonNullElements(blocks)); + Contract.Requires(Cce.NonNullElements(blocks)); Contract.Requires(0 < blocks.Count); LocVars = localVariables; Blocks = blocks; diff --git a/Source/Core/AST/Expression/FunctionCall.cs b/Source/Core/AST/Expression/FunctionCall.cs index 22807ca5f..82e722bbd 100644 --- a/Source/Core/AST/Expression/FunctionCall.cs +++ b/Source/Core/AST/Expression/FunctionCall.cs @@ -153,7 +153,7 @@ public virtual Type Typecheck(IList actuals, out TypeParamInstantiation tp null, // we need some token to report a possibly wrong number of // arguments - actuals.Count > 0 ? cce.NonNull(actuals[0]).tok : Token.NoToken, + actuals.Count > 0 ? Cce.NonNull(actuals[0]).tok : Token.NoToken, "application of " + name.Name, tc); diff --git a/Source/Core/AST/Implementation.cs b/Source/Core/AST/Implementation.cs index 9169f014b..467d674aa 100644 --- a/Source/Core/AST/Implementation.cs +++ b/Source/Core/AST/Implementation.cs @@ -117,9 +117,9 @@ public void AddRecycledFailingAssertion(AssertCmd assertion) void ObjectInvariant() { Contract.Invariant(LocVars != null); - Contract.Invariant(cce.NonNullElements(Blocks)); - Contract.Invariant(cce.NonNullElements(OriginalBlocks, true)); - Contract.Invariant(cce.NonNullElements(scc, true)); + Contract.Invariant(Cce.NonNullElements(Blocks)); + Contract.Invariant(Cce.NonNullElements(OriginalBlocks, true)); + Contract.Invariant(Cce.NonNullElements(scc, true)); } private bool BlockPredecessorsComputed; @@ -132,7 +132,7 @@ public bool StronglyConnectedComponentsComputed public bool IsSkipVerification(CoreOptions options) { bool verify = true; - cce.NonNull(this.Proc).CheckBooleanAttribute("verify", ref verify); + Cce.NonNull(this.Proc).CheckBooleanAttribute("verify", ref verify); this.CheckBooleanAttribute("verify", ref verify); if (!verify) { return true; @@ -399,7 +399,7 @@ public Implementation(IToken tok, string name, List typeParams, Li List outParams, List localVariables, [Captured] List block) : this(tok, name, typeParams, inParams, outParams, localVariables, block, null) { - Contract.Requires(cce.NonNullElements(block)); + Contract.Requires(Cce.NonNullElements(block)); Contract.Requires(localVariables != null); Contract.Requires(outParams != null); Contract.Requires(inParams != null); @@ -423,7 +423,7 @@ public Implementation(IToken /*!*/ tok, Contract.Requires(inParams != null); Contract.Requires(outParams != null); Contract.Requires(localVariables != null); - Contract.Requires(cce.NonNullElements(blocks)); + Contract.Requires(Cce.NonNullElements(blocks)); LocVars = localVariables; Blocks = blocks; BlockPredecessorsComputed = false; @@ -509,7 +509,7 @@ public override void Resolve(ResolutionContext rc) return; } - Proc = rc.LookUpProcedure(cce.NonNull(this.Name)); + Proc = rc.LookUpProcedure(Cce.NonNull(this.Name)); if (Proc == null) { rc.Error(this, "implementation given for undeclared procedure: {0}", this.Name); @@ -741,15 +741,15 @@ void MatchFormals(List /*!*/ implFormals, List /*!*/ procFor // the names of the formals are allowed to change from the proc to the impl // but types must be identical - Type t = cce.NonNull((Variable) implFormals[i]).TypedIdent.Type.Substitute(subst2); - Type u = cce.NonNull((Variable) procFormals[i]).TypedIdent.Type.Substitute(subst1); + Type t = Cce.NonNull((Variable) implFormals[i]).TypedIdent.Type.Substitute(subst2); + Type u = Cce.NonNull((Variable) procFormals[i]).TypedIdent.Type.Substitute(subst1); if (!t.Equals(u)) { string /*!*/ - a = cce.NonNull((Variable) implFormals[i]).Name; + a = Cce.NonNull((Variable) implFormals[i]).Name; Contract.Assert(a != null); string /*!*/ - b = cce.NonNull((Variable) procFormals[i]).Name; + b = Cce.NonNull((Variable) procFormals[i]).Name; Contract.Assert(b != null); string /*!*/ c; @@ -807,9 +807,9 @@ public void ResetImplFormalMap() for (int i = 0; i < OutParams.Count; i++) { Variable /*!*/ - v = cce.NonNull(OutParams[i]); + v = Cce.NonNull(OutParams[i]); IdentifierExpr ie = new IdentifierExpr(v.tok, v); - Variable pv = cce.NonNull(Proc.OutParams[i]); + Variable pv = Cce.NonNull(Proc.OutParams[i]); map.Add(pv, ie); } @@ -823,9 +823,9 @@ public void ResetImplFormalMap() foreach (var e in map) { options.OutputWriter.Write(" "); - cce.NonNull((Variable /*!*/) e.Key).Emit(stream, 0); + Cce.NonNull((Variable /*!*/) e.Key).Emit(stream, 0); options.OutputWriter.Write(" --> "); - cce.NonNull((Expr) e.Value).Emit(stream); + Cce.NonNull((Expr) e.Value).Emit(stream); options.OutputWriter.WriteLine(); } } @@ -841,7 +841,7 @@ public void ResetImplFormalMap() public ICollection GetConnectedComponents(Block startingBlock) { Contract.Requires(startingBlock != null); - Contract.Ensures(cce.NonNullElements(Contract.Result>(), true)); + Contract.Ensures(Cce.NonNullElements(Contract.Result>(), true)); Contract.Assert(this.Blocks.Contains(startingBlock)); if (!this.BlockPredecessorsComputed) @@ -853,7 +853,7 @@ public void ResetImplFormalMap() System.Console.WriteLine("* Strongly connected components * \n{0} \n ** ", scc); #endif - foreach (ICollection component in cce.NonNull(this.scc)) + foreach (ICollection component in Cce.NonNull(this.scc)) { foreach (Block /*!*/ b in component) { @@ -867,7 +867,7 @@ public void ResetImplFormalMap() { Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } // if we are here, it means that the block is not in one of the components. This is an error. } diff --git a/Source/Core/AST/Program.cs b/Source/Core/AST/Program.cs index 5684c315f..5fd26b029 100644 --- a/Source/Core/AST/Program.cs +++ b/Source/Core/AST/Program.cs @@ -13,8 +13,8 @@ public class Program : Absy [ContractInvariantMethod] void ObjectInvariant() { - Contract.Invariant(cce.NonNullElements(this.topLevelDeclarations)); - Contract.Invariant(cce.NonNullElements(this.globalVariablesCache, true)); + Contract.Invariant(Cce.NonNullElements(this.topLevelDeclarations)); + Contract.Invariant(Cce.NonNullElements(this.globalVariablesCache, true)); } public Dictionary> DeclarationDependencies { get; set; } @@ -179,7 +179,7 @@ public IReadOnlyList TopLevelDeclarations { get { - Contract.Ensures(cce.NonNullElements(Contract.Result>())); + Contract.Ensures(Cce.NonNullElements(Contract.Result>())); return topLevelDeclarations.AsReadOnly(); } @@ -210,7 +210,7 @@ public void AddTopLevelDeclaration(Declaration decl) public void AddTopLevelDeclarations(IEnumerable decls) { Contract.Requires(!TopLevelDeclarationsAreFrozen); - Contract.Requires(cce.NonNullElements(decls)); + Contract.Requires(Cce.NonNullElements(decls)); topLevelDeclarations.AddRange(decls); this.globalVariablesCache = null; @@ -391,7 +391,7 @@ public List /*!*/ GlobalVariables { get { - Contract.Ensures(cce.NonNullElements(Contract.Result>())); + Contract.Ensures(Cce.NonNullElements(Contract.Result>())); if (globalVariablesCache == null) { @@ -435,15 +435,15 @@ public void UnrollLoops(int n, bool uc) { if (impl.Blocks != null && impl.Blocks.Count > 0) { - cce.BeginExpose(impl); + Cce.BeginExpose(impl); { Block start = impl.Blocks[0]; Contract.Assume(start != null); - Contract.Assume(cce.IsConsistent(start)); + Contract.Assume(Cce.IsConsistent(start)); impl.Blocks = LoopUnroll.UnrollLoops(start, n, uc); impl.FreshenCaptureStates(); } - cce.EndExpose(); + Cce.EndExpose(); } } } @@ -511,7 +511,7 @@ void AddEdge(Block a, Block b) { } } - g.AddSource(cce.NonNull(blocks[0])); // there is always at least one node in the graph + g.AddSource(Cce.NonNull(blocks[0])); // there is always at least one node in the graph foreach (Block b in blocks) { if (b.TransferCmd is GotoCmd gtc) @@ -526,7 +526,7 @@ void AddEdge(Block a, Block b) { public static Graph /*!*/ GraphFromImpl(Implementation impl, bool forward = true) { Contract.Requires(impl != null); - Contract.Ensures(cce.NonNullElements(Contract.Result>().Nodes)); + Contract.Ensures(Cce.NonNullElements(Contract.Result>().Nodes)); Contract.Ensures(Contract.Result>() != null); return GraphFromBlocks(impl.Blocks, forward); diff --git a/Source/Core/AlphaEquality.cs b/Source/Core/AlphaEquality.cs index 95bf97faf..2bbd8393e 100644 --- a/Source/Core/AlphaEquality.cs +++ b/Source/Core/AlphaEquality.cs @@ -157,12 +157,12 @@ public FreeVariable(TypedIdent ti) : base(Token.NoToken, ti) public override bool IsMutable { - get { throw new cce.UnreachableException(); } + get { throw new Cce.UnreachableException(); } } public override void Register(ResolutionContext rc) { - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } } } diff --git a/Source/Core/BoogiePL.atg b/Source/Core/BoogiePL.atg index 66c5789aa..a581a4146 100644 --- a/Source/Core/BoogiePL.atg +++ b/Source/Core/BoogiePL.atg @@ -44,7 +44,7 @@ public static Program ParseLibrary(string libraryName) /// public static int Parse(string/*!*/ filename, List defines, out /*maybe null*/ Program program, bool useBaseName=false) /* throws System.IO.IOException */ { Contract.Requires(filename != null); - Contract.Requires(cce.NonNullElements(defines,true)); + Contract.Requires(Cce.NonNullElements(defines,true)); if (filename == "stdin.bpl") { return Parse(Console.In, filename, defines, out program, useBaseName); @@ -65,7 +65,7 @@ public static int Parse(string s, string/*!*/ filename, out /*maybe null*/ Progr Contract.Requires(s != null); Contract.Requires(filename != null); - byte[]/*!*/ buffer = cce.NonNull(UTF8Encoding.Default.GetBytes(s)); + byte[]/*!*/ buffer = Cce.NonNull(UTF8Encoding.Default.GetBytes(s)); MemoryStream ms = new MemoryStream(buffer,false); Errors errors = new Errors(); Scanner scanner = new Scanner(ms, errors, filename, useBaseName); @@ -116,9 +116,9 @@ private class BvBounds : Expr { } public override void Emit(TokenTextWriter/*!*/ stream, int contextBindingStrength, bool fragileContext) { - Contract.Assert(false);throw new cce.UnreachableException(); + Contract.Assert(false);throw new Cce.UnreachableException(); } - public override void ComputeFreeVariables(GSet/*!*/ freeVars) { Contract.Assert(false);throw new cce.UnreachableException(); } + public override void ComputeFreeVariables(GSet/*!*/ freeVars) { Contract.Assert(false);throw new Cce.UnreachableException(); } public override int ContentHash => throw new NotSupportedException("Not supported since this type is translated away"); @@ -501,7 +501,7 @@ Function<.out List/*!*/ ds.> if (!allUnnamed) { Bpl.Type prevType = null; for (int i = arguments.Count; 0 <= --i; ) { - TypedIdent/*!*/ curr = cce.NonNull(arguments[i]).TypedIdent; + TypedIdent/*!*/ curr = Cce.NonNull(arguments[i]).TypedIdent; if (curr.HasName) { // the argument was given as both an identifier and a type prevType = curr.Type; @@ -578,7 +578,7 @@ Axiom /*------------------------------------------------------------------------*/ UserDefinedTypes<.out List/*!*/ ts.> -= (. Contract.Ensures(cce.NonNullElements(Contract.ValueAtReturn(out ts))); Declaration/*!*/ decl; QKeyValue kv = null; ts = new List (); .) += (. Contract.Ensures(Cce.NonNullElements(Contract.ValueAtReturn(out ts))); Declaration/*!*/ decl; QKeyValue kv = null; ts = new List (); .) "type" { Attribute } UserDefinedType (. ts.Add(decl); .) @@ -1040,7 +1040,7 @@ TransferCmd . StructuredCmd -= (. Contract.Ensures(Contract.ValueAtReturn(out ec) != null); ec = dummyStructuredCmd; Contract.Assume(cce.IsPeerConsistent(ec)); += (. Contract.Ensures(Contract.ValueAtReturn(out ec) != null); ec = dummyStructuredCmd; Contract.Assume(Cce.IsPeerConsistent(ec)); IfCmd/*!*/ ifcmd; WhileCmd/*!*/ wcmd; BreakCmd/*!*/ bcmd; .) ( IfCmd (. ec = ifcmd; .) @@ -1077,7 +1077,7 @@ WhileCmd QKeyValue kv = null; .) "while" (. x = t; .) - Guard (. Contract.Assume(guard == null || cce.Owner.None(guard)); .) + Guard (. Contract.Assume(guard == null || Cce.Owner.None(guard)); .) { (. isFree = false; z = la/*lookahead token*/; .) [ "free" (. isFree = true; .) ] "invariant" @@ -1228,7 +1228,7 @@ LabelOrAssign . MapAssignIndex<.out IToken/*!*/ x, out List/*!*/ indexes.> -= (.Contract.Ensures(Contract.ValueAtReturn(out x) != null); Contract.Ensures(cce.NonNullElements(Contract.ValueAtReturn(out indexes))); indexes = new List (); += (.Contract.Ensures(Contract.ValueAtReturn(out x) != null); Contract.Ensures(Cce.NonNullElements(Contract.ValueAtReturn(out indexes))); indexes = new List (); Expr/*!*/ e; .) "[" (. x = t; .) @@ -1666,7 +1666,7 @@ AtomExpression . CodeExpression<.out List/*!*/ locals, out List/*!*/ blocks.> -= (. Contract.Ensures(Contract.ValueAtReturn(out locals) != null); Contract.Ensures(cce.NonNullElements(Contract.ValueAtReturn(out blocks))); locals = new List(); Block/*!*/ b; += (. Contract.Ensures(Contract.ValueAtReturn(out locals) != null); Contract.Ensures(Cce.NonNullElements(Contract.ValueAtReturn(out blocks))); locals = new List(); Block/*!*/ b; blocks = new List(); .) "|{" diff --git a/Source/Core/DeadVarElim.cs b/Source/Core/DeadVarElim.cs index 65233640b..cc2b29004 100644 --- a/Source/Core/DeadVarElim.cs +++ b/Source/Core/DeadVarElim.cs @@ -58,8 +58,8 @@ public class ModSetCollector : ReadOnlyVisitor [ContractInvariantMethod] void ObjectInvariant() { - Contract.Invariant(cce.NonNullDictionaryAndValues(modSets)); - Contract.Invariant(Contract.ForAll(modSets.Values, v => cce.NonNullElements(v))); + Contract.Invariant(Cce.NonNullDictionaryAndValues(modSets)); + Contract.Invariant(Contract.ForAll(modSets.Values, v => Cce.NonNullElements(v))); } public ModSetCollector(CoreOptions options) @@ -234,7 +234,7 @@ public override Cmd VisitCallCmd(CallCmd callCmd) private void ProcessVariable(Variable var) { Procedure /*!*/ - localProc = cce.NonNull(enclosingProc); + localProc = Cce.NonNull(enclosingProc); if (var == null) { return; @@ -315,8 +315,8 @@ public IEnumerable oldVarsUsed [ContractInvariantMethod] void ObjectInvariant() { - Contract.Invariant(cce.NonNullElements(_usedVars)); - Contract.Invariant(cce.NonNullElements(_oldVarsUsed)); + Contract.Invariant(Cce.NonNullElements(_usedVars)); + Contract.Invariant(Cce.NonNullElements(_oldVarsUsed)); } int insideOldExpr; @@ -383,7 +383,7 @@ public static void CoalesceBlocks(Program program) private static HashSet /*!*/ ComputeMultiPredecessorBlocks(Implementation /*!*/ impl) { Contract.Requires(impl != null); - Contract.Ensures(cce.NonNullElements(Contract.Result>())); + Contract.Ensures(Cce.NonNullElements(Contract.Result>())); HashSet visitedBlocks = new HashSet(); HashSet multiPredBlocks = new HashSet(); Stack dfsStack = new Stack(); @@ -435,7 +435,7 @@ public override Implementation VisitImplementation(Implementation impl) //Console.WriteLine("Initial number of blocks = {0}", impl.Blocks.Count); HashSet multiPredBlocks = ComputeMultiPredecessorBlocks(impl); - Contract.Assert(cce.NonNullElements(multiPredBlocks)); + Contract.Assert(Cce.NonNullElements(multiPredBlocks)); HashSet visitedBlocks = new HashSet(); HashSet removedBlocks = new HashSet(); Stack dfsStack = new Stack(); @@ -471,7 +471,7 @@ public override Implementation VisitImplementation(Implementation impl) if (gotoCmd.labelTargets.Count == 1) { Block /*!*/ - succ = cce.NonNull(gotoCmd.labelTargets[0]); + succ = Cce.NonNull(gotoCmd.labelTargets[0]); if (!multiPredBlocks.Contains(succ)) { foreach (Cmd /*!*/ cmd in succ.Cmds) @@ -599,11 +599,11 @@ public void ComputeLiveVariables(Implementation impl) if (cmds[i] is CallCmd) { Procedure /*!*/ - proc = cce.NonNull(cce.NonNull((CallCmd /*!*/) cmds[i]).Proc); + proc = Cce.NonNull(Cce.NonNull((CallCmd /*!*/) cmds[i]).Proc); if (InterProcGenKill.HasSummary(proc.Name)) { liveVarsAfter = - InterProcGenKill.PropagateLiveVarsAcrossCall(options, cce.NonNull((CallCmd /*!*/) cmds[i]), liveVarsAfter); + InterProcGenKill.PropagateLiveVarsAcrossCall(options, Cce.NonNull((CallCmd /*!*/) cmds[i]), liveVarsAfter); continue; } } @@ -619,11 +619,11 @@ public void ComputeLiveVariables(Implementation impl) public void Propagate(Cmd cmd, HashSet /*!*/ liveSet) { Contract.Requires(cmd != null); - Contract.Requires(cce.NonNullElements(liveSet)); + Contract.Requires(Cce.NonNullElements(liveSet)); if (cmd is AssignCmd) { AssignCmd /*!*/ - assignCmd = (AssignCmd) cce.NonNull(cmd); + assignCmd = (AssignCmd) Cce.NonNull(cmd); // I must first iterate over all the targets and remove the live ones. // After the removals are done, I must add the variables referred on // the right side of the removed targets @@ -679,7 +679,7 @@ public void Propagate(Cmd cmd, HashSet /*!*/ liveSet) { Contract.Assert((cmd is AssertCmd || cmd is AssumeCmd)); PredicateCmd /*!*/ - predicateCmd = (PredicateCmd) cce.NonNull(cmd); + predicateCmd = (PredicateCmd) Cce.NonNull(cmd); if (predicateCmd.Expr is LiteralExpr) { LiteralExpr le = (LiteralExpr) predicateCmd.Expr; @@ -708,15 +708,15 @@ public void Propagate(Cmd cmd, HashSet /*!*/ liveSet) else if (cmd is SugaredCmd) { SugaredCmd /*!*/ - sugCmd = (SugaredCmd) cce.NonNull(cmd); + sugCmd = (SugaredCmd) Cce.NonNull(cmd); Propagate(sugCmd.GetDesugaring(options), liveSet); } else if (cmd is StateCmd) { StateCmd /*!*/ - stCmd = (StateCmd) cce.NonNull(cmd); + stCmd = (StateCmd) Cce.NonNull(cmd); List /*!*/ - cmds = cce.NonNull(stCmd.Cmds); + cmds = Cce.NonNull(stCmd.Cmds); int len = cmds.Count; for (int i = len - 1; i >= 0; i--) { @@ -733,7 +733,7 @@ public void Propagate(Cmd cmd, HashSet /*!*/ liveSet) { { Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } } } @@ -765,8 +765,8 @@ public class GenKillWeight [ContractInvariantMethod] void ObjectInvariant() { - Contract.Invariant(cce.NonNullElements(gen)); - Contract.Invariant(cce.NonNullElements(kill)); + Contract.Invariant(Cce.NonNullElements(gen)); + Contract.Invariant(Cce.NonNullElements(kill)); Contract.Invariant(oneWeight != null); Contract.Invariant(zeroWeight != null); } @@ -789,8 +789,8 @@ public GenKillWeight() public GenKillWeight(HashSet gen, HashSet kill) { - Contract.Requires(cce.NonNullElements(gen)); - Contract.Requires(cce.NonNullElements(kill)); + Contract.Requires(Cce.NonNullElements(gen)); + Contract.Requires(Cce.NonNullElements(kill)); Contract.Assert(gen != null); Contract.Assert(kill != null); this.gen = gen; @@ -910,14 +910,14 @@ public override string ToString() public HashSet /*!*/ getLiveVars() { - Contract.Ensures(cce.NonNullElements(Contract.Result>())); + Contract.Ensures(Cce.NonNullElements(Contract.Result>())); return gen; } public HashSet /*!*/ getLiveVars(HashSet /*!*/ lv) { - Contract.Requires(cce.NonNullElements(lv)); - Contract.Ensures(cce.NonNullElements(Contract.Result>())); + Contract.Requires(Cce.NonNullElements(lv)); + Contract.Ensures(Cce.NonNullElements(Contract.Result>())); HashSet temp = new HashSet(lv); temp.ExceptWith(kill); temp.UnionWith(gen); @@ -975,18 +975,18 @@ public Implementation /*!*/ [ContractInvariantMethod] void ObjectInvariant() { - Contract.Invariant(cce.NonNullElements(graph.Nodes)); - Contract.Invariant(cce.NonNullDictionaryAndValues(procsCalled)); - Contract.Invariant(cce.NonNullElements(nodes)); - Contract.Invariant(cce.NonNullDictionaryAndValues(succEdges)); - Contract.Invariant(cce.NonNullDictionaryAndValues(predEdges)); + Contract.Invariant(Cce.NonNullElements(graph.Nodes)); + Contract.Invariant(Cce.NonNullDictionaryAndValues(procsCalled)); + Contract.Invariant(Cce.NonNullElements(nodes)); + Contract.Invariant(Cce.NonNullDictionaryAndValues(succEdges)); + Contract.Invariant(Cce.NonNullDictionaryAndValues(predEdges)); Contract.Invariant(priority != null); - Contract.Invariant(cce.NonNullElements(srcNodes)); - Contract.Invariant(cce.NonNullElements(exitNodes)); - Contract.Invariant(cce.NonNullDictionaryAndValues(weightBefore)); - Contract.Invariant(cce.NonNullDictionaryAndValues(weightAfter)); - Contract.Invariant(cce.NonNullDictionaryAndValues(liveVarsAfter)); - Contract.Invariant(cce.NonNullDictionaryAndValues(liveVarsBefore)); + Contract.Invariant(Cce.NonNullElements(srcNodes)); + Contract.Invariant(Cce.NonNullElements(exitNodes)); + Contract.Invariant(Cce.NonNullDictionaryAndValues(weightBefore)); + Contract.Invariant(Cce.NonNullDictionaryAndValues(weightAfter)); + Contract.Invariant(Cce.NonNullDictionaryAndValues(liveVarsAfter)); + Contract.Invariant(Cce.NonNullDictionaryAndValues(liveVarsBefore)); Contract.Invariant(summary != null); Contract.Invariant(impl != null); } @@ -1054,7 +1054,7 @@ private void Initialize(Implementation impl) if (c is CallCmd) { CallCmd /*!*/ - cc = cce.NonNull((CallCmd /*!*/) c); + cc = Cce.NonNull((CallCmd /*!*/) c); Contract.Assert(cc.Proc != null); string /*!*/ procName = cc.Proc.Name; @@ -1182,18 +1182,18 @@ void ObjectInvariant() Contract.Invariant(workList != null); Contract.Invariant(mainImpl != null); Contract.Invariant(program != null); - Contract.Invariant(cce.NonNullDictionaryAndValues(procICFG)); - Contract.Invariant(cce.NonNullDictionaryAndValues(name2Proc)); - Contract.Invariant(cce.NonNullDictionaryAndValues(callers) && - Contract.ForAll(callers.Values, v => cce.NonNullElements(v))); - Contract.Invariant(cce.NonNullElements(callGraph.Nodes)); + Contract.Invariant(Cce.NonNullDictionaryAndValues(procICFG)); + Contract.Invariant(Cce.NonNullDictionaryAndValues(name2Proc)); + Contract.Invariant(Cce.NonNullDictionaryAndValues(callers) && + Contract.ForAll(callers.Values, v => Cce.NonNullElements(v))); + Contract.Invariant(Cce.NonNullElements(callGraph.Nodes)); Contract.Invariant(procPriority != null); - Contract.Invariant(cce.NonNullDictionaryAndValues(varsLiveAtEntry)); - Contract.Invariant(cce.NonNullDictionaryAndValues(varsLiveAtExit) && - Contract.ForAll(varsLiveAtExit.Values, v => cce.NonNullElements(v))); - Contract.Invariant(cce.NonNullDictionaryAndValues(varsLiveSummary)); - Contract.Invariant(cce.NonNullDictionaryAndValues(weightCacheAfterCall)); - Contract.Invariant(cce.NonNullDictionaryAndValues(weightCacheBeforeCall)); + Contract.Invariant(Cce.NonNullDictionaryAndValues(varsLiveAtEntry)); + Contract.Invariant(Cce.NonNullDictionaryAndValues(varsLiveAtExit) && + Contract.ForAll(varsLiveAtExit.Values, v => Cce.NonNullElements(v))); + Contract.Invariant(Cce.NonNullDictionaryAndValues(varsLiveSummary)); + Contract.Invariant(Cce.NonNullDictionaryAndValues(weightCacheAfterCall)); + Contract.Invariant(Cce.NonNullDictionaryAndValues(weightCacheBeforeCall)); } @@ -1225,13 +1225,13 @@ public InterProcGenKill(Implementation impl, Program program, CoreOptions option if (decl is Implementation) { Implementation /*!*/ - imp = (Implementation /*!*/) cce.NonNull(decl); + imp = (Implementation /*!*/) Cce.NonNull(decl); name2Impl[imp.Name] = imp; } else if (decl is Procedure) { Procedure /*!*/ - proc = cce.NonNull(decl as Procedure); + proc = Cce.NonNull(decl as Procedure); name2Proc[proc.Name] = proc; } } @@ -1314,7 +1314,7 @@ public InterProcGenKill(Implementation impl, Program program, CoreOptions option { Contract.Requires(prog != null); Contract.Requires(impl != null); - Contract.Ensures(cce.NonNullElements(Contract.Result>())); + Contract.Ensures(Cce.NonNullElements(Contract.Result>())); if (varsLiveAtExit.ContainsKey(impl.Name)) { return varsLiveAtExit[impl.Name]; @@ -1342,7 +1342,7 @@ public InterProcGenKill(Implementation impl, Program program, CoreOptions option { Contract.Requires(prog != null); Contract.Requires(impl != null); - Contract.Ensures(cce.NonNullElements(Contract.Result>())); + Contract.Ensures(Cce.NonNullElements(Contract.Result>())); if (varsLiveAtEntry.ContainsKey(impl.Name)) { return varsLiveAtEntry[impl.Name]; @@ -1376,10 +1376,10 @@ public static HashSet /*!*/ PropagateLiveVarsAcrossCall(CoreOptions options, CallCmd cmd, HashSet /*!*/ lvAfter) { Contract.Requires(cmd != null); - Contract.Requires(cce.NonNullElements(lvAfter)); - Contract.Ensures(cce.NonNullElements(Contract.Result>())); + Contract.Requires(Cce.NonNullElements(lvAfter)); + Contract.Ensures(Cce.NonNullElements(Contract.Result>())); Procedure /*!*/ - proc = cce.NonNull(cmd.Proc); + proc = Cce.NonNull(cmd.Proc); if (varsLiveSummary.ContainsKey(proc.Name)) { GenKillWeight /*!*/ @@ -1457,7 +1457,7 @@ public bool setWeightBefore(GenKillWeight w) public override bool Equals(object other) { WorkItem /*!*/ - wi = (WorkItem /*!*/) cce.NonNull(other); + wi = (WorkItem /*!*/) Cce.NonNull(other); return (wi.cfg == cfg && wi.block == block); } @@ -1508,9 +1508,9 @@ class WorkList void ObjectInvariant() { Contract.Invariant(priorities != null); - Contract.Invariant(cce.NonNullElements(labels)); - Contract.Invariant(cce.NonNullDictionaryAndValues(workList) && - Contract.ForAll(workList.Values, v => cce.NonNullElements(v))); + Contract.Invariant(Cce.NonNullElements(labels)); + Contract.Invariant(Cce.NonNullDictionaryAndValues(workList) && + Contract.ForAll(workList.Values, v => Cce.NonNullElements(v))); } @@ -1552,7 +1552,7 @@ public WorkItem Get() { Contract.Ensures(Contract.Result() != null); // Get minimum priority - int p = cce.NonNull(priorities.Keys)[0]; + int p = Cce.NonNull(priorities.Keys)[0]; priorities[p] = priorities[p] - 1; if (priorities[p] == 0) { @@ -1594,7 +1594,7 @@ private GenKillWeight getSummary(CallCmd cmd) { Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } } @@ -1715,7 +1715,7 @@ private void ProcessLv(WorkItem wi) Contract.Assert(block != null); HashSet /*!*/ lv = cfg.liveVarsAfter[block]; - Contract.Assert(cce.NonNullElements(lv)); + Contract.Assert(Cce.NonNullElements(lv)); // Propagate backwards in the block HashSet /*!*/ prop = new HashSet(); @@ -1728,7 +1728,7 @@ private void ProcessLv(WorkItem wi) if (cmd is CallCmd) { string /*!*/ - procName = cce.NonNull(cce.NonNull((CallCmd) cmd).Proc).Name; + procName = Cce.NonNull(Cce.NonNull((CallCmd) cmd).Proc).Name; Contract.Assert(procName != null); if (procICFG.ContainsKey(procName)) { @@ -1764,7 +1764,7 @@ private void ProcessLv(WorkItem wi) // Continue with intra propagation GenKillWeight /*!*/ - summary = GetWeightCall(cce.NonNull((CallCmd /*!*/) cmd)); + summary = GetWeightCall(Cce.NonNull((CallCmd /*!*/) cmd)); prop = summary.getLiveVars(prop); } else @@ -1785,11 +1785,11 @@ private void ProcessLv(WorkItem wi) Contract.Assert(b != null); HashSet /*!*/ prev = cfg.liveVarsAfter[b]; - Contract.Assert(cce.NonNullElements(prev)); + Contract.Assert(Cce.NonNullElements(prev)); HashSet /*!*/ curr = new HashSet(prev); curr.UnionWith(cfg.liveVarsBefore[block]); - Contract.Assert(cce.NonNullElements(curr)); + Contract.Assert(Cce.NonNullElements(curr)); if (curr.Count != prev.Count) { cfg.liveVarsAfter[b] = curr; @@ -1810,9 +1810,9 @@ private void process(WorkItem wi) Cmd /*!*/ c = wi.block.Cmds[i]; Contract.Assert(c != null); - if (c is CallCmd && procICFG.ContainsKey(cce.NonNull(cce.NonNull((CallCmd) c).Proc).Name)) + if (c is CallCmd && procICFG.ContainsKey(Cce.NonNull(Cce.NonNull((CallCmd) c).Proc).Name)) { - w = GenKillWeight.extend(GetWeightCall(cce.NonNull((CallCmd) c)), w); + w = GenKillWeight.extend(GetWeightCall(Cce.NonNull((CallCmd) c)), w); } else { @@ -1961,7 +1961,7 @@ private GenKillWeight GetWeight(Cmd cmd, Implementation impl, Program prog) else if (cmd is HavocCmd) { HavocCmd /*!*/ - havocCmd = (HavocCmd) cce.NonNull(cmd); + havocCmd = (HavocCmd) Cce.NonNull(cmd); foreach (IdentifierExpr /*!*/ expr in havocCmd.Vars) { Contract.Assert(expr != null); @@ -1977,14 +1977,14 @@ private GenKillWeight GetWeight(Cmd cmd, Implementation impl, Program prog) { Contract.Assert((cmd is AssertCmd || cmd is AssumeCmd)); PredicateCmd /*!*/ - predicateCmd = (PredicateCmd) cce.NonNull(cmd); + predicateCmd = (PredicateCmd) Cce.NonNull(cmd); if (predicateCmd.Expr is LiteralExpr && prog != null && impl != null) { LiteralExpr le = (LiteralExpr) predicateCmd.Expr; if (le.IsFalse) { var globals = prog.GlobalVariables; - Contract.Assert(cce.NonNullElements(globals)); + Contract.Assert(Cce.NonNullElements(globals)); foreach (Variable /*!*/ v in globals) { Contract.Assert(v != null); @@ -2056,7 +2056,7 @@ private GenKillWeight GetWeight(Cmd cmd, Implementation impl, Program prog) { { Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } } @@ -2087,7 +2087,7 @@ private static GenKillWeight getWeightAfterCall(Cmd cmd) Contract.Assert(cmd is CallCmd); CallCmd /*!*/ - ccmd = cce.NonNull((CallCmd) cmd); + ccmd = Cce.NonNull((CallCmd) cmd); foreach (IdentifierExpr /*!*/ ie in ccmd.Outs) { @@ -2099,7 +2099,7 @@ private static GenKillWeight getWeightAfterCall(Cmd cmd) } // Variables in ensures are considered as "read" - foreach (Ensures /*!*/ re in cce.NonNull(ccmd.Proc).Ensures) + foreach (Ensures /*!*/ re in Cce.NonNull(ccmd.Proc).Ensures) { Contract.Assert(re != null); VariableCollector /*!*/ @@ -2137,7 +2137,7 @@ private static GenKillWeight getWeightBeforeCall(Cmd cmd) HashSet /*!*/ kill = new HashSet(); CallCmd /*!*/ - ccmd = cce.NonNull((CallCmd /*!*/) cmd); + ccmd = Cce.NonNull((CallCmd /*!*/) cmd); foreach (Expr /*!*/ expr in ccmd.Ins) { diff --git a/Source/Core/Duplicator.cs b/Source/Core/Duplicator.cs index a4b058c39..58f0f9c00 100644 --- a/Source/Core/Duplicator.cs +++ b/Source/Core/Duplicator.cs @@ -122,7 +122,7 @@ public override Expr VisitCodeExpr(CodeExpr node) if (g != null) { List targets = new List(); - foreach (Block t in cce.NonNull(g.labelTargets)) + foreach (Block t in Cce.NonNull(g.labelTargets)) { Block nt = subst[t]; targets.Add(nt); @@ -145,7 +145,7 @@ public override List VisitBlockSeq(List blockSeq) public override List /*!*/ VisitBlockList(List /*!*/ blocks) { //Contract.Requires(cce.NonNullElements(blocks)); - Contract.Ensures(cce.NonNullElements(Contract.Result>())); + Contract.Ensures(Cce.NonNullElements(Contract.Result>())); return base.VisitBlockList(new List(blocks)); } @@ -224,7 +224,7 @@ public override Declaration VisitDeclaration(Declaration node) public override List /*!*/ VisitDeclarationList(List /*!*/ declarationList) { //Contract.Requires(cce.NonNullElements(declarationList)); - Contract.Ensures(cce.NonNullElements(Contract.Result>())); + Contract.Ensures(Cce.NonNullElements(Contract.Result>())); // For Implementation.Proc to resolve correctly to duplicated Procedures // we need to visit the procedures first @@ -235,7 +235,7 @@ public override Declaration VisitDeclaration(Declaration node) continue; } - declarationList[i] = cce.NonNull((Declaration) this.Visit(declarationList[i])); + declarationList[i] = Cce.NonNull((Declaration) this.Visit(declarationList[i])); } // Now visit everything else @@ -246,7 +246,7 @@ public override Declaration VisitDeclaration(Declaration node) continue; } - declarationList[i] = cce.NonNull((Declaration) this.Visit(declarationList[i])); + declarationList[i] = Cce.NonNull((Declaration) this.Visit(declarationList[i])); } return declarationList; @@ -1031,12 +1031,12 @@ public override Expr VisitIdentifierExpr(IdentifierExpr node) if (insideOldExpr) { - e = forold(cce.NonNull(node.Decl)); + e = forold(Cce.NonNull(node.Decl)); } if (e == null) { - e = always(cce.NonNull(node.Decl)); + e = always(Cce.NonNull(node.Decl)); } return e == null ? base.VisitIdentifierExpr(node) : e; @@ -1049,7 +1049,7 @@ public override Expr VisitOldExpr(OldExpr node) bool previouslyInOld = insideOldExpr; insideOldExpr = true; Expr /*!*/ - e = (Expr /*!*/) cce.NonNull(this.Visit(node.Expr)); + e = (Expr /*!*/) Cce.NonNull(this.Visit(node.Expr)); insideOldExpr = previouslyInOld; return new OldExpr(node.tok, e); } @@ -1144,12 +1144,12 @@ public override Expr VisitIdentifierExpr(IdentifierExpr node) if (insideOldExpr) { - e = forold(cce.NonNull(node.Decl)); + e = forold(Cce.NonNull(node.Decl)); } if (e == null) { - e = always(cce.NonNull(node.Decl)); + e = always(Cce.NonNull(node.Decl)); } return e == null ? base.VisitIdentifierExpr(node) : e; @@ -1162,7 +1162,7 @@ public override Expr VisitOldExpr(OldExpr node) bool previouslyInOld = insideOldExpr; insideOldExpr = true; Expr /*!*/ - e = (Expr /*!*/) cce.NonNull(this.Visit(node.Expr)); + e = (Expr /*!*/) Cce.NonNull(this.Visit(node.Expr)); insideOldExpr = previouslyInOld; return e; } diff --git a/Source/Core/Helpers.cs b/Source/Core/Helpers.cs index 3b51dd496..72288e39b 100644 --- a/Source/Core/Helpers.cs +++ b/Source/Core/Helpers.cs @@ -119,13 +119,13 @@ public static string PrettyPrintBplExpr(Expr e) else if (fun is MapSelect && eSeq.Count <= 3) { // only maps with up to two arguments are supported right now (here) - if (cce.NonNull(eSeq[0]).ToString() == "$Heap") + if (Cce.NonNull(eSeq[0]).ToString() == "$Heap") { //print Index0.Index1, unless Index1 is "$elements", then just print Index0 - string s0 = PrettyPrintBplExpr(cce.NonNull(eSeq[1])); + string s0 = PrettyPrintBplExpr(Cce.NonNull(eSeq[1])); if (eSeq.Count > 2) { - string s1 = PrettyPrintBplExpr(cce.NonNull(eSeq[2])); + string s1 = PrettyPrintBplExpr(Cce.NonNull(eSeq[2])); if (s1 == "$elements") { return s0; @@ -265,7 +265,7 @@ public static void ExtraTraceInformation(CoreOptions options, string point) private static readonly ConcurrentDictionary UsedLogNames = new(); public static (string fileName, bool reused) GetLogFilename(string descriptiveName, string filename, bool allowReuse) { - filename = SubstituteAtPROC(descriptiveName, cce.NonNull(filename)); + filename = SubstituteAtPROC(descriptiveName, Cce.NonNull(filename)); var reused = false; var index = UsedLogNames.AddOrUpdate(filename, 0, (_, i) => { diff --git a/Source/Core/Inline.cs b/Source/Core/Inline.cs index e649a3c3f..4e194a1ff 100644 --- a/Source/Core/Inline.cs +++ b/Source/Core/Inline.cs @@ -156,7 +156,7 @@ protected void ProcessImplementation(Program program, Implementation impl) bool inlined = false; List newBlocks = DoInlineBlocks(impl.Blocks, ref inlined); - Contract.Assert(cce.NonNullElements(newBlocks)); + Contract.Assert(Cce.NonNullElements(newBlocks)); if (!inlined) { @@ -271,7 +271,7 @@ protected int GetInlineCount(Implementation impl) void CheckRecursion(Implementation impl, Stack /*!*/ callStack) { Contract.Requires(impl != null); - Contract.Requires(cce.NonNullElements(callStack)); + Contract.Requires(Cce.NonNullElements(callStack)); foreach (Procedure /*!*/ p in callStack) { Contract.Assert(p != null); @@ -294,7 +294,7 @@ private int InlineCallCmd(Block block, CallCmd callCmd, Implementation impl, Lis List newBlocks, int lblCount) { Contract.Assume(impl != null); - Contract.Assert(cce.NonNull(impl.OriginalBlocks).Count > 0); + Contract.Assert(Cce.NonNull(impl.OriginalBlocks).Count > 0); // do inline now int nextlblCount = lblCount + 1; @@ -313,7 +313,7 @@ private int InlineCallCmd(Block block, CallCmd callCmd, Implementation impl, Lis List /*!*/ inlinedBlocks = CreateInlinedBlocks(callCmd, impl, nextBlockLabel); - Contract.Assert(cce.NonNullElements(inlinedBlocks)); + Contract.Assert(Cce.NonNullElements(inlinedBlocks)); EndInline(); @@ -355,15 +355,15 @@ private int InlineCallCmd(Block block, CallCmd callCmd, Implementation impl, Lis public virtual List /*!*/ DoInlineBlocks(List /*!*/ blocks, ref bool inlinedSomething) { - Contract.Requires(cce.NonNullElements(blocks)); - Contract.Ensures(cce.NonNullElements(Contract.Result>())); + Contract.Requires(Cce.NonNullElements(blocks)); + Contract.Ensures(Cce.NonNullElements(Contract.Result>())); List /*!*/ newBlocks = new List(); foreach (Block block in blocks) { TransferCmd /*!*/ - transferCmd = cce.NonNull(block.TransferCmd); + transferCmd = Cce.NonNull(block.TransferCmd); List cmds = block.Cmds; List newCmds = new List(); int lblCount = 0; @@ -474,7 +474,7 @@ protected void BeginInline(Implementation impl) Dictionary substMap = new Dictionary(); Procedure proc = impl.Proc; - foreach (Variable /*!*/ locVar in cce.NonNull(impl.OriginalLocVars)) + foreach (Variable /*!*/ locVar in Cce.NonNull(impl.OriginalLocVars)) { Contract.Assert(locVar != null); LocalVariable localVar = new LocalVariable(Token.NoToken, @@ -488,7 +488,7 @@ protected void BeginInline(Implementation impl) for (int i = 0; i < impl.InParams.Count; i++) { - Variable inVar = cce.NonNull(impl.InParams[i]); + Variable inVar = Cce.NonNull(impl.InParams[i]); LocalVariable localVar = new LocalVariable(Token.NoToken, new TypedIdent(Token.NoToken, GetProcVarName(proc.Name, inVar.Name), inVar.TypedIdent.Type, inVar.TypedIdent.WhereExpr)); @@ -501,7 +501,7 @@ protected void BeginInline(Implementation impl) IdentifierExpr ie = new IdentifierExpr(Token.NoToken, localVar); substMap.Add(inVar, ie); // also add a substitution from the corresponding formal occurring in the PROCEDURE declaration - Variable procInVar = cce.NonNull(proc.InParams[i]); + Variable procInVar = Cce.NonNull(proc.InParams[i]); if (procInVar != inVar) { substMap.Add(procInVar, ie); @@ -510,7 +510,7 @@ protected void BeginInline(Implementation impl) for (int i = 0; i < impl.OutParams.Count; i++) { - Variable outVar = cce.NonNull(impl.OutParams[i]); + Variable outVar = Cce.NonNull(impl.OutParams[i]); LocalVariable localVar = new LocalVariable(Token.NoToken, new TypedIdent(Token.NoToken, GetProcVarName(proc.Name, outVar.Name), outVar.TypedIdent.Type, outVar.TypedIdent.WhereExpr)); @@ -523,7 +523,7 @@ protected void BeginInline(Implementation impl) IdentifierExpr ie = new IdentifierExpr(Token.NoToken, localVar); substMap.Add(outVar, ie); // also add a substitution from the corresponding formal occurring in the PROCEDURE declaration - Variable procOutVar = cce.NonNull(proc.OutParams[i]); + Variable procOutVar = Cce.NonNull(proc.OutParams[i]); if (procOutVar != outVar) { substMap.Add(procOutVar, ie); @@ -536,7 +536,7 @@ protected void BeginInline(Implementation impl) { Contract.Assert(mie != null); Variable /*!*/ - mVar = cce.NonNull(mie.Decl); + mVar = Cce.NonNull(mie.Decl); LocalVariable localVar = new LocalVariable(Token.NoToken, new TypedIdent(Token.NoToken, GetProcVarName(proc.Name, mVar.Name), mVar.TypedIdent.Type)); newLocalVars.Add(localVar); @@ -564,7 +564,7 @@ protected void EndInline() private Cmd InlinedRequires(CallCmd callCmd, Requires req) { Requires /*!*/ - reqCopy = (Requires /*!*/) cce.NonNull(req.Clone()); + reqCopy = (Requires /*!*/) Cce.NonNull(req.Clone()); if (req.Free) { reqCopy.Condition = Expr.True; @@ -593,7 +593,7 @@ private Cmd InlinedEnsures(CallCmd callCmd, Ensures ens) else { Ensures /*!*/ - ensCopy = (Ensures /*!*/) cce.NonNull(ens.Clone()); + ensCopy = (Ensures /*!*/) Cce.NonNull(ens.Clone()); ensCopy.Condition = codeCopier.CopyExpr(ens.Condition); return new AssertEnsuresCmd(ensCopy); } @@ -626,9 +626,9 @@ private List RemoveAsserts(List cmds) Contract.Requires(codeCopier.substMap != null); Contract.Requires(codeCopier.oldSubstMap != null); - Contract.Ensures(cce.NonNullElements(Contract.Result>())); + Contract.Ensures(Cce.NonNullElements(Contract.Result>())); List /*!*/ - implBlocks = cce.NonNull(impl.OriginalBlocks); + implBlocks = Cce.NonNull(impl.OriginalBlocks); Contract.Assert(implBlocks.Count > 0); Procedure proc = impl.Proc; @@ -644,8 +644,8 @@ private List RemoveAsserts(List cmds) for (int i = 0; i < impl.InParams.Count; ++i) { Cmd cmd = Cmd.SimpleAssign(impl.tok, - (IdentifierExpr) codeCopier.Subst(cce.NonNull(impl.InParams[i])), - cce.NonNull(callCmd.Ins[i])); + (IdentifierExpr) codeCopier.Subst(Cce.NonNull(impl.InParams[i])), + Cce.NonNull(callCmd.Ins[i])); inCmds.Add(cmd); } @@ -653,11 +653,11 @@ private List RemoveAsserts(List cmds) for (int i = 0; i < proc.Requires.Count; i++) { Requires /*!*/ - req = cce.NonNull(proc.Requires[i]); + req = Cce.NonNull(proc.Requires[i]); inCmds.Add(InlinedRequires(callCmd, req)); } - List locVars = cce.NonNull(impl.OriginalLocVars); + List locVars = Cce.NonNull(impl.OriginalLocVars); // havoc locals and out parameters in case procedure is invoked in a loop List havocVars = new List(); @@ -681,8 +681,8 @@ private List RemoveAsserts(List cmds) { Contract.Assert(mie != null); Variable /*!*/ - mvar = cce.NonNull(mie.Decl); - AssignCmd assign = Cmd.SimpleAssign(impl.tok, (IdentifierExpr) cce.NonNull(codeCopier.OldSubst(mvar)), mie); + mvar = Cce.NonNull(mie.Decl); + AssignCmd assign = Cmd.SimpleAssign(impl.tok, (IdentifierExpr) Cce.NonNull(codeCopier.OldSubst(mvar)), mie); inCmds.Add(assign); } @@ -702,7 +702,7 @@ private List RemoveAsserts(List cmds) } TransferCmd transferCmd = - CreateInlinedTransferCmd(cce.NonNull(block.TransferCmd), GetInlinedProcLabel(proc.Name)); + CreateInlinedTransferCmd(Cce.NonNull(block.TransferCmd), GetInlinedProcLabel(proc.Name)); intBlock = new Block(block.tok, GetInlinedProcLabel(proc.Name) + "$" + block.Label, copyCmds, transferCmd); inlinedBlocks.Add(intBlock); } @@ -714,7 +714,7 @@ private List RemoveAsserts(List cmds) for (int i = 0; i < proc.Ensures.Count; i++) { Ensures /*!*/ - ens = cce.NonNull(proc.Ensures[i]); + ens = Cce.NonNull(proc.Ensures[i]); outCmds.Add(InlinedEnsures(callCmd, ens)); } @@ -722,8 +722,8 @@ private List RemoveAsserts(List cmds) for (int i = 0; i < impl.OutParams.Count; ++i) { Expr /*!*/ - cout_exp = (IdentifierExpr) cce.NonNull(codeCopier.Subst(cce.NonNull(impl.OutParams[i]))); - Cmd cmd = Cmd.SimpleAssign(impl.tok, cce.NonNull(callCmd.Outs[i]), cout_exp); + cout_exp = (IdentifierExpr) Cce.NonNull(codeCopier.Subst(Cce.NonNull(impl.OutParams[i]))); + Cmd cmd = Cmd.SimpleAssign(impl.tok, Cce.NonNull(callCmd.Outs[i]), cout_exp); outCmds.Add(cmd); } @@ -746,7 +746,7 @@ protected TransferCmd CreateInlinedTransferCmd(TransferCmd transferCmd, string p { List gotoSeq = gotoCmd.labelNames; List newGotoSeq = new List(); - foreach (string /*!*/ blockLabel in cce.NonNull(gotoSeq)) + foreach (string /*!*/ blockLabel in Cce.NonNull(gotoSeq)) { Contract.Assert(blockLabel != null); newGotoSeq.Add(procLabel + "$" + blockLabel); diff --git a/Source/Core/LambdaHelper.cs b/Source/Core/LambdaHelper.cs index 2826e66e9..6ee0f5e7b 100644 --- a/Source/Core/LambdaHelper.cs +++ b/Source/Core/LambdaHelper.cs @@ -294,7 +294,7 @@ private Expr LiftLambdaFreeVars(LambdaExpr lambda) string lam_str = sw.ToString(); IToken tok = lambda.tok; - Formal res = new Formal(tok, new TypedIdent(tok, TypedIdent.NoName, cce.NonNull(lambda.Type)), false); + Formal res = new Formal(tok, new TypedIdent(tok, TypedIdent.NoName, Cce.NonNull(lambda.Type)), false); if (liftedLambdas.TryGetValue(lambda, out var fcall)) { diff --git a/Source/Core/LoopUnroll.cs b/Source/Core/LoopUnroll.cs index 1c9b95897..22f9cdfc5 100644 --- a/Source/Core/LoopUnroll.cs +++ b/Source/Core/LoopUnroll.cs @@ -12,7 +12,7 @@ public class LoopUnroll Contract.Requires(start != null); Contract.Requires(0 <= unrollMaxDepth); - Contract.Ensures(cce.NonNullElements(Contract.Result>())); + Contract.Ensures(Cce.NonNullElements(Contract.Result>())); Dictionary gd = new Dictionary(); HashSet beingVisited = new HashSet(); GraphNode gStart = GraphNode.ComputeGraphInfo(null, start, gd, beingVisited); @@ -88,9 +88,9 @@ void ObjectInvariant() { Contract.Invariant(Block != null); Contract.Invariant(Body != null); - Contract.Invariant(cce.NonNullElements(ForwardEdges)); - Contract.Invariant(cce.NonNullElements(BackEdges)); - Contract.Invariant(cce.NonNullElements(Predecessors)); + Contract.Invariant(Cce.NonNullElements(ForwardEdges)); + Contract.Invariant(Cce.NonNullElements(BackEdges)); + Contract.Invariant(Cce.NonNullElements(Predecessors)); Contract.Invariant(isCutPoint == (BackEdges.Count != 0)); } @@ -143,7 +143,7 @@ public static GraphNode ComputeGraphInfo(GraphNode from, Block b, { Contract.Requires(beingVisited != null); Contract.Requires(b != null); - Contract.Requires(cce.NonNullDictionaryAndValues(gd)); + Contract.Requires(Cce.NonNullDictionaryAndValues(gd)); Contract.Ensures(Contract.Result() != null); if (gd.TryGetValue(b, out var g)) { @@ -220,8 +220,8 @@ readonly LoopUnroll /*!*/ void ObjectInvariant() { Contract.Invariant(head != null); - Contract.Invariant(cce.NonNullElements(newBlockSeqGlobal)); - Contract.Invariant(newBlocks != null && cce.NonNullElements(newBlocks.Values)); + Contract.Invariant(Cce.NonNullElements(newBlockSeqGlobal)); + Contract.Invariant(newBlocks != null && Cce.NonNullElements(newBlocks.Values)); } @@ -230,9 +230,9 @@ private LoopUnroll(int unrollMaxDepth, bool soundLoopUnrolling, Dictionary> /*!*/ scc, List /*!*/ newBlockSeqGlobal) : base() { - Contract.Requires(cce.NonNullElements(newBlockSeqGlobal)); - Contract.Requires(cce.NonNullDictionaryAndValues(scc) && - Contract.ForAll(scc.Values, v => cce.NonNullElements(v))); + Contract.Requires(Cce.NonNullElements(newBlockSeqGlobal)); + Contract.Requires(Cce.NonNullDictionaryAndValues(scc) && + Contract.ForAll(scc.Values, v => Cce.NonNullElements(v))); Contract.Requires(0 <= unrollMaxDepth); this.newBlockSeqGlobal = newBlockSeqGlobal; this.c = unrollMaxDepth; @@ -248,8 +248,8 @@ private LoopUnroll(int unrollMaxDepth, bool soundLoopUnrolling, Dictionary> scc, List /*!*/ newBlockSeqGlobal, LoopUnroll head) { Contract.Requires(head != null); - Contract.Requires(cce.NonNullDictionaryAndValues(scc)); - Contract.Requires(cce.NonNullElements(newBlockSeqGlobal)); + Contract.Requires(Cce.NonNullDictionaryAndValues(scc)); + Contract.Requires(Cce.NonNullElements(newBlockSeqGlobal)); Contract.Requires(0 <= unrollMaxDepth); this.newBlockSeqGlobal = newBlockSeqGlobal; this.c = unrollMaxDepth; diff --git a/Source/Core/MaxHolesLambdaLifter.cs b/Source/Core/MaxHolesLambdaLifter.cs index c6d7a1630..ee2f25297 100644 --- a/Source/Core/MaxHolesLambdaLifter.cs +++ b/Source/Core/MaxHolesLambdaLifter.cs @@ -374,7 +374,7 @@ public override Expr VisitLambdaExpr(LambdaExpr node) // the resulting lifted function applied to free variables IToken tok = _lambda.tok; - Formal res = new Formal(tok, new TypedIdent(tok, TypedIdent.NoName, cce.NonNull(_lambda.Type)), false); + Formal res = new Formal(tok, new TypedIdent(tok, TypedIdent.NoName, Cce.NonNull(_lambda.Type)), false); var liftedLambda = (LambdaExpr) LambdaLiftingMaxHolesFiller.Fill( (from kvp in _templates where !kvp.Value.ContainsBoundVariables() select kvp.Key).ToList(), @@ -490,7 +490,7 @@ public override Expr VisitOldExpr(OldExpr node) else { // After OldFinder pass, old expressions should only occur around free variables - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } return node; diff --git a/Source/Core/Monomorphization.cs b/Source/Core/Monomorphization.cs index 4c5b2c36d..6cfe267aa 100644 --- a/Source/Core/Monomorphization.cs +++ b/Source/Core/Monomorphization.cs @@ -1159,7 +1159,7 @@ public override Expr VisitBinderExpr(BinderExpr node) } else { - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } } @@ -1223,7 +1223,7 @@ public bool IsPolymorphic(Type type) mapType.TypeParameters.ForEach(x => boundTypeVariables.Remove(x)); return returnVal; } - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } } } @@ -1563,7 +1563,7 @@ public IEnumerable> AbsyInstantiations(Absy decl) { return polymorphicMapInfos[mapType].Instances; } - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } public PolymorphicMapInfo RegisterPolymorphicMapType(Type type) diff --git a/Source/Core/OOLongUtil.cs b/Source/Core/OOLongUtil.cs index 4c09e8c5a..1d29fc03a 100644 --- a/Source/Core/OOLongUtil.cs +++ b/Source/Core/OOLongUtil.cs @@ -92,16 +92,16 @@ public LineReader([Captured] TextReader reader) public override void Close() { - cce.BeginExpose(this); + Cce.BeginExpose(this); { reader.Close(); } - cce.EndExpose(); + Cce.EndExpose(); } public override int Read() { - cce.BeginExpose(this); + Cce.BeginExpose(this); try { while (readAhead == null) @@ -129,7 +129,7 @@ public override int Read() } finally { - cce.EndExpose(); + Cce.EndExpose(); } } @@ -155,12 +155,12 @@ public override string ReadLine() string res; if (readAhead != null) { - cce.BeginExpose(this); + Cce.BeginExpose(this); { res = readAhead.Substring(readAheadConsumed); readAhead = null; } - cce.EndExpose(); + Cce.EndExpose(); } else { @@ -181,7 +181,7 @@ public class IfdefReader : LineReader void ObjectInvariant() { Contract.Invariant(readState != null); - Contract.Invariant(cce.NonNullElements(defines)); + Contract.Invariant(Cce.NonNullElements(defines)); Contract.Invariant(0 <= ignoreCutoff && ignoreCutoff <= readState.Count); } @@ -190,7 +190,7 @@ public IfdefReader([Captured] TextReader reader, [Captured] List / : base(reader) { Contract.Requires(reader != null); - Contract.Requires(cce.NonNullElements(defines)); + Contract.Requires(Cce.NonNullElements(defines)); this.defines = defines; } diff --git a/Source/Core/Parser.cs b/Source/Core/Parser.cs index 0094b0fc3..fb6dc1df6 100644 --- a/Source/Core/Parser.cs +++ b/Source/Core/Parser.cs @@ -75,7 +75,7 @@ public static Program ParseLibrary(string libraryName) /// public static int Parse(string/*!*/ filename, List defines, out /*maybe null*/ Program program, bool useBaseName=false) /* throws System.IO.IOException */ { Contract.Requires(filename != null); - Contract.Requires(cce.NonNullElements(defines,true)); + Contract.Requires(Cce.NonNullElements(defines,true)); if (filename == "stdin.bpl") { return Parse(Console.In, filename, defines, out program, useBaseName); @@ -96,7 +96,7 @@ public static int Parse(string s, string/*!*/ filename, out /*maybe null*/ Progr Contract.Requires(s != null); Contract.Requires(filename != null); - byte[]/*!*/ buffer = cce.NonNull(UTF8Encoding.Default.GetBytes(s)); + byte[]/*!*/ buffer = Cce.NonNull(UTF8Encoding.Default.GetBytes(s)); MemoryStream ms = new MemoryStream(buffer,false); Errors errors = new Errors(); Scanner scanner = new Scanner(ms, errors, filename, useBaseName); @@ -147,9 +147,9 @@ public override void Resolve(ResolutionContext/*!*/ rc) { } public override void Emit(TokenTextWriter/*!*/ stream, int contextBindingStrength, bool fragileContext) { - Contract.Assert(false);throw new cce.UnreachableException(); + Contract.Assert(false);throw new Cce.UnreachableException(); } - public override void ComputeFreeVariables(GSet/*!*/ freeVars) { Contract.Assert(false);throw new cce.UnreachableException(); } + public override void ComputeFreeVariables(GSet/*!*/ freeVars) { Contract.Assert(false);throw new Cce.UnreachableException(); } public override int ContentHash => throw new NotSupportedException("Not supported since this type is translated away"); @@ -471,7 +471,7 @@ void Function(out List/*!*/ ds) { if (!allUnnamed) { Bpl.Type prevType = null; for (int i = arguments.Count; 0 <= --i; ) { - TypedIdent/*!*/ curr = cce.NonNull(arguments[i]).TypedIdent; + TypedIdent/*!*/ curr = Cce.NonNull(arguments[i]).TypedIdent; if (curr.HasName) { // the argument was given as both an identifier and a type prevType = curr.Type; @@ -530,7 +530,7 @@ void Axiom(out Axiom/*!*/ m) { } void UserDefinedTypes(out List/*!*/ ts) { - Contract.Ensures(cce.NonNullElements(Contract.ValueAtReturn(out ts))); Declaration/*!*/ decl; QKeyValue kv = null; ts = new List (); + Contract.Ensures(Cce.NonNullElements(Contract.ValueAtReturn(out ts))); Declaration/*!*/ decl; QKeyValue kv = null; ts = new List (); Expect(32); while (la.kind == 26) { Attribute(ref kv); @@ -1511,7 +1511,7 @@ void LabelOrCmd(out Cmd c, out IToken label) { } void StructuredCmd(out StructuredCmd/*!*/ ec) { - Contract.Ensures(Contract.ValueAtReturn(out ec) != null); ec = dummyStructuredCmd; Contract.Assume(cce.IsPeerConsistent(ec)); + Contract.Ensures(Contract.ValueAtReturn(out ec) != null); ec = dummyStructuredCmd; Contract.Assume(Cce.IsPeerConsistent(ec)); IfCmd/*!*/ ifcmd; WhileCmd/*!*/ wcmd; BreakCmd/*!*/ bcmd; if (la.kind == 56) { @@ -1584,7 +1584,7 @@ void WhileCmd(out WhileCmd wcmd) { Expect(58); x = t; Guard(out guard); - Contract.Assume(guard == null || cce.Owner.None(guard)); + Contract.Assume(guard == null || Cce.Owner.None(guard)); while (la.kind == 35 || la.kind == 52) { isFree = false; z = la/*lookahead token*/; if (la.kind == 52) { @@ -1739,7 +1739,7 @@ void ParCallCmd(out Cmd d) { } void MapAssignIndex(out IToken/*!*/ x, out List/*!*/ indexes) { - Contract.Ensures(Contract.ValueAtReturn(out x) != null); Contract.Ensures(cce.NonNullElements(Contract.ValueAtReturn(out indexes))); indexes = new List (); + Contract.Ensures(Contract.ValueAtReturn(out x) != null); Contract.Ensures(Cce.NonNullElements(Contract.ValueAtReturn(out indexes))); indexes = new List (); Expr/*!*/ e; Expect(19); @@ -2529,7 +2529,7 @@ void IfThenElseExpression(out Expr/*!*/ e) { } void CodeExpression(out List/*!*/ locals, out List/*!*/ blocks) { - Contract.Ensures(Contract.ValueAtReturn(out locals) != null); Contract.Ensures(cce.NonNullElements(Contract.ValueAtReturn(out blocks))); locals = new List(); Block/*!*/ b; + Contract.Ensures(Contract.ValueAtReturn(out locals) != null); Contract.Ensures(Cce.NonNullElements(Contract.ValueAtReturn(out blocks))); locals = new List(); Block/*!*/ b; blocks = new List(); Expect(113); diff --git a/Source/Core/ParserHelper.cs b/Source/Core/ParserHelper.cs index 5af2aed8b..e439086a6 100644 --- a/Source/Core/ParserHelper.cs +++ b/Source/Core/ParserHelper.cs @@ -23,7 +23,7 @@ public ReadState(bool hasSeenElse, bool mayStillIncludeAnotherAlternative) private static bool IfdefConditionSaysToInclude(string arg, List /*!*/ defines) { Contract.Requires(arg != null); - Contract.Requires(cce.NonNullElements(defines)); + Contract.Requires(Cce.NonNullElements(defines)); bool sense = true; while (arg.StartsWith("!")) { @@ -37,7 +37,7 @@ private static bool IfdefConditionSaysToInclude(string arg, List / public static string Fill(Stream stream, List /*!*/ defines) { Contract.Requires(stream != null); - Contract.Requires(cce.NonNullElements(defines)); + Contract.Requires(Cce.NonNullElements(defines)); Contract.Ensures(Contract.Result() != null); StreamReader /*!*/ reader = new StreamReader(stream); @@ -47,7 +47,7 @@ public static string Fill(Stream stream, List /*!*/ defines) public static string Fill(TextReader reader, List /*!*/ defines) { Contract.Requires(reader != null); - Contract.Requires(cce.NonNullElements(defines)); + Contract.Requires(Cce.NonNullElements(defines)); Contract.Ensures(Contract.Result() != null); StringBuilder sb = new StringBuilder(); List /*!*/ diff --git a/Source/Core/ResolutionContext.cs b/Source/Core/ResolutionContext.cs index 47fe6bd57..e667b9869 100644 --- a/Source/Core/ResolutionContext.cs +++ b/Source/Core/ResolutionContext.cs @@ -133,7 +133,7 @@ public ResolutionContext(IErrorSink errorSink, CoreOptions options) void ObjectInvariant() { Contract.Invariant(types != null); - Contract.Invariant(cce.NonNullElements(typeBinders)); + Contract.Invariant(Cce.NonNullElements(typeBinders)); Contract.Invariant(varContext != null); Contract.Invariant(functions != null); Contract.Invariant(procedures != null); @@ -382,7 +382,7 @@ public void AddStatementId(IToken tok, string name) public void AddVariable(Variable var) { Contract.Requires(var != null); - var previous = FindVariable(cce.NonNull(var.Name), true); + var previous = FindVariable(Cce.NonNull(var.Name), true); if (previous == null) { varContext.VarSymbols.Add(var.Name, var); @@ -711,11 +711,11 @@ public State StateMode { Contract.Assert(value != stateMode); Contract.Assert(stateMode == State.Single || value == State.Single); - cce.BeginExpose(this); + Cce.BeginExpose(this); { stateMode = value; } - cce.EndExpose(); + Cce.EndExpose(); } } @@ -732,11 +732,11 @@ public bool TriggerMode set { Contract.Assert(triggerMode != value); - cce.BeginExpose(this); + Cce.BeginExpose(this); { triggerMode = value; } - cce.EndExpose(); + Cce.EndExpose(); } } diff --git a/Source/Core/StandardVisitor.cs b/Source/Core/StandardVisitor.cs index 0c72da8df..5f1210854 100644 --- a/Source/Core/StandardVisitor.cs +++ b/Source/Core/StandardVisitor.cs @@ -32,7 +32,7 @@ public virtual IList VisitExprSeq(IList list) { for (int i = 0, n = list.Count; i < n; i++) { - list[i] = (Expr) this.Visit(cce.NonNull(list[i])); + list[i] = (Expr) this.Visit(Cce.NonNull(list[i])); } } @@ -102,8 +102,8 @@ public virtual Cmd VisitAssignCmd(AssignCmd node) Contract.Ensures(Contract.Result() != null); for (int i = 0; i < node.Lhss.Count; ++i) { - node.SetLhs(i, cce.NonNull((AssignLhs) this.Visit(node.Lhss[i]))); - node.SetRhs(i, cce.NonNull((Expr /*!*/) this.VisitExpr(node.Rhss[i]))); + node.SetLhs(i, Cce.NonNull((AssignLhs) this.Visit(node.Lhss[i]))); + node.SetRhs(i, Cce.NonNull((Expr /*!*/) this.VisitExpr(node.Rhss[i]))); } VisitAttributes(node); return node; @@ -191,7 +191,7 @@ public virtual Block VisitBlock(Block node) Contract.Requires(node != null); Contract.Ensures(Contract.Result() != null); node.Cmds = this.VisitCmdSeq(node.Cmds); - node.TransferCmd = (TransferCmd) this.Visit(cce.NonNull(node.TransferCmd)); + node.TransferCmd = (TransferCmd) this.Visit(Cce.NonNull(node.TransferCmd)); return node; } @@ -212,7 +212,7 @@ public virtual List VisitBlockSeq(List blockSeq) { for (int i = 0, n = blockSeq.Count; i < n; i++) { - blockSeq[i] = this.VisitBlock(cce.NonNull(blockSeq[i])); + blockSeq[i] = this.VisitBlock(Cce.NonNull(blockSeq[i])); } } @@ -247,7 +247,7 @@ public virtual Cmd VisitCallCmd(CallCmd node) { if (node.Ins[i] != null) { - node.Ins[i] = this.VisitExpr(cce.NonNull(node.Ins[i])); + node.Ins[i] = this.VisitExpr(Cce.NonNull(node.Ins[i])); } } @@ -255,7 +255,7 @@ public virtual Cmd VisitCallCmd(CallCmd node) { if (node.Outs[i] != null) { - node.Outs[i] = (IdentifierExpr) this.VisitIdentifierExpr(cce.NonNull(node.Outs[i])); + node.Outs[i] = (IdentifierExpr) this.VisitIdentifierExpr(Cce.NonNull(node.Outs[i])); } } VisitAttributes(node); @@ -304,7 +304,7 @@ public virtual List VisitCmdSeq(List cmdSeq) for (int i = 0, n = cmdSeq.Count; i < n; i++) { cmdSeq[i] = (Cmd) this.Visit( - cce.NonNull(cmdSeq[i])); // call general Visit so subtypes of Cmd get visited by their particular visitor + Cce.NonNull(cmdSeq[i])); // call general Visit so subtypes of Cmd get visited by their particular visitor } } @@ -341,7 +341,7 @@ public virtual CtorType VisitCtorType(CtorType node) { for (int i = 0; i < node.Arguments.Count; ++i) { - node.Arguments[i] = cce.NonNull((Type /*!*/) this.Visit(node.Arguments[i])); + node.Arguments[i] = Cce.NonNull((Type /*!*/) this.Visit(node.Arguments[i])); } } @@ -361,7 +361,7 @@ public virtual Declaration VisitDeclaration(Declaration node) Contract.Ensures(Contract.Result>() != null); for (int i = 0, n = declarationList.Count; i < n; i++) { - declarationList[i] = cce.NonNull((Declaration /*!*/) this.Visit(declarationList[i])); + declarationList[i] = Cce.NonNull((Declaration /*!*/) this.Visit(declarationList[i])); } return declarationList; @@ -406,7 +406,7 @@ public override IList VisitExprSeq(IList exprSeq) Contract.Ensures(Contract.Result>() != null); for (int i = 0, n = exprSeq.Count; i < n; i++) { - exprSeq[i] = this.VisitExpr(cce.NonNull(exprSeq[i])); + exprSeq[i] = this.VisitExpr(Cce.NonNull(exprSeq[i])); } return exprSeq; @@ -547,7 +547,7 @@ public virtual List VisitIdentifierExprSeq(List { for (int i = 0, n = identifierExprSeq.Count; i < n; i++) { - identifierExprSeq[i] = (IdentifierExpr) this.VisitIdentifierExpr(cce.NonNull(identifierExprSeq[i])); + identifierExprSeq[i] = (IdentifierExpr) this.VisitIdentifierExpr(Cce.NonNull(identifierExprSeq[i])); } } @@ -584,10 +584,10 @@ public virtual AssignLhs VisitMapAssignLhs(MapAssignLhs node) { Contract.Requires(node != null); Contract.Ensures(Contract.Result() != null); - node.Map = cce.NonNull((AssignLhs) this.Visit(node.Map)); + node.Map = Cce.NonNull((AssignLhs) this.Visit(node.Map)); for (int i = 0; i < node.Indexes.Count; ++i) { - node.Indexes[i] = cce.NonNull((Expr) this.VisitExpr(node.Indexes[i])); + node.Indexes[i] = Cce.NonNull((Expr) this.VisitExpr(node.Indexes[i])); } return node; @@ -597,7 +597,7 @@ public virtual AssignLhs VisitFieldAssignLhs(FieldAssignLhs node) { Contract.Requires(node != null); Contract.Ensures(Contract.Result() != null); - node.Datatype = cce.NonNull((AssignLhs) this.Visit(node.Datatype)); + node.Datatype = Cce.NonNull((AssignLhs) this.Visit(node.Datatype)); return node; } @@ -614,11 +614,11 @@ public virtual Type VisitMapType(MapType node) { for (int i = 0; i < node.Arguments.Count; ++i) { - node.Arguments[i] = cce.NonNull((Type /*!*/) this.Visit(node.Arguments[i])); + node.Arguments[i] = Cce.NonNull((Type /*!*/) this.Visit(node.Arguments[i])); } } - node.Result = cce.NonNull((Type /*!*/) this.Visit(node.Result)); + node.Result = Cce.NonNull((Type /*!*/) this.Visit(node.Result)); return node; } @@ -771,7 +771,7 @@ public virtual QuantifierExpr VisitQuantifierExpr(QuantifierExpr node) { Contract.Requires(node != null); Contract.Ensures(Contract.Result() != null); - node = cce.NonNull((QuantifierExpr) this.VisitBinderExpr(node)); + node = Cce.NonNull((QuantifierExpr) this.VisitBinderExpr(node)); if (node.Triggers != null) { node.Triggers = this.VisitTrigger(node.Triggers); @@ -793,7 +793,7 @@ public virtual List VisitRESeq(List reSeq) Contract.Ensures(Contract.Result>() != null); for (int i = 0, n = reSeq.Count; i < n; i++) { - reSeq[i] = (RE) this.VisitRE(cce.NonNull(reSeq[i])); + reSeq[i] = (RE) this.VisitRE(Cce.NonNull(reSeq[i])); } return reSeq; @@ -894,12 +894,12 @@ public virtual Type VisitTypeSynonymAnnotation(TypeSynonymAnnotation node) { Contract.Requires(node != null); Contract.Ensures(Contract.Result() != null); - node.ExpandedType = cce.NonNull((Type /*!*/) this.Visit(node.ExpandedType)); + node.ExpandedType = Cce.NonNull((Type /*!*/) this.Visit(node.ExpandedType)); lock (node.Arguments) { for (int i = 0; i < node.Arguments.Count; ++i) { - node.Arguments[i] = cce.NonNull((Type /*!*/) this.Visit(node.Arguments[i])); + node.Arguments[i] = Cce.NonNull((Type /*!*/) this.Visit(node.Arguments[i])); } } @@ -928,7 +928,7 @@ public virtual Type VisitTypeProxy(TypeProxy node) // specific type, we visit the instantiation if (node.ProxyFor != null) { - return cce.NonNull((Type /*!*/) this.Visit(node.ProxyFor)); + return Cce.NonNull((Type /*!*/) this.Visit(node.ProxyFor)); } return this.VisitType(node); @@ -957,7 +957,7 @@ public virtual List VisitVariableSeq(List variableSeq) { for (int i = 0, n = variableSeq.Count; i < n; i++) { - variableSeq[i] = this.VisitVariable(cce.NonNull(variableSeq[i])); + variableSeq[i] = this.VisitVariable(Cce.NonNull(variableSeq[i])); } } @@ -1127,7 +1127,7 @@ public override Block VisitBlock(Block node) { Contract.Ensures(Contract.Result() == node); this.VisitCmdSeq(node.Cmds); - this.Visit(cce.NonNull(node.TransferCmd)); + this.Visit(Cce.NonNull(node.TransferCmd)); return node; } @@ -1144,7 +1144,7 @@ public override List VisitBlockSeq(List blockSeq) Contract.Ensures(Contract.Result>() == blockSeq); for (int i = 0, n = blockSeq.Count; i < n; i++) { - this.VisitBlock(cce.NonNull(blockSeq[i])); + this.VisitBlock(Cce.NonNull(blockSeq[i])); } return blockSeq; @@ -1208,7 +1208,7 @@ public override List VisitCmdSeq(List cmdSeq) Contract.Ensures(Contract.Result>() == cmdSeq); for (int i = 0, n = cmdSeq.Count; i < n; i++) { - this.Visit(cce.NonNull( + this.Visit(Cce.NonNull( cmdSeq[i])); // call general Visit so subtypes of Cmd get visited by their particular visitor } @@ -1294,7 +1294,7 @@ public override IList VisitExprSeq(IList exprSeq) Contract.Ensures(Contract.Result>() == exprSeq); for (int i = 0, n = exprSeq.Count; i < n; i++) { - this.VisitExpr(cce.NonNull(exprSeq[i])); + this.VisitExpr(Cce.NonNull(exprSeq[i])); } return exprSeq; @@ -1415,7 +1415,7 @@ public override List VisitIdentifierExprSeq(List Contract.Ensures(Contract.Result>() == identifierExprSeq); for (int i = 0, n = identifierExprSeq.Count; i < n; i++) { - this.VisitIdentifierExpr(cce.NonNull(identifierExprSeq[i])); + this.VisitIdentifierExpr(Cce.NonNull(identifierExprSeq[i])); } return identifierExprSeq; @@ -1568,7 +1568,7 @@ public override List VisitRESeq(List reSeq) Contract.Ensures(Contract.Result>() == reSeq); for (int i = 0, n = reSeq.Count; i < n; i++) { - this.VisitRE(cce.NonNull(reSeq[i])); + this.VisitRE(Cce.NonNull(reSeq[i])); } return reSeq; @@ -1652,7 +1652,7 @@ public override Declaration VisitTypeCtorDecl(TypeCtorDecl node) public override Type VisitTypeSynonymAnnotation(TypeSynonymAnnotation node) { Contract.Ensures(Contract.Result() == node); - node.ExpandedType = cce.NonNull((Type /*!*/) this.Visit(node.ExpandedType)); + node.ExpandedType = Cce.NonNull((Type /*!*/) this.Visit(node.ExpandedType)); for (int i = 0; i < node.Arguments.Count; ++i) { this.Visit(node.Arguments[i]); @@ -1704,7 +1704,7 @@ public override List VisitVariableSeq(List variableSeq) Contract.Ensures(Contract.Result>() == variableSeq); for (int i = 0, n = variableSeq.Count; i < n; i++) { - this.VisitVariable(cce.NonNull(variableSeq[i])); + this.VisitVariable(Cce.NonNull(variableSeq[i])); } return variableSeq; diff --git a/Source/Core/TypeAmbiguitySeeker.cs b/Source/Core/TypeAmbiguitySeeker.cs index ae0cb8a30..76e3579f6 100644 --- a/Source/Core/TypeAmbiguitySeeker.cs +++ b/Source/Core/TypeAmbiguitySeeker.cs @@ -56,7 +56,7 @@ public override Expr VisitNAryExpr(NAryExpr node) { //Contract.Requires(node != null); Contract.Ensures(Contract.Result() != null); - CheckTypeParams(node, cce.NonNull(node.TypeParameters)); + CheckTypeParams(node, Cce.NonNull(node.TypeParameters)); return base.VisitNAryExpr(node); } @@ -64,7 +64,7 @@ public override AssignLhs VisitMapAssignLhs(MapAssignLhs node) { //Contract.Requires(node != null); Contract.Ensures(Contract.Result() != null); - CheckTypeParams(node, cce.NonNull(node.TypeParameters)); + CheckTypeParams(node, Cce.NonNull(node.TypeParameters)); return base.VisitMapAssignLhs(node); } } diff --git a/Source/Core/Xml.cs b/Source/Core/Xml.cs index 6f8e33820..18f40117a 100644 --- a/Source/Core/Xml.cs +++ b/Source/Core/Xml.cs @@ -43,7 +43,7 @@ public string Open() Close(); } - cce.BeginExpose(this); + Cce.BeginExpose(this); XmlWriterSettings settings = new XmlWriterSettings(); settings.Indent = true; wr = XmlWriter.Create(filename, settings); @@ -51,7 +51,7 @@ public string Open() wr.WriteStartElement("boogie"); wr.WriteAttributeString("version", options.VersionNumber); wr.WriteAttributeString("commandLine", Environment.CommandLine); - cce.EndExpose(); + Cce.EndExpose(); return null; // success } @@ -60,13 +60,13 @@ public void Close() //modifies this.*; if (wr != null) { - cce.BeginExpose(this); + Cce.BeginExpose(this); { wr.WriteEndDocument(); wr.Close(); wr = null; } - cce.EndExpose(); + Cce.EndExpose(); } } @@ -79,11 +79,11 @@ public void WriteStartMethod(string methodName, DateTime startTime) //modifies this.*; Contract.Ensures(IsOpen); Contract.Assert(wr != null); - cce.BeginExpose(this); + Cce.BeginExpose(this); wr.WriteStartElement("method"); wr.WriteAttributeString("name", methodName); wr.WriteAttributeString("startTime", startTime.ToString(DateTimeFormatString)); - cce.EndExpose(); + Cce.EndExpose(); } public void WriteEndMethod(string outcome, DateTime endTime, TimeSpan elapsed, int? resourceCount) @@ -93,7 +93,7 @@ public void WriteEndMethod(string outcome, DateTime endTime, TimeSpan elapsed, i //modifies this.*; Contract.Ensures(IsOpen); Contract.Assert(wr != null); - cce.BeginExpose(this); + Cce.BeginExpose(this); { wr.WriteStartElement("conclusion"); wr.WriteAttributeString("endTime", endTime.ToString(DateTimeFormatString)); @@ -108,7 +108,7 @@ public void WriteEndMethod(string outcome, DateTime endTime, TimeSpan elapsed, i wr.WriteEndElement(); // outcome wr.WriteEndElement(); // method } - cce.EndExpose(); + Cce.EndExpose(); } public void WriteSplit(int splitNum, int iteration, IEnumerable asserts, DateTime startTime, @@ -121,7 +121,7 @@ public void WriteSplit(int splitNum, int iteration, IEnumerable asser Contract.Ensures(IsOpen); Contract.Assert(wr != null); - cce.BeginExpose(this); + Cce.BeginExpose(this); { wr.WriteStartElement("assertionBatch"); wr.WriteAttributeString("number", splitNum.ToString()); @@ -149,18 +149,18 @@ public void WriteSplit(int splitNum, int iteration, IEnumerable asser wr.WriteEndElement(); // assertionBatch } - cce.EndExpose(); + Cce.EndExpose(); } public void WriteError(string message, IToken errorToken, IToken relatedToken, List trace) { Contract.Requires(errorToken != null); Contract.Requires(message != null); - Contract.Requires(IsOpen && (trace == null || cce.Owner.Different(this, trace))); + Contract.Requires(IsOpen && (trace == null || Cce.Owner.Different(this, trace))); //modifies this.*, errorToken.*, relatedToken.*, trace.*; Contract.Ensures(IsOpen); Contract.Assert(wr != null); - cce.BeginExpose(this); + Cce.BeginExpose(this); { wr.WriteStartElement("error"); wr.WriteAttributeString("message", message); @@ -178,7 +178,7 @@ public void WriteError(string message, IToken errorToken, IToken relatedToken, L { foreach (object bo in trace) { - cce.LoopInvariant(wr != null); + Cce.LoopInvariant(wr != null); Contract.Assume(bo is Block); Block b = (Block) bo; wr.WriteStartElement("traceNode"); @@ -195,7 +195,7 @@ public void WriteError(string message, IToken errorToken, IToken relatedToken, L wr.WriteEndElement(); } - cce.EndExpose(); + Cce.EndExpose(); } #if CCI @@ -238,7 +238,7 @@ public void WriteError(string message, Cci.Node offendingNode, List trace [Inside] private void WriteTokenAttributes(IToken tok) { - Contract.Requires(wr != null && cce.IsPeerConsistent(wr)); + Contract.Requires(wr != null && Cce.IsPeerConsistent(wr)); //modifies this.0, wr.*; if (tok != null && tok.filename != null) { @@ -270,12 +270,12 @@ public void WriteStartInference(string inferenceName) //modifies this.*; Contract.Ensures(IsOpen); Contract.Assert(wr != null); - cce.BeginExpose(this); + Cce.BeginExpose(this); { wr.WriteStartElement("inference"); wr.WriteAttributeString("name", inferenceName); } - cce.EndExpose(); + Cce.EndExpose(); } public void WriteEndInference() @@ -284,11 +284,11 @@ public void WriteEndInference() //modifies this.*; Contract.Ensures(IsOpen); Contract.Assert(wr != null); - cce.BeginExpose(this); + Cce.BeginExpose(this); { wr.WriteEndElement(); // inference } - cce.EndExpose(); + Cce.EndExpose(); } public void WriteContractParaAssignment(string varName, string val) @@ -298,14 +298,14 @@ public void WriteContractParaAssignment(string varName, string val) //modifies this.*; Contract.Ensures(IsOpen); Contract.Assert(wr != null); - cce.BeginExpose(this); + Cce.BeginExpose(this); { wr.WriteStartElement("assignment"); wr.WriteAttributeString("name", varName); wr.WriteAttributeString("value", val); wr.WriteEndElement(); } - cce.EndExpose(); + Cce.EndExpose(); } public void WriteStartFile(string filename) @@ -315,12 +315,12 @@ public void WriteStartFile(string filename) //modifies this.*; Contract.Ensures(IsOpen); Contract.Assert(wr != null); - cce.BeginExpose(this); + Cce.BeginExpose(this); { wr.WriteStartElement("file"); wr.WriteAttributeString("name", filename); } - cce.EndExpose(); + Cce.EndExpose(); } public void WriteEndFile() @@ -329,11 +329,11 @@ public void WriteEndFile() //modifies this.*; Contract.Ensures(IsOpen); Contract.Assert(wr != null); - cce.BeginExpose(this); + Cce.BeginExpose(this); { wr.WriteEndElement(); } - cce.EndExpose(); + Cce.EndExpose(); } public void WriteFileFragment(string fragment) @@ -343,13 +343,13 @@ public void WriteFileFragment(string fragment) //modifies this.*; Contract.Ensures(IsOpen); Contract.Assert(wr != null); - cce.BeginExpose(this); + Cce.BeginExpose(this); { wr.WriteStartElement("fileFragment"); wr.WriteAttributeString("name", fragment); wr.WriteEndElement(); } - cce.EndExpose(); + Cce.EndExpose(); } } @@ -366,7 +366,7 @@ public XmlFileScope(XmlSink sink, string filename) if (sink != null) { sink.WriteStartFile(filename); // invoke this method while "sink" is still peer consistent - cce.Owner.AssignSame(this, sink); + Cce.Owner.AssignSame(this, sink); this.sink = sink; } } diff --git a/Source/ExecutionEngine/CommandLineOptionEngine.cs b/Source/ExecutionEngine/CommandLineOptionEngine.cs index d9bf47d72..3ce9a11d4 100644 --- a/Source/ExecutionEngine/CommandLineOptionEngine.cs +++ b/Source/ExecutionEngine/CommandLineOptionEngine.cs @@ -17,7 +17,7 @@ void ObjectInvariant() Contract.Invariant(ToolName != null); Contract.Invariant(DescriptiveToolName != null); Contract.Invariant(this._environment != null); - Contract.Invariant(cce.NonNullElements(this._files)); + Contract.Invariant(Cce.NonNullElements(this._files)); Contract.Invariant(this._fileTimestamp != null); } @@ -43,7 +43,7 @@ public IList /*!*/ Files { get { - Contract.Ensures(cce.NonNullElements(Contract.Result>())); + Contract.Ensures(Cce.NonNullElements(Contract.Result>())); Contract.Ensures(Contract.Result>().IsReadOnly); return this._files.AsReadOnly(); } @@ -67,7 +67,7 @@ public virtual string /*!*/ VersionNumber get { Contract.Ensures(Contract.Result() != null); - return cce.NonNull(cce + return Cce.NonNull(Cce .NonNull(System.Diagnostics.FileVersionInfo.GetVersionInfo(System.Reflection.Assembly.GetExecutingAssembly() .Location)).FileVersion); } @@ -92,7 +92,7 @@ public virtual string /*!*/ Version } private string /*!*/ - _fileTimestamp = cce.NonNull(DateTime.Now.ToString("o")).Replace(':', '.'); + _fileTimestamp = Cce.NonNull(DateTime.Now.ToString("o")).Replace(':', '.'); public string FileTimestamp { @@ -188,16 +188,16 @@ public virtual bool ProcessInfoFlags() /// public virtual bool Parse(string[] /*!*/ args) { - Contract.Requires(cce.NonNullElements(args)); + Contract.Requires(Cce.NonNullElements(args)); // save the command line options for the log files Environment += "Command Line Options: " + string.Join(" ", args); - args = cce.NonNull((string[]) args.Clone()); // the operations performed may mutate the array, so make a copy + args = Cce.NonNull((string[]) args.Clone()); // the operations performed may mutate the array, so make a copy var ps = InitializeCommandLineParseState(args); while (ps.i < args.Length) { - cce.LoopInvariant(ps.args == args); + Cce.LoopInvariant(ps.args == args); string arg = args[ps.i]; Contract.Assert(arg != null); ps.s = arg.Trim(); diff --git a/Source/ExecutionEngine/CommandLineOptions.cs b/Source/ExecutionEngine/CommandLineOptions.cs index 426c46e0b..8abbd10e9 100644 --- a/Source/ExecutionEngine/CommandLineOptions.cs +++ b/Source/ExecutionEngine/CommandLineOptions.cs @@ -370,7 +370,7 @@ void ObjectInvariant3() Contract.Invariant(0 <= EnhancedErrorMessages && EnhancedErrorMessages < 2); Contract.Invariant(0 <= Ai.StepsBeforeWidening && Ai.StepsBeforeWidening <= 9); Contract.Invariant(-1 <= this.bracketIdsInVC && this.bracketIdsInVC <= 1); - Contract.Invariant(cce.NonNullElements(this.ProverOptions)); + Contract.Invariant(Cce.NonNullElements(this.ProverOptions)); } public int LoopUnrollCount { get; set; } = -1; // -1 means don't unroll loops @@ -567,8 +567,8 @@ public bool KeepQuantifier { [ContractInvariantMethod] void ObjectInvariant5() { - Contract.Invariant(cce.NonNullElements(this.ProcsToCheck, true)); - Contract.Invariant(cce.NonNullElements(this.ProcsToIgnore, true)); + Contract.Invariant(Cce.NonNullElements(this.ProcsToCheck, true)); + Contract.Invariant(Cce.NonNullElements(this.ProcsToIgnore, true)); Contract.Invariant(Ai != null); } @@ -618,7 +618,7 @@ protected override bool ParseOption(string name, CommandLineParseState ps) if (ps.ConfirmArgumentCount(1)) { UseAbstractInterpretation = true; - foreach (char c in cce.NonNull(args[ps.i])) + foreach (char c in Cce.NonNull(args[ps.i])) { switch (c) { @@ -669,7 +669,7 @@ protected override bool ParseOption(string name, CommandLineParseState ps) case "lib": if (ps.ConfirmArgumentCount(1)) { - this.Libraries.Add(cce.NonNull(args[ps.i])); + this.Libraries.Add(Cce.NonNull(args[ps.i])); } return true; @@ -677,7 +677,7 @@ protected override bool ParseOption(string name, CommandLineParseState ps) case "proc": if (ps.ConfirmArgumentCount(1)) { - this.ProcsToCheck.Add(cce.NonNull(args[ps.i])); + this.ProcsToCheck.Add(Cce.NonNull(args[ps.i])); } return true; @@ -685,7 +685,7 @@ protected override bool ParseOption(string name, CommandLineParseState ps) case "noProc": if (ps.ConfirmArgumentCount(1)) { - this.ProcsToIgnore.Add(cce.NonNull(args[ps.i])); + this.ProcsToIgnore.Add(Cce.NonNull(args[ps.i])); } return true; @@ -791,7 +791,7 @@ protected override bool ParseOption(string name, CommandLineParseState ps) case "logPrefix": if (ps.ConfirmArgumentCount(1)) { - string s = cce.NonNull(args[ps.i]); + string s = Cce.NonNull(args[ps.i]); LogPrefix += s.Replace('/', '-').Replace('\\', '-'); } @@ -820,7 +820,7 @@ protected override bool ParseOption(string name, CommandLineParseState ps) default: { Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } // postcondition of GetIntArgument guarantees that we don't get here } } @@ -847,7 +847,7 @@ protected override bool ParseOption(string name, CommandLineParseState ps) default: { Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } // postcondition of GetIntArgument guarantees that we don't get here } } @@ -940,7 +940,7 @@ protected override bool ParseOption(string name, CommandLineParseState ps) default: { Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } // postcondition of GetIntArgument guarantees that we don't get here } } @@ -1059,7 +1059,7 @@ protected override bool ParseOption(string name, CommandLineParseState ps) case "proverDll": if (ps.ConfirmArgumentCount(1)) { - ProverDllName = cce.NonNull(args[ps.i]); + ProverDllName = Cce.NonNull(args[ps.i]); TheProverFactory = ProverFactory.Load(ProverDllName); } @@ -1069,7 +1069,7 @@ protected override bool ParseOption(string name, CommandLineParseState ps) case "proverOpt": if (ps.ConfirmArgumentCount(1)) { - ProverOptions.Add(cce.NonNull(args[ps.i])); + ProverOptions.Add(Cce.NonNull(args[ps.i])); } return true; @@ -1117,14 +1117,14 @@ protected override bool ParseOption(string name, CommandLineParseState ps) case "recursionBound": if (ps.ConfirmArgumentCount(1)) { - RecursionBound = Int32.Parse(cce.NonNull(args[ps.i])); + RecursionBound = Int32.Parse(Cce.NonNull(args[ps.i])); } return true; case "enableUnSatCoreExtraction": if (ps.ConfirmArgumentCount(1)) { - EnableUnSatCoreExtract = Int32.Parse(cce.NonNull(args[ps.i])); + EnableUnSatCoreExtract = Int32.Parse(Cce.NonNull(args[ps.i])); } return true; @@ -1478,7 +1478,7 @@ public virtual StringCollection ParseNamedArgumentList(string argList) int i = 0; for (int n = argList.Length; i < n;) { - cce.LoopInvariant(0 <= i); + Cce.LoopInvariant(0 <= i); int separatorIndex = this.GetArgumentSeparatorIndex(argList, i); if (separatorIndex > i) { diff --git a/Source/ExecutionEngine/ExecutionEngine.cs b/Source/ExecutionEngine/ExecutionEngine.cs index cc37f985a..251f31c8e 100644 --- a/Source/ExecutionEngine/ExecutionEngine.cs +++ b/Source/ExecutionEngine/ExecutionEngine.cs @@ -91,7 +91,7 @@ static readonly ConcurrentDictionary public async Task ProcessFiles(TextWriter output, IList fileNames, bool lookForSnapshots = true, string programId = null) { - Contract.Requires(cce.NonNullElements(fileNames)); + Contract.Requires(Cce.NonNullElements(fileNames)); if (Options.VerifySeparately && 1 < fileNames.Count) { var success = true; @@ -283,7 +283,7 @@ public static void PrintBplFile(ExecutionEngineOptions options, string filename, /// public Program ParseBoogieProgram(IList fileNames, bool suppressTraceOutput) { - Contract.Requires(cce.NonNullElements(fileNames)); + Contract.Requires(Cce.NonNullElements(fileNames)); Program program = new Program(); bool okay = true; @@ -470,7 +470,7 @@ public void Inline(Program program) } // Inline - var TopLevelDeclarations = cce.NonNull(program.TopLevelDeclarations); + var TopLevelDeclarations = Cce.NonNull(program.TopLevelDeclarations); if (Options.ProcedureInlining != CoreOptions.Inlining.None) { @@ -632,7 +632,7 @@ private ProcessedProgram ExtractLoops(Program program) private Implementation[] GetPrioritizedImplementations(Program program) { var impls = program.Implementations.Where( - impl => impl != null && Options.UserWantsToCheckRoutine(cce.NonNull(impl.VerboseName)) && + impl => impl != null && Options.UserWantsToCheckRoutine(Cce.NonNull(impl.VerboseName)) && !impl.IsSkipVerification(Options)).ToArray(); // operate on a stable copy, in case it gets updated while we're running @@ -695,7 +695,7 @@ private async Task VerifyEachImplementation(TextWriter outputWr .OrderBy(s => s))); } - cce.NonNull(Options.TheProverFactory).Close(); + Cce.NonNull(Options.TheProverFactory).Close(); return outcome; @@ -1227,7 +1227,7 @@ private static string OutcomeIndication(VcOutcome vcOutcome, List> edges) { - Contract.Requires(cce.NonNullElements(edges) && Contract.ForAll(edges, p => p.Item1 != null && p.Item2 != null)); + Contract.Requires(Cce.NonNullElements(edges) && Contract.ForAll(edges, p => p.Item1 != null && p.Item2 != null)); this.edges = edges; // original A# @@ -537,7 +537,7 @@ public HashSet Nodes { get { - Contract.Ensures(cce.NonNullElements(Contract.Result>>()) + Contract.Ensures(Cce.NonNullElements(Contract.Result>>()) && Contract.ForAll(Contract.Result>>(), n => n.Item1 != null && n.Item2 != null)); return edges; @@ -1454,7 +1454,7 @@ private IDictionary /*!*/ private ICollection /*!*/ nodes { - get { return cce.NonNull(nodesMap.Keys); } + get { return Cce.NonNull(nodesMap.Keys); } } [Pure] @@ -1581,7 +1581,7 @@ public StronglyConnectedComponents(System.Collections.IEnumerable /**/ gr Contract.Ensures(Contract.Result>>() != null); Contract.Assume(Computed); - Contract.Assert(cce.NonNullElements((IEnumerable /*!*/>) sccs)); //REVIEW + Contract.Assert(Cce.NonNullElements((IEnumerable /*!*/>) sccs)); //REVIEW return ((IEnumerable /*!*/>) sccs).GetEnumerator(); } @@ -1591,7 +1591,7 @@ private readonly IList /*!*/> /*!*/ [ContractInvariantMethod] void sccsInvariant() { - Contract.Invariant(cce.NonNullElements(sccs)); + Contract.Invariant(Cce.NonNullElements(sccs)); } @@ -1601,7 +1601,7 @@ public void Compute() Contract.Ensures(Computed); // Compute post times on graph with edges reversed this.dfsNext = this.preds; - foreach (Node /*!*/ n in cce.NonNull(graph.Keys)) + foreach (Node /*!*/ n in Cce.NonNull(graph.Keys)) { Contract.Assert(n != null); if (!seen.ContainsKey(n)) @@ -1649,7 +1649,7 @@ private readonly Stack /*!*/ void ObjectInvariant() { Contract.Invariant(seen != null); - Contract.Invariant(cce.NonNullElements(postOrder)); + Contract.Invariant(Cce.NonNullElements(postOrder)); } diff --git a/Source/Provers/SMTLib/ProverContext.cs b/Source/Provers/SMTLib/ProverContext.cs index adb7465eb..02ed47c53 100644 --- a/Source/Provers/SMTLib/ProverContext.cs +++ b/Source/Provers/SMTLib/ProverContext.cs @@ -136,8 +136,8 @@ void ObjectInvariant() Contract.Invariant(gen != null); Contract.Invariant(genOptions != null); Contract.Invariant(translator != null); - Contract.Invariant(cce.NonNullElements(distincts)); - Contract.Invariant(cce.NonNullElements(axiomConjuncts)); + Contract.Invariant(Cce.NonNullElements(distincts)); + Contract.Invariant(Cce.NonNullElements(axiomConjuncts)); } public VCExprTranslator /*?*/ @@ -191,7 +191,7 @@ protected DeclFreeProverContext(DeclFreeProverContext ctxt) } else { - exprTranslator = (VCExprTranslator) cce.NonNull(ctxt.exprTranslator.Clone()); + exprTranslator = (VCExprTranslator) Cce.NonNull(ctxt.exprTranslator.Clone()); } } diff --git a/Source/Provers/SMTLib/ProverInterface.cs b/Source/Provers/SMTLib/ProverInterface.cs index c2beaa48a..dae025b4f 100644 --- a/Source/Provers/SMTLib/ProverInterface.cs +++ b/Source/Provers/SMTLib/ProverInterface.cs @@ -27,7 +27,7 @@ public static ProverInterface CreateProver(SMTLibOptions libOptions, Program pro { Contract.Requires(prog != null); - ProverOptions options = cce.NonNull(libOptions.TheProverFactory).BlankProverOptions(libOptions); + ProverOptions options = Cce.NonNull(libOptions.TheProverFactory).BlankProverOptions(libOptions); if (logFilePath != null) { @@ -125,7 +125,7 @@ public virtual int StartingProcId() public virtual void OnModel(IList labels, Model model, SolverOutcome proverOutcome) { - Contract.Requires(cce.NonNullElements(labels)); + Contract.Requires(Cce.NonNullElements(labels)); } public virtual void OnResourceExceeded(string message, @@ -149,7 +149,7 @@ public virtual void OnProverWarning(string message) break; default: Contract.Assume(false); - throw new cce.UnreachableException(); // unexpected case + throw new Cce.UnreachableException(); // unexpected case } } diff --git a/Source/Provers/SMTLib/ProverUtil.cs b/Source/Provers/SMTLib/ProverUtil.cs index c1eea5473..03f70ba9b 100644 --- a/Source/Provers/SMTLib/ProverUtil.cs +++ b/Source/Provers/SMTLib/ProverUtil.cs @@ -100,7 +100,7 @@ The generic options may or may not be used by the prover plugin. public virtual void Parse(IEnumerable /*!*/ opts) { - Contract.Requires(cce.NonNullElements(opts)); + Contract.Requires(Cce.NonNullElements(opts)); StringBuilder sb = new StringBuilder(stringRepr); Contract.Assert(sb != null); foreach (string /*!*/ opt in opts) @@ -129,7 +129,7 @@ public virtual void PostParse() static string CodebaseString() { Contract.Ensures(Contract.Result() != null); - return Path.GetDirectoryName(cce.NonNull(System.Reflection.Assembly.GetExecutingAssembly().Location)); + return Path.GetDirectoryName(Cce.NonNull(System.Reflection.Assembly.GetExecutingAssembly().Location)); } public string ExecutablePath() @@ -205,7 +205,7 @@ protected virtual bool ParseBool(string opt, string name, ref bool field) string tmp = null; if (ParseString(opt, name, ref tmp)) { - switch (cce.NonNull(tmp).ToLower()) + switch (Cce.NonNull(tmp).ToLower()) { case "1": case "true": @@ -232,7 +232,7 @@ protected virtual bool ParseInt(string opt, string name, ref int field) string tmp = null; if (ParseString(opt, name, ref tmp)) { - if (int.TryParse(cce.NonNull(tmp), out var t2)) + if (int.TryParse(Cce.NonNull(tmp), out var t2)) { field = t2; return true; @@ -253,7 +253,7 @@ protected virtual bool ParseUInt(string opt, string name, ref uint field) string tmp = null; if (ParseString(opt, name, ref tmp)) { - if (uint.TryParse(cce.NonNull(tmp), out var t2)) + if (uint.TryParse(Cce.NonNull(tmp), out var t2)) { field = t2; return true; @@ -317,7 +317,7 @@ public static ProverFactory Load(string proverName) { Contract.Requires(proverName != null); Contract.Ensures(Contract.Result() != null); - Contract.Ensures(cce.IsNew(Contract.Result()) && cce.Owner.New(Contract.Result())); + Contract.Ensures(Cce.IsNew(Contract.Result()) && Cce.Owner.New(Contract.Result())); string /*!*/ path; if (proverName.IndexOf("/") >= 0 || proverName.IndexOf("\\") >= 0) @@ -326,16 +326,16 @@ public static ProverFactory Load(string proverName) } else { - string codebase = cce.NonNull(System.IO.Path.GetDirectoryName( - cce.NonNull(System.Reflection.Assembly.GetExecutingAssembly().Location))); + string codebase = Cce.NonNull(System.IO.Path.GetDirectoryName( + Cce.NonNull(System.Reflection.Assembly.GetExecutingAssembly().Location))); path = System.IO.Path.Combine(codebase, "Boogie.Provers." + proverName + ".dll"); } - Assembly asm = cce.NonNull(Assembly.LoadFrom(path)); - string name = cce.NonNull(asm.GetName().Name); + Assembly asm = Cce.NonNull(Assembly.LoadFrom(path)); + string name = Cce.NonNull(asm.GetName().Name); System.Type factoryType = - cce.NonNull(asm.GetType("Microsoft.Boogie." + name.Replace("Boogie.Provers.", "") + ".Factory")); - return cce.NonNull((ProverFactory /*!*/) Activator.CreateInstance(factoryType)); + Cce.NonNull(asm.GetType("Microsoft.Boogie." + name.Replace("Boogie.Provers.", "") + ".Factory")); + return Cce.NonNull((ProverFactory /*!*/) Activator.CreateInstance(factoryType)); } } diff --git a/Source/Provers/SMTLib/SMTLibLineariser.cs b/Source/Provers/SMTLib/SMTLibLineariser.cs index 0b87b5918..039089879 100644 --- a/Source/Provers/SMTLib/SMTLibLineariser.cs +++ b/Source/Provers/SMTLib/SMTLibLineariser.cs @@ -73,7 +73,7 @@ public static string ToString(VCExpr e, UniqueNamer namer, SMTLibOptions libOpti SMTLibExprLineariser lin = new SMTLibExprLineariser(sw, namer, libOptions, opts, namedAssumes, optReqs); Contract.Assert(lin != null); lin.Linearise(e, LineariserOptions.Default); - return cce.NonNull(sw.ToString()); + return Cce.NonNull(sw.ToString()); } //////////////////////////////////////////////////////////////////////////////////////// @@ -316,7 +316,7 @@ public bool Visit(VCExprLiteral node, LineariserOptions options) else { Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } return true; @@ -622,7 +622,7 @@ void ObjectInvariant() /////////////////////////////////////////////////////////////////////////////////// private void WriteApplication(string opName, VCExprNAry /*!>!*/ call, LineariserOptions options) { - Contract.Requires(cce.NonNullElements(call.Arguments)); + Contract.Requires(Cce.NonNullElements(call.Arguments)); Contract.Requires(options != null); Contract.Assert(opName != null); diff --git a/Source/Provers/SMTLib/SMTLibProcessTheoremProver.cs b/Source/Provers/SMTLib/SMTLibProcessTheoremProver.cs index 16c5cf28e..149409384 100644 --- a/Source/Provers/SMTLib/SMTLibProcessTheoremProver.cs +++ b/Source/Provers/SMTLib/SMTLibProcessTheoremProver.cs @@ -39,8 +39,8 @@ private void ObjectInvariant() Contract.Invariant(ctx != null); Contract.Invariant(Namer != null); Contract.Invariant(DeclCollector != null); - Contract.Invariant(cce.NonNullElements(Axioms)); - Contract.Invariant(cce.NonNullElements(TypeDecls)); + Contract.Invariant(Cce.NonNullElements(Axioms)); + Contract.Invariant(Cce.NonNullElements(TypeDecls)); Contract.Invariant(backgroundPredicates != null); } @@ -1632,8 +1632,8 @@ public override ProverInterface SpawnProver(SMTLibOptions libOptions, ProverOpti Contract.Ensures(Contract.Result() != null); return this.SpawnProver(libOptions, options, - cce.NonNull((SMTLibProverContext) ctxt).ExprGen, - cce.NonNull((SMTLibProverContext) ctxt)); + Cce.NonNull((SMTLibProverContext) ctxt).ExprGen, + Cce.NonNull((SMTLibProverContext) ctxt)); } public override ProverContext NewProverContext(ProverOptions options) diff --git a/Source/Provers/SMTLib/SMTLibSolverOptions.cs b/Source/Provers/SMTLib/SMTLibSolverOptions.cs index 379b923d0..79d0676ef 100644 --- a/Source/Provers/SMTLib/SMTLibSolverOptions.cs +++ b/Source/Provers/SMTLib/SMTLibSolverOptions.cs @@ -160,7 +160,7 @@ public override void PostParse() break; default: Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } if (ProverName == null) { diff --git a/Source/Provers/SMTLib/TypeDeclCollector.cs b/Source/Provers/SMTLib/TypeDeclCollector.cs index 6f034db03..0afc4841d 100644 --- a/Source/Provers/SMTLib/TypeDeclCollector.cs +++ b/Source/Provers/SMTLib/TypeDeclCollector.cs @@ -127,7 +127,7 @@ public List!*/> AllDeclarations { get { - Contract.Ensures(cce.NonNullElements(Contract.Result>())); + Contract.Ensures(Cce.NonNullElements(Contract.Result>())); List /*!>!*/ res = new List(); @@ -138,7 +138,7 @@ public List!*/> AllDeclarations public List!*/> GetNewDeclarations() { - Contract.Ensures(cce.NonNullElements(Contract.Result>())); + Contract.Ensures(Cce.NonNullElements(Contract.Result>())); List /*!>!*/ res = new List(); res.AddRange(IncDecls); diff --git a/Source/VCExpr/BigLiteralAbstracter.cs b/Source/VCExpr/BigLiteralAbstracter.cs index 5c1d4797e..f15e656ec 100644 --- a/Source/VCExpr/BigLiteralAbstracter.cs +++ b/Source/VCExpr/BigLiteralAbstracter.cs @@ -61,7 +61,7 @@ private readonly List /*!*/ [ContractInvariantMethod] void ObjectInvariant() { - Contract.Invariant(cce.NonNullElements(IncAxioms)); + Contract.Invariant(Cce.NonNullElements(IncAxioms)); } private void AddAxiom(VCExpr /*!*/ axiom) diff --git a/Source/VCExpr/Boogie2VCExpr.cs b/Source/VCExpr/Boogie2VCExpr.cs index a4596afe0..7ab58ee1e 100644 --- a/Source/VCExpr/Boogie2VCExpr.cs +++ b/Source/VCExpr/Boogie2VCExpr.cs @@ -52,7 +52,7 @@ private readonly Stack /*!*/ [ContractInvariantMethod] void ObjectInvariant() { - Contract.Invariant(cce.NonNullElements(SubExpressions)); + Contract.Invariant(Cce.NonNullElements(SubExpressions)); Contract.Invariant(Gen != null); } @@ -80,12 +80,12 @@ public VCExpr Translate(Expr expr) public List /*!*/ Translate(IList exprs) { Contract.Requires(exprs != null); - Contract.Ensures(cce.NonNullElements(Contract.Result>())); + Contract.Ensures(Cce.NonNullElements(Contract.Result>())); List /*!*/ res = new List(); foreach (Expr e in exprs) { - res.Add(Translate(cce.NonNull(e))); + res.Add(Translate(Cce.NonNull(e))); } return res; @@ -153,7 +153,7 @@ private class VariableMapping : ICloneable [ContractInvariantMethod] void ObjectInvariant() { - Contract.Invariant(Mapping != null && Contract.ForAll(Mapping, i => cce.NonNullDictionaryAndValues(i))); + Contract.Invariant(Mapping != null && Contract.ForAll(Mapping, i => Cce.NonNullDictionaryAndValues(i))); } @@ -174,7 +174,7 @@ private VariableMapping(VariableMapping vm) new List /*!*/>(); foreach (Dictionary /*!*/ d in vm.Mapping) { - Contract.Assert(cce.NonNullDictionaryAndValues(d)); + Contract.Assert(Cce.NonNullDictionaryAndValues(d)); mapping.Add(new Dictionary(d)); } @@ -310,7 +310,7 @@ public VCExprVar BindVariable(Variable boogieVar) { // only bound variables and formals are declared explicitly Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } } @@ -328,7 +328,7 @@ public VCExprVar LookupVariable(Variable boogieVar) Formal fml = boogieVar as Formal; if (fml != null && Formals.TryGetValue(fml, out var res)) { - return cce.NonNull(res); + return Cce.NonNull(res); } // global variables, local variables, incarnations, etc. are @@ -347,7 +347,7 @@ public VCExprVar LookupVariable(Variable boogieVar) UnboundVariables.Bind(boogieVar, res); } - return cce.NonNull(res); + return Cce.NonNull(res); } /// @@ -364,12 +364,12 @@ public VCExprVar TryLookupVariable(Variable boogieVar) Formal fml = boogieVar as Formal; if (fml != null && Formals.TryGetValue(fml, out var res)) { - return cce.NonNull(res); + return Cce.NonNull(res); } if (UnboundVariables.TryGetValue(boogieVar, out res)) { - return cce.NonNull(res); + return Cce.NonNull(res); } return null; // not present @@ -440,7 +440,7 @@ private VCExpr TranslateLiteralExpr(LiteralExpr node) { System.Diagnostics.Debug.Assert(false, "unknown kind of literal " + node.tok.ToString()); Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } } @@ -466,7 +466,7 @@ public override Expr VisitOldExpr(OldExpr node) //Contract.Requires(node != null); Contract.Ensures(Contract.Result() != null); Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } /////////////////////////////////////////////////////////////////////////////////// @@ -520,7 +520,7 @@ private VCExpr TranslateNAryExpr(NAryExpr node) isPositiveContext = !isPositiveContext; } - vcs.Add(Translate(cce.NonNull(node.Args)[i])); + vcs.Add(Translate(Cce.NonNull(node.Args)[i])); if (i == 0 && flipContextForArg0) { isPositiveContext = !isPositiveContext; @@ -531,11 +531,11 @@ private VCExpr TranslateNAryExpr(NAryExpr node) { System.Console.WriteLine("*** type is null for {0}", node); Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } return IAppTranslator.Translate(node.Fun, node.Type, vcs, - ToList(cce.NonNull(node.TypeParameters))); + ToList(Cce.NonNull(node.TypeParameters))); } @@ -552,7 +552,7 @@ void ObjectInvirant() private List /*!*/ ToList(TypeParamInstantiation insts) { Contract.Requires(insts != null); - Contract.Ensures(cce.NonNullElements(Contract.Result>())); + Contract.Ensures(Cce.NonNullElements(Contract.Result>())); if (insts.FormalTypeParams.Count == 0) { return EMPTY_TYPE_LIST; @@ -637,7 +637,7 @@ private VCExpr TranslateQuantifierExpr(QuantifierExpr node) else { Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } return Gen.Quantify(quan, typeParams, boundVars, triggers, info, body); @@ -650,7 +650,7 @@ private VCExpr TranslateQuantifierExpr(QuantifierExpr node) private List /*!*/ TranslateTriggers(Trigger node) { - Contract.Ensures(cce.NonNullElements(Contract.Result>())); + Contract.Ensures(Cce.NonNullElements(Contract.Result>())); List /*!*/ res = new List(); Trigger curTrigger = node; @@ -765,7 +765,7 @@ private VCExpr TranslateBvExtractExpr(BvExtractExpr node) Contract.Ensures(Contract.Result() != null); VCExpr /*!*/ bv = Translate(node.Bitvector); - return Gen.BvExtract(bv, cce.NonNull(node.Bitvector.Type).BvBits, node.Start, node.End); + return Gen.BvExtract(bv, Cce.NonNull(node.Bitvector.Type).BvBits, node.Start, node.End); } /////////////////////////////////////////////////////////////////////////////////// @@ -797,21 +797,21 @@ public override Cmd VisitAssertCmd(AssertCmd node) //Contract.Requires(node != null); Contract.Ensures(Contract.Result() != null); Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } public override Cmd VisitAssignCmd(AssignCmd node) { Contract.Ensures(Contract.Result() != null); Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } public override Cmd VisitUnpackCmd(UnpackCmd node) { Contract.Ensures(Contract.Result() != null); Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } public override Cmd VisitAssumeCmd(AssumeCmd node) @@ -819,7 +819,7 @@ public override Cmd VisitAssumeCmd(AssumeCmd node) //Contract.Requires(node != null); Contract.Ensures(Contract.Result() != null); Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } public override AtomicRE VisitAtomicRE(AtomicRE node) @@ -827,7 +827,7 @@ public override AtomicRE VisitAtomicRE(AtomicRE node) //Contract.Requires(node != null); Contract.Ensures(Contract.Result() != null); Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } public override Axiom VisitAxiom(Axiom node) @@ -835,7 +835,7 @@ public override Axiom VisitAxiom(Axiom node) //Contract.Requires(node != null); Contract.Ensures(Contract.Result() != null); Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } public override Type VisitBasicType(BasicType node) @@ -843,7 +843,7 @@ public override Type VisitBasicType(BasicType node) //Contract.Requires(node != null); Contract.Ensures(Contract.Result() != null); Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } public override Type VisitBvType(BvType node) @@ -851,7 +851,7 @@ public override Type VisitBvType(BvType node) //Contract.Requires(node != null); Contract.Ensures(Contract.Result() != null); Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } public override Block VisitBlock(Block node) @@ -859,7 +859,7 @@ public override Block VisitBlock(Block node) //Contract.Requires(node != null); Contract.Ensures(Contract.Result() != null); Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } public CodeExprConverter codeExprConverter = null; @@ -886,15 +886,15 @@ public override List VisitBlockSeq(List blockSeq) //Contract.Requires(blockSeq != null); Contract.Ensures(Contract.Result>() != null); Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } public override List /*!*/ VisitBlockList(List /*!*/ blocks) { //Contract.Requires(cce.NonNullElements(blocks)); - Contract.Ensures(cce.NonNullElements(Contract.Result>())); + Contract.Ensures(Cce.NonNullElements(Contract.Result>())); Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } public override BoundVariable VisitBoundVariable(BoundVariable node) @@ -902,7 +902,7 @@ public override BoundVariable VisitBoundVariable(BoundVariable node) //Contract.Requires(node != null); Contract.Ensures(Contract.Result() != null); Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } public override Cmd VisitCallCmd(CallCmd node) @@ -910,7 +910,7 @@ public override Cmd VisitCallCmd(CallCmd node) //Contract.Requires(node != null); Contract.Ensures(Contract.Result() != null); Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } public override Cmd VisitParCallCmd(ParCallCmd node) @@ -918,7 +918,7 @@ public override Cmd VisitParCallCmd(ParCallCmd node) //Contract.Requires(node != null); Contract.Ensures(Contract.Result() != null); Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } public override List VisitCmdSeq(List cmdSeq) @@ -926,7 +926,7 @@ public override List VisitCmdSeq(List cmdSeq) //Contract.Requires(cmdSeq != null); Contract.Ensures(Contract.Result>() != null); Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } public override Choice VisitChoice(Choice node) @@ -934,7 +934,7 @@ public override Choice VisitChoice(Choice node) //Contract.Requires(node != null); Contract.Ensures(Contract.Result() != null); Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } public override Cmd VisitCommentCmd(CommentCmd node) @@ -942,7 +942,7 @@ public override Cmd VisitCommentCmd(CommentCmd node) //Contract.Requires(node != null); Contract.Ensures(Contract.Result() != null); Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } public override Constant VisitConstant(Constant node) @@ -950,7 +950,7 @@ public override Constant VisitConstant(Constant node) //Contract.Requires(node != null); Contract.Ensures(Contract.Result() != null); Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } public override CtorType VisitCtorType(CtorType node) @@ -958,7 +958,7 @@ public override CtorType VisitCtorType(CtorType node) //Contract.Requires(node != null); Contract.Ensures(Contract.Result() != null); Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } public override Declaration VisitDeclaration(Declaration node) @@ -966,15 +966,15 @@ public override Declaration VisitDeclaration(Declaration node) //Contract.Requires(node != null); Contract.Ensures(Contract.Result() != null); Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } public override List /*!*/ VisitDeclarationList(List /*!*/ declarationList) { //Contract.Requires(cce.NonNullElements(declarationList)); - Contract.Ensures(cce.NonNullElements(Contract.Result>())); + Contract.Ensures(Cce.NonNullElements(Contract.Result>())); Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } public override DeclWithFormals VisitDeclWithFormals(DeclWithFormals node) @@ -982,7 +982,7 @@ public override DeclWithFormals VisitDeclWithFormals(DeclWithFormals node) //Contract.Requires(node != null); Contract.Ensures(Contract.Result() != null); Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } public override Requires VisitRequires(Requires @requires) @@ -990,7 +990,7 @@ public override Requires VisitRequires(Requires @requires) //Contract.Requires(@requires != null); Contract.Ensures(Contract.Result() != null); Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } public override List VisitRequiresSeq(List requiresSeq) @@ -998,7 +998,7 @@ public override List VisitRequiresSeq(List requiresSeq) //Contract.Requires(requiresSeq != null); Contract.Ensures(Contract.Result>() != null); Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } public override Ensures VisitEnsures(Ensures @ensures) @@ -1006,7 +1006,7 @@ public override Ensures VisitEnsures(Ensures @ensures) //Contract.Requires(@ensures != null); Contract.Ensures(Contract.Result() != null); Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } public override List VisitEnsuresSeq(List ensuresSeq) @@ -1014,7 +1014,7 @@ public override List VisitEnsuresSeq(List ensuresSeq) //Contract.Requires(ensuresSeq != null); Contract.Ensures(Contract.Result>() != null); Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } public override Formal VisitFormal(Formal node) @@ -1022,7 +1022,7 @@ public override Formal VisitFormal(Formal node) //Contract.Requires(node != null); Contract.Ensures(Contract.Result() != null); Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } public override Function VisitFunction(Function node) @@ -1030,7 +1030,7 @@ public override Function VisitFunction(Function node) //Contract.Requires(node != null); Contract.Ensures(Contract.Result() != null); Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } public override GlobalVariable VisitGlobalVariable(GlobalVariable node) @@ -1038,7 +1038,7 @@ public override GlobalVariable VisitGlobalVariable(GlobalVariable node) //Contract.Requires(node != null); Contract.Ensures(Contract.Result() != null); Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } public override GotoCmd VisitGotoCmd(GotoCmd node) @@ -1046,7 +1046,7 @@ public override GotoCmd VisitGotoCmd(GotoCmd node) //Contract.Requires(node != null); Contract.Ensures(Contract.Result() != null); Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } public override Cmd VisitHavocCmd(HavocCmd node) @@ -1054,7 +1054,7 @@ public override Cmd VisitHavocCmd(HavocCmd node) //Contract.Requires(node != null); Contract.Ensures(Contract.Result() != null); Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } public override Implementation VisitImplementation(Implementation node) @@ -1062,7 +1062,7 @@ public override Implementation VisitImplementation(Implementation node) //Contract.Requires(node != null); Contract.Ensures(Contract.Result() != null); Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } public override LocalVariable VisitLocalVariable(LocalVariable node) @@ -1070,7 +1070,7 @@ public override LocalVariable VisitLocalVariable(LocalVariable node) //Contract.Requires(node != null); Contract.Ensures(Contract.Result() != null); Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } public override AssignLhs VisitMapAssignLhs(MapAssignLhs node) @@ -1078,7 +1078,7 @@ public override AssignLhs VisitMapAssignLhs(MapAssignLhs node) //Contract.Requires(node != null); Contract.Ensures(Contract.Result() != null); Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } public override Type VisitMapType(MapType node) @@ -1086,7 +1086,7 @@ public override Type VisitMapType(MapType node) //Contract.Requires(node != null); Contract.Ensures(Contract.Result() != null); Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } public override Procedure VisitProcedure(Procedure node) @@ -1094,7 +1094,7 @@ public override Procedure VisitProcedure(Procedure node) //Contract.Requires(node != null); Contract.Ensures(Contract.Result() != null); Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } public override Program VisitProgram(Program node) @@ -1102,7 +1102,7 @@ public override Program VisitProgram(Program node) //Contract.Requires(node != null); Contract.Ensures(Contract.Result() != null); Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } public override Cmd VisitRE(RE node) @@ -1110,7 +1110,7 @@ public override Cmd VisitRE(RE node) //Contract.Requires(node != null); Contract.Ensures(Contract.Result() != null); Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } public override List VisitRESeq(List reSeq) @@ -1118,7 +1118,7 @@ public override List VisitRESeq(List reSeq) //Contract.Requires(reSeq != null); Contract.Ensures(Contract.Result>() != null); Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } public override ReturnCmd VisitReturnCmd(ReturnCmd node) @@ -1126,7 +1126,7 @@ public override ReturnCmd VisitReturnCmd(ReturnCmd node) //Contract.Requires(node != null); Contract.Ensures(Contract.Result() != null); Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } public override ReturnExprCmd VisitReturnExprCmd(ReturnExprCmd node) @@ -1134,7 +1134,7 @@ public override ReturnExprCmd VisitReturnExprCmd(ReturnExprCmd node) //Contract.Requires(node != null); Contract.Ensures(Contract.Result() != null); Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } public override Sequential VisitSequential(Sequential node) @@ -1142,7 +1142,7 @@ public override Sequential VisitSequential(Sequential node) //Contract.Requires(node != null); Contract.Ensures(Contract.Result() != null); Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } public override AssignLhs VisitSimpleAssignLhs(SimpleAssignLhs node) @@ -1150,7 +1150,7 @@ public override AssignLhs VisitSimpleAssignLhs(SimpleAssignLhs node) //Contract.Requires(node != null); Contract.Ensures(Contract.Result() != null); Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } public override Cmd VisitStateCmd(StateCmd node) @@ -1158,7 +1158,7 @@ public override Cmd VisitStateCmd(StateCmd node) //Contract.Requires(node != null); Contract.Ensures(Contract.Result() != null); Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } public override TransferCmd VisitTransferCmd(TransferCmd node) @@ -1166,7 +1166,7 @@ public override TransferCmd VisitTransferCmd(TransferCmd node) //Contract.Requires(node != null); Contract.Ensures(Contract.Result() != null); Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } public override Trigger VisitTrigger(Trigger node) @@ -1174,7 +1174,7 @@ public override Trigger VisitTrigger(Trigger node) //Contract.Requires(node != null); Contract.Ensures(Contract.Result() != null); Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } public override Type VisitType(Type node) @@ -1182,7 +1182,7 @@ public override Type VisitType(Type node) //Contract.Requires(node != null); Contract.Ensures(Contract.Result() != null); Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } public override TypedIdent VisitTypedIdent(TypedIdent node) @@ -1190,7 +1190,7 @@ public override TypedIdent VisitTypedIdent(TypedIdent node) //Contract.Requires(node != null); Contract.Ensures(Contract.Result() != null); Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } public override Type VisitTypeSynonymAnnotation(TypeSynonymAnnotation node) @@ -1198,7 +1198,7 @@ public override Type VisitTypeSynonymAnnotation(TypeSynonymAnnotation node) //Contract.Requires(node != null); Contract.Ensures(Contract.Result() != null); Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } public override Type VisitTypeVariable(TypeVariable node) @@ -1206,7 +1206,7 @@ public override Type VisitTypeVariable(TypeVariable node) //Contract.Requires(node != null); Contract.Ensures(Contract.Result() != null); Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } public override Variable VisitVariable(Variable node) @@ -1214,7 +1214,7 @@ public override Variable VisitVariable(Variable node) //Contract.Requires(node != null); Contract.Ensures(Contract.Result() != null); Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } public override List VisitVariableSeq(List variableSeq) @@ -1222,7 +1222,7 @@ public override List VisitVariableSeq(List variableSeq) //Contract.Requires(variableSeq != null); Contract.Ensures(Contract.Result>() != null); Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } public override Cmd VisitAssertEnsuresCmd(AssertEnsuresCmd node) @@ -1230,7 +1230,7 @@ public override Cmd VisitAssertEnsuresCmd(AssertEnsuresCmd node) //Contract.Requires(node != null); Contract.Ensures(Contract.Result() != null); Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } public override Cmd VisitAssertRequiresCmd(AssertRequiresCmd node) @@ -1238,7 +1238,7 @@ public override Cmd VisitAssertRequiresCmd(AssertRequiresCmd node) //Contract.Requires(node != null); Contract.Ensures(Contract.Result() != null); Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } } @@ -1303,8 +1303,8 @@ public VCExpr Translate(IAppliable app, Type ty, List /*!*/ args, { Contract.Requires(ty != null); Contract.Requires(app != null); - Contract.Requires(cce.NonNullElements(typeArgs)); - Contract.Requires(cce.NonNullElements(args)); + Contract.Requires(Cce.NonNullElements(typeArgs)); + Contract.Requires(Cce.NonNullElements(args)); Contract.Ensures(Contract.Result() != null); List /*!*/ @@ -1331,8 +1331,8 @@ public VCExpr Visit(UnaryOperator unaryOperator) Contract.Assert(this.args.Count == 1); if (unaryOperator.Op == UnaryOperator.Opcode.Neg) { - VCExpr e = cce.NonNull(this.args[0]); - if (cce.NonNull(e.Type).IsInt) + VCExpr e = Cce.NonNull(this.args[0]); + if (Cce.NonNull(e.Type).IsInt) { return Gen.Function(VCExpressionGenerator.SubIOp, Gen.Integer(BigNum.ZERO), e); } @@ -1436,7 +1436,7 @@ public VCExpr Visit(FieldAccess fieldAccess) public VCExpr Visit(FieldUpdate fieldUpdate) { - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } public VCExpr Visit(IsConstructor isConstructor) @@ -1450,10 +1450,10 @@ public VCExpr Visit(IsConstructor isConstructor) private VCExpr TranslateBinaryOperator(BinaryOperator app, List /*!*/ args) { Contract.Requires(app != null); - Contract.Requires(cce.NonNullElements(args)); + Contract.Requires(Cce.NonNullElements(args)); Contract.Ensures(Contract.Result() != null); Contract.Assert(args.Count == 2); - Type t = cce.NonNull(cce.NonNull(args[0]).Type); + Type t = Cce.NonNull(Cce.NonNull(args[0]).Type); switch (app.Op) { @@ -1509,14 +1509,14 @@ private VCExpr TranslateBinaryOperator(BinaryOperator app, List /* return Gen.Function(Gen.BinaryFloatOp(t.FloatSignificand, t.FloatExponent, "/"), args); } - VCExpr arg0 = cce.NonNull(args[0]); - VCExpr arg1 = cce.NonNull(args[1]); - if (cce.NonNull(arg0.Type).IsInt) + VCExpr arg0 = Cce.NonNull(args[0]); + VCExpr arg1 = Cce.NonNull(args[1]); + if (Cce.NonNull(arg0.Type).IsInt) { arg0 = Gen.Function(VCExpressionGenerator.ToRealOp, arg0); } - if (cce.NonNull(arg1.Type).IsInt) + if (Cce.NonNull(arg1.Type).IsInt) { arg1 = Gen.Function(VCExpressionGenerator.ToRealOp, arg1); } @@ -1576,7 +1576,7 @@ private VCExpr TranslateBinaryOperator(BinaryOperator app, List /* return Gen.Function(VCExpressionGenerator.OrOp, args); default: Contract.Assert(false); - throw new cce.UnreachableException(); // unexpected binary operator + throw new Cce.UnreachableException(); // unexpected binary operator } } @@ -1585,8 +1585,8 @@ private VCExpr TranslateBinaryOperator(BinaryOperator app, List /* private VCExpr /*!*/ TranslateFunctionCall(FunctionCall app, List /*!*/ args, List /*!*/ typeArgs) { - Contract.Requires(cce.NonNullElements(args)); - Contract.Requires(cce.NonNullElements(typeArgs)); + Contract.Requires(Cce.NonNullElements(args)); + Contract.Requires(Cce.NonNullElements(typeArgs)); Contract.Requires(app != null); Contract.Requires((app.Func != null)); Contract.Ensures(Contract.Result() != null); // resolution must have happened @@ -1605,8 +1605,8 @@ private VCExpr /*!*/ private VCExpr ApplyExpansion(FunctionCall app, List /*!*/ args, List /*!*/ typeArgs) { Contract.Requires(app != null); - Contract.Requires(cce.NonNullElements(args)); - Contract.Requires(cce.NonNullElements(typeArgs)); + Contract.Requires(Cce.NonNullElements(args)); + Contract.Requires(Cce.NonNullElements(typeArgs)); Contract.Assert(app.Func != null); // resolution must have happened lock (app.Func) diff --git a/Source/VCExpr/Clustering.cs b/Source/VCExpr/Clustering.cs index 33677850c..75b0a3851 100644 --- a/Source/VCExpr/Clustering.cs +++ b/Source/VCExpr/Clustering.cs @@ -17,8 +17,8 @@ private readonly VCExpressionGenerator /*!*/ void ObjectInvariant() { Contract.Invariant(Gen != null); - Contract.Invariant(cce.NonNullDictionaryAndValues(GlobalVariables)); - Contract.Invariant(cce.NonNullDictionaryAndValues(SubtermClusters)); + Contract.Invariant(Cce.NonNullDictionaryAndValues(GlobalVariables)); + Contract.Invariant(Cce.NonNullDictionaryAndValues(SubtermClusters)); } @@ -40,7 +40,7 @@ public void UnifyClusters() foreach (KeyValuePair pair in SubtermClusters) { - Contract.Assert(cce.NonNullElements(pair)); + Contract.Assert(Cce.NonNullElements(pair)); pair.Value.UnifyClusters(); } } @@ -84,7 +84,7 @@ public override bool Visit(VCExprNAry node, bool arg) SubtermClusters.Add(op, clusters); } - cce.NonNull(clusters).AddExpr(node); + Cce.NonNull(clusters).AddExpr(node); } return res; @@ -110,7 +110,7 @@ public override string ToString() foreach (KeyValuePair pair in SubtermClusters) { - Contract.Assert(cce.NonNullElements(pair)); + Contract.Assert(Cce.NonNullElements(pair)); res = res + pair.Value + "\n"; } @@ -129,7 +129,7 @@ void ObjectInvariant() { Contract.Invariant(Op != null); Contract.Invariant(Gen != null); - Contract.Invariant(cce.NonNullDictionaryAndValues(GlobalVariables)); + Contract.Invariant(Cce.NonNullDictionaryAndValues(GlobalVariables)); } // variables that are global and treated like constants @@ -145,7 +145,7 @@ private readonly VCExpressionGenerator /*!*/ public TermClustersSameHead(VCExprOp op, IDictionary /*!*/ globalVars, VCExpressionGenerator /*!*/ gen) { - Contract.Requires(cce.NonNullDictionaryAndValues(globalVars)); + Contract.Requires(Cce.NonNullDictionaryAndValues(globalVars)); Contract.Requires(gen != null); Contract.Requires(op != null); Op = op; @@ -251,7 +251,7 @@ public readonly bool[] /*!*/ void ObjectInvariant() { Contract.Invariant(Gen != null); - Contract.Invariant(cce.NonNullDictionaryAndValues(GlobalVariables)); + Contract.Invariant(Cce.NonNullDictionaryAndValues(GlobalVariables)); Contract.Invariant(Clusters != null); Contract.Invariant(RemainingClusters != null); Contract.Invariant(Distances != null); @@ -269,7 +269,7 @@ public Distance(Cluster a, Cluster b, IDictionary clusters, IDictionary c = new List(); c.AddRange(clusters); Clusters = c; @@ -438,7 +438,7 @@ private readonly VCExpressionGenerator /*!*/ void ObjectInvariant() { Contract.Invariant(Gen != null); - Contract.Invariant(cce.NonNullDictionaryAndValues(Representation)); + Contract.Invariant(Cce.NonNullDictionaryAndValues(Representation)); } @@ -503,11 +503,11 @@ public void Reset() public bool RepresentationIsRenaming(IDictionary /*!*/ globalVars) { - Contract.Requires(cce.NonNullDictionaryAndValues(globalVars)); + Contract.Requires(Cce.NonNullDictionaryAndValues(globalVars)); 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)))) + !globalVars.ContainsKey(Cce.NonNull((VCExprVar) pair.Key.Expr0)) && + !globalVars.ContainsKey(Cce.NonNull((VCExprVar /*!*/) pair.Key.Expr1)))) { return false; } @@ -522,7 +522,7 @@ pair.Key.Expr0 is VCExprVar && pair.Key.Expr1 is VCExprVar && public void RepresentationSize(IDictionary /*!*/ globalVars, out int expr0Size, out int expr1Size) { - Contract.Requires(cce.NonNullDictionaryAndValues(globalVars)); + Contract.Requires(Cce.NonNullDictionaryAndValues(globalVars)); ReprSizeComputingVisitor /*!*/ size0Visitor = new ReprSizeComputingVisitor(); ReprSizeComputingVisitor /*!*/ @@ -564,7 +564,7 @@ private VCExprVar AbstractWithVariable(VCExpr s, VCExpr t) Representation.Add(pair, repr); } - return cce.NonNull(repr); + return Cce.NonNull(repr); } //////////////////////////////////////////////////////////////////////////// @@ -626,7 +626,7 @@ protected override VCExpr StandardResult(VCExpr node, VCExpr that) //Contract.Requires(node != null); Contract.Ensures(Contract.Result() != null); Contract.Assert(false); - throw new cce.UnreachableException(); // not handled here + throw new Cce.UnreachableException(); // not handled here } } @@ -642,7 +642,7 @@ internal class ReprSizeComputingVisitor public void ComputeSize(VCExpr expr, IDictionary /*!*/ globalVars) { Contract.Requires(expr != null); - Contract.Requires(cce.NonNullDictionaryAndValues(globalVars)); + Contract.Requires(Cce.NonNullDictionaryAndValues(globalVars)); Traverse(expr, globalVars); } diff --git a/Source/VCExpr/LetBindingSorter.cs b/Source/VCExpr/LetBindingSorter.cs index c4824020f..8b159a594 100644 --- a/Source/VCExpr/LetBindingSorter.cs +++ b/Source/VCExpr/LetBindingSorter.cs @@ -23,7 +23,7 @@ private readonly FreeVariableCollector /*!*/ private List /*!*/ FreeVarsIn(VCExpr expr) { Contract.Requires(expr != null); - Contract.Ensures(cce.NonNullElements(Contract.Result>())); + Contract.Ensures(Cce.NonNullElements(Contract.Result>())); FreeVarCollector.Collect(expr); List /*!*/ freeVars = new List(FreeVarCollector.FreeTermVars); @@ -57,7 +57,7 @@ public override VCExpr Visit(VCExprLet node, bool arg) // generate the occurrence edges foreach (KeyValuePair pair in boundVars) { - Contract.Assert(cce.NonNullElements(pair)); + Contract.Assert(Cce.NonNullElements(pair)); Binding /*!*/ b = pair.Value; Contract.Assert(b != null); @@ -66,7 +66,7 @@ public override VCExpr Visit(VCExprLet node, bool arg) Contract.Assert(v != null); if (boundVars.TryGetValue(v, out var b2)) { - cce.NonNull(b2).Occurrences.Add(b); + Cce.NonNull(b2).Occurrences.Add(b); b.InvOccurrencesNum = b.InvOccurrencesNum + 1; } } @@ -76,7 +76,7 @@ public override VCExpr Visit(VCExprLet node, bool arg) Stack rootBindings = new Stack(); foreach (KeyValuePair pair in boundVars) { - Contract.Assert(cce.NonNullElements(pair)); + Contract.Assert(Cce.NonNullElements(pair)); if (pair.Value.InvOccurrencesNum == 0) { rootBindings.Push(pair.Value); @@ -171,7 +171,7 @@ void ObjectInvariant() { Contract.Invariant(V != null); Contract.Invariant(E != null); - Contract.Invariant(cce.NonNullElements(FreeVars)); + Contract.Invariant(Cce.NonNullElements(FreeVars)); Contract.Invariant(Occurrences != null); } @@ -190,7 +190,7 @@ public Binding(VCExprVar v, VCExpr e, List /*!*/ freeVars) { Contract.Requires(e != null); Contract.Requires(v != null); - Contract.Requires(cce.NonNullElements(freeVars)); + Contract.Requires(Cce.NonNullElements(freeVars)); this.V = v; this.E = e; this.FreeVars = freeVars; diff --git a/Source/VCExpr/MutatingVCExprVisitor.cs b/Source/VCExpr/MutatingVCExprVisitor.cs index 38ab0f7c9..f82a4b7e7 100644 --- a/Source/VCExpr/MutatingVCExprVisitor.cs +++ b/Source/VCExpr/MutatingVCExprVisitor.cs @@ -31,8 +31,8 @@ public VCExpr Mutate(VCExpr expr, Arg arg) public List /*!*/ MutateSeq(IEnumerable /*!*/ exprs, Arg arg) { - Contract.Requires(cce.NonNullElements(exprs)); - Contract.Ensures(cce.NonNullElements(Contract.Result>())); + Contract.Requires(Cce.NonNullElements(exprs)); + Contract.Ensures(Cce.NonNullElements(Contract.Result>())); List /*!*/ res = new List(); foreach (VCExpr /*!*/ expr in exprs) @@ -46,8 +46,8 @@ public VCExpr Mutate(VCExpr expr, Arg arg) private List /*!*/ MutateList(List /*!*/ exprs, Arg arg) { - Contract.Requires(cce.NonNullElements(exprs)); - Contract.Ensures(cce.NonNullElements(Contract.Result>())); + Contract.Requires(Cce.NonNullElements(exprs)); + Contract.Ensures(Cce.NonNullElements(Contract.Result>())); bool changed = false; List /*!*/ res = new List(); @@ -104,8 +104,8 @@ private readonly Stack /*!*/ [ContractInvariantMethod] void ObjectInvarianta() { - Contract.Invariant(cce.NonNullElements(NAryExprResultStack)); - Contract.Invariant(cce.NonNullElements(NAryExprTodoStack)); + Contract.Invariant(Cce.NonNullElements(NAryExprResultStack)); + Contract.Invariant(Cce.NonNullElements(NAryExprTodoStack)); } @@ -198,7 +198,7 @@ public virtual VCExpr Visit(VCExprNAry node, Arg arg) bool changed, Arg arg) { - Contract.Requires(cce.NonNullElements(newSubExprs)); + Contract.Requires(Cce.NonNullElements(newSubExprs)); Contract.Ensures(Contract.Result() != null); if (changed) @@ -223,8 +223,8 @@ public virtual VCExpr Visit(VCExprVar node, Arg arg) protected List /*!*/ MutateTriggers(List /*!*/ triggers, Arg arg) { - Contract.Requires(cce.NonNullElements(triggers)); - Contract.Ensures(cce.NonNullElements(Contract.Result>())); + Contract.Requires(Cce.NonNullElements(triggers)); + Contract.Ensures(Cce.NonNullElements(Contract.Result>())); List /*!*/ newTriggers = new List(); bool changed = false; @@ -275,10 +275,10 @@ public virtual VCExpr Visit(VCExprQuantifier node, Arg arg) // visit the trigger expressions as well List /*!*/ triggers = node.Triggers; - Contract.Assert(cce.NonNullElements(triggers)); + Contract.Assert(Cce.NonNullElements(triggers)); List /*!*/ newTriggers = MutateTriggers(triggers, arg); - Contract.Assert(cce.NonNullElements(newTriggers)); + Contract.Assert(Cce.NonNullElements(newTriggers)); if (!Object.ReferenceEquals(triggers, newTriggers)) { changed = true; diff --git a/Source/VCExpr/OpTypeEraserPremisses.cs b/Source/VCExpr/OpTypeEraserPremisses.cs index 4fcd187af..15a2a0d66 100644 --- a/Source/VCExpr/OpTypeEraserPremisses.cs +++ b/Source/VCExpr/OpTypeEraserPremisses.cs @@ -31,8 +31,8 @@ private VCExpr HandleFunctionOp(Function newFun, List /*!*/ typeArgs { Contract.Requires(bindings != null); Contract.Requires(newFun != null); - Contract.Requires(cce.NonNullElements(typeArgs /*!*/)); - Contract.Requires(cce.NonNullElements(oldArgs)); + Contract.Requires(Cce.NonNullElements(typeArgs /*!*/)); + Contract.Requires(Cce.NonNullElements(oldArgs)); Contract.Ensures(Contract.Result() != null); // UGLY: the code for tracking polarities should be factored out int oldPolarity = Eraser.Polarity; @@ -53,7 +53,7 @@ private VCExpr HandleFunctionOp(Function newFun, List /*!*/ typeArgs { Contract.Assert(arg != null); Type /*!*/ - newType = cce.NonNull(newFun.InParams[newArgs.Count]).TypedIdent.Type; + newType = Cce.NonNull(newFun.InParams[newArgs.Count]).TypedIdent.Type; newArgs.Add(AxBuilder.Cast(Eraser.Mutate(arg, bindings), newType)); } @@ -132,8 +132,8 @@ public override VCExpr VisitBoogieFunctionOp(VCExprNAry node, VariableBindings b { Contract.Requires(allTypeParams != null); Contract.Requires(node != null); - Contract.Requires(cce.NonNullElements(explicitTypeParams)); - Contract.Ensures(cce.NonNullElements(Contract.Result>())); + Contract.Requires(Cce.NonNullElements(explicitTypeParams)); + Contract.Ensures(Cce.NonNullElements(Contract.Result>())); List /*!*/ res = new List(explicitTypeParams.Count); foreach (TypeVariable /*!*/ var in explicitTypeParams) diff --git a/Source/VCExpr/ScopedNamer.cs b/Source/VCExpr/ScopedNamer.cs index 00d28fead..6d955c1d8 100644 --- a/Source/VCExpr/ScopedNamer.cs +++ b/Source/VCExpr/ScopedNamer.cs @@ -60,19 +60,19 @@ protected ScopedNamer(ScopedNamer namer) [ContractInvariantMethod] private void GlobalNamesInvariantMethod() { - Contract.Invariant(cce.NonNullDictionaryAndValues(GlobalNames)); + Contract.Invariant(Cce.NonNullDictionaryAndValues(GlobalNames)); } [ContractInvariantMethod] private void LocalNamesInvariantMethod() { - Contract.Invariant(Contract.ForAll(LocalNames, i => i != null && cce.NonNullDictionaryAndValues(i))); + Contract.Invariant(Contract.ForAll(LocalNames, i => i != null && Cce.NonNullDictionaryAndValues(i))); } [ContractInvariantMethod] private void UsedNamesInvariantMethod() { - Contract.Invariant(cce.NonNull(UsedNames)); + Contract.Invariant(Cce.NonNull(UsedNames)); } [ContractInvariantMethod] @@ -84,7 +84,7 @@ private void CurrentCountersInvariantMethod() [ContractInvariantMethod] private void GlobalPlusLocalNamesInvariantMethod() { - Contract.Invariant(cce.NonNullDictionaryAndValues(GlobalPlusLocalNames)); + Contract.Invariant(Cce.NonNullDictionaryAndValues(GlobalPlusLocalNames)); } public void PushScope() diff --git a/Source/VCExpr/TypeErasure/HelperFuns.cs b/Source/VCExpr/TypeErasure/HelperFuns.cs index 179162989..eb46f188a 100644 --- a/Source/VCExpr/TypeErasure/HelperFuns.cs +++ b/Source/VCExpr/TypeErasure/HelperFuns.cs @@ -10,7 +10,7 @@ public static Function BoogieFunction(string name, List /*!* { Contract.Requires(types != null); Contract.Requires(name != null); - Contract.Requires(cce.NonNullElements(typeParams)); + Contract.Requires(Cce.NonNullElements(typeParams)); Contract.Requires(types.Length > 0); Contract.Requires(Contract.ForAll(0, types.Length, i => types[i] != null)); Contract.Ensures(Contract.Result() != null); @@ -19,13 +19,13 @@ public static Function BoogieFunction(string name, List /*!* for (int i = 0; i < types.Length - 1; ++i) { args.Add(new Formal(Token.NoToken, - new TypedIdent(Token.NoToken, "arg" + i, cce.NonNull(types[i])), + new TypedIdent(Token.NoToken, "arg" + i, Cce.NonNull(types[i])), true)); } Formal result = new Formal(Token.NoToken, new TypedIdent(Token.NoToken, "res", - cce.NonNull(types)[types.Length - 1]), + Cce.NonNull(types)[types.Length - 1]), false); return new Function(Token.NoToken, name, new List(typeParams), args, result); } @@ -58,7 +58,7 @@ public static Function UniformBoogieFunction(string name, int arity, Type U) { Contract.Requires(gen != null); Contract.Requires(fun != null); - Contract.Ensures(cce.NonNullElements(Contract.Result>())); + Contract.Ensures(Cce.NonNullElements(Contract.Result>())); List /*!*/ arguments = new List(fun.InParams.Count); foreach (Formal /*!*/ f in fun.InParams) @@ -74,15 +74,15 @@ public static Function UniformBoogieFunction(string name, int arity, Type U) public static List /*!*/ ToList(params T[] args) where T : class { - Contract.Requires(cce.NonNullElements(args)); - Contract.Ensures(cce.NonNullElements(Contract.Result>())); + Contract.Requires(Cce.NonNullElements(args)); + Contract.Ensures(Cce.NonNullElements(Contract.Result>())); return new List(args); } public static List /*!*/ ToVCExprList(List /*!*/ list) { - Contract.Requires(cce.NonNullElements(list)); - Contract.Ensures(cce.NonNullElements(Contract.Result>())); + Contract.Requires(Cce.NonNullElements(list)); + Contract.Ensures(Cce.NonNullElements(Contract.Result>())); return new List(list); } @@ -91,7 +91,7 @@ public static Function UniformBoogieFunction(string name, int arity, Type U) Contract.Requires(gen != null); Contract.Requires(type != null); Contract.Requires(baseName != null); - Contract.Ensures(cce.NonNullElements(Contract.Result>())); + Contract.Ensures(Cce.NonNullElements(Contract.Result>())); List /*!*/ res = new List(num); for (int i = 0; i < num; ++i) @@ -107,8 +107,8 @@ public static List /*!*/ { Contract.Requires(gen != null); Contract.Requires(baseName != null); - Contract.Requires(cce.NonNullElements(types)); - Contract.Ensures(cce.NonNullElements(Contract.Result>())); + Contract.Requires(Cce.NonNullElements(types)); + Contract.Ensures(Cce.NonNullElements(Contract.Result>())); List /*!*/ res = new List(types.Count); for (int i = 0; i < types.Count; ++i) diff --git a/Source/VCExpr/TypeErasure/MapTypeAbstractionBuilder.cs b/Source/VCExpr/TypeErasure/MapTypeAbstractionBuilder.cs index 96f70e643..a28346577 100644 --- a/Source/VCExpr/TypeErasure/MapTypeAbstractionBuilder.cs +++ b/Source/VCExpr/TypeErasure/MapTypeAbstractionBuilder.cs @@ -57,7 +57,7 @@ private readonly List /*!*/ [ContractInvariantMethod] void AbstractionVariablesInvariantMethod() { - Contract.Invariant(cce.NonNullElements(AbstractionVariables)); + Contract.Invariant(Cce.NonNullElements(AbstractionVariables)); } private TypeVariable AbstractionVariable(int num) diff --git a/Source/VCExpr/TypeErasure/OpTypeEraser.cs b/Source/VCExpr/TypeErasure/OpTypeEraser.cs index 98d10ccef..0d244d424 100644 --- a/Source/VCExpr/TypeErasure/OpTypeEraser.cs +++ b/Source/VCExpr/TypeErasure/OpTypeEraser.cs @@ -43,14 +43,14 @@ protected override VCExpr StandardResult(VCExprNAry node, VariableBindings bindi Contract.Ensures(Contract.Result() != null); System.Diagnostics.Debug.Fail("Don't know how to erase types in this expression: " + node); Contract.Assert(false); - throw new cce.UnreachableException(); // to please the compiler + throw new Cce.UnreachableException(); // to please the compiler } private List /*!*/ MutateSeq(VCExprNAry node, VariableBindings bindings, int newPolarity) { Contract.Requires((bindings != null)); Contract.Requires((node != null)); - Contract.Ensures(cce.NonNullElements(Contract.Result>())); + Contract.Ensures(Cce.NonNullElements(Contract.Result>())); int oldPolarity = Eraser.Polarity; Eraser.Polarity = newPolarity; List /*!*/ diff --git a/Source/VCExpr/TypeErasure/TypeAxiomBuilder.cs b/Source/VCExpr/TypeErasure/TypeAxiomBuilder.cs index 8a96a9d9c..260c9bf4b 100644 --- a/Source/VCExpr/TypeErasure/TypeAxiomBuilder.cs +++ b/Source/VCExpr/TypeErasure/TypeAxiomBuilder.cs @@ -32,7 +32,7 @@ private readonly List /*!*/ [ContractInvariantMethod] void AllTypeAxiomsInvariantMethod() { - Contract.Invariant(cce.NonNullElements(AllTypeAxioms)); + Contract.Invariant(Cce.NonNullElements(AllTypeAxioms)); } // list in which type axioms are incrementally collected @@ -42,7 +42,7 @@ private readonly List /*!*/ [ContractInvariantMethod] void IncTypeAxiomsInvariantMethod() { - Contract.Invariant(cce.NonNullElements(IncTypeAxioms)); + Contract.Invariant(Cce.NonNullElements(IncTypeAxioms)); } internal void AddTypeAxiom(VCExpr axiom) @@ -109,7 +109,7 @@ protected VCExpr GenLeftInverseAxiom(Function fun, Function invFun, int dtorNum) Contract.Ensures(Contract.Result() != null); List /*!*/ quantifiedVars = HelperFuns.GenVarsForInParams(fun, Gen); - Contract.Assert(cce.NonNullElements(quantifiedVars)); + Contract.Assert(Cce.NonNullElements(quantifiedVars)); VCExpr /*!*/ funApp = Gen.Function(fun, HelperFuns.ToVCExprList(quantifiedVars)); @@ -122,7 +122,7 @@ protected VCExpr GenLeftInverseAxiom(Function fun, Function invFun, int dtorNum) List /*!*/ triggers = HelperFuns.ToList(Gen.Trigger(true, HelperFuns.ToList(funApp))); - Contract.Assert(cce.NonNullElements(triggers)); + Contract.Assert(Cce.NonNullElements(triggers)); return Gen.Forall(quantifiedVars, triggers, "typeInv:" + invFun.Name, 1, eq); } @@ -165,7 +165,7 @@ public readonly Type /*!*/ [ContractInvariantMethod] void BasicTypeReprsInvariantMethod() { - Contract.Invariant(cce.NonNullDictionaryAndValues(BasicTypeReprs)); + Contract.Invariant(Cce.NonNullDictionaryAndValues(BasicTypeReprs)); } private VCExpr GetBasicTypeRepr(Type type) @@ -180,7 +180,7 @@ private VCExpr GetBasicTypeRepr(Type type) BasicTypeReprs.Add(type, res); } - return cce.NonNull(res); + return Cce.NonNull(res); } private readonly IDictionary /*!*/ @@ -240,7 +240,7 @@ public Function GetTypeDtor(TypeCtorDecl decl, int num) [ContractInvariantMethod] void TypeVariableMappingInvariantMethod() { - Contract.Invariant(cce.NonNullDictionaryAndValues(TypeVariableMapping)); + Contract.Invariant(Cce.NonNullDictionaryAndValues(TypeVariableMapping)); } public VCExprVar Typed2Untyped(TypeVariable var) @@ -253,7 +253,7 @@ public VCExprVar Typed2Untyped(TypeVariable var) TypeVariableMapping.Add(var, res); } - return cce.NonNull(res); + return Cce.NonNull(res); } @@ -267,7 +267,7 @@ public VCExprVar Typed2Untyped(TypeVariable var) [ContractInvariantMethod] void Typed2UntypedVariablesInvariantMethod() { - Contract.Invariant(cce.NonNullDictionaryAndValues(Typed2UntypedVariables)); + Contract.Invariant(Cce.NonNullDictionaryAndValues(Typed2UntypedVariables)); } // This method must only be used for free (unbound) variables @@ -283,7 +283,7 @@ public VCExprVar Typed2Untyped(VCExprVar var) AddVarTypeAxiom(res, var.Type); } - return cce.NonNull(res); + return Cce.NonNull(res); } /// @@ -314,7 +314,7 @@ public VCExprVar TryTyped2Untyped(VCExprVar var) public VCExpr Type2Term(Type type, IDictionary /*!*/ varMapping) { Contract.Requires(type != null); - Contract.Requires(cce.NonNullDictionaryAndValues(varMapping)); + Contract.Requires(Cce.NonNullDictionaryAndValues(varMapping)); Contract.Ensures(Contract.Result() != null); // if (type.IsBasic || type.IsBv || type.IsFloat) @@ -350,7 +350,7 @@ public VCExpr Type2Term(Type type, IDictionary res = Typed2Untyped(type.AsVariable); } - return cce.NonNull(res); + return Cce.NonNull(res); // } else if (type.IsMap) @@ -363,7 +363,7 @@ public VCExpr Type2Term(Type type, IDictionary { System.Diagnostics.Debug.Fail("Don't know how to handle this type: " + type); Contract.Assert(false); - throw new cce.UnreachableException(); // please the compiler + throw new Cce.UnreachableException(); // please the compiler } } diff --git a/Source/VCExpr/TypeErasure/TypeEraser.cs b/Source/VCExpr/TypeErasure/TypeEraser.cs index b5818305b..a32786cc0 100644 --- a/Source/VCExpr/TypeErasure/TypeEraser.cs +++ b/Source/VCExpr/TypeErasure/TypeEraser.cs @@ -103,7 +103,7 @@ public override VCExpr Visit(VCExprVar node, VariableBindings bindings) return AxBuilder.Typed2Untyped(node); } - return cce.NonNull(res); + return Cce.NonNull(res); } //////////////////////////////////////////////////////////////////////////// @@ -121,8 +121,8 @@ protected bool IsUniversalQuantifier(VCExprQuantifier node) VariableBindings /*!*/ bindings) { Contract.Requires(bindings != null); - Contract.Requires(cce.NonNullElements(oldBoundVars)); - Contract.Ensures(cce.NonNullElements(Contract.Result>())); + Contract.Requires(Cce.NonNullElements(oldBoundVars)); + Contract.Ensures(Cce.NonNullElements(Contract.Result>())); List /*!*/ newBoundVars = new List(oldBoundVars.Count); @@ -155,10 +155,10 @@ protected bool RedoQuantifier(VCExprQuantifier /*!*/ node, { Contract.Requires(node != null); Contract.Requires(newNode != null); - Contract.Requires(cce.NonNullElements(occurringVars)); + Contract.Requires(Cce.NonNullElements(occurringVars)); Contract.Requires(oldBindings != null); Contract.Ensures(Contract.ValueAtReturn(out newBindings) != null); - Contract.Ensures(cce.NonNullElements(Contract.ValueAtReturn(out newBoundVars))); + Contract.Ensures(Cce.NonNullElements(Contract.ValueAtReturn(out newBoundVars))); List castVariables = VariableCastCollector.FindCastVariables(node, newNode, AxBuilder); if (castVariables.Count == 0) diff --git a/Source/VCExpr/TypeErasure/TypeEraserPremisses.cs b/Source/VCExpr/TypeErasure/TypeEraserPremisses.cs index c1957bd47..493df989a 100644 --- a/Source/VCExpr/TypeErasure/TypeEraserPremisses.cs +++ b/Source/VCExpr/TypeErasure/TypeEraserPremisses.cs @@ -86,7 +86,7 @@ public override VCExpr Visit(VCExprQuantifier node, VariableBindings oldBindings List /*!*/ newBoundVars = BoundVarsAfterErasure(occurringVars, bindings); - Contract.Assert(cce.NonNullElements(newBoundVars)); + Contract.Assert(Cce.NonNullElements(newBoundVars)); VCExpr /*!*/ newNode = HandleQuantifier(node, occurringVars, newBoundVars, bindings); @@ -114,11 +114,11 @@ public override VCExpr Visit(VCExprQuantifier node, VariableBindings oldBindings List /*!*/ typeVarBindings, out List /*!*/ triggers) { - Contract.Requires(cce.NonNullElements(oldBoundVars)); - Contract.Requires(cce.NonNullElements(newBoundVars)); - Contract.Requires(cce.NonNullDictionaryAndValues(typeVarTranslation)); - Contract.Requires(cce.NonNullElements(typeVarBindings)); - Contract.Ensures(cce.NonNullElements(Contract.ValueAtReturn(out triggers))); + Contract.Requires(Cce.NonNullElements(oldBoundVars)); + Contract.Requires(Cce.NonNullElements(newBoundVars)); + Contract.Requires(Cce.NonNullDictionaryAndValues(typeVarTranslation)); + Contract.Requires(Cce.NonNullElements(typeVarBindings)); + Contract.Ensures(Cce.NonNullElements(Contract.ValueAtReturn(out triggers))); Contract.Ensures(Contract.Result() != null); // build a substitution of the type variables that it can be checked @@ -200,8 +200,8 @@ private VCExpr HandleQuantifier(VCExprQuantifier node, List /*! { Contract.Requires(bindings != null); Contract.Requires(node != null); - Contract.Requires(cce.NonNullElements(occurringVars /*!*/)); - Contract.Requires(cce.NonNullElements(newBoundVars)); + Contract.Requires(Cce.NonNullElements(occurringVars /*!*/)); + Contract.Requires(Cce.NonNullElements(newBoundVars)); Contract.Ensures(Contract.Result() != null); List /*!*/ typeVarBindings = @@ -246,11 +246,11 @@ private VCExpr HandleQuantifier(VCExprQuantifier node, List /*! bindings.TypeVariableBindings, typeVarBindings, out var furtherTriggers); - Contract.Assert(cce.NonNullElements(furtherTriggers)); + Contract.Assert(Cce.NonNullElements(furtherTriggers)); Contract.Assert(typePremisses != null); List /*!*/ newTriggers = new List(MutateTriggers(node.Triggers, bindings)); - Contract.Assert(cce.NonNullElements(newTriggers)); + Contract.Assert(Cce.NonNullElements(newTriggers)); newTriggers.AddRange(furtherTriggers); newTriggers = AddLets2Triggers(newTriggers, typeVarBindings); @@ -291,9 +291,9 @@ private VCExpr HandleQuantifier(VCExprQuantifier node, List /*! private List /*!*/ AddLets2Triggers(List /*!*/ triggers /*!*/, List /*!*/ typeVarBindings) { - Contract.Requires(cce.NonNullElements(triggers /*!*/)); - Contract.Requires(cce.NonNullElements(typeVarBindings)); - Contract.Ensures(cce.NonNullElements(Contract.Result>())); + Contract.Requires(Cce.NonNullElements(triggers /*!*/)); + Contract.Requires(Cce.NonNullElements(typeVarBindings)); + Contract.Ensures(Cce.NonNullElements(Contract.Result>())); List /*!*/ triggersWithLets = new List(triggers.Count); @@ -308,7 +308,7 @@ private VCExpr HandleQuantifier(VCExprQuantifier node, List /*! { Contract.Assert(e != null); HashSet freeVars = FreeVariableCollector.FreeTermVariables(e); - Contract.Assert(freeVars != null && cce.NonNullElements(freeVars)); + Contract.Assert(freeVars != null && Cce.NonNullElements(freeVars)); if (typeVarBindings.Any(b => freeVars.Contains(b.V))) { exprsWithLets.Add(Gen.Let(typeVarBindings, e)); diff --git a/Source/VCExpr/TypeErasure/TypeErasure.cs b/Source/VCExpr/TypeErasure/TypeErasure.cs index e9f7a9128..3b4785aa4 100644 --- a/Source/VCExpr/TypeErasure/TypeErasure.cs +++ b/Source/VCExpr/TypeErasure/TypeErasure.cs @@ -29,14 +29,14 @@ public readonly List /*!*/ void ObjectInvariant() { Contract.Invariant(Ctor != null); - Contract.Invariant(cce.NonNullElements(Dtors)); + Contract.Invariant(Cce.NonNullElements(Dtors)); } public TypeCtorRepr(Function ctor, List /*!*/ dtors) { Contract.Requires(ctor != null); - Contract.Requires(cce.NonNullElements(dtors)); + Contract.Requires(Cce.NonNullElements(dtors)); Contract.Requires(ctor.InParams.Count == dtors.Count); this.Ctor = ctor; this.Dtors = dtors; @@ -146,7 +146,7 @@ protected VCExpr GenReverseCastEq(Function castToU, Function castFromU, out VCEx { Contract.Requires((castFromU != null)); Contract.Requires((castToU != null)); - Contract.Ensures((cce.NonNullElements(Contract.ValueAtReturn(out triggers)))); + Contract.Ensures((Cce.NonNullElements(Contract.ValueAtReturn(out triggers)))); Contract.Ensures(Contract.ValueAtReturn(out var) != null); Contract.Ensures(Contract.Result() != null); var = Gen.Variable("x", U); @@ -245,11 +245,11 @@ public bool IsCast(Function fun) } Type /*!*/ - inType = cce.NonNull(fun.InParams[0]).TypedIdent.Type; + inType = Cce.NonNull(fun.InParams[0]).TypedIdent.Type; if (inType.Equals(U)) { Type /*!*/ - outType = cce.NonNull(fun.OutParams[0]).TypedIdent.Type; + outType = Cce.NonNull(fun.OutParams[0]).TypedIdent.Type; if (!TypeCasts.ContainsKey(outType)) { return false; @@ -265,7 +265,7 @@ public bool IsCast(Function fun) } Type /*!*/ - outType = cce.NonNull(fun.OutParams[0]).TypedIdent.Type; + outType = Cce.NonNull(fun.OutParams[0]).TypedIdent.Type; if (!outType.Equals(U)) { return false; @@ -330,8 +330,8 @@ public override VCExpr Cast(VCExpr expr, Type toType) public List /*!*/ CastSeq(List /*!*/ exprs, Type toType) { Contract.Requires(toType != null); - Contract.Requires(cce.NonNullElements(exprs)); - Contract.Ensures(cce.NonNullElements(Contract.Result>())); + Contract.Requires(Cce.NonNullElements(exprs)); + Contract.Ensures(Cce.NonNullElements(Contract.Result>())); List /*!*/ res = new List(exprs.Count); foreach (VCExpr /*!*/ expr in exprs) diff --git a/Source/VCExpr/TypeErasure/TypeErasureArguments.cs b/Source/VCExpr/TypeErasure/TypeErasureArguments.cs index ebbd4958c..a3fbfff18 100644 --- a/Source/VCExpr/TypeErasure/TypeErasureArguments.cs +++ b/Source/VCExpr/TypeErasure/TypeErasureArguments.cs @@ -104,7 +104,7 @@ protected override void AddVarTypeAxiom(VCExprVar var, Type originalType) [ContractInvariantMethod] void Typed2UntypedFunctionsInvariantMethod() { - Contract.Invariant(cce.NonNullDictionaryAndValues(Typed2UntypedFunctions)); + Contract.Invariant(Cce.NonNullDictionaryAndValues(Typed2UntypedFunctions)); } public Function Typed2Untyped(Function fun) @@ -117,8 +117,8 @@ public Function Typed2Untyped(Function fun) // if all of the parameters are int or bool, the function does // not have to be changed - if (fun.InParams.All(param => UnchangedType(cce.NonNull(param).TypedIdent.Type)) && - UnchangedType(cce.NonNull(fun.OutParams[0]).TypedIdent.Type)) + if (fun.InParams.All(param => UnchangedType(Cce.NonNull(param).TypedIdent.Type)) && + UnchangedType(Cce.NonNull(fun.OutParams[0]).TypedIdent.Type)) { res = fun; } @@ -143,7 +143,7 @@ public Function Typed2Untyped(Function fun) i = i + 1; } - types[types.Length - 1] = TypeAfterErasure(cce.NonNull(fun.OutParams[0]).TypedIdent.Type); + types[types.Length - 1] = TypeAfterErasure(Cce.NonNull(fun.OutParams[0]).TypedIdent.Type); res = HelperFuns.BoogieFunction(fun.Name, types); res.Attributes = fun.Attributes; @@ -152,7 +152,7 @@ public Function Typed2Untyped(Function fun) Typed2UntypedFunctions.Add(fun, res); } - return cce.NonNull(res); + return Cce.NonNull(res); } } @@ -243,8 +243,8 @@ protected override void GenSelectStoreFunctions(MapType abstractedType, TypeCtor i++; // Fill in the map type which is the output of the store function storeTypes[i] = AxBuilder.U; - Contract.Assert(cce.NonNullElements(selectTypes)); - Contract.Assert(cce.NonNullElements(storeTypes)); + Contract.Assert(Cce.NonNullElements(selectTypes)); + Contract.Assert(Cce.NonNullElements(storeTypes)); select = HelperFuns.BoogieFunction(baseName + "Select", selectTypes); store = HelperFuns.BoogieFunction(baseName + "Store", storeTypes); @@ -262,8 +262,8 @@ private VCExpr Select(Function select, List /*!*/ types, VCExpr { Contract.Requires(map != null); Contract.Requires(select != null); - Contract.Requires(cce.NonNullElements(indexes)); - Contract.Requires(cce.NonNullElements(types)); + Contract.Requires(Cce.NonNullElements(indexes)); + Contract.Requires(Cce.NonNullElements(types)); Contract.Ensures(Contract.Result() != null); List /*!*/ selectArgs = new List(); @@ -279,8 +279,8 @@ private VCExpr Store(Function store, List /*!*/ types, VCExpr m Contract.Requires(val != null); Contract.Requires(map != null); Contract.Requires(store != null); - Contract.Requires(cce.NonNullElements(indexes)); - Contract.Requires(cce.NonNullElements(types)); + Contract.Requires(Cce.NonNullElements(indexes)); + Contract.Requires(Cce.NonNullElements(types)); Contract.Ensures(Contract.Result() != null); List /*!*/ storeArgs = new List(); @@ -311,7 +311,7 @@ private VCExpr Store(Function store, List /*!*/ types, VCExpr m List indexTypes = new List(); for (int i = mapTypeParamNum + mapAbstractionVarNum + 1; i < select.InParams.Count; i++) { - indexTypes.Add(cce.NonNull(select.InParams[i]).TypedIdent.Type); + indexTypes.Add(Cce.NonNull(select.InParams[i]).TypedIdent.Type); } Contract.Assert(arity == indexTypes.Count); @@ -323,7 +323,7 @@ private VCExpr Store(Function store, List /*!*/ types, VCExpr m m = Gen.Variable("m", AxBuilder.U); Contract.Assert(m != null); VCExprVar /*!*/ - val = Gen.Variable("val", cce.NonNull(select.OutParams[0]).TypedIdent.Type); + val = Gen.Variable("val", Cce.NonNull(select.OutParams[0]).TypedIdent.Type); Contract.Assert(val != null); VCExpr /*!*/ @@ -381,7 +381,7 @@ private VCExpr Store(Function store, List /*!*/ types, VCExpr m List indexTypes = new List(); for (int i = mapTypeParamNum + mapAbstractionVarNum + 1; i < select.InParams.Count; i++) { - indexTypes.Add(cce.NonNull(select.InParams[i]).TypedIdent.Type); + indexTypes.Add(Cce.NonNull(select.InParams[i]).TypedIdent.Type); } Contract.Assert(arity == indexTypes.Count); @@ -395,7 +395,7 @@ private VCExpr Store(Function store, List /*!*/ types, VCExpr m m = Gen.Variable("m", AxBuilder.U); Contract.Assert(m != null); VCExprVar /*!*/ - val = Gen.Variable("val", cce.NonNull(select.OutParams[0]).TypedIdent.Type); + val = Gen.Variable("val", Cce.NonNull(select.OutParams[0]).TypedIdent.Type); Contract.Assert(val != null); VCExpr /*!*/ @@ -541,8 +541,8 @@ private void GenBoundVarsForTypeParams(List /*!*/ typeParams List /*!*/ newBoundVars, VariableBindings bindings) { Contract.Requires(bindings != null); - Contract.Requires(cce.NonNullElements(typeParams)); - Contract.Requires(cce.NonNullElements(newBoundVars)); + Contract.Requires(Cce.NonNullElements(typeParams)); + Contract.Requires(Cce.NonNullElements(newBoundVars)); foreach (TypeVariable /*!*/ tvar in typeParams) { Contract.Assert(tvar != null); @@ -559,11 +559,11 @@ private VCExpr HandleQuantifier(VCExprQuantifier node, List /*! { Contract.Requires(bindings != null); Contract.Requires(node != null); - Contract.Requires(cce.NonNullElements(newBoundVars)); + Contract.Requires(Cce.NonNullElements(newBoundVars)); Contract.Ensures(Contract.Result() != null); List /*!*/ newTriggers = MutateTriggers(node.Triggers, bindings); - Contract.Assert(cce.NonNullElements(newTriggers)); + Contract.Assert(Cce.NonNullElements(newTriggers)); VCExpr /*!*/ newBody = Mutate(node.Body, bindings); Contract.Assert(newBody != null); @@ -608,7 +608,7 @@ private VCExpr AssembleOpExpression(OpTypesPair opTypes, IEnumerable() != null); // UGLY: the code for tracking polarities should be factored out int oldPolarity = Eraser.Polarity; @@ -632,7 +632,7 @@ private VCExpr AssembleOpExpression(OpTypesPair opTypes, IEnumerable /*!*/ void ObjectInvariant() { Contract.Invariant(Op != null); - Contract.Invariant(cce.NonNullElements(Types)); + Contract.Invariant(Cce.NonNullElements(Types)); } public OpTypesPair(VCExprOp op, List /*!*/ types) { Contract.Requires(op != null); - Contract.Requires(cce.NonNullElements(types)); + Contract.Requires(Cce.NonNullElements(types)); this.Op = op; this.Types = types; this.HashCode = HFNS.PolyHash(op.GetHashCode(), 17, types); diff --git a/Source/VCExpr/TypeErasure/TypeErasurePremisses.cs b/Source/VCExpr/TypeErasure/TypeErasurePremisses.cs index 9e2f75dcb..7b9fb2d65 100644 --- a/Source/VCExpr/TypeErasure/TypeErasurePremisses.cs +++ b/Source/VCExpr/TypeErasure/TypeErasurePremisses.cs @@ -38,8 +38,8 @@ public readonly List /*!*/ void ObjectInvariant() { Contract.Invariant(Fun != null); - Contract.Invariant(cce.NonNullElements(ImplicitTypeParams)); - Contract.Invariant(cce.NonNullElements(ExplicitTypeParams)); + Contract.Invariant(Cce.NonNullElements(ImplicitTypeParams)); + Contract.Invariant(Cce.NonNullElements(ExplicitTypeParams)); } @@ -48,8 +48,8 @@ public UntypedFunction(Function /*!*/ fun, List /*!*/ explicitTypeParams) { Contract.Requires(fun != null); - Contract.Requires(cce.NonNullElements(implicitTypeParams)); - Contract.Requires(cce.NonNullElements(explicitTypeParams)); + Contract.Requires(Cce.NonNullElements(implicitTypeParams)); + Contract.Requires(Cce.NonNullElements(explicitTypeParams)); Fun = fun; ImplicitTypeParams = implicitTypeParams; ExplicitTypeParams = explicitTypeParams; @@ -115,12 +115,12 @@ protected override VCExpr GenReverseCastAxiom(Function castToU, Function castFro Contract.Ensures(Contract.Result() != null); VCExpr /*!*/ eq = GenReverseCastEq(castToU, castFromU, out var var, out var triggers); - Contract.Assert(cce.NonNullElements(triggers)); + Contract.Assert(Cce.NonNullElements(triggers)); Contract.Assert(var != null); Contract.Assert(eq != null); VCExpr /*!*/ premiss; - premiss = GenVarTypeAxiom(var, cce.NonNull(castFromU.OutParams[0]).TypedIdent.Type, + premiss = GenVarTypeAxiom(var, Cce.NonNull(castFromU.OutParams[0]).TypedIdent.Type, // we don't have any bindings available new Dictionary()); VCExpr /*!*/ @@ -135,7 +135,7 @@ protected override VCExpr GenCastTypeAxioms(Function castToU, Function castFromU //Contract.Requires(castToU != null); Contract.Ensures(Contract.Result() != null); Type /*!*/ - fromType = cce.NonNull(castToU.InParams[0]).TypedIdent.Type; + fromType = Cce.NonNull(castToU.InParams[0]).TypedIdent.Type; return GenFunctionAxiom(castToU, new List(), new List(), HelperFuns.ToList(fromType), fromType); } @@ -201,10 +201,10 @@ public List /*!*/ bool addTypeVarsToBindings) { Contract.Requires(typeParams != null); - Contract.Requires(cce.NonNullElements(oldBoundVars)); + Contract.Requires(Cce.NonNullElements(oldBoundVars)); Contract.Requires(bindings != null); - Contract.Ensures(cce.NonNullElements(Contract.Result>())); + Contract.Ensures(Cce.NonNullElements(Contract.Result>())); // type variables are replaced with ordinary variables that are bound using a // let-expression @@ -244,7 +244,7 @@ public List /*!*/ VCExpr /*!*/ typePremisses, bool universal, VCExpr /*!*/ body) { - Contract.Requires(cce.NonNullElements(typeVarBindings)); + Contract.Requires(Cce.NonNullElements(typeVarBindings)); Contract.Requires(typePremisses != null); Contract.Requires(body != null); Contract.Ensures(Contract.Result() != null); @@ -274,11 +274,11 @@ public List /*!*/ List /*!*/ concreteTypeSources, VariableBindings /*!*/ bindings) { - Contract.Requires(cce.NonNullElements(vars)); - Contract.Requires(cce.NonNullElements(types)); - Contract.Requires(cce.NonNullElements(concreteTypeSources)); + Contract.Requires(Cce.NonNullElements(vars)); + Contract.Requires(Cce.NonNullElements(types)); + Contract.Requires(Cce.NonNullElements(concreteTypeSources)); Contract.Requires(bindings != null); - Contract.Ensures(cce.NonNullElements(Contract.Result>())); + Contract.Ensures(Cce.NonNullElements(Contract.Result>())); List /*!*/ typeParamBindings = new List(); @@ -301,10 +301,10 @@ private VCExpr BestTypeVarExtractor(TypeVariable /*!*/ var, List /*! List /*!*/ concreteTypeSources) { Contract.Requires(var != null); - Contract.Requires(cce.NonNullElements(types)); - Contract.Requires(cce.NonNullElements(concreteTypeSources)); + Contract.Requires(Cce.NonNullElements(types)); + Contract.Requires(Cce.NonNullElements(concreteTypeSources)); List allExtractors = TypeVarExtractors(var, types, concreteTypeSources); - Contract.Assert(cce.NonNullElements(allExtractors)); + Contract.Assert(Cce.NonNullElements(allExtractors)); if (allExtractors.Count == 0) { return null; @@ -329,10 +329,10 @@ private VCExpr BestTypeVarExtractor(TypeVariable /*!*/ var, List /*! List /*!*/ concreteTypeSources) { Contract.Requires(var != null); - Contract.Requires(cce.NonNullElements(types)); - Contract.Requires(cce.NonNullElements(concreteTypeSources)); + Contract.Requires(Cce.NonNullElements(types)); + Contract.Requires(Cce.NonNullElements(concreteTypeSources)); Contract.Requires((types.Count == concreteTypeSources.Count)); - Contract.Ensures(cce.NonNullElements(Contract.Result>())); + Contract.Ensures(Cce.NonNullElements(Contract.Result>())); List /*!*/ res = new List(); for (int i = 0; i < types.Count; ++i) @@ -349,7 +349,7 @@ private void TypeVarExtractors(TypeVariable var, Type completeType, VCExpr inner Contract.Requires(innerTerm != null); Contract.Requires(completeType != null); Contract.Requires(var != null); - Contract.Requires(cce.NonNullElements(extractors)); + Contract.Requires(Cce.NonNullElements(extractors)); if (completeType.IsVariable) { if (var.Equals(completeType)) @@ -409,10 +409,10 @@ internal static void SeparateTypeParams(List /*!*/ valueArgumentType out List /*!*/ implicitParams, out List /*!*/ explicitParams) { - Contract.Requires(cce.NonNullElements(valueArgumentTypes)); + Contract.Requires(Cce.NonNullElements(valueArgumentTypes)); Contract.Requires(allTypeParams != null); - Contract.Ensures(cce.NonNullElements(Contract.ValueAtReturn(out implicitParams))); - Contract.Ensures(cce.NonNullElements(Contract.ValueAtReturn(out explicitParams))); + Contract.Ensures(Cce.NonNullElements(Contract.ValueAtReturn(out implicitParams))); + Contract.Ensures(Cce.NonNullElements(Contract.ValueAtReturn(out explicitParams))); List /*!*/ varsInInParamTypes = new List(); foreach (Type /*!*/ t in valueArgumentTypes) @@ -450,8 +450,8 @@ internal UntypedFunction Typed2Untyped(Function fun) // if all of the parameters are int or bool, the function does // not have to be changed - if (fun.InParams.All(param => UnchangedType(cce.NonNull(param).TypedIdent.Type)) && - UnchangedType(cce.NonNull(fun.OutParams[0]).TypedIdent.Type) && + if (fun.InParams.All(param => UnchangedType(Cce.NonNull(param).TypedIdent.Type)) && + UnchangedType(Cce.NonNull(fun.OutParams[0]).TypedIdent.Type) && fun.TypeParameters.Count == 0) { res = new UntypedFunction(fun, new List(), new List()); @@ -479,10 +479,10 @@ internal UntypedFunction Typed2Untyped(Function fun) for (int j = 0; j < fun.InParams.Count; ++i, ++j) { - types[i] = TypeAfterErasure(cce.NonNull(fun.InParams[j]).TypedIdent.Type); + types[i] = TypeAfterErasure(Cce.NonNull(fun.InParams[j]).TypedIdent.Type); } - types[types.Length - 1] = TypeAfterErasure(cce.NonNull(fun.OutParams[0]).TypedIdent.Type); + types[types.Length - 1] = TypeAfterErasure(Cce.NonNull(fun.OutParams[0]).TypedIdent.Type); Function /*!*/ untypedFun = HelperFuns.BoogieFunction(fun.Name, types); @@ -514,7 +514,7 @@ private VCExpr GenFunctionAxiom(UntypedFunction fun, Function originalFun) return GenFunctionAxiom(fun.Fun, fun.ImplicitTypeParams, fun.ExplicitTypeParams, originalInTypes, - cce.NonNull(originalFun.OutParams[0]).TypedIdent.Type); + Cce.NonNull(originalFun.OutParams[0]).TypedIdent.Type); } internal VCExpr /*!*/ GenFunctionAxiom(Function /*!*/ fun, @@ -523,10 +523,10 @@ private VCExpr GenFunctionAxiom(UntypedFunction fun, Function originalFun) List /*!*/ originalInTypes, Type /*!*/ originalResultType) { - Contract.Requires(cce.NonNullElements(implicitTypeParams)); + Contract.Requires(Cce.NonNullElements(implicitTypeParams)); Contract.Requires(fun != null); - Contract.Requires(cce.NonNullElements(explicitTypeParams)); - Contract.Requires(cce.NonNullElements(originalInTypes)); + Contract.Requires(Cce.NonNullElements(explicitTypeParams)); + Contract.Requires(Cce.NonNullElements(originalInTypes)); Contract.Requires(originalResultType != null); Contract.Requires(originalInTypes.Count + explicitTypeParams.Count == fun.InParams.Count); Contract.Ensures(Contract.Result() != null); @@ -574,7 +574,7 @@ private VCExpr GenFunctionAxiom(UntypedFunction fun, Function originalFun) List typeVarBindings = GenTypeParamBindings(implicitTypeParams, typedInputVars, bindings, true); - Contract.Assert(cce.NonNullElements(typeVarBindings)); + Contract.Assert(Cce.NonNullElements(typeVarBindings)); List boundVarExprs = HelperFuns.ToVCExprList(boundVars); VCExpr /*!*/ @@ -597,7 +597,7 @@ private VCExpr GenFunctionAxiom(UntypedFunction fun, Function originalFun) if (boundVars.Count > 0) { List triggers = HelperFuns.ToList(Gen.Trigger(true, HelperFuns.ToList(funApp))); - Contract.Assert(cce.NonNullElements(triggers)); + Contract.Assert(Cce.NonNullElements(triggers)); return Gen.Forall(boundVars, triggers, "funType:" + fun.Name, 1, conclusionWithPremisses); } else @@ -622,7 +622,7 @@ public VCExpr GenVarTypeAxiom(VCExprVar var, Type originalType, { Contract.Requires(var != null); Contract.Requires(originalType != null); - Contract.Requires(cce.NonNullDictionaryAndValues(varMapping)); + Contract.Requires(Cce.NonNullDictionaryAndValues(varMapping)); Contract.Ensures(Contract.Result() != null); if (!var.Type.Equals(originalType)) @@ -699,7 +699,7 @@ internal MapTypeAbstractionBuilderPremisses(TypeAxiomBuilderPremisses axBuilder, explicitSelectTypeParamsCache.Add(type, res); } - return cce.NonNull(res); + return Cce.NonNull(res); } private IDictionary /*!*/> /*!*/ @@ -709,7 +709,7 @@ internal MapTypeAbstractionBuilderPremisses(TypeAxiomBuilderPremisses axBuilder, [ContractInvariantMethod] void ObjectInvarant() { - Contract.Invariant(cce.NonNullDictionaryAndValues(explicitSelectTypeParamsCache)); + Contract.Invariant(Cce.NonNullDictionaryAndValues(explicitSelectTypeParamsCache)); } @@ -753,8 +753,8 @@ protected void GenTypeAxiomParams(MapType /*!*/ abstractedType, TypeCtorDecl /*! Contract.Requires(abstractedType != null); Contract.Requires(synonymDecl != null); Contract.Ensures(Contract.ValueAtReturn(out mapTypeSynonym) != null); - Contract.Ensures(cce.NonNullElements(Contract.ValueAtReturn(out typeParams))); - Contract.Ensures(cce.NonNullElements(Contract.ValueAtReturn(out originalIndexTypes))); + Contract.Ensures(Cce.NonNullElements(Contract.ValueAtReturn(out typeParams))); + Contract.Ensures(Cce.NonNullElements(Contract.ValueAtReturn(out originalIndexTypes))); typeParams = new List(); typeParams.AddRange(abstractedType.TypeParameters); typeParams.AddRange(abstractedType.FreeVariables); @@ -781,13 +781,13 @@ protected void GenTypeAxiomParams(MapType /*!*/ abstractedType, TypeCtorDecl /*! string /*!*/ name, out List /*!*/ implicitTypeParams, out List /*!*/ explicitTypeParams) { - Contract.Requires(cce.NonNullElements(originalTypeParams)); - Contract.Requires(cce.NonNullElements(originalInTypes)); + Contract.Requires(Cce.NonNullElements(originalTypeParams)); + Contract.Requires(Cce.NonNullElements(originalInTypes)); Contract.Requires(originalResult != null); Contract.Requires(name != null); Contract.Ensures(Contract.Result() != null); - Contract.Ensures(cce.NonNullElements(Contract.ValueAtReturn(out implicitTypeParams))); - Contract.Ensures(cce.NonNullElements(Contract.ValueAtReturn(out explicitTypeParams))); + Contract.Ensures(Cce.NonNullElements(Contract.ValueAtReturn(out implicitTypeParams))); + Contract.Ensures(Cce.NonNullElements(Contract.ValueAtReturn(out explicitTypeParams))); // select and store are basically handled like normal functions: the type // parameters are split into the implicit parameters, and into the parameters @@ -842,9 +842,9 @@ protected void GenTypeAxiomParams(MapType /*!*/ abstractedType, TypeCtorDecl /*! List /*!*/ indexes) { Contract.Requires(select != null); - Contract.Requires(cce.NonNullElements(typeParams)); + Contract.Requires(Cce.NonNullElements(typeParams)); Contract.Requires(map != null); - Contract.Requires(cce.NonNullElements(indexes)); + Contract.Requires(Cce.NonNullElements(indexes)); Contract.Ensures(Contract.Result() != null); List /*!*/ @@ -860,7 +860,7 @@ private VCExpr Store(Function store, VCExpr map, List /*!*/ ind Contract.Requires(val != null); Contract.Requires(map != null); Contract.Requires(store != null); - Contract.Requires(cce.NonNullElements(indexes)); + Contract.Requires(Cce.NonNullElements(indexes)); Contract.Ensures(Contract.Result() != null); List /*!*/ storeArgs = new List(indexes.Count + 2); @@ -884,9 +884,9 @@ private VCExpr GenMapAxiom0(Function select, Function store, Type mapResult, Contract.Requires(mapResult != null); Contract.Requires(store != null); Contract.Requires(select != null); - Contract.Requires(cce.NonNullElements(implicitTypeParamsSelect)); - Contract.Requires(cce.NonNullElements(originalInTypes)); - Contract.Requires(cce.NonNullElements(explicitTypeParamsSelect)); + Contract.Requires(Cce.NonNullElements(implicitTypeParamsSelect)); + Contract.Requires(Cce.NonNullElements(originalInTypes)); + Contract.Requires(Cce.NonNullElements(explicitTypeParamsSelect)); Contract.Ensures(Contract.Result() != null); int arity = store.InParams.Count - 2; List inParams = new List(); @@ -906,14 +906,14 @@ private VCExpr GenMapAxiom0(Function select, Function store, Type mapResult, for (int i = 1; i < store.InParams.Count - 1; i++) { origIndexTypes.Add(originalInTypes[i]); - indexTypes.Add(cce.NonNull(store.InParams[i]).TypedIdent.Type); + indexTypes.Add(Cce.NonNull(store.InParams[i]).TypedIdent.Type); } Contract.Assert(arity == indexTypes.Count); List typedArgs = HelperFuns.VarVector("arg", origIndexTypes, Gen); - Contract.Assert(cce.NonNullElements(typedArgs)); + Contract.Assert(Cce.NonNullElements(typedArgs)); List indexes = HelperFuns.VarVector("x", indexTypes, Gen); - Contract.Assert(cce.NonNullElements(indexes)); + Contract.Assert(Cce.NonNullElements(indexes)); Contract.Assert(typedArgs.Count == indexes.Count); inParams.AddRange(typedArgs); quantifiedVars.AddRange(indexes); @@ -924,7 +924,7 @@ private VCExpr GenMapAxiom0(Function select, Function store, Type mapResult, // bound variable: val VCExprVar typedVal = Gen.Variable("val", mapResult); - VCExprVar val = Gen.Variable("val", cce.NonNull(select.OutParams[0]).TypedIdent.Type); + VCExprVar val = Gen.Variable("val", Cce.NonNull(select.OutParams[0]).TypedIdent.Type); quantifiedVars.Add(val); bindings.VCExprVarBindings.Add(typedVal, val); @@ -957,12 +957,12 @@ private VCExpr GenMapAxiom0(Function select, Function store, Type mapResult, // in inParams here. List letBindings_Implicit = AxBuilderPremisses.GenTypeParamBindings(implicitTypeParamsSelect, inParams, bindings, false); - Contract.Assert(cce.NonNullElements(letBindings_Implicit)); + Contract.Assert(Cce.NonNullElements(letBindings_Implicit)); // The explicit ones, by definition, can only be phrased in terms of the result, so we pass // in List(typedVal) here. List letBindings_Explicit = AxBuilderPremisses.GenTypeParamBindings(explicitTypeParamsSelect, HelperFuns.ToList(typedVal), bindings, false); - Contract.Assert(cce.NonNullElements(letBindings_Explicit)); + Contract.Assert(Cce.NonNullElements(letBindings_Explicit)); // generate: select(store(m, indices, val)) == val VCExpr /*!*/ @@ -975,7 +975,7 @@ private VCExpr GenMapAxiom0(Function select, Function store, Type mapResult, AxBuilderPremisses.Type2Term(mapResult, bindings.TypeVariableBindings)); Contract.Assert(ante != null); VCExpr body; - if (!AxBuilder.U.Equals(cce.NonNull(select.OutParams[0]).TypedIdent.Type)) + if (!AxBuilder.U.Equals(Cce.NonNull(select.OutParams[0]).TypedIdent.Type)) { body = Gen.Let(letBindings_Explicit, eq); } @@ -993,29 +993,29 @@ private VCExpr GenMapAxiom1(Function select, Function store, Type mapResult, Contract.Requires(mapResult != null); Contract.Requires(store != null); Contract.Requires(select != null); - Contract.Requires(cce.NonNullElements(explicitSelectParams)); + Contract.Requires(Cce.NonNullElements(explicitSelectParams)); Contract.Ensures(Contract.Result() != null); int arity = store.InParams.Count - 2; List indexTypes = new List(); for (int i = 1; i < store.InParams.Count - 1; i++) { - indexTypes.Add(cce.NonNull(store.InParams[i]).TypedIdent.Type); + indexTypes.Add(Cce.NonNull(store.InParams[i]).TypedIdent.Type); } Contract.Assert(indexTypes.Count == arity); List /*!*/ indexes0 = HelperFuns.VarVector("x", indexTypes, Gen); - Contract.Assert(cce.NonNullElements(indexes0)); + Contract.Assert(Cce.NonNullElements(indexes0)); List /*!*/ indexes1 = HelperFuns.VarVector("y", indexTypes, Gen); - Contract.Assert(cce.NonNullElements(indexes1)); + Contract.Assert(Cce.NonNullElements(indexes1)); VCExprVar /*!*/ m = Gen.Variable("m", AxBuilder.U); Contract.Assert(m != null); VCExprVar /*!*/ - val = Gen.Variable("val", cce.NonNull(select.OutParams[0]).TypedIdent.Type); + val = Gen.Variable("val", Cce.NonNull(select.OutParams[0]).TypedIdent.Type); Contract.Assert(val != null); // extract the explicit type parameters from the actual result type ... @@ -1031,7 +1031,7 @@ private VCExpr GenMapAxiom1(Function select, Function store, Type mapResult, AxBuilderPremisses.GenTypeParamBindings(explicitSelectParams, HelperFuns.ToList(typedVal), bindings, true); - Contract.Assert(cce.NonNullElements(letBindings)); + Contract.Assert(Cce.NonNullElements(letBindings)); // ... and quantify the introduced term variables for type // parameters universally @@ -1073,7 +1073,7 @@ private VCExpr GenMapAxiom1(Function select, Function store, Type mapResult, List /*!*/ triggers = new List(); - Contract.Assert(cce.NonNullElements(triggers)); + Contract.Assert(Cce.NonNullElements(triggers)); VCExpr /*!*/ axiom = VCExpressionGenerator.True; diff --git a/Source/VCExpr/TypeErasure/VariableBindings.cs b/Source/VCExpr/TypeErasure/VariableBindings.cs index 7085846c0..ee241c77c 100644 --- a/Source/VCExpr/TypeErasure/VariableBindings.cs +++ b/Source/VCExpr/TypeErasure/VariableBindings.cs @@ -15,16 +15,16 @@ public class VariableBindings [ContractInvariantMethod] void ObjectInvariant() { - Contract.Invariant(cce.NonNullDictionaryAndValues(VCExprVarBindings)); - Contract.Invariant(cce.NonNullDictionaryAndValues(TypeVariableBindings)); + Contract.Invariant(Cce.NonNullDictionaryAndValues(VCExprVarBindings)); + Contract.Invariant(Cce.NonNullDictionaryAndValues(TypeVariableBindings)); } public VariableBindings(IDictionary /*!*/ vcExprVarBindings, IDictionary /*!*/ typeVariableBindings) { - Contract.Requires(cce.NonNullDictionaryAndValues(vcExprVarBindings)); - Contract.Requires(cce.NonNullDictionaryAndValues(typeVariableBindings)); + Contract.Requires(Cce.NonNullDictionaryAndValues(vcExprVarBindings)); + Contract.Requires(Cce.NonNullDictionaryAndValues(typeVariableBindings)); this.VCExprVarBindings = vcExprVarBindings; this.TypeVariableBindings = typeVariableBindings; } @@ -43,7 +43,7 @@ public VariableBindings Clone() new Dictionary(); foreach (KeyValuePair pair in VCExprVarBindings) { - Contract.Assert(cce.NonNullElements(pair)); + Contract.Assert(Cce.NonNullElements(pair)); newVCExprVarBindings.Add(pair); } @@ -52,7 +52,7 @@ public VariableBindings Clone() new Dictionary(); foreach (KeyValuePair pair in TypeVariableBindings) { - Contract.Assert(cce.NonNullElements(pair)); + Contract.Assert(Cce.NonNullElements(pair)); newTypeVariableBindings.Add(pair); } diff --git a/Source/VCExpr/TypeErasure/VariableCastCollector.cs b/Source/VCExpr/TypeErasure/VariableCastCollector.cs index 860a509f6..95704f733 100644 --- a/Source/VCExpr/TypeErasure/VariableCastCollector.cs +++ b/Source/VCExpr/TypeErasure/VariableCastCollector.cs @@ -23,7 +23,7 @@ internal class VariableCastCollector : TraversingVCExprVisitor Contract.Requires((axBuilder != null)); Contract.Requires((newNode != null)); Contract.Requires((oldNode != null)); - Contract.Ensures(cce.NonNullElements(Contract.Result>())); + Contract.Ensures(Cce.NonNullElements(Contract.Result>())); VariableCastCollector /*!*/ collector = new VariableCastCollector(axBuilder); Contract.Assert(collector != null); @@ -79,7 +79,7 @@ readonly List /*!*/ [ContractInvariantMethod] void ObjectInvariant() { - Contract.Invariant(cce.NonNullElements(varsInCasts)); + Contract.Invariant(Cce.NonNullElements(varsInCasts)); Contract.Invariant(varsOutsideCasts != null && Contract.ForAll(varsOutsideCasts, voc => voc.Key != null)); Contract.Invariant(AxBuilder != null); } diff --git a/Source/VCExpr/VCExprAST.cs b/Source/VCExpr/VCExprAST.cs index a8f68dcbe..8249e0d9e 100644 --- a/Source/VCExpr/VCExprAST.cs +++ b/Source/VCExpr/VCExprAST.cs @@ -25,7 +25,7 @@ public static bool SameElements(IEnumerable a, IEnumerable b) { if (ib.MoveNext()) { - if (!cce.NonNull(ia.Current).Equals(ib.Current)) + if (!Cce.NonNull(ia.Current).Equals(ib.Current)) { return false; } @@ -48,7 +48,7 @@ public static int PolyHash(int init, int factor, IEnumerable a) int res = init; foreach (object x in a) { - res = res * factor + (cce.NonNull(x)).GetHashCode(); + res = res * factor + (Cce.NonNull(x)).GetHashCode(); } return res; @@ -77,7 +77,7 @@ public static List ToTypeSeq(VCExpr[] exprs, int startIndex) res = new List(); for (int i = startIndex; i < exprs.Length; ++i) { - res.Add(cce.NonNull(exprs[i]).Type); + res.Add(Cce.NonNull(exprs[i]).Type); } return res; @@ -90,7 +90,7 @@ public static List ToTypeSeq(VCExpr[] exprs, int startIndex) res = new List(args.Length); foreach (T t in args) { - res.Add(cce.NonNull(t)); + res.Add(Cce.NonNull(t)); } return res; @@ -143,7 +143,7 @@ public override string ToString() StringWriter sw = new StringWriter(); VCExprPrinter printer = new VCExprPrinter(PrintOptions.Default); printer.Print(this, sw); - return cce.NonNull(sw.ToString()); + return Cce.NonNull(sw.ToString()); } } @@ -396,8 +396,8 @@ public IEnumerable Arguments void ObjectInvariant() { Contract.Invariant(Op != null); - Contract.Invariant(cce.NonNullElements(EMPTY_TYPE_LIST)); - Contract.Invariant(cce.NonNullElements(EMPTY_VCEXPR_LIST)); + Contract.Invariant(Cce.NonNullElements(EMPTY_TYPE_LIST)); + Contract.Invariant(Cce.NonNullElements(EMPTY_VCEXPR_LIST)); } public int Arity @@ -469,7 +469,7 @@ public override bool Equals(object that) } else { - if (!cce.NonNull(enum0.Current).Equals(enum1.Current)) + if (!Cce.NonNull(enum0.Current).Equals(enum1.Current)) { return false; } @@ -555,7 +555,7 @@ public override VCExpr this[int index] Contract.Ensures(Contract.Result() != null); Contract.Assert(false); - throw new cce.UnreachableException(); // no arguments + throw new Cce.UnreachableException(); // no arguments } } @@ -564,7 +564,7 @@ public override List /*!*/ TypeArguments { get { - Contract.Ensures(cce.NonNullElements(Contract.Result>())); + Contract.Ensures(Cce.NonNullElements(Contract.Result>())); return EMPTY_TYPE_LIST; } } @@ -618,7 +618,7 @@ public override List /*!*/ TypeArguments { get { - Contract.Ensures(cce.NonNullElements(Contract.Result>())); + Contract.Ensures(Cce.NonNullElements(Contract.Result>())); return EMPTY_TYPE_LIST; } } @@ -627,7 +627,7 @@ internal VCExprUnary(VCExprOp op, List arguments) : base(op) { Contract.Requires(op != null); - Contract.Requires(cce.NonNullElements(arguments)); + Contract.Requires(Cce.NonNullElements(arguments)); Contract.Requires(op.Arity == 1 && op.TypeParamArity == 0 && arguments.Count == 1); this.Argument = arguments[0]; @@ -688,7 +688,7 @@ public override VCExpr this[int index] default: { Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } } } @@ -699,7 +699,7 @@ public override List /*!*/ TypeArguments { get { - Contract.Ensures(cce.NonNullElements(Contract.Result>())); + Contract.Ensures(Cce.NonNullElements(Contract.Result>())); return EMPTY_TYPE_LIST; } } @@ -708,7 +708,7 @@ internal VCExprBinary(VCExprOp op, List arguments) : base(op) { Contract.Requires(op != null); - Contract.Requires(cce.NonNullElements(arguments)); + Contract.Requires(Cce.NonNullElements(arguments)); Contract.Requires(op.Arity == 2 && op.TypeParamArity == 0 && arguments.Count == 2); this.Argument0 = arguments[0]; @@ -743,8 +743,8 @@ private readonly List /*!*/ [ContractInvariantMethod] void ObjectInvariant() { - Contract.Invariant(cce.NonNullElements(arguments)); - Contract.Invariant(cce.NonNullElements(TypeArgumentsAttr)); + Contract.Invariant(Cce.NonNullElements(arguments)); + Contract.Invariant(Cce.NonNullElements(TypeArgumentsAttr)); Contract.Invariant(ExprType != null); } @@ -768,7 +768,7 @@ public override VCExpr /*!*/ this[int index] Contract.Ensures(Contract.Result() != null); Contract.Assume(index >= 0 && index < Arity); - return cce.NonNull(arguments)[index]; + return Cce.NonNull(arguments)[index]; } } @@ -777,7 +777,7 @@ public override List /*!*/ TypeArguments { get { - Contract.Ensures(cce.NonNullElements(Contract.Result>())); + Contract.Ensures(Cce.NonNullElements(Contract.Result>())); return TypeArgumentsAttr; } } @@ -786,7 +786,7 @@ internal VCExprMultiAry(VCExprOp op, List arguments) : base(op) { Contract.Requires(op != null); - Contract.Requires(cce.NonNullElements(arguments)); + Contract.Requires(Cce.NonNullElements(arguments)); this.arguments = arguments; this.TypeArgumentsAttr = EMPTY_TYPE_LIST; this.ExprType = op.InferType(arguments, TypeArgumentsAttr); @@ -796,8 +796,8 @@ internal VCExprMultiAry(VCExprOp op, List arguments, List /* : base(op) { Contract.Requires(op != null); - Contract.Requires(cce.NonNullElements(typeArguments)); - Contract.Requires(cce.NonNullElements(arguments)); + Contract.Requires(Cce.NonNullElements(typeArguments)); + Contract.Requires(Cce.NonNullElements(arguments)); Contract.Requires(arguments.Count > 2 || typeArguments.Count > 0); Contract.Requires(op.Arity == arguments.Count); Contract.Requires(op.TypeParamArity == typeArguments.Count); @@ -874,13 +874,13 @@ public virtual Result Accept(VCExprNAry expr, IVCExprOpVisitor args, List typeArgs) { - Contract.Requires(cce.NonNullElements(args)); - Contract.Requires(cce.NonNullElements(typeArgs)); + Contract.Requires(Cce.NonNullElements(args)); + Contract.Requires(Cce.NonNullElements(typeArgs)); Contract.Ensures(Contract.Result() != null); throw new NotImplementedException(); @@ -1412,7 +1412,7 @@ public override Type InferType(List args, List /*!*/ typeArg return Type.Bool; default: Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } } @@ -1478,7 +1478,7 @@ public override Result Accept( return visitor.VisitNeqOp(expr, arg); default: Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } } } @@ -1712,7 +1712,7 @@ public override Type InferType(List args, List /*!*/ typeArg Contract.Assert(TypeParamArity == Func.TypeParameters.Count); if (TypeParamArity == 0) { - return cce.NonNull(Func.OutParams[0]).TypedIdent.Type; + return Cce.NonNull(Func.OutParams[0]).TypedIdent.Type; } IDictionary /*!*/ @@ -1722,7 +1722,7 @@ public override Type InferType(List args, List /*!*/ typeArg subst.Add(Func.TypeParameters[i], typeArgs[i]); } - return cce.NonNull(Func.OutParams[0]).TypedIdent.Type.Substitute(subst); + return Cce.NonNull(Func.OutParams[0]).TypedIdent.Type.Substitute(subst); } [Pure] @@ -1826,7 +1826,7 @@ private string KindPrefix(VCExprVarKind kind) VCExprVarKind.Soft => "soft$$", VCExprVarKind.Try => "try$$", VCExprVarKind.Normal => "", - _ => throw new cce.UnreachableException() + _ => throw new Cce.UnreachableException() }; } @@ -1866,8 +1866,8 @@ public readonly List /*!*/ void ObjectInvariant() { Contract.Invariant(Body != null); - Contract.Invariant(cce.NonNullElements(TypeParameters)); - Contract.Invariant(cce.NonNullElements(BoundVars)); + Contract.Invariant(Cce.NonNullElements(TypeParameters)); + Contract.Invariant(Cce.NonNullElements(BoundVars)); } @@ -1884,8 +1884,8 @@ public override Type /*!*/ Type internal VCExprBinder(List /*!*/ typeParams, List /*!*/ boundVars, VCExpr body) { Contract.Requires(body != null); - Contract.Requires(cce.NonNullElements(boundVars)); - Contract.Requires(cce.NonNullElements(typeParams)); + Contract.Requires(Cce.NonNullElements(boundVars)); + Contract.Requires(Cce.NonNullElements(typeParams)); Contract.Requires(boundVars.Count + typeParams.Count > 0); // only nontrivial binders ... this.TypeParameters = typeParams; this.BoundVars = boundVars; @@ -1936,7 +1936,7 @@ public override int GetHashCode() public VCTrigger(bool pos, List exprs) { - Contract.Requires(cce.NonNullElements(exprs)); + Contract.Requires(Cce.NonNullElements(exprs)); this.Pos = pos; this.Exprs = exprs; } @@ -2002,7 +2002,7 @@ public class VCExprQuantifier : VCExprBinder void ObjectInvariant() { Contract.Invariant(Info != null); - Contract.Invariant(cce.NonNullElements(Triggers)); + Contract.Invariant(Cce.NonNullElements(Triggers)); } public readonly List /*!*/ @@ -2049,9 +2049,9 @@ internal VCExprQuantifier(Quantifier kind, List /*!*/ typePa { Contract.Requires(body != null); Contract.Requires(info != null); - Contract.Requires(cce.NonNullElements(triggers)); - Contract.Requires(cce.NonNullElements(boundVars)); - Contract.Requires(cce.NonNullElements(typeParams)); + Contract.Requires(Cce.NonNullElements(triggers)); + Contract.Requires(Cce.NonNullElements(boundVars)); + Contract.Requires(Cce.NonNullElements(typeParams)); this.Quan = kind; this.Triggers = triggers; @@ -2124,7 +2124,7 @@ private readonly List /*!*/ [ContractInvariantMethod] void ObjectInvariant() { - Contract.Invariant(cce.NonNullElements(Bindings)); + Contract.Invariant(Cce.NonNullElements(Bindings)); } @@ -2173,7 +2173,7 @@ public override int GetHashCode() [Escapes(true, false)] public IEnumerator /*!*/ GetEnumerator() { - Contract.Ensures(cce.NonNullElements(Contract.Result>())); + Contract.Ensures(Cce.NonNullElements(Contract.Result>())); return Bindings.GetEnumerator(); } @@ -2188,8 +2188,8 @@ IEnumerator System.Collections.IEnumerable.GetEnumerator() private static List /*!*/ toSeq(List /*!*/ bindings) { - Contract.Requires(cce.NonNullElements(bindings)); - Contract.Ensures(cce.NonNullElements(Contract.Result>())); + Contract.Requires(Cce.NonNullElements(bindings)); + Contract.Ensures(Cce.NonNullElements(Contract.Result>())); List res = new List(); foreach (VCExprLetBinding /*!*/ b in bindings) { @@ -2202,7 +2202,7 @@ IEnumerator System.Collections.IEnumerable.GetEnumerator() internal VCExprLet(List /*!*/ bindings, VCExpr /*!*/ body) : base(new List(), toSeq(bindings), body) { - Contract.Requires(cce.NonNullElements(bindings)); + Contract.Requires(Cce.NonNullElements(bindings)); Contract.Requires(body != null); this.Bindings = bindings; } diff --git a/Source/VCExpr/VCExprASTPrinter.cs b/Source/VCExpr/VCExprASTPrinter.cs index 1bf7ba56c..1300f38ea 100644 --- a/Source/VCExpr/VCExprASTPrinter.cs +++ b/Source/VCExpr/VCExprASTPrinter.cs @@ -62,7 +62,7 @@ public bool Visit(VCExprLiteral node, TextWriter wr) else { Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } return true; @@ -92,7 +92,7 @@ public bool Visit(VCExprNAry node, TextWriter wr) if (naryExpr == null || !naryExpr.Op.Equals(op)) { wr.Write(" "); - Print(cce.NonNull((VCExpr /*!*/) enumerator.Current), wr); + Print(Cce.NonNull((VCExpr /*!*/) enumerator.Current), wr); } } @@ -270,7 +270,7 @@ public bool VisitAndOp(VCExprNAry node, TextWriter wr) //Contract.Requires(wr != null); //Contract.Requires(node != null); Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } public bool VisitOrOp(VCExprNAry node, TextWriter wr) @@ -278,7 +278,7 @@ public bool VisitOrOp(VCExprNAry node, TextWriter wr) //Contract.Requires(wr != null); //Contract.Requires(node != null); Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } public bool VisitImpliesOp(VCExprNAry node, TextWriter wr) diff --git a/Source/VCExpr/VCExprASTVisitors.cs b/Source/VCExpr/VCExprASTVisitors.cs index eece56645..47ad03bfc 100644 --- a/Source/VCExpr/VCExprASTVisitors.cs +++ b/Source/VCExpr/VCExprASTVisitors.cs @@ -416,7 +416,7 @@ public virtual Result Visit(VCExprNAry node, Arg arg) IEnumerator enumerator = new VCExprNAryMultiUniformOpEnumerator(node, ops); while (enumerator.MoveNext()) { - VCExpr expr = cce.NonNull((VCExpr) enumerator.Current); + VCExpr expr = Cce.NonNull((VCExpr) enumerator.Current); VCExprNAry naryExpr = expr as VCExprNAry; if (naryExpr == null || !ops.Contains(naryExpr.Op)) { @@ -508,7 +508,7 @@ private readonly Stack /*!*/ void ObjectInvariant() { Contract.Invariant(CompleteExpr != null); - Contract.Invariant(cce.NonNullElements(ExprTodo)); + Contract.Invariant(Cce.NonNullElements(ExprTodo)); } public VCExprNAryEnumerator(VCExprNAry completeExpr) @@ -554,7 +554,7 @@ public bool MoveNext() public object Current { - get { return cce.NonNull(CurrentExpr); } + get { return Cce.NonNull(CurrentExpr); } } public void Reset() @@ -752,7 +752,7 @@ public class FreeVariableCollector : BoundVarTraversingVCExprVisitor void ObjectInvariant() { Contract.Invariant(FreeTermVars != null && Contract.ForAll(FreeTermVars, entry => entry != null)); - Contract.Invariant(cce.NonNullElements(FreeTypeVars)); + Contract.Invariant(Cce.NonNullElements(FreeTypeVars)); } @@ -776,7 +776,7 @@ public static HashSet FreeTermVariables(VCExpr node) public static List FreeTypeVariables(VCExpr node) { Contract.Requires(node != null); - Contract.Ensures(cce.NonNullElements(Contract.Result>())); + Contract.Ensures(Cce.NonNullElements(Contract.Result>())); FreeVariableCollector collector = new FreeVariableCollector(); collector.Traverse(node, true); return collector.FreeTypeVars; @@ -804,7 +804,7 @@ public void Collect(Type type) private void CollectTypeVariables(IEnumerable /*!*/ boundVars) { - Contract.Requires(cce.NonNullElements(boundVars)); + Contract.Requires(Cce.NonNullElements(boundVars)); foreach (VCExprVar /*!*/ var in boundVars) { Contract.Assert(var != null); @@ -814,7 +814,7 @@ private void CollectTypeVariables(IEnumerable /*!*/ boundVars) private void AddTypeVariables(IEnumerable /*!*/ typeVars) { - Contract.Requires(cce.NonNullElements(typeVars)); + Contract.Requires(Cce.NonNullElements(typeVars)); foreach (TypeVariable /*!*/ tvar in typeVars) { Contract.Assert(tvar != null); @@ -885,7 +885,7 @@ public class VCExprSubstitution [ContractInvariantMethod] void TermSubstsInvariantMethod() { - Contract.Invariant(TermSubsts != null && Contract.ForAll(TermSubsts, i => cce.NonNullDictionaryAndValues(i))); + Contract.Invariant(TermSubsts != null && Contract.ForAll(TermSubsts, i => Cce.NonNullDictionaryAndValues(i))); } private readonly List /*!*/> /*!*/ @@ -894,14 +894,14 @@ void TermSubstsInvariantMethod() [ContractInvariantMethod] void TypeSubstsInvariantMethod() { - Contract.Invariant(TermSubsts != null && Contract.ForAll(TypeSubsts, i => cce.NonNullDictionaryAndValues(i))); + Contract.Invariant(TermSubsts != null && Contract.ForAll(TypeSubsts, i => Cce.NonNullDictionaryAndValues(i))); } public VCExprSubstitution(IDictionary /*!*/ termSubst, IDictionary /*!*/ typeSubst) { - Contract.Requires(cce.NonNullDictionaryAndValues(termSubst)); - Contract.Requires(cce.NonNullDictionaryAndValues(typeSubst)); + Contract.Requires(Cce.NonNullDictionaryAndValues(termSubst)); + Contract.Requires(Cce.NonNullDictionaryAndValues(typeSubst)); List /*!*/> /*!*/ termSubsts = new List /*!*/>(); @@ -946,7 +946,7 @@ public VCExpr this[VCExprVar /*!*/ var] return null; } - set { TermSubsts[TermSubsts.Count - 1][var] = cce.NonNull(value); } + set { TermSubsts[TermSubsts.Count - 1][var] = Cce.NonNull(value); } } public Type this[TypeVariable /*!*/ var] @@ -964,7 +964,7 @@ public Type this[TypeVariable /*!*/ var] return null; } - set { TypeSubsts[TypeSubsts.Count - 1][var] = cce.NonNull(value); } + set { TypeSubsts[TypeSubsts.Count - 1][var] = Cce.NonNull(value); } } public bool ContainsKey(VCExprVar var) @@ -993,14 +993,14 @@ public bool TypeSubstIsEmpty { get { - Contract.Ensures(cce.NonNullDictionaryAndValues(Contract.Result>())); + Contract.Ensures(Cce.NonNullDictionaryAndValues(Contract.Result>())); IDictionary /*!*/ res = new Dictionary(); foreach (IDictionary /*!*/ dict in TypeSubsts) { foreach (KeyValuePair pair in dict) { - Contract.Assert(cce.NonNullElements(pair)); + Contract.Assert(Cce.NonNullElements(pair)); // later ones overwrite earlier ones res[pair.Key] = pair.Value; } @@ -1015,7 +1015,7 @@ public IEnumerable /*!*/ TermDomain { get { - Contract.Ensures(cce.NonNullElements(Contract.Result>())); + Contract.Ensures(Cce.NonNullElements(Contract.Result>())); HashSet /*!*/ domain = new HashSet(); foreach (IDictionary /*!*/ dict in TermSubsts) @@ -1040,7 +1040,7 @@ public IEnumerable /*!*/ TypeDomain { get { - Contract.Ensures(cce.NonNullElements(Contract.Result>())); + Contract.Ensures(Cce.NonNullElements(Contract.Result>())); HashSet /*!*/ domain = new HashSet(); foreach (IDictionary /*!*/ dict in TypeSubsts) @@ -1070,12 +1070,12 @@ public FreeVariableCollector /*!*/ Codomains coll = new FreeVariableCollector(); foreach (VCExprVar /*!*/ var in TermDomain) { - coll.Collect(cce.NonNull(this)[var]); + coll.Collect(Cce.NonNull(this)[var]); } foreach (TypeVariable /*!*/ var in TypeDomain) { - coll.Collect(cce.NonNull(this)[var]); + coll.Collect(Cce.NonNull(this)[var]); } return coll; @@ -1118,8 +1118,8 @@ public SubstitutingVCExprVisitor(VCExpressionGenerator gen) private bool CollisionPossible(IEnumerable /*!*/ typeParams, IEnumerable /*!*/ boundVars, VCExprSubstitution /*!*/ substitution) { - Contract.Requires(cce.NonNullElements(typeParams)); - Contract.Requires(cce.NonNullElements(boundVars)); + Contract.Requires(Cce.NonNullElements(typeParams)); + Contract.Requires(Cce.NonNullElements(boundVars)); Contract.Requires(substitution != null); // variables can be shadowed by a binder if (typeParams.Any(var => substitution.ContainsKey(var)) || @@ -1201,7 +1201,7 @@ protected virtual string ChooseNewVariableName(string oldName) { List /*!*/ typeParams = node.TypeParameters; - Contract.Assert(cce.NonNullElements(typeParams)); + Contract.Assert(Cce.NonNullElements(typeParams)); bool refreshAllVariables = refreshBoundVariables || CollisionPossible(node.TypeParameters, node.BoundVars, substitution); if (refreshAllVariables) @@ -1223,7 +1223,7 @@ protected virtual string ChooseNewVariableName(string oldName) List /*!*/ boundVars = node.BoundVars; - Contract.Assert(cce.NonNullElements(boundVars)); + Contract.Assert(Cce.NonNullElements(boundVars)); if (refreshAllVariables || !substitution.TypeSubstIsEmpty) { // collisions are possible, or we also substitute type variables. in this case @@ -1232,7 +1232,7 @@ protected virtual string ChooseNewVariableName(string oldName) boundVars = new List(); IDictionary /*!*/ typeSubst = substitution.ToTypeSubst; - Contract.Assert(cce.NonNullDictionaryAndValues(typeSubst)); + Contract.Assert(Cce.NonNullDictionaryAndValues(typeSubst)); foreach (VCExprVar /*!*/ var in node.BoundVars) { Contract.Assert(var != null); @@ -1308,7 +1308,7 @@ public VCExpr Visit(VCExprLet node, VCExprSubstitution substitution, bool refres List /*!*/ newBoundVars = node.BoundVars; - Contract.Assert(cce.NonNullElements(newBoundVars)); + Contract.Assert(Cce.NonNullElements(newBoundVars)); if (refreshAllVariables) { // collisions are possible, or we also substitute type variables. in this case @@ -1317,7 +1317,7 @@ public VCExpr Visit(VCExprLet node, VCExprSubstitution substitution, bool refres newBoundVars = new List(); IDictionary /*!*/ typeSubst = substitution.ToTypeSubst; - Contract.Assert(cce.NonNullDictionaryAndValues(typeSubst)); + Contract.Assert(Cce.NonNullDictionaryAndValues(typeSubst)); foreach (VCExprVar /*!*/ var in node.BoundVars) { Contract.Assert(var != null); diff --git a/Source/VCExpr/VCExpressionGenerator.cs b/Source/VCExpr/VCExpressionGenerator.cs index 6cc61ce05..edd70c67d 100644 --- a/Source/VCExpr/VCExpressionGenerator.cs +++ b/Source/VCExpr/VCExpressionGenerator.cs @@ -81,8 +81,8 @@ public VCExpr ControlFlowFunctionApplication(VCExpr e1, VCExpr e2) List /*!*/ typeArguments) { Contract.Requires(op != null); - Contract.Requires(cce.NonNullElements(arguments)); - Contract.Requires(cce.NonNullElements(typeArguments)); + Contract.Requires(Cce.NonNullElements(arguments)); + Contract.Requires(Cce.NonNullElements(typeArguments)); if (typeArguments.Count > 0) { return new VCExprMultiAry(op, arguments, typeArguments); @@ -104,7 +104,7 @@ public VCExpr ControlFlowFunctionApplication(VCExpr e1, VCExpr e2) public VCExpr /*!*/ Function(VCExprOp /*!*/ op, List /*!*/ arguments) { Contract.Requires(op != null); - Contract.Requires(cce.NonNullElements(arguments)); + Contract.Requires(Cce.NonNullElements(arguments)); Contract.Ensures(Contract.Result() != null); return Function(op, arguments, VCExprNAry.EMPTY_TYPE_LIST); @@ -113,7 +113,7 @@ public VCExpr ControlFlowFunctionApplication(VCExpr e1, VCExpr e2) public VCExpr /*!*/ Function(VCExprOp /*!*/ op, params VCExpr[] /*!*/ arguments) { Contract.Requires(op != null); - Contract.Requires(cce.NonNullElements(arguments)); + Contract.Requires(Cce.NonNullElements(arguments)); return Function(op, HelperFuns.ToNonNullList(arguments), @@ -123,8 +123,8 @@ public VCExpr ControlFlowFunctionApplication(VCExpr e1, VCExpr e2) public VCExpr /*!*/ Function(VCExprOp /*!*/ op, VCExpr[] /*!*/ arguments, Type[] /*!*/ typeArguments) { Contract.Requires(op != null); - Contract.Requires(cce.NonNullElements(arguments)); - Contract.Requires(cce.NonNullElements(typeArguments)); + Contract.Requires(Cce.NonNullElements(arguments)); + Contract.Requires(Cce.NonNullElements(typeArguments)); Contract.Ensures(Contract.Result() != null); @@ -136,7 +136,7 @@ public VCExpr ControlFlowFunctionApplication(VCExpr e1, VCExpr e2) public VCExpr /*!*/ Function(Function /*!*/ op, List /*!*/ arguments) { Contract.Requires(op != null); - Contract.Requires(cce.NonNullElements(arguments)); + Contract.Requires(Cce.NonNullElements(arguments)); Contract.Ensures(Contract.Result() != null); return Function(BoogieFunctionOp(op), arguments, VCExprNAry.EMPTY_TYPE_LIST); @@ -144,7 +144,7 @@ public VCExpr ControlFlowFunctionApplication(VCExpr e1, VCExpr e2) public VCExpr /*!*/ Function(Function /*!*/ op, params VCExpr[] /*!*/ arguments) { - Contract.Requires(cce.NonNullElements(arguments)); + Contract.Requires(Cce.NonNullElements(arguments)); Contract.Requires(op != null); Contract.Ensures(Contract.Result() != null); @@ -157,7 +157,7 @@ public VCExpr ControlFlowFunctionApplication(VCExpr e1, VCExpr e2) public VCExpr /*!*/ NAry(VCExprOp /*!*/ op, List /*!*/ args) { Contract.Requires(op != null); - Contract.Requires(cce.NonNullElements(args)); + Contract.Requires(Cce.NonNullElements(args)); Contract.Ensures(Contract.Result() != null); return NAry(op, args.ToArray()); @@ -166,7 +166,7 @@ public VCExpr ControlFlowFunctionApplication(VCExpr e1, VCExpr e2) public VCExpr /*!*/ NAry(VCExprOp /*!*/ op, params VCExpr[] /*!*/ args) { Contract.Requires(op != null); - Contract.Requires(cce.NonNullElements(args)); + Contract.Requires(Cce.NonNullElements(args)); Contract.Requires(op == AndOp || op == OrOp); Contract.Ensures(Contract.Result() != null); @@ -176,7 +176,7 @@ public VCExpr ControlFlowFunctionApplication(VCExpr e1, VCExpr e2) e = and ? True : False; foreach (VCExpr a in args) { - e = and ? AndSimp(e, cce.NonNull(a)) : OrSimp(e, cce.NonNull(a)); + e = and ? AndSimp(e, Cce.NonNull(a)) : OrSimp(e, Cce.NonNull(a)); } return e; @@ -251,7 +251,7 @@ public VCExprDistinctOp DistinctOp(int arity) Contract.Requires(e1 != null); Contract.Ensures(Contract.Result() != null); - VCExprOp op = cce.NonNull(cce.NonNull(e0).Type).IsInt ? AddIOp : AddROp; + VCExprOp op = Cce.NonNull(Cce.NonNull(e0).Type).IsInt ? AddIOp : AddROp; return Function(op, e0, e1); } @@ -273,7 +273,7 @@ public VCExprDistinctOp DistinctOp(int arity) public VCExpr /*!*/ Distinct(List /*!*/ args) { - Contract.Requires(cce.NonNullElements(args)); + Contract.Requires(Cce.NonNullElements(args)); Contract.Ensures(Contract.Result() != null); if (args.Count <= 1) @@ -582,7 +582,7 @@ public VCExprLetBinding LetBinding(VCExprVar v, VCExpr e) public VCExpr Let(List bindings, VCExpr body) { Contract.Requires(body != null); - Contract.Requires(cce.NonNullElements(bindings)); + Contract.Requires(Cce.NonNullElements(bindings)); Contract.Ensures(Contract.Result() != null); if (bindings.Count == 0) { @@ -596,7 +596,7 @@ public VCExpr Let(List bindings, VCExpr body) public VCExpr Let(VCExpr body, params VCExprLetBinding[] bindings) { Contract.Requires(body != null); - Contract.Requires((cce.NonNullElements(bindings))); + Contract.Requires((Cce.NonNullElements(bindings))); Contract.Ensures(Contract.Result() != null); return Let(HelperFuns.ToNonNullList(bindings), body); } @@ -616,7 +616,7 @@ public VCExpr Let(VCExpr body, params VCExprLetBinding[] bindings) // Turn let-bindings let v = E in ... into implications E ==> v public VCExpr AsImplications(List bindings) { - Contract.Requires(cce.NonNullElements(bindings)); + Contract.Requires(Cce.NonNullElements(bindings)); Contract.Ensures(Contract.Result() != null); VCExpr /*!*/ antecedents = True; @@ -632,7 +632,7 @@ public VCExpr AsImplications(List bindings) // Turn let-bindings let v = E in ... into equations v == E public VCExpr AsEquations(List bindings) { - Contract.Requires(cce.NonNullElements(bindings)); + Contract.Requires(Cce.NonNullElements(bindings)); Contract.Ensures(Contract.Result() != null); VCExpr /*!*/ antecedents = True; @@ -685,9 +685,9 @@ public VCExpr Quantify(Quantifier quan, List /*!*/ typeParam { Contract.Requires(body != null); Contract.Requires(info != null); - Contract.Requires(cce.NonNullElements(triggers)); - Contract.Requires(cce.NonNullElements(vars)); - Contract.Requires(cce.NonNullElements(typeParams)); + Contract.Requires(Cce.NonNullElements(triggers)); + Contract.Requires(Cce.NonNullElements(vars)); + Contract.Requires(Cce.NonNullElements(typeParams)); Contract.Ensures(Contract.Result() != null); return new VCExprQuantifier(quan, typeParams, vars, triggers, info, body); } @@ -697,9 +697,9 @@ public VCExpr Forall(List /*!*/ typeParams, List() != null); return Quantify(Quantifier.ALL, typeParams, vars, triggers, info, body); } @@ -709,8 +709,8 @@ public VCExpr Forall(List /*!*/ vars, List /*! { Contract.Requires(body != null); Contract.Requires(qid != null); - Contract.Requires(cce.NonNullElements(triggers)); - Contract.Requires(cce.NonNullElements(vars)); + Contract.Requires(Cce.NonNullElements(triggers)); + Contract.Requires(Cce.NonNullElements(vars)); Contract.Ensures(Contract.Result() != null); return Quantify(Quantifier.ALL, new List(), vars, triggers, new VCQuantifierInfo(qid, -1, weight), body); @@ -719,8 +719,8 @@ public VCExpr Forall(List /*!*/ vars, List /*! public VCExpr Forall(List /*!*/ vars, List /*!*/ triggers, VCExpr body) { Contract.Requires(body != null); - Contract.Requires(cce.NonNullElements(triggers)); - Contract.Requires(cce.NonNullElements(vars)); + Contract.Requires(Cce.NonNullElements(triggers)); + Contract.Requires(Cce.NonNullElements(vars)); Contract.Ensures(Contract.Result() != null); return Quantify(Quantifier.ALL, new List(), vars, triggers, new VCQuantifierInfo(null, -1), body); @@ -740,9 +740,9 @@ public VCExpr Exists(List /*!*/ typeParams, List() != null); return Quantify(Quantifier.EX, typeParams, vars, triggers, info, body); } @@ -750,8 +750,8 @@ public VCExpr Exists(List /*!*/ typeParams, List /*!*/ vars, List /*!*/ triggers, VCExpr body) { Contract.Requires(body != null); - Contract.Requires(cce.NonNullElements(triggers)); - Contract.Requires(cce.NonNullElements(vars)); + Contract.Requires(Cce.NonNullElements(triggers)); + Contract.Requires(Cce.NonNullElements(vars)); Contract.Ensures(Contract.Result() != null); return Quantify(Quantifier.EX, new List(), vars, triggers, new VCQuantifierInfo(null, -1), body); @@ -768,7 +768,7 @@ public VCExpr Exists(VCExprVar var, VCTrigger trigger, VCExpr body) public VCTrigger Trigger(bool pos, List exprs) { - Contract.Requires(cce.NonNullElements(exprs)); + Contract.Requires(Cce.NonNullElements(exprs)); Contract.Ensures(Contract.Result() != null); return new VCTrigger(pos, exprs); } diff --git a/Source/VCGeneration/BlockStats.cs b/Source/VCGeneration/BlockStats.cs index 73cc8dde7..b543892b5 100644 --- a/Source/VCGeneration/BlockStats.cs +++ b/Source/VCGeneration/BlockStats.cs @@ -22,8 +22,8 @@ class BlockStats [ContractInvariantMethod] void ObjectInvariant() { - Contract.Invariant(cce.NonNullElements(virtualSuccessors)); - Contract.Invariant(cce.NonNullElements(virtualPredecessors)); + Contract.Invariant(Cce.NonNullElements(virtualSuccessors)); + Contract.Invariant(Cce.NonNullElements(virtualPredecessors)); Contract.Invariant(block != null); } diff --git a/Source/VCGeneration/Checker.cs b/Source/VCGeneration/Checker.cs index 49f23b1df..ee829ff16 100644 --- a/Source/VCGeneration/Checker.cs +++ b/Source/VCGeneration/Checker.cs @@ -104,7 +104,7 @@ public Checker(CheckerPool pool, string /*?*/ logFilePath, bool appendLogFile) { Pool = pool; - SolverOptions = cce.NonNull(Pool.Options.TheProverFactory).BlankProverOptions(pool.Options); + SolverOptions = Cce.NonNull(Pool.Options.TheProverFactory).BlankProverOptions(pool.Options); if (logFilePath != null) { @@ -267,7 +267,7 @@ public int GetProverResourceCount() private async Task Check(string descriptiveName, VCExpr vc, CancellationToken cancellationToken) { try { - outcome = await thmProver.Check(descriptiveName, vc, cce.NonNull(handler), Options.ErrorLimit, + outcome = await thmProver.Check(descriptiveName, vc, Cce.NonNull(handler), Options.ErrorLimit, cancellationToken); } catch (OperationCanceledException) { diff --git a/Source/VCGeneration/ConditionGeneration.cs b/Source/VCGeneration/ConditionGeneration.cs index f0f481b8e..8ff1d459c 100644 --- a/Source/VCGeneration/ConditionGeneration.cs +++ b/Source/VCGeneration/ConditionGeneration.cs @@ -66,7 +66,7 @@ public static VcOutcome ProverInterfaceOutcomeToConditionGenerationOutcome(Solve [ContractInvariantMethod] void ObjectInvariant() { - Contract.Invariant(cce.NonNullDictionaryAndValues(incarnationOriginMap)); + Contract.Invariant(Cce.NonNullDictionaryAndValues(incarnationOriginMap)); Contract.Invariant(program != null); } @@ -295,7 +295,7 @@ protected static void InjectPostConditions(VCGenOptions options, ImplementationR if (!ens.Free) { Expr e = Substituter.Apply(formalProcImplSubst, ens.Condition); - Ensures ensCopy = (Ensures) cce.NonNull(ens.Clone()); + Ensures ensCopy = (Ensures) Cce.NonNull(ens.Clone()); ensCopy.Condition = e; AssertEnsuresCmd c = new AssertEnsuresCmd(ensCopy); c.ErrorDataEnhanced = ensCopy.ErrorDataEnhanced; @@ -397,7 +397,7 @@ protected static List GetPost(VCGenOptions options, ImplementationRun run) { Expr e = Substituter.Apply(formalProcImplSubst, ens.Condition); Contract.Assert(e != null); - Ensures ensCopy = cce.NonNull((Ensures) ens.Clone()); + Ensures ensCopy = Cce.NonNull((Ensures) ens.Clone()); ensCopy.Condition = e; Cmd c = new AssertEnsuresCmd(ensCopy); ((AssertEnsuresCmd) c).ErrorDataEnhanced = ensCopy.ErrorDataEnhanced; @@ -461,14 +461,14 @@ protected static List GetParamWhereClauses(VCGenOptions options, Implementa Contract.Assert(impl.OutParams.Count == impl.Proc.OutParams.Count); for (int i = 0; i < impl.OutParams.Count; i++) { - Variable f = cce.NonNull(impl.Proc.OutParams[i]); + Variable f = Cce.NonNull(impl.Proc.OutParams[i]); if (f.TypedIdent.WhereExpr != null) { Expr e = Substituter.Apply(formalProcImplSubst, f.TypedIdent.WhereExpr); Cmd c = new AssumeCmd(f.tok, e); whereClauses.Add(c); - Variable fi = cce.NonNull(impl.OutParams[i]); + Variable fi = Cce.NonNull(impl.OutParams[i]); Contract.Assume(fi.TypedIdent.WhereExpr == null); fi.TypedIdent.WhereExpr = e; @@ -720,7 +720,7 @@ protected Dictionary ComputeIncarnationMap(Block b, #region Create an identifier expression for the last incarnation in pred - Dictionary predMap = (Dictionary) cce.NonNull(block2Incarnation[pred]); + Dictionary predMap = (Dictionary) Cce.NonNull(block2Incarnation[pred]); Expr pred_incarnation_exp; Expr o = predMap.ContainsKey(v) ? predMap[v] : null; @@ -952,7 +952,7 @@ protected static Substitution ComputeOldExpressionSubstitution(List) cce.NonNull(new Dictionary(incarnationMap)); + ac.IncarnationMap = (Dictionary) Cce.NonNull(new Dictionary(incarnationMap)); var subsumption = Wlp.Subsumption(Options, ac); if (relevantDoomedAssumpVars.Any()) @@ -1241,8 +1241,8 @@ protected void TurnIntoPassiveCmd(TextWriter traceWriter, Cmd c, Block enclosing for (int i = 0; i < assign.Lhss.Count; ++i) { IdentifierExpr lhsIdExpr = - cce.NonNull((SimpleAssignLhs) assign.Lhss[i]).AssignedVariable; - Variable lhs = cce.NonNull(lhsIdExpr.Decl); + Cce.NonNull((SimpleAssignLhs) assign.Lhss[i]).AssignedVariable; + Variable lhs = Cce.NonNull(lhsIdExpr.Decl); Contract.Assert(lhs != null); Expr rhs = assign.Rhss[i]; Contract.Assert(rhs != null); @@ -1255,9 +1255,9 @@ protected void TurnIntoPassiveCmd(TextWriter traceWriter, Cmd c, Block enclosing else if (rhs is IdentifierExpr) { IdentifierExpr ie = (IdentifierExpr) rhs; - if (incarnationMap.ContainsKey(cce.NonNull(ie.Decl))) + if (incarnationMap.ContainsKey(Cce.NonNull(ie.Decl))) { - newIncarnationMappings[lhs] = cce.NonNull((Expr) incarnationMap[ie.Decl]); + newIncarnationMappings[lhs] = Cce.NonNull((Expr) incarnationMap[ie.Decl]); } else { @@ -1378,7 +1378,7 @@ protected void TurnIntoPassiveCmd(TextWriter traceWriter, Cmd c, Block enclosing Contract.Assert(ie != null); if (!(ie.Decl is Incarnation)) { - Variable x = cce.NonNull(ie.Decl); + Variable x = Cce.NonNull(ie.Decl); Variable x_prime = CreateIncarnation(x, c); incarnationMap[x] = new IdentifierExpr(x_prime.tok, x_prime); } @@ -1391,7 +1391,7 @@ protected void TurnIntoPassiveCmd(TextWriter traceWriter, Cmd c, Block enclosing Contract.Assert(ie != null); if (!(ie.Decl is Incarnation)) { - Variable x = cce.NonNull(ie.Decl); + Variable x = Cce.NonNull(ie.Decl); Expr w = x.TypedIdent.WhereExpr; if (w != null) { @@ -1512,7 +1512,7 @@ protected Block CreateBlockBetween(int predIndex, Block succ) Contract.Requires(succ != null); Contract.Ensures(Contract.Result() != null); - Block pred = cce.NonNull(succ.Predecessors[predIndex]); + Block pred = Cce.NonNull(succ.Predecessors[predIndex]); string newBlockLabel = pred.Label + "_@2_" + succ.Label; @@ -1538,7 +1538,7 @@ protected Block CreateBlockBetween(int predIndex, Block succ) #region Change the edge "pred->succ" to "pred->newBlock" - GotoCmd gtc = (GotoCmd) cce.NonNull(pred.TransferCmd); + GotoCmd gtc = (GotoCmd) Cce.NonNull(pred.TransferCmd); Contract.Assume(gtc.labelTargets != null); Contract.Assume(gtc.labelNames != null); for (int i = 0, n = gtc.labelTargets.Count; i < n; i++) @@ -1574,7 +1574,7 @@ protected void AddBlocksBetween(List blocks) // b is a join point (i.e., it has more than one predecessor) for (int i = 0; i < nPreds; i++) { - GotoCmd gotocmd = (GotoCmd) (cce.NonNull(b.Predecessors[i]).TransferCmd); + GotoCmd gotocmd = (GotoCmd) (Cce.NonNull(b.Predecessors[i]).TransferCmd); if (gotocmd.labelNames != null && gotocmd.labelNames.Count > 1) { tweens.Add(CreateBlockBetween(i, b)); diff --git a/Source/VCGeneration/Counterexample.cs b/Source/VCGeneration/Counterexample.cs index 31cafb18c..77535413f 100644 --- a/Source/VCGeneration/Counterexample.cs +++ b/Source/VCGeneration/Counterexample.cs @@ -20,12 +20,12 @@ public List /*!>!*/ [ContractInvariantMethod] void ObjectInvariant() { - Contract.Invariant(cce.NonNullElements(args)); + Contract.Invariant(Cce.NonNullElements(args)); } public CalleeCounterexampleInfo(Counterexample cex, List!*/> x) { - Contract.Requires(cce.NonNullElements(x)); + Contract.Requires(Cce.NonNullElements(x)); counterexample = cex; args = x; } @@ -72,7 +72,7 @@ void ObjectInvariant() { Contract.Invariant(Trace != null); Contract.Invariant(Context != null); - Contract.Invariant(cce.NonNullDictionaryAndValues(calleeCounterexamples)); + Contract.Invariant(Cce.NonNullDictionaryAndValues(calleeCounterexamples)); } public ProofRun ProofRun { get; } @@ -125,7 +125,7 @@ public void AddCalleeCounterexample(int numBlock, int numInstr, CalleeCounterexa public void AddCalleeCounterexample(Dictionary cs) { - Contract.Requires(cce.NonNullDictionaryAndValues(cs)); + Contract.Requires(Cce.NonNullDictionaryAndValues(cs)); foreach (TraceLocation loc in cs.Keys) { AddCalleeCounterexample(loc, cs[loc]); @@ -761,7 +761,7 @@ public virtual void OnWarning(CoreOptions options, string msg) break; default: Contract.Assume(false); - throw new cce.UnreachableException(); // unexpected case + throw new Cce.UnreachableException(); // unexpected case } } diff --git a/Source/VCGeneration/LoopExtractor.cs b/Source/VCGeneration/LoopExtractor.cs index 90e9e7292..262ab4ca7 100644 --- a/Source/VCGeneration/LoopExtractor.cs +++ b/Source/VCGeneration/LoopExtractor.cs @@ -87,7 +87,7 @@ static void CreateProceduresForLoops(CoreOptions options, Implementation impl, G Dictionary> fullMap) { Contract.Requires(impl != null); - Contract.Requires(cce.NonNullElements(loopImpls)); + Contract.Requires(Cce.NonNullElements(loopImpls)); // Enumerate the headers // for each header h: // create implementation p_h with @@ -438,13 +438,13 @@ static void CreateProceduresForLoops(CoreOptions options, Implementation impl, G blocks = new List(); Block exit = new Block(Token.NoToken, "exit", new List(), new ReturnCmd(Token.NoToken)); GotoCmd cmd = new GotoCmd(Token.NoToken, - new List {cce.NonNull(blockMap[header]).Label, exit.Label}, + new List {Cce.NonNull(blockMap[header]).Label, exit.Label}, new List {blockMap[header], exit}); if (detLoopExtract) //cutting the non-determinism { cmd = new GotoCmd(Token.NoToken, - new List {cce.NonNull(blockMap[header]).Label}, + new List {Cce.NonNull(blockMap[header]).Label}, new List {blockMap[header]}); } @@ -463,7 +463,7 @@ static void CreateProceduresForLoops(CoreOptions options, Implementation impl, G { Contract.Assert(block != null); Block /*!*/ - newBlock = cce.NonNull(blockMap[block]); + newBlock = Cce.NonNull(blockMap[block]); GotoCmd gotoCmd = block.TransferCmd as GotoCmd; if (gotoCmd == null) { diff --git a/Source/VCGeneration/ManualSplitFinder.cs b/Source/VCGeneration/ManualSplitFinder.cs index 9d1804742..d48a9d7fa 100644 --- a/Source/VCGeneration/ManualSplitFinder.cs +++ b/Source/VCGeneration/ManualSplitFinder.cs @@ -14,7 +14,7 @@ public static IEnumerable FocusAndSplit(VCGenOptions options, Imple private static List FindManualSplits(ManualSplit initialSplit) { Contract.Requires(initialSplit.Implementation != null); - Contract.Ensures(Contract.Result>() == null || cce.NonNullElements(Contract.Result>())); + Contract.Ensures(Contract.Result>() == null || Cce.NonNullElements(Contract.Result>())); var splitOnEveryAssert = initialSplit.Options.VcsSplitOnEveryAssert; initialSplit.Run.Implementation.CheckBooleanAttribute("vcs_split_on_every_assert", ref splitOnEveryAssert); diff --git a/Source/VCGeneration/SmokeTester.cs b/Source/VCGeneration/SmokeTester.cs index 340dfff58..6422317aa 100644 --- a/Source/VCGeneration/SmokeTester.cs +++ b/Source/VCGeneration/SmokeTester.cs @@ -19,8 +19,8 @@ void ObjectInvariant() Contract.Invariant(parent != null); Contract.Invariant(run != null); Contract.Invariant(initial != null); - Contract.Invariant(cce.NonNullDictionaryAndValues(copies)); - Contract.Invariant(cce.NonNull(visited)); + Contract.Invariant(Cce.NonNullDictionaryAndValues(copies)); + Contract.Invariant(Cce.NonNull(visited)); Contract.Invariant(callback != null); } @@ -83,14 +83,14 @@ Block CloneBlock(Block b) if (copies.TryGetValue(b, out var fake_res)) { - return cce.NonNull(fake_res); + return Cce.NonNull(fake_res); } Block res = new Block(b.tok, b.Label, new List(b.Cmds), null); copies[b] = res; if (b.TransferCmd is GotoCmd) { - foreach (Block ch in cce.NonNull((GotoCmd) b.TransferCmd).labelTargets) + foreach (Block ch in Cce.NonNull((GotoCmd) b.TransferCmd).labelTargets) { Contract.Assert(ch != null); CloneBlock(ch); @@ -115,7 +115,7 @@ Block CopyBlock(Block b) if (copies.TryGetValue(b, out var fake_res)) { // fake_res should be Block! but the compiler fails - return cce.NonNull(fake_res); + return Cce.NonNull(fake_res); } Block res; @@ -147,7 +147,7 @@ Block CopyBlock(Block b) List GetCopiedBlocks() { - Contract.Ensures(cce.NonNullElements(Contract.Result>())); + Contract.Ensures(Cce.NonNullElements(Contract.Result>())); // the order of nodes in res is random (except for the first one, being the entry) List res = new List(); @@ -167,12 +167,12 @@ List GetCopiedBlocks() { GotoCmd copy = new GotoCmd(go.tok, new List(), new List()); kv.Value.TransferCmd = copy; - foreach (Block b in cce.NonNull(go.labelTargets)) + foreach (Block b in Cce.NonNull(go.labelTargets)) { Contract.Assert(b != null); if (copies.TryGetValue(b, out var c)) { - copy.AddTarget(cce.NonNull(c)); + copy.AddTarget(Cce.NonNull(c)); } } } @@ -183,7 +183,7 @@ List GetCopiedBlocks() else { Contract.Assume(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } } @@ -208,7 +208,7 @@ bool BooleanEval(Expr e, ref bool val) else if (call != null && call.Fun is UnaryOperator && ((UnaryOperator) call.Fun).Op == UnaryOperator.Opcode.Not && - BooleanEval(cce.NonNull(call.Args[0]), ref val)) + BooleanEval(Cce.NonNull(call.Args[0]), ref val)) { val = !val; return true; @@ -218,7 +218,7 @@ call.Fun is UnaryOperator && call.Fun is BinaryOperator && ((BinaryOperator) call.Fun).Op == BinaryOperator.Opcode.Neq && call.Args[0] is LiteralExpr && - cce.NonNull(call.Args[0]).Equals(call.Args[1])) + Cce.NonNull(call.Args[0]).Equals(call.Args[1])) { val = false; return true; @@ -306,7 +306,7 @@ async Task CheckUnreachable(TextWriter traceWriter, Block cur, List s Emit(); } } - await checker.BeginCheck(cce.NonNull(Implementation.Name + "_smoke" + id++), vc, new ErrorHandler(Options, absyIds, callback), + await checker.BeginCheck(Cce.NonNull(Implementation.Name + "_smoke" + id++), vc, new ErrorHandler(Options, absyIds, callback), Options.SmokeTimeout, Options.ResourceLimit, CancellationToken.None); await checker.ProverTask; @@ -403,7 +403,7 @@ async Task DepthFirstSearch(TextWriter traceWriter, Block cur) } else if (call != null) { - foreach (Ensures e in (cce.NonNull(call.Proc)).Ensures) + foreach (Ensures e in (Cce.NonNull(call.Proc)).Ensures) { Contract.Assert(e != null); if (IsFalse(e.Condition)) @@ -428,7 +428,7 @@ async Task DepthFirstSearch(TextWriter traceWriter, Block cur) Contract.Assume(!(go != null && go.labelTargets == null && go.labelNames != null && go.labelNames.Count > 0)); - if (ret != null || (go != null && cce.NonNull(go.labelTargets).Count == 0)) + if (ret != null || (go != null && Cce.NonNull(go.labelTargets).Count == 0)) { // we end in return, so there will be no more places to check await CheckUnreachable(traceWriter, cur, seq); @@ -438,7 +438,7 @@ async Task DepthFirstSearch(TextWriter traceWriter, Block cur) bool needToCheck = true; // if all of our children have more than one parent, then // we're in the right place to check - foreach (Block target in cce.NonNull(go.labelTargets)) + foreach (Block target in Cce.NonNull(go.labelTargets)) { Contract.Assert(target != null); if (target.Predecessors.Count == 1) @@ -487,7 +487,7 @@ public override Absy Label2Absy(string label) Contract.Ensures(Contract.Result() != null); int id = int.Parse(label); - return cce.NonNull((Absy) absyIds.GetValue(id)); + return Cce.NonNull((Absy) absyIds.GetValue(id)); } public override void OnProverWarning(string msg) diff --git a/Source/VCGeneration/Split.cs b/Source/VCGeneration/Split.cs index 4012a6bdd..74bcd776b 100644 --- a/Source/VCGeneration/Split.cs +++ b/Source/VCGeneration/Split.cs @@ -83,7 +83,7 @@ public Split(VCGenOptions options, List /*!*/ blocks, Dictionary /*!*/ gotoCmdOrigins, VerificationConditionGenerator /*!*/ par, ImplementationRun run, int? randomSeed = null) { - Contract.Requires(cce.NonNullElements(blocks)); + Contract.Requires(Cce.NonNullElements(blocks)); Contract.Requires(gotoCmdOrigins != null); Contract.Requires(par != null); this.Blocks = blocks; @@ -223,7 +223,7 @@ BlockStats GetBlockStats(Block b) stats[b] = s; } - return cce.NonNull(s); + return Cce.NonNull(s); } double AssertionCost(PredicateCmd c) @@ -284,7 +284,7 @@ void CountAssertions(Block b) HashSet /*!*/ ComputeReachableNodes(Block /*!*/ b) { Contract.Requires(b != null); - Contract.Ensures(cce.NonNull(Contract.Result>())); + Contract.Ensures(Cce.NonNull(Contract.Result>())); BlockStats s = GetBlockStats(b); if (s.reachableBlocks != null) { @@ -345,7 +345,7 @@ void ComputeBestSplit() Options.OutputWriter.WriteLine("non-big {0} accessed from {1}", ch, b); DumpDot(-1); Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } chs.virtualPredecessors.Add(b); @@ -369,7 +369,7 @@ void ComputeBestSplit() continue; } - List targ = cce.NonNull(gt.labelTargets); + List targ = Cce.NonNull(gt.labelTargets); if (targ.Count < 2) { continue; @@ -380,14 +380,14 @@ void ComputeBestSplit() splitBlock = b; assumizedBranches.Clear(); - assumizedBranches.Add(cce.NonNull(targ[0])); + assumizedBranches.Add(Cce.NonNull(targ[0])); left0 = DoComputeScore(true); right0 = DoComputeScore(false); assumizedBranches.Clear(); for (int idx = 1; idx < targ.Count; idx++) { - assumizedBranches.Add(cce.NonNull(targ[idx])); + assumizedBranches.Add(Cce.NonNull(targ[idx])); } left1 = DoComputeScore(true); @@ -400,7 +400,7 @@ void ComputeBestSplit() { currentScore = otherScore; assumizedBranches.Clear(); - assumizedBranches.Add(cce.NonNull(targ[0])); + assumizedBranches.Add(Cce.NonNull(targ[0])); } if (currentScore < score) @@ -507,7 +507,7 @@ void ComputeBlockSets(bool allowSmall) foreach (Block b in allowSmall ? Blocks : bigBlocks) { Contract.Assert(b != null); - if (ComputeReachableNodes(b).Contains(cce.NonNull(splitBlock))) + if (ComputeReachableNodes(b).Contains(Cce.NonNull(splitBlock))) { keepAtAll.Add(b); } @@ -613,7 +613,7 @@ List SliceCmds(Block b) else { Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } if (swap) @@ -635,7 +635,7 @@ Block CloneBlock(Block b) if (copies.TryGetValue(b, out var res)) { - return cce.NonNull(res); + return Cce.NonNull(res); } res = new Block(b.tok, b.Label, SliceCmds(b), b.TransferCmd); @@ -646,7 +646,7 @@ Block CloneBlock(Block b) GotoCmd newGoto = new GotoCmd(gt.tok, new List(), new List()); res.TransferCmd = newGoto; int pos = 0; - foreach (Block ch in cce.NonNull(gt.labelTargets)) + foreach (Block ch in Cce.NonNull(gt.labelTargets)) { Contract.Assert(ch != null); Contract.Assert(doingSlice || @@ -681,7 +681,7 @@ private Split DoSplit() continue; } - newBlocks.Add(cce.NonNull(tmp)); + newBlocks.Add(Cce.NonNull(tmp)); if (GotoCmdOrigins.TryGetValue(block.TransferCmd, out var origin)) { newGotoCmdOrigins[tmp.TransferCmd] = origin; @@ -756,7 +756,7 @@ public Counterexample ToCounterexample(ProverContext context) if (command is AssertCmd assertCmd) { var counterexample = VerificationConditionGenerator.AssertCmdToCounterexample(Options, assertCmd, - cce.NonNull(block.TransferCmd), trace, null, null, null, context, this); + Cce.NonNull(block.TransferCmd), trace, null, null, null, context, this); Counterexamples.Add(counterexample); return counterexample; } @@ -764,13 +764,13 @@ public Counterexample ToCounterexample(ProverContext context) } Contract.Assume(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } public static List /*!*/ DoSplit(Split initial, double splitThreshold, int maxSplits) { Contract.Requires(initial != null); - Contract.Ensures(cce.NonNullElements(Contract.Result>())); + Contract.Ensures(Cce.NonNullElements(Contract.Result>())); var run = initial.Run; var result = new List { initial }; @@ -813,7 +813,7 @@ public Counterexample ToCounterexample(ProverContext context) if (g != null) { run.OutputWriter.Write(" exits: "); - foreach (Block b in cce.NonNull(g.labelTargets)) + foreach (Block b in Cce.NonNull(g.labelTargets)) { Contract.Assert(b != null); run.OutputWriter.Write("{0} ", b.Label); @@ -862,7 +862,7 @@ public Counterexample ToCounterexample(ProverContext context) s0.DumpDot(-2); s1.DumpDot(-3); Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } } @@ -889,7 +889,7 @@ public Counterexample ToCounterexample(ProverContext context) public VerificationRunResult ReadOutcome(int iteration, Checker checker, VerifierCallback callback) { Contract.EnsuresOnThrow(true); - SolverOutcome outcome = cce.NonNull(checker).ReadOutcome(); + SolverOutcome outcome = Cce.NonNull(checker).ReadOutcome(); if (Options.Trace && SplitIndex >= 0) { @@ -987,7 +987,7 @@ public string Description { get { - string description = cce.NonNull(Implementation.Name); + string description = Cce.NonNull(Implementation.Name); if (SplitIndex >= 0) { description += "_split" + SplitIndex; @@ -1000,7 +1000,7 @@ public string Description private void SoundnessCheck(HashSet /*!*/> /*!*/ cache, Block /*!*/ orig, List /*!*/ copies) { - Contract.Requires(cce.NonNull(cache)); + Contract.Requires(Cce.NonNull(cache)); Contract.Requires(orig != null); Contract.Requires(copies != null); { diff --git a/Source/VCGeneration/SplitAndVerifyWorker.cs b/Source/VCGeneration/SplitAndVerifyWorker.cs index 63b763de0..263384e56 100644 --- a/Source/VCGeneration/SplitAndVerifyWorker.cs +++ b/Source/VCGeneration/SplitAndVerifyWorker.cs @@ -219,7 +219,7 @@ public static bool IsProverFailed(SolverOutcome outcome) return true; default: Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } } @@ -261,7 +261,7 @@ private static VcOutcome MergeOutcomes(VcOutcome currentVcOutcome, SolverOutcome return currentVcOutcome; default: Contract.Assert(false); - throw new cce.UnreachableException(); + throw new Cce.UnreachableException(); } } diff --git a/Source/VCGeneration/VerificationConditionGenerator.cs b/Source/VCGeneration/VerificationConditionGenerator.cs index bdff1b0f2..b551e3eef 100644 --- a/Source/VCGeneration/VerificationConditionGenerator.cs +++ b/Source/VCGeneration/VerificationConditionGenerator.cs @@ -67,7 +67,7 @@ public static AssumeCmd AssertTurnedIntoAssume(VCGenOptions options, AssertCmd a break; default: Contract.Assert(false); - throw new cce.UnreachableException(); // unexpected case + throw new Cce.UnreachableException(); // unexpected case } var assume = new AssumeCmd(assrt.tok, expr); @@ -169,9 +169,9 @@ public VCExpr GenerateVCAux(Implementation /*!*/ impl, VCExpr controlFlowVariabl VCExpr vc; int assertionCount; - if (cce.NonNull(CheckerPool.Options.TheProverFactory).SupportsDags) + if (Cce.NonNull(CheckerPool.Options.TheProverFactory).SupportsDags) { - vc = DagVC(cce.NonNull(impl.Blocks[0]), controlFlowVariableExpr, absyIds, + vc = DagVC(Cce.NonNull(impl.Blocks[0]), controlFlowVariableExpr, absyIds, new Dictionary(), proverContext, out assertionCount); } else @@ -492,7 +492,7 @@ void ObjectInvariant() { Contract.Invariant(gotoCmdOrigins != null); Contract.Invariant(absyIds != null); - Contract.Invariant(cce.NonNullElements(blocks)); + Contract.Invariant(Cce.NonNullElements(blocks)); Contract.Invariant(callback != null); Contract.Invariant(context != null); Contract.Invariant(program != null); @@ -520,7 +520,7 @@ public ErrorReporter(VCGenOptions options, { Contract.Requires(gotoCmdOrigins != null); Contract.Requires(absyIds != null); - Contract.Requires(cce.NonNullElements(blocks)); + Contract.Requires(Cce.NonNullElements(blocks)); Contract.Requires(callback != null); Contract.Requires(context != null); Contract.Requires(program != null); @@ -563,7 +563,7 @@ public override void OnModel(IList labels /*!*/ /*!*/, Model model, } List trace = new List(); - Block entryBlock = cce.NonNull(this.blocks[0]); + Block entryBlock = Cce.NonNull(this.blocks[0]); Contract.Assert(traceNodes.Contains(entryBlock)); trace.Add(entryBlock); @@ -605,7 +605,7 @@ public override Absy Label2Absy(string label) Contract.Ensures(Contract.Result() != null); int id = int.Parse(label); - return cce.NonNull(absyIds.GetValue(id)); + return Cce.NonNull(absyIds.GetValue(id)); } public override void OnResourceExceeded(string msg, IEnumerable> assertCmds = null) @@ -729,11 +729,11 @@ private void ConvertCFG2DAGStandard(Implementation impl, Dictionary backEdgeNodes = new Dictionary(); - foreach (Block b in cce.NonNull(g.BackEdgeNodes(header))) + foreach (Block b in Cce.NonNull(g.BackEdgeNodes(header))) { Contract.Assert(b != null); backEdgeNodes.Add(b, null); @@ -840,10 +840,10 @@ private void ConvertCFG2DAGStandard(Implementation impl, Dictionary 1) @@ -876,7 +876,7 @@ private void ConvertCFG2DAGStandard(Implementation impl, Dictionary VarsAssignedInLoop(Graph g, Block header) { List varsToHavoc = new List(); - foreach (Block backEdgeNode in cce.NonNull(g.BackEdgeNodes(header))) + foreach (Block backEdgeNode in Cce.NonNull(g.BackEdgeNodes(header))) { Contract.Assert(backEdgeNode != null); foreach (Block b in g.NaturalLoops(header, backEdgeNode)) @@ -993,7 +993,7 @@ public static List VarsAssignedInLoop(Graph g, Block header) public static IEnumerable VarsReferencedInLoop(Graph g, Block header) { HashSet referencedVars = new HashSet(); - foreach (Block backEdgeNode in cce.NonNull(g.BackEdgeNodes(header))) + foreach (Block backEdgeNode in Cce.NonNull(g.BackEdgeNodes(header))) { Contract.Assert(backEdgeNode != null); foreach (Block b in g.NaturalLoops(header, backEdgeNode)) @@ -1044,7 +1044,7 @@ private void ConvertCFG2DAGKInduction(Implementation impl, Dictionary backEdgeNodes = new Dictionary(); - foreach (Block b in cce.NonNull(g.BackEdgeNodes(header))) + foreach (Block b in Cce.NonNull(g.BackEdgeNodes(header))) { Contract.Assert(b != null); backEdgeNodes.Add(b, null); @@ -1121,7 +1121,7 @@ private void ConvertCFG2DAGKInduction(Implementation impl, Dictionary g, #region create copies of all blocks in the loop - foreach (Block backEdgeNode in cce.NonNull(g.BackEdgeNodes(header))) + foreach (Block backEdgeNode in Cce.NonNull(g.BackEdgeNodes(header))) { Contract.Assert(backEdgeNode != null); foreach (Block b in g.NaturalLoops(header, backEdgeNode)) @@ -1906,7 +1906,7 @@ static Counterexample TraceCounterexample( Contract.Requires(traceNodes != null); Contract.Requires(trace != null); Contract.Requires(context != null); - Contract.Requires(cce.NonNullDictionaryAndValues(calleeCounterexamples)); + Contract.Requires(Cce.NonNullDictionaryAndValues(calleeCounterexamples)); // After translation, all potential errors come from asserts. List augmentedTrace = new List(); @@ -1914,10 +1914,10 @@ static Counterexample TraceCounterexample( { List cmds = b.Cmds; Contract.Assert(cmds != null); - TransferCmd transferCmd = cce.NonNull(b.TransferCmd); + TransferCmd transferCmd = Cce.NonNull(b.TransferCmd); for (int i = 0; i < cmds.Count; i++) { - Cmd cmd = cce.NonNull(cmds[i]); + Cmd cmd = Cce.NonNull(cmds[i]); // update augmentedTrace if (errModel != null && debugInfos != null && debugInfos.ContainsKey(cmd)) @@ -1944,7 +1944,7 @@ static Counterexample TraceCounterexample( } Block foundBlock = null; - foreach (Block bb in cce.NonNull(gotoCmd.labelTargets)) + foreach (Block bb in Cce.NonNull(gotoCmd.labelTargets)) { Contract.Assert(bb != null); if (traceNodes.Contains(bb)) @@ -2242,7 +2242,7 @@ VCExpr DagVC(Block block, GotoCmd gotocmd = block.TransferCmd as GotoCmd; if (gotocmd != null) { - foreach (Block successor in cce.NonNull(gotocmd.labelTargets)) + foreach (Block successor in Cce.NonNull(gotocmd.labelTargets)) { Contract.Assert(successor != null); VCExpr c = DagVC(successor, controlFlowVariableExpr, absyIds, blockEquations, proverCtxt, out var ac); diff --git a/Source/VCGeneration/VerificationResultCollector.cs b/Source/VCGeneration/VerificationResultCollector.cs index 6957914ad..e94c247a1 100644 --- a/Source/VCGeneration/VerificationResultCollector.cs +++ b/Source/VCGeneration/VerificationResultCollector.cs @@ -16,8 +16,8 @@ public VerificationResultCollector(VCGenOptions options) : base(options.PrintPro [ContractInvariantMethod] void ObjectInvariant() { - Contract.Invariant(cce.NonNullElements(examples)); - Contract.Invariant(cce.NonNullElements(vcResults)); + Contract.Invariant(Cce.NonNullElements(examples)); + Contract.Invariant(Cce.NonNullElements(vcResults)); } public readonly ConcurrentQueue examples = new(); diff --git a/Source/VCGeneration/Wlp.cs b/Source/VCGeneration/Wlp.cs index 84090f10a..58e7b4b14 100644 --- a/Source/VCGeneration/Wlp.cs +++ b/Source/VCGeneration/Wlp.cs @@ -62,19 +62,19 @@ public static VCExpr Block(Block b, VCExpr N, VCContext ctxt) for (int i = b.Cmds.Count; --i >= 0;) { - res = Cmd(b, cce.NonNull(b.Cmds[i]), res, ctxt); + res = Cmd(b, Cce.NonNull(b.Cmds[i]), res, ctxt); } ctxt.absyIds.GetId(b); try { - cce.BeginExpose(ctxt); + Cce.BeginExpose(ctxt); return res; } finally { - cce.EndExpose(); + Cce.EndExpose(); } } @@ -231,7 +231,7 @@ internal static VCExpr Cmd(Block b, Cmd cmd, VCExpr N, VCContext ctxt) { ctxt.Options.OutputWriter.WriteLine(cmd.ToString()); Contract.Assert(false); - throw new cce.UnreachableException(); // unexpected command + throw new Cce.UnreachableException(); // unexpected command } } @@ -293,10 +293,10 @@ public static VCExpr RegExpr(RE r, VCExpr N, VCContext ctxt) } else { - VCExpr currentWLP = RegExpr(cce.NonNull(ch.rs[0]), N, ctxt); + VCExpr currentWLP = RegExpr(Cce.NonNull(ch.rs[0]), N, ctxt); for (int i = 1, n = ch.rs.Count; i < n; i++) { - currentWLP = ctxt.Ctxt.ExprGen.And(currentWLP, RegExpr(cce.NonNull(ch.rs[i]), N, ctxt)); + currentWLP = ctxt.Ctxt.ExprGen.And(currentWLP, RegExpr(Cce.NonNull(ch.rs[i]), N, ctxt)); } res = currentWLP; @@ -307,7 +307,7 @@ public static VCExpr RegExpr(RE r, VCExpr N, VCContext ctxt) else { Contract.Assert(false); - throw new cce.UnreachableException(); // unexpected RE subtype + throw new Cce.UnreachableException(); // unexpected RE subtype } } }