Skip to content

Commit f3d17bb

Browse files
Rename cce to Cce
1 parent de1c567 commit f3d17bb

File tree

79 files changed

+1058
-1058
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+1058
-1058
lines changed

Source/AbstractInterpretation/Traverse.cs

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,44 +18,44 @@ public class WidenPoints
1818
public static void Compute(Program program)
1919
{
2020
Contract.Requires(program != null);
21-
cce.BeginExpose(program);
21+
Cce.BeginExpose(program);
2222

2323
foreach (var impl in program.Implementations)
2424
{
2525
if (impl.Blocks != null && impl.Blocks.Count > 0)
2626
{
27-
Contract.Assume(cce.IsConsistent(impl));
28-
cce.BeginExpose(impl);
27+
Contract.Assume(Cce.IsConsistent(impl));
28+
Cce.BeginExpose(impl);
2929
Block start = impl.Blocks[0];
3030
Contract.Assume(start != null);
31-
Contract.Assume(cce.IsConsistent(start));
31+
Contract.Assume(Cce.IsConsistent(start));
3232
Visit(start);
3333

3434
// We reset the state...
3535
foreach (Block b in impl.Blocks)
3636
{
37-
cce.BeginExpose(b);
37+
Cce.BeginExpose(b);
3838
b.TraversingStatus = Block.VisitState.ToVisit;
39-
cce.EndExpose();
39+
Cce.EndExpose();
4040
}
4141

42-
cce.EndExpose();
42+
Cce.EndExpose();
4343
}
4444
}
4545

46-
cce.EndExpose();
46+
Cce.EndExpose();
4747
}
4848

4949
static void Visit(Block b)
5050
{
5151
Contract.Requires(b != null);
52-
Contract.Assume(cce.IsExposable(b));
52+
Contract.Assume(Cce.IsExposable(b));
5353
if (b.TraversingStatus == Block.VisitState.BeingVisited)
5454
{
55-
cce.BeginExpose(b);
55+
Cce.BeginExpose(b);
5656
// we got here through a back-edge
5757
b.widenBlock = true;
58-
cce.EndExpose();
58+
Cce.EndExpose();
5959
}
6060
else if (b.TraversingStatus == Block.VisitState.AlreadyVisited)
6161
{
@@ -66,15 +66,15 @@ static void Visit(Block b)
6666
Contract.Assert(b.TraversingStatus == Block.VisitState.ToVisit);
6767

6868
GotoCmd g = (GotoCmd) b.TransferCmd;
69-
cce.BeginExpose(b);
69+
Cce.BeginExpose(b);
7070

71-
cce.BeginExpose(g); //PM: required for the subsequent expose (g.labelTargets)
71+
Cce.BeginExpose(g); //PM: required for the subsequent expose (g.labelTargets)
7272
b.TraversingStatus = Block.VisitState.BeingVisited;
7373

7474
// labelTargets is made non-null by Resolve, which we assume
7575
// has already called in a prior pass.
7676
Contract.Assume(g.labelTargets != null);
77-
cce.BeginExpose(g.labelTargets);
77+
Cce.BeginExpose(g.labelTargets);
7878
foreach (Block succ in g.labelTargets)
7979
// invariant b.currentlyTraversed;
8080
//PM: The following loop invariant will work once properties are axiomatized
@@ -84,7 +84,7 @@ static void Visit(Block b)
8484
Visit(succ);
8585
}
8686

87-
cce.EndExpose();
87+
Cce.EndExpose();
8888

8989
Contract.Assert(b.TraversingStatus == Block.VisitState.BeingVisited);
9090
// System.Diagnostics.Debug.Assert(b.currentlyTraversed);
@@ -94,7 +94,7 @@ static void Visit(Block b)
9494
//PM: The folowing assumption is needed because we cannot prove that a simple field update
9595
//PM: leaves the value of a property unchanged.
9696
Contract.Assume(g.labelNames == null || g.labelNames.Count == g.labelTargets.Count);
97-
cce.EndExpose();
97+
Cce.EndExpose();
9898
}
9999
else
100100
{
@@ -113,7 +113,7 @@ public static List<Block> ComputeLoopBodyFrom(Block block)
113113
{
114114
Contract.Requires(block.widenBlock);
115115
Contract.Requires(block != null);
116-
Contract.Ensures(cce.NonNullElements(Contract.Result<List<Block>>()));
116+
Contract.Ensures(Cce.NonNullElements(Contract.Result<List<Block>>()));
117117

118118
Contract.Assert(rootBlock == null);
119119
rootBlock = block;
@@ -141,8 +141,8 @@ public static List<Block> ComputeLoopBodyFrom(Block block)
141141
private static void DoDFSVisit(Block block, List<Block> path, List<Block> blocksInPath)
142142
{
143143
Contract.Requires(block != null);
144-
Contract.Requires(cce.NonNullElements(path));
145-
Contract.Requires(cce.NonNullElements(path));
144+
Contract.Requires(Cce.NonNullElements(path));
145+
Contract.Requires(Cce.NonNullElements(path));
146146

147147
#region case 1. We visit the root => We are done, "path" is a path inside the loop
148148

Source/BaseTypes/BigNum.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ public override int GetHashCode()
148148
public override string /*!*/ ToString()
149149
{
150150
Contract.Ensures(Contract.Result<string>() != null);
151-
return cce.NonNull(val.ToString());
151+
return Cce.NonNull(val.ToString());
152152
}
153153

154154
//////////////////////////////////////////////////////////////////////////////

Source/BaseTypes/Set.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ public virtual int Count
273273
Contract.Ensures(Contract.Result<GSet<T>>() != null);
274274
//Contract.Ensures(Contract.ForAll(result, x => a[x] && b[x] ));
275275
GSet<T> /*!*/
276-
res = (GSet<T> /*!*/) cce.NonNull(a.Clone());
276+
res = (GSet<T> /*!*/) Cce.NonNull(a.Clone());
277277
res.Intersect(b);
278278
return res;
279279
}
@@ -286,7 +286,7 @@ public virtual int Count
286286
Contract.Ensures(Contract.Result<GSet<T>>() != null);
287287
// Contract.Ensures(Contract.ForAll(result, x => a[x] || b[x] ));
288288
GSet<T> /*!*/
289-
res = (GSet<T> /*!*/) cce.NonNull(a.Clone());
289+
res = (GSet<T> /*!*/) Cce.NonNull(a.Clone());
290290
res.AddRange(b);
291291
return res;
292292
}

Source/BoogieDriver/BoogieDriver.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public class OnlyBoogie
99
{
1010
public static int Main(string[] args)
1111
{
12-
Contract.Requires(cce.NonNullElements(args));
12+
Contract.Requires(Cce.NonNullElements(args));
1313

1414
var options = new CommandLineOptions(Console.Out, new ConsolePrinter())
1515
{

Source/CodeContractsExtender/cce.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
/// <summary>
77
/// A class containing static methods to extend the functionality of Code Contracts
88
/// </summary>
9-
public static class cce
9+
public static class Cce
1010
{
1111
//[Pure]
1212
//public static bool NonNullElements<T>(Microsoft.Dafny.Graph<T> collection) {
@@ -29,7 +29,7 @@ public static bool NonNullElements<T>(IEnumerable<T> collection) where T : class
2929
[Pure]
3030
public static bool NonNullDictionaryAndValues<TKey, TValue>(IDictionary<TKey, TValue> collection) where TValue : class
3131
{
32-
return collection != null && cce.NonNullElements(collection.Values);
32+
return collection != null && Cce.NonNullElements(collection.Values);
3333
}
3434

3535
//[Pure]
@@ -46,7 +46,7 @@ public static bool NonNullDictionaryAndValues<TKey, TValue>(IDictionary<TKey, TV
4646
[Pure]
4747
public static bool NonNullElements<T>(IEnumerable<T> collection, bool nullability) where T : class
4848
{
49-
return (nullability && collection == null) || cce.NonNullElements(collection);
49+
return (nullability && collection == null) || Cce.NonNullElements(collection);
5050
//Should be the same as:
5151
/*if(nullability&&collection==null)
5252
* return true;

Source/Concurrency/CivlCoreTypes.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ private List<AssertCmd> HoistAsserts(Implementation impl, ConcurrencyOptions opt
390390
}
391391
else
392392
{
393-
throw new cce.UnreachableException();
393+
throw new Cce.UnreachableException();
394394
}
395395
}
396396
return wlps[impl.Blocks[0]].Select(assertCmd => Forall(impl.LocVars.Union(impl.OutParams), assertCmd)).ToList();
@@ -435,7 +435,7 @@ private List<AssertCmd> HoistAsserts(List<Cmd> cmds, List<AssertCmd> postconditi
435435
}
436436
else
437437
{
438-
throw new cce.UnreachableException();
438+
throw new Cce.UnreachableException();
439439
}
440440
}
441441
cmds.RemoveAll(cmd => cmd is AssertCmd);

Source/Concurrency/CivlUtil.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public void Compute()
3636
}
3737
else
3838
{
39-
throw new cce.UnreachableException();
39+
throw new Cce.UnreachableException();
4040
}
4141
}
4242
}
@@ -108,7 +108,7 @@ private HashSet<Variable> Propagate(Cmd cmd, HashSet<Variable> liveVars)
108108
liveVars.ExceptWith(stateCmd.Locals);
109109
return liveVars;
110110
}
111-
throw new cce.UnreachableException();
111+
throw new Cce.UnreachableException();
112112
}
113113
}
114114

Source/Core/AST/Absy.cs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public virtual Absy Clone()
8585
{
8686
Contract.Ensures(Contract.Result<Absy>() != null);
8787
Absy /*!*/
88-
result = cce.NonNull((Absy /*!*/) this.MemberwiseClone());
88+
result = Cce.NonNull((Absy /*!*/) this.MemberwiseClone());
8989
result.UniqueId = System.Threading.Interlocked.Increment(ref CurrentAbsyNodeId); // BUGBUG??
9090

9191
if (InternalNumberedMetadata != null)
@@ -762,7 +762,7 @@ public NamedDeclaration(IToken tok, string name)
762762
[Pure]
763763
public override string ToString()
764764
{
765-
return cce.NonNull(Name);
765+
return Cce.NonNull(Name);
766766
}
767767

768768
public virtual bool MayRename => true;
@@ -1128,7 +1128,7 @@ public override void Typecheck(TypecheckingContext tc)
11281128

11291129
public static void ResolveTypeSynonyms(List<TypeSynonymDecl /*!*/> /*!*/ synonymDecls, ResolutionContext /*!*/ rc)
11301130
{
1131-
Contract.Requires(cce.NonNullElements(synonymDecls));
1131+
Contract.Requires(Cce.NonNullElements(synonymDecls));
11321132
Contract.Requires(rc != null);
11331133
// then discover all dependencies between type synonyms
11341134
IDictionary<TypeSynonymDecl /*!*/, List<TypeSynonymDecl /*!*/> /*!*/> /*!*/
@@ -1196,7 +1196,7 @@ private static void FindDependencies(Type /*!*/ type, List<TypeSynonymDecl /*!*/
11961196
ResolutionContext /*!*/ rc)
11971197
{
11981198
Contract.Requires(type != null);
1199-
Contract.Requires(cce.NonNullElements(deps));
1199+
Contract.Requires(Cce.NonNullElements(deps));
12001200
Contract.Requires(rc != null);
12011201
if (type.IsVariable || type.IsBasic)
12021202
{
@@ -1398,7 +1398,7 @@ public int Compare(object a, object b)
13981398
throw new ArgumentException("VariableComparer works only on objects of type Variable");
13991399
}
14001400

1401-
return cce.NonNull(A.Name).CompareTo(B.Name);
1401+
return Cce.NonNull(A.Name).CompareTo(B.Name);
14021402
}
14031403
}
14041404

@@ -1741,12 +1741,12 @@ public DeclWithFormals(IToken tok, string name, List<TypeVariable> typeParams,
17411741
}
17421742

17431743
protected DeclWithFormals(DeclWithFormals that)
1744-
: base(that.tok, cce.NonNull(that.Name))
1744+
: base(that.tok, Cce.NonNull(that.Name))
17451745
{
17461746
Contract.Requires(that != null);
17471747
this.TypeParameters = that.TypeParameters;
1748-
this.inParams = cce.NonNull(that.InParams);
1749-
this.outParams = cce.NonNull(that.OutParams);
1748+
this.inParams = Cce.NonNull(that.InParams);
1749+
this.outParams = Cce.NonNull(that.OutParams);
17501750
}
17511751

17521752
public byte[] MD5Checksum_;
@@ -1938,7 +1938,7 @@ protected void EmitSignature(TokenTextWriter stream, bool shortRet)
19381938
{
19391939
Contract.Assert(OutParams.Count == 1);
19401940
stream.Write(" : ");
1941-
cce.NonNull(OutParams[0]).TypedIdent.Type.Emit(stream);
1941+
Cce.NonNull(OutParams[0]).TypedIdent.Type.Emit(stream);
19421942
}
19431943
else if (OutParams.Count > 0)
19441944
{
@@ -2240,11 +2240,11 @@ public override void Typecheck(TypecheckingContext tc)
22402240
{
22412241
Contract.Assert(DefinitionBody == null);
22422242
Body.Typecheck(tc);
2243-
if (!cce.NonNull(Body.Type).Unify(cce.NonNull(OutParams[0]).TypedIdent.Type))
2243+
if (!Cce.NonNull(Body.Type).Unify(Cce.NonNull(OutParams[0]).TypedIdent.Type))
22442244
{
22452245
tc.Error(Body,
22462246
"function body with invalid type: {0} (expected: {1})",
2247-
Body.Type, cce.NonNull(OutParams[0]).TypedIdent.Type);
2247+
Body.Type, Cce.NonNull(OutParams[0]).TypedIdent.Type);
22482248
}
22492249
}
22502250
else if (DefinitionBody != null)
@@ -2253,11 +2253,11 @@ public override void Typecheck(TypecheckingContext tc)
22532253

22542254
// We are matching the type of the function body with output param, and not the type
22552255
// of DefinitionBody, which is always going to be bool (since it is of the form func_call == func_body)
2256-
if (!cce.NonNull(DefinitionBody.Args[1].Type).Unify(cce.NonNull(OutParams[0]).TypedIdent.Type))
2256+
if (!Cce.NonNull(DefinitionBody.Args[1].Type).Unify(Cce.NonNull(OutParams[0]).TypedIdent.Type))
22572257
{
22582258
tc.Error(DefinitionBody.Args[1],
22592259
"function body with invalid type: {0} (expected: {1})",
2260-
DefinitionBody.Args[1].Type, cce.NonNull(OutParams[0]).TypedIdent.Type);
2260+
DefinitionBody.Args[1].Type, Cce.NonNull(OutParams[0]).TypedIdent.Type);
22612261
}
22622262
}
22632263
}
@@ -3692,7 +3692,7 @@ public static class Emitter
36923692
public static void Emit(this List<Declaration /*!*/> /*!*/ decls, TokenTextWriter stream)
36933693
{
36943694
Contract.Requires(stream != null);
3695-
Contract.Requires(cce.NonNullElements(decls));
3695+
Contract.Requires(Cce.NonNullElements(decls));
36963696
bool first = true;
36973697
foreach (Declaration d in decls)
36983698
{
@@ -4041,7 +4041,7 @@ public static RE Transform(Block b)
40414041
Contract.Assume(g.labelTargets != null);
40424042
if (g.labelTargets.Count == 1)
40434043
{
4044-
return new Sequential(new AtomicRE(b), Transform(cce.NonNull(g.labelTargets[0])));
4044+
return new Sequential(new AtomicRE(b), Transform(Cce.NonNull(g.labelTargets[0])));
40454045
}
40464046
else
40474047
{
@@ -4060,7 +4060,7 @@ public static RE Transform(Block b)
40604060
else
40614061
{
40624062
Contract.Assume(false);
4063-
throw new cce.UnreachableException();
4063+
throw new Cce.UnreachableException();
40644064
}
40654065
}
40664066
}

0 commit comments

Comments
 (0)