diff options
author | 0biha <unknown> | 2014-12-09 18:17:32 +0100 |
---|---|---|
committer | 0biha <unknown> | 2014-12-09 18:17:32 +0100 |
commit | 419a8f5fec1ba66266a32434618c85429b1427cf (patch) | |
tree | b4066b988ca1c9b2cac26b346e07db14a209a4c2 /Source/Core | |
parent | 4b63f8d174c95abd850b0565aae9b779631e1a97 (diff) |
Made expression invariant of class 'Axiom' robust by changing the design (replaced public field by getter/setter).
Diffstat (limited to 'Source/Core')
-rw-r--r-- | Source/Core/Absy.cs | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/Source/Core/Absy.cs b/Source/Core/Absy.cs index 9a17f50b..7d4bc547 100644 --- a/Source/Core/Absy.cs +++ b/Source/Core/Absy.cs @@ -1449,10 +1449,22 @@ namespace Microsoft.Boogie { }
public class Axiom : Declaration {
- public Expr/*!*/ Expr;
+ private Expr/*!*/ expression;
+
+ public Expr Expr {
+ get {
+ Contract.Ensures(Contract.Result<Expr>() != null);
+ return this.expression;
+ }
+ set {
+ Contract.Requires(value != null);
+ this.expression = value;
+ }
+ }
+
[ContractInvariantMethod]
void ExprInvariant() {
- Contract.Invariant(Expr != null);
+ Contract.Invariant(this.expression != null);
}
public string Comment;
@@ -1467,7 +1479,7 @@ namespace Microsoft.Boogie { : base(tok) {
Contract.Requires(tok != null);
Contract.Requires(expr != null);
- Expr = expr;
+ this.expression = expr;
Comment = comment;
}
|