diff options
author | qadeer <unknown> | 2015-01-16 10:08:55 -0800 |
---|---|---|
committer | qadeer <unknown> | 2015-01-16 10:08:55 -0800 |
commit | 2358c4a57c4fa3bd21fe97f5000f321a78534694 (patch) | |
tree | 732513417183735e0c6b4b8998b236b13e1d5236 /Source/Concurrency | |
parent | 0fad1c4a0580045c012ea0b0aed480d954646bd1 (diff) |
removed "layer" attribute from the desugared program
Diffstat (limited to 'Source/Concurrency')
-rw-r--r-- | Source/Concurrency/TypeCheck.cs | 47 |
1 files changed, 47 insertions, 0 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
|