summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorGravatar qadeer <unknown>2015-01-16 10:08:55 -0800
committerGravatar qadeer <unknown>2015-01-16 10:08:55 -0800
commit2358c4a57c4fa3bd21fe97f5000f321a78534694 (patch)
tree732513417183735e0c6b4b8998b236b13e1d5236 /Source
parent0fad1c4a0580045c012ea0b0aed480d954646bd1 (diff)
removed "layer" attribute from the desugared program
Diffstat (limited to 'Source')
-rw-r--r--Source/Concurrency/TypeCheck.cs47
-rw-r--r--Source/ExecutionEngine/ExecutionEngine.cs3
2 files changed, 48 insertions, 2 deletions
diff --git a/Source/Concurrency/TypeCheck.cs b/Source/Concurrency/TypeCheck.cs
index 13356aff..f2b2c0ca 100644
--- a/Source/Concurrency/TypeCheck.cs
+++ b/Source/Concurrency/TypeCheck.cs
@@ -213,6 +213,52 @@ namespace Microsoft.Boogie
}
}
+ public class LayerEraser : ReadOnlyVisitor
+ {
+ private QKeyValue RemoveLayerAttribute(QKeyValue iter)
+ {
+ if (iter == null) return null;
+ iter.Next = RemoveLayerAttribute(iter.Next);
+ return (iter.Key == "layer") ? iter.Next : iter;
+ }
+
+ public override Variable VisitVariable(Variable node)
+ {
+ node.Attributes = RemoveLayerAttribute(node.Attributes);
+ return base.VisitVariable(node);
+ }
+
+ public override Procedure VisitProcedure(Procedure node)
+ {
+ node.Attributes = RemoveLayerAttribute(node.Attributes);
+ return base.VisitProcedure(node);
+ }
+
+ public override Implementation VisitImplementation(Implementation node)
+ {
+ node.Attributes = RemoveLayerAttribute(node.Attributes);
+ return base.VisitImplementation(node);
+ }
+
+ public override Requires VisitRequires(Requires node)
+ {
+ node.Attributes = RemoveLayerAttribute(node.Attributes);
+ return base.VisitRequires(node);
+ }
+
+ public override Ensures VisitEnsures(Ensures node)
+ {
+ node.Attributes = RemoveLayerAttribute(node.Attributes);
+ return base.VisitEnsures(node);
+ }
+
+ public override Cmd VisitAssertCmd(AssertCmd node)
+ {
+ node.Attributes = RemoveLayerAttribute(node.Attributes);
+ return base.VisitAssertCmd(node);
+ }
+ }
+
public class MoverTypeChecker : ReadOnlyVisitor
{
CheckingContext checkingContext;
@@ -427,6 +473,7 @@ namespace Microsoft.Boogie
this.VisitProgram(program);
if (errorCount > 0) return;
YieldTypeChecker.PerformYieldSafeCheck(this);
+ new LayerEraser().VisitProgram(program);
}
public IEnumerable<Variable> SharedVariables
diff --git a/Source/ExecutionEngine/ExecutionEngine.cs b/Source/ExecutionEngine/ExecutionEngine.cs
index ae833dbf..92fc9780 100644
--- a/Source/ExecutionEngine/ExecutionEngine.cs
+++ b/Source/ExecutionEngine/ExecutionEngine.cs
@@ -509,8 +509,7 @@ namespace Microsoft.Boogie
if (CommandLineOptions.Clo.StratifiedInlining == 0)
{
Concurrency.Transform(linearTypeChecker, moverTypeChecker);
- var eraser = new LinearEraser();
- eraser.VisitProgram(program);
+ (new LinearEraser()).VisitProgram(program);
if (CommandLineOptions.Clo.OwickiGriesDesugaredOutputFile != null)
{
int oldPrintUnstructured = CommandLineOptions.Clo.PrintUnstructured;