summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar qadeer <unknown>2013-07-29 16:19:29 -0700
committerGravatar qadeer <unknown>2013-07-29 16:19:29 -0700
commit5b5c96d758359b03810a3f751576246ec2086ae4 (patch)
treeb6cdda5a9d1c8c296563a8f4b1c742308e92b26c
parent6f10dcf53d5fc8858ff3b088c294d66938ea050f (diff)
added types for all the expressions being added to calls
-rw-r--r--Source/Core/LinearSets.cs8
-rw-r--r--Test/linear/Answer4
-rw-r--r--Test/linear/f3.bpl8
-rw-r--r--Test/linear/runtest.bat2
4 files changed, 19 insertions, 3 deletions
diff --git a/Source/Core/LinearSets.cs b/Source/Core/LinearSets.cs
index c8815575..6ceacdf7 100644
--- a/Source/Core/LinearSets.cs
+++ b/Source/Core/LinearSets.cs
@@ -445,14 +445,18 @@ namespace Microsoft.Boogie
Dictionary<string, Expr> domainNameToExpr = new Dictionary<string, Expr>();
foreach (var domainName in linearDomains.Keys)
{
- domainNameToExpr[domainName] = new IdentifierExpr(Token.NoToken, domainNameToInputVar[domainName]);
+ var expr = new IdentifierExpr(Token.NoToken, domainNameToInputVar[domainName]);
+ expr.Type = new MapType(Token.NoToken, new List<TypeVariable>(), new List<Type> { linearDomains[domainName].elementType }, Type.Bool);
+ domainNameToExpr[domainName] = expr;
}
foreach (Variable v in availableLocalLinearVars[callCmd])
{
var domainName = FindDomainName(v);
var domain = linearDomains[domainName];
IdentifierExpr ie = new IdentifierExpr(Token.NoToken, v);
- domainNameToExpr[domainName] = new NAryExpr(Token.NoToken, new FunctionCall(domain.mapOrBool), new List<Expr> { v.TypedIdent.Type is MapType ? ie : Singleton(ie, domainName), domainNameToExpr[domainName] });
+ var expr = new NAryExpr(Token.NoToken, new FunctionCall(domain.mapOrBool), new List<Expr> { v.TypedIdent.Type is MapType ? ie : Singleton(ie, domainName), domainNameToExpr[domainName] });
+ expr.Type = new MapType(Token.NoToken, new List<TypeVariable>(), new List<Type> { linearDomains[domainName].elementType }, Type.Bool);
+ domainNameToExpr[domainName] = expr;
}
foreach (var domainName in linearDomains.Keys)
{
diff --git a/Test/linear/Answer b/Test/linear/Answer
index 678579ea..e6df2e87 100644
--- a/Test/linear/Answer
+++ b/Test/linear/Answer
@@ -42,3 +42,7 @@ Execution trace:
f2.bpl(15,4): anon0
Boogie program verifier finished with 0 verified, 1 error
+
+-------------------- f3.bpl --------------------
+
+Boogie program verifier finished with 2 verified, 0 errors
diff --git a/Test/linear/f3.bpl b/Test/linear/f3.bpl
new file mode 100644
index 00000000..a375338c
--- /dev/null
+++ b/Test/linear/f3.bpl
@@ -0,0 +1,8 @@
+procedure A() {}
+
+procedure B({:linear ""} tid:int) returns({:linear ""} tid':int)
+{
+ tid' := tid;
+ call A();
+}
+
diff --git a/Test/linear/runtest.bat b/Test/linear/runtest.bat
index 3ccd660c..c8d3dc62 100644
--- a/Test/linear/runtest.bat
+++ b/Test/linear/runtest.bat
@@ -9,7 +9,7 @@ for %%f in (typecheck.bpl) do (
%BGEXE% %* /nologo /noinfer /typeEncoding:m /useArrayTheory %%f
)
-for %%f in (list.bpl allocator.bpl f1.bpl f2.bpl) do (
+for %%f in (list.bpl allocator.bpl f1.bpl f2.bpl f3.bpl) do (
echo.
echo -------------------- %%f --------------------
%BGEXE% %* /nologo /noinfer /typeEncoding:m /useArrayTheory /doModSetAnalysis %%f