Skip to content

Commit d2b3855

Browse files
Rename cce to Cce
1 parent 775dbf2 commit d2b3855

File tree

93 files changed

+1042
-1042
lines changed

Some content is hidden

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

93 files changed

+1042
-1042
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
@@ -12,7 +12,7 @@ public class OnlyBoogie
1212
{
1313
public static int Main(string[] args)
1414
{
15-
Contract.Requires(cce.NonNullElements(args));
15+
Contract.Requires(Cce.NonNullElements(args));
1616

1717
var options = new CommandLineOptions(Console.Out, new ConsolePrinter())
1818
{

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
@@ -397,7 +397,7 @@ private List<AssertCmd> HoistAsserts(Implementation impl, ConcurrencyOptions opt
397397
}
398398
else
399399
{
400-
throw new cce.UnreachableException();
400+
throw new Cce.UnreachableException();
401401
}
402402
}
403403
return wlps[impl.Blocks[0]].Select(assertCmd => Forall(impl.LocVars.Union(impl.OutParams), assertCmd)).ToList();
@@ -442,7 +442,7 @@ private List<AssertCmd> HoistAsserts(List<Cmd> cmds, List<AssertCmd> postconditi
442442
}
443443
else
444444
{
445-
throw new cce.UnreachableException();
445+
throw new Cce.UnreachableException();
446446
}
447447
}
448448
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)
@@ -697,7 +697,7 @@ public NamedDeclaration(IToken tok, string name)
697697
[Pure]
698698
public override string ToString()
699699
{
700-
return cce.NonNull(Name);
700+
return Cce.NonNull(Name);
701701
}
702702
}
703703

@@ -1061,7 +1061,7 @@ public override void Typecheck(TypecheckingContext tc)
10611061

10621062
public static void ResolveTypeSynonyms(List<TypeSynonymDecl /*!*/> /*!*/ synonymDecls, ResolutionContext /*!*/ rc)
10631063
{
1064-
Contract.Requires(cce.NonNullElements(synonymDecls));
1064+
Contract.Requires(Cce.NonNullElements(synonymDecls));
10651065
Contract.Requires(rc != null);
10661066
// then discover all dependencies between type synonyms
10671067
IDictionary<TypeSynonymDecl /*!*/, List<TypeSynonymDecl /*!*/> /*!*/> /*!*/
@@ -1129,7 +1129,7 @@ private static void FindDependencies(Type /*!*/ type, List<TypeSynonymDecl /*!*/
11291129
ResolutionContext /*!*/ rc)
11301130
{
11311131
Contract.Requires(type != null);
1132-
Contract.Requires(cce.NonNullElements(deps));
1132+
Contract.Requires(Cce.NonNullElements(deps));
11331133
Contract.Requires(rc != null);
11341134
if (type.IsVariable || type.IsBasic)
11351135
{
@@ -1331,7 +1331,7 @@ public int Compare(object a, object b)
13311331
throw new ArgumentException("VariableComparer works only on objects of type Variable");
13321332
}
13331333

1334-
return cce.NonNull(A.Name).CompareTo(B.Name);
1334+
return Cce.NonNull(A.Name).CompareTo(B.Name);
13351335
}
13361336
}
13371337

@@ -1674,12 +1674,12 @@ public DeclWithFormals(IToken tok, string name, List<TypeVariable> typeParams,
16741674
}
16751675

16761676
protected DeclWithFormals(DeclWithFormals that)
1677-
: base(that.tok, cce.NonNull(that.Name))
1677+
: base(that.tok, Cce.NonNull(that.Name))
16781678
{
16791679
Contract.Requires(that != null);
16801680
this.TypeParameters = that.TypeParameters;
1681-
this.inParams = cce.NonNull(that.InParams);
1682-
this.outParams = cce.NonNull(that.OutParams);
1681+
this.inParams = Cce.NonNull(that.InParams);
1682+
this.outParams = Cce.NonNull(that.OutParams);
16831683
}
16841684

16851685
public byte[] MD5Checksum_;
@@ -1871,7 +1871,7 @@ protected void EmitSignature(TokenTextWriter stream, bool shortRet)
18711871
{
18721872
Contract.Assert(OutParams.Count == 1);
18731873
stream.Write(" : ");
1874-
cce.NonNull(OutParams[0]).TypedIdent.Type.Emit(stream);
1874+
Cce.NonNull(OutParams[0]).TypedIdent.Type.Emit(stream);
18751875
}
18761876
else if (OutParams.Count > 0)
18771877
{
@@ -2172,11 +2172,11 @@ public override void Typecheck(TypecheckingContext tc)
21722172
{
21732173
Contract.Assert(DefinitionBody == null);
21742174
Body.Typecheck(tc);
2175-
if (!cce.NonNull(Body.Type).Unify(cce.NonNull(OutParams[0]).TypedIdent.Type))
2175+
if (!Cce.NonNull(Body.Type).Unify(Cce.NonNull(OutParams[0]).TypedIdent.Type))
21762176
{
21772177
tc.Error(Body,
21782178
"function body with invalid type: {0} (expected: {1})",
2179-
Body.Type, cce.NonNull(OutParams[0]).TypedIdent.Type);
2179+
Body.Type, Cce.NonNull(OutParams[0]).TypedIdent.Type);
21802180
}
21812181
}
21822182
else if (DefinitionBody != null)
@@ -2185,11 +2185,11 @@ public override void Typecheck(TypecheckingContext tc)
21852185

21862186
// We are matching the type of the function body with output param, and not the type
21872187
// of DefinitionBody, which is always going to be bool (since it is of the form func_call == func_body)
2188-
if (!cce.NonNull(DefinitionBody.Args[1].Type).Unify(cce.NonNull(OutParams[0]).TypedIdent.Type))
2188+
if (!Cce.NonNull(DefinitionBody.Args[1].Type).Unify(Cce.NonNull(OutParams[0]).TypedIdent.Type))
21892189
{
21902190
tc.Error(DefinitionBody.Args[1],
21912191
"function body with invalid type: {0} (expected: {1})",
2192-
DefinitionBody.Args[1].Type, cce.NonNull(OutParams[0]).TypedIdent.Type);
2192+
DefinitionBody.Args[1].Type, Cce.NonNull(OutParams[0]).TypedIdent.Type);
21932193
}
21942194
}
21952195
}
@@ -3630,7 +3630,7 @@ public static class Emitter
36303630
public static void Emit(this List<Declaration /*!*/> /*!*/ decls, TokenTextWriter stream)
36313631
{
36323632
Contract.Requires(stream != null);
3633-
Contract.Requires(cce.NonNullElements(decls));
3633+
Contract.Requires(Cce.NonNullElements(decls));
36343634
bool first = true;
36353635
foreach (Declaration d in decls)
36363636
{
@@ -3978,7 +3978,7 @@ public static RE Transform(Block b)
39783978
Contract.Assume(g.LabelTargets != null);
39793979
if (g.LabelTargets.Count == 1)
39803980
{
3981-
return new Sequential(new AtomicRE(b), Transform(cce.NonNull(g.LabelTargets[0])));
3981+
return new Sequential(new AtomicRE(b), Transform(Cce.NonNull(g.LabelTargets[0])));
39823982
}
39833983
else
39843984
{
@@ -3997,7 +3997,7 @@ public static RE Transform(Block b)
39973997
else
39983998
{
39993999
Contract.Assume(false);
4000-
throw new cce.UnreachableException();
4000+
throw new Cce.UnreachableException();
40014001
}
40024002
}
40034003
}

Source/Core/AST/AbsyQuant.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,7 @@ public override Expr VisitNAryExpr(NAryExpr node)
691691
//Contract.Requires(node != null);
692692
Contract.Ensures(Contract.Result<Expr>() != null);
693693
FunctionCall fn = node.Fun as FunctionCall;
694-
if (fn != null && cce.NonNull(fn.Func).NeverTrigger)
694+
if (fn != null && Cce.NonNull(fn.Func).NeverTrigger)
695695
{
696696
parent.Triggers = new Trigger(fn.Func.tok, false, new List<Expr> {node}, parent.Triggers);
697697
}

0 commit comments

Comments
 (0)