summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorGravatar Dietrich <dgeisler50@gmail.com>2015-04-17 12:29:04 -0600
committerGravatar Dietrich <dgeisler50@gmail.com>2015-04-17 12:29:04 -0600
commit02326abeca88715427d09f8995ee5ccfd9dab397 (patch)
tree4cc522fbd5732927f45863bf7b22d518a9807268 /Source/Core
parentea068f2bddb4be2eb4827f75418f46f52fd3a1f9 (diff)
adding references to the floating point type wherever references to the real type exist. This remains a work in progress
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/AbsyExpr.cs15
-rw-r--r--Source/Core/AbsyType.cs11
-rw-r--r--Source/Core/Core.csproj4
-rw-r--r--Source/Core/Parser.cs7
4 files changed, 33 insertions, 4 deletions
diff --git a/Source/Core/AbsyExpr.cs b/Source/Core/AbsyExpr.cs
index f3a943b8..00306a5e 100644
--- a/Source/Core/AbsyExpr.cs
+++ b/Source/Core/AbsyExpr.cs
@@ -552,6 +552,21 @@ namespace Microsoft.Boogie {
CachedHashCode = ComputeHashCode();
}
+ /// <summary>
+ /// Creates a literal expression for the floating point value "v".
+ /// </summary>
+ /// <param name="tok"></param>
+ /// <param name="v"></param>
+ public LiteralExpr(IToken/*!*/ tok, FP32 v, bool immutable = false)
+ : base(tok, immutable)
+ {
+ Contract.Requires(tok != null);
+ Val = v;
+ Type = Type.Float;
+ if (immutable)
+ CachedHashCode = ComputeHashCode();
+ }
+
[Pure]
[Reads(ReadsAttribute.Reads.Nothing)]
public override bool Equals(object obj) {
diff --git a/Source/Core/AbsyType.cs b/Source/Core/AbsyType.cs
index 97309155..ec8cd9e2 100644
--- a/Source/Core/AbsyType.cs
+++ b/Source/Core/AbsyType.cs
@@ -336,6 +336,7 @@ namespace Microsoft.Boogie {
public static readonly Type/*!*/ Int = new BasicType(SimpleType.Int);
public static readonly Type/*!*/ Real = new BasicType(SimpleType.Real);
+ public static readonly Type/*!*/ Float = new BasicType(SimpleType.Float);
public static readonly Type/*!*/ Bool = new BasicType(SimpleType.Bool);
private static BvType[] bvtypeCache;
@@ -871,6 +872,8 @@ namespace Microsoft.Boogie {
return "int";
case SimpleType.Real:
return "real";
+ case SimpleType.Float:
+ return "float";
case SimpleType.Bool:
return "bool";
}
@@ -993,6 +996,13 @@ namespace Microsoft.Boogie {
return this.T == SimpleType.Real;
}
}
+ public override bool IsFloat
+ {
+ get
+ {
+ return this.T == SimpleType.Float;
+ }
+ }
public override bool IsBool {
get {
return this.T == SimpleType.Bool;
@@ -3526,6 +3536,7 @@ Contract.Ensures(Contract.ValueAtReturn(out tpInstantiation) != null);
public enum SimpleType {
Int,
Real,
+ Float,
Bool
};
diff --git a/Source/Core/Core.csproj b/Source/Core/Core.csproj
index 27f4eea7..fbb23cfe 100644
--- a/Source/Core/Core.csproj
+++ b/Source/Core/Core.csproj
@@ -34,7 +34,7 @@
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
- <TargetFrameworkProfile Condition=" '$(OS)' == 'Windows_NT'" >Client</TargetFrameworkProfile>
+ <TargetFrameworkProfile Condition=" '$(OS)' == 'Windows_NT'">Client</TargetFrameworkProfile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@@ -186,7 +186,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Basetypes\Basetypes.csproj">
- <Project>{43DFAD18-3E35-4558-9BE2-CAFF6B5BA8A0}</Project>
+ <Project>{43dfad18-3e35-4558-9be2-caff6b5ba8a0}</Project>
<Name>Basetypes</Name>
</ProjectReference>
<ProjectReference Include="..\CodeContractsExtender\CodeContractsExtender.csproj">
diff --git a/Source/Core/Parser.cs b/Source/Core/Parser.cs
index 9a0bab51..1d4b38b8 100644
--- a/Source/Core/Parser.cs
+++ b/Source/Core/Parser.cs
@@ -664,8 +664,11 @@ private class BvBounds : Expr {
ty = new BasicType(t, SimpleType.Int);
} else if (la.kind == 15) {
Get();
- ty = new BasicType(t, SimpleType.Real);
- } else if (la.kind == 16) {
+ ty = new BasicType(t, SimpleType.Real);
+ } else if (la.kind == 112837) {
+ Get();
+ ty = new BasicType(t, SimpleType.Float);
+ } else if (la.kind == 16) {
Get();
ty = new BasicType(t, SimpleType.Bool);
} else if (la.kind == 9) {