diff options
author | Dan Liew <daniel.liew@imperial.ac.uk> | 2015-01-25 20:39:09 +0000 |
---|---|---|
committer | Dan Liew <daniel.liew@imperial.ac.uk> | 2015-01-25 20:39:09 +0000 |
commit | f11b44a267d7b77feccf33dd1d6d3a2ee712458e (patch) | |
tree | d4dc13f793f13f5c36e19592497ac82c4433475f /Source/Core | |
parent | 458be604ebe9f9ed93a2b8af4c424493f119cd8c (diff) |
Change the return type of StandardVisitor.VisitBvExtractExpr() from
BvExtractExpr to Expr. Enforcing the return type be BvExtractExpr is
too restrictive. For example it prevents anyone from implementing
a visitor that does constant folding of an Expr tree.
There is precedence for this. For example VisitNAryExpr() returns
an Expr not an NAryExpr.
Unfortunately this a breaking API change so anyone who subclasses
the StandardVisitor (or one of its sub classes) and overrides this
method will get compilation errors until they change the return type.
a visitor that does constant folding of an Expr tree
Diffstat (limited to 'Source/Core')
-rw-r--r-- | Source/Core/Duplicator.cs | 2 | ||||
-rw-r--r-- | Source/Core/StandardVisitor.cs | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/Source/Core/Duplicator.cs b/Source/Core/Duplicator.cs index fbe36feb..da2b5b95 100644 --- a/Source/Core/Duplicator.cs +++ b/Source/Core/Duplicator.cs @@ -81,7 +81,7 @@ namespace Microsoft.Boogie { Contract.Ensures(Contract.Result<BvConcatExpr>() != null);
return base.VisitBvConcatExpr((BvConcatExpr) node.Clone());
}
- public override BvExtractExpr VisitBvExtractExpr(BvExtractExpr node) {
+ public override Expr VisitBvExtractExpr(BvExtractExpr node) {
Contract.Ensures(Contract.Result<BvExtractExpr>() != null);
return base.VisitBvExtractExpr((BvExtractExpr) node.Clone());
}
diff --git a/Source/Core/StandardVisitor.cs b/Source/Core/StandardVisitor.cs index 4c167953..a50acdba 100644 --- a/Source/Core/StandardVisitor.cs +++ b/Source/Core/StandardVisitor.cs @@ -245,7 +245,7 @@ namespace Microsoft.Boogie { node = (ExistsExpr)this.VisitQuantifierExpr(node);
return node;
}
- public virtual BvExtractExpr VisitBvExtractExpr(BvExtractExpr node) {
+ public virtual Expr VisitBvExtractExpr(BvExtractExpr node) {
Contract.Requires(node != null);
Contract.Ensures(Contract.Result<BvExtractExpr>() != null);
node.Bitvector = this.VisitExpr(node.Bitvector);
@@ -810,7 +810,7 @@ namespace Microsoft.Boogie { Contract.Ensures(Contract.Result<ExistsExpr>() == node);
return (ExistsExpr)this.VisitQuantifierExpr(node);
}
- public override BvExtractExpr VisitBvExtractExpr(BvExtractExpr node)
+ public override Expr VisitBvExtractExpr(BvExtractExpr node)
{
Contract.Ensures(Contract.Result<BvExtractExpr>() == node);
this.VisitExpr(node.Bitvector);
|