summaryrefslogtreecommitdiff
path: root/Source/Provers/SMTLib/SMTLibLineariser.cs
diff options
context:
space:
mode:
authorGravatar qadeer <qadeer@microsoft.com>2011-10-05 19:11:23 -0700
committerGravatar qadeer <qadeer@microsoft.com>2011-10-05 19:11:23 -0700
commit696796e1dcea137ee9b5c270b233892dd3267155 (patch)
treed7886f80fd90265c688585c6a05508d860078381 /Source/Provers/SMTLib/SMTLibLineariser.cs
parentf878eae7ec3b85cc6b66040def0993c8bcc1e28c (diff)
implementing datatypes
Diffstat (limited to 'Source/Provers/SMTLib/SMTLibLineariser.cs')
-rw-r--r--Source/Provers/SMTLib/SMTLibLineariser.cs12
1 files changed, 12 insertions, 0 deletions
diff --git a/Source/Provers/SMTLib/SMTLibLineariser.cs b/Source/Provers/SMTLib/SMTLibLineariser.cs
index 36df38e3..f008bb88 100644
--- a/Source/Provers/SMTLib/SMTLibLineariser.cs
+++ b/Source/Provers/SMTLib/SMTLibLineariser.cs
@@ -655,14 +655,26 @@ namespace Microsoft.Boogie.SMTLib
return true;
}
+ private string ExtractDatatypeSelector(Function func) {
+ if (QKeyValue.FindBoolAttribute(func.Attributes, "selector")) {
+ return func.Name.Remove(func.Name.IndexOf('#'));
+ }
+ else {
+ return null;
+ }
+ }
+
public bool VisitBoogieFunctionOp(VCExprNAry node, LineariserOptions options) {
VCExprBoogieFunctionOp op = (VCExprBoogieFunctionOp)node.Op;
Contract.Assert(op != null);
string printedName;
var builtin = ExtractBuiltin(op.Func);
+ var datatype = ExtractDatatypeSelector(op.Func);
if (builtin != null)
printedName = builtin;
+ else if (datatype != null)
+ printedName = datatype;
else
printedName = ExprLineariser.Namer.GetQuotedName(op.Func, op.Func.Name);
Contract.Assert(printedName != null);