From 5c6129cb734a16a0dbe10bd707942ba21741df09 Mon Sep 17 00:00:00 2001 From: tabarbe Date: Thu, 22 Jul 2010 21:26:15 +0000 Subject: Boogie: One last file to add for the port commit. Also, AssemblyInfo.ssc is no longer necessarry. --- Source/Provers/SMTLib/AssemblyInfo.ssc | 4 -- Source/Provers/SMTLib/cce.cs | 76 ++++++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+), 4 deletions(-) delete mode 100644 Source/Provers/SMTLib/AssemblyInfo.ssc create mode 100644 Source/Provers/SMTLib/cce.cs (limited to 'Source') diff --git a/Source/Provers/SMTLib/AssemblyInfo.ssc b/Source/Provers/SMTLib/AssemblyInfo.ssc deleted file mode 100644 index ed1d3451..00000000 --- a/Source/Provers/SMTLib/AssemblyInfo.ssc +++ /dev/null @@ -1,4 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -[assembly: AssemblyKeyFile("..\\..\\InterimKey.snk")] diff --git a/Source/Provers/SMTLib/cce.cs b/Source/Provers/SMTLib/cce.cs new file mode 100644 index 00000000..1229931c --- /dev/null +++ b/Source/Provers/SMTLib/cce.cs @@ -0,0 +1,76 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics.Contracts; +using System.Text; +using Microsoft.Boogie; + + /// + /// A class containing static methods to extend the functionality of Code Contracts + /// + +public static class cce { + [Pure] + public static T NonNull(T t) { + Contract.Assert(t != null); + return t; + } + [Pure] + public static bool NonNullElements(IEnumerable collection) { + return collection != null && Contract.ForAll(collection, c => c != null); + } + [Pure] + public static bool NonNullElements(IDictionary collection) { + return collection != null && NonNullElements(collection.Keys) && NonNullElements(collection.Values); + } + [Pure] + public static bool NonNullElements(VariableSeq collection) { + return collection != null && Contract.ForAll(0, collection.Length, i => collection[i] != null); + } + public class UnreachableException : Exception { + public UnreachableException() { + } + } + [Pure] + public static void BeginExpose(object o) { + } + [Pure] + public static void EndExpose() { + } + public static bool IsPeerConsistent(this object o) { + return true; + } + public static bool IsConsistent(this object o) { + return true; + } + public static bool IsExposable(this object o) { + return true; + } + public static class Owner { + [Pure] + public static bool Same(object o, object p) { + return true; + } + public static void AssignSame(object o, object p) { + } + public static object ElementProxy(object o) { + return o; + } + public static bool None(object o) { + return true; + } + } + internal static void LoopInvariant(bool p) { + Contract.Assert(p); + } +} + +public class PeerAttribute : System.Attribute { +} +public class RepAttribute : System.Attribute { +} +public class CapturedAttribute : System.Attribute { +} +public class NotDelayedAttribute : System.Attribute { +} +public class NoDefaultContractAttribute : System.Attribute { +} \ No newline at end of file -- cgit v1.2.3