summaryrefslogtreecommitdiff
path: root/Source/Provers
diff options
context:
space:
mode:
authorGravatar Unknown <qadeer@FAIZ-AHMED-FAIZ.redmond.corp.microsoft.com>2012-12-28 07:38:50 -0800
committerGravatar Unknown <qadeer@FAIZ-AHMED-FAIZ.redmond.corp.microsoft.com>2012-12-28 07:38:50 -0800
commitfe14d9b1fd7bd816f91f58e44314b5c0772227cb (patch)
treed42dd62801c7f7d617babe83082ed4308c7df995 /Source/Provers
parent44542347498f3dfed6cffb3c17988dbfeb9e93ea (diff)
extended Evaluate to handle more types
Diffstat (limited to 'Source/Provers')
-rw-r--r--Source/Provers/SMTLib/ProverInterface.cs12
1 files changed, 8 insertions, 4 deletions
diff --git a/Source/Provers/SMTLib/ProverInterface.cs b/Source/Provers/SMTLib/ProverInterface.cs
index ec91dcbc..ca0e811b 100644
--- a/Source/Provers/SMTLib/ProverInterface.cs
+++ b/Source/Provers/SMTLib/ProverInterface.cs
@@ -816,12 +816,12 @@ namespace Microsoft.Boogie.SMTLib
SendThisVC("(set-option :SOFT_TIMEOUT " + ms.ToString() + ")\n");
}
- public override int Evaluate(VCExpr expr)
+ public override object Evaluate(VCExpr expr)
{
string vcString = VCExpr2String(expr, 1);
SendThisVC("(get-value (" + vcString + "))");
var resp = Process.GetProverResponse();
- if (resp == null) throw new VCExprEvaluationException();
+ if (resp == null) throw new VCExprEvaluationException();
if (!(resp.Name == "" && resp.ArgCount == 1)) throw new VCExprEvaluationException();
resp = resp.Arguments[0];
if (resp.Name == "")
@@ -842,8 +842,12 @@ namespace Microsoft.Boogie.SMTLib
}
if (resp.ArgCount != 0)
throw new VCExprEvaluationException();
- var v = int.Parse(resp.Name);
- return v;
+ if (expr.Type.Equals(Boogie.Type.Bool))
+ return bool.Parse(resp.Name);
+ else if (expr.Type.Equals(Boogie.Type.Int))
+ return int.Parse(resp.Name);
+ else
+ return resp.Name;
}
/// <summary>