summaryrefslogtreecommitdiff
path: root/Source/Provers/SMTLib/SMTLibProcess.cs
diff options
context:
space:
mode:
authorGravatar MichalMoskal <unknown>2011-02-17 19:00:30 +0000
committerGravatar MichalMoskal <unknown>2011-02-17 19:00:30 +0000
commit6b85a0f0d4f88b6ad57812175354acf3a2947a0e (patch)
treec214ed7a953471eaf2689a6b7517cd0ead5fb9bf /Source/Provers/SMTLib/SMTLibProcess.cs
parent12027267b93833110c0a1a044e1bc80ebf6e7b29 (diff)
Provide /p: as the short form of /proverOpt:.
Add /p:O:<name>=<value> and /p:C:<solver-argument> prover options in SMT. Add default Z3 options when using Z3.
Diffstat (limited to 'Source/Provers/SMTLib/SMTLibProcess.cs')
-rw-r--r--Source/Provers/SMTLib/SMTLibProcess.cs27
1 files changed, 18 insertions, 9 deletions
diff --git a/Source/Provers/SMTLib/SMTLibProcess.cs b/Source/Provers/SMTLib/SMTLibProcess.cs
index 8cc67256..b23fddbb 100644
--- a/Source/Provers/SMTLib/SMTLibProcess.cs
+++ b/Source/Provers/SMTLib/SMTLibProcess.cs
@@ -71,7 +71,7 @@ namespace Microsoft.Boogie.SMTLib
public bool IsPong(SExpr sx)
{
- return sx.Name == ":name";
+ return sx != null && sx.Name == ":name";
}
public void PingPong()
@@ -79,6 +79,11 @@ namespace Microsoft.Boogie.SMTLib
Ping();
while (true) {
var sx = GetProverResponse();
+ if (sx == null) {
+ ErrorHandler("Prover died");
+ return;
+ }
+
if (IsPong(sx))
return;
else
@@ -261,21 +266,25 @@ namespace Microsoft.Boogie.SMTLib
void prover_OutputDataReceived(object sender, DataReceivedEventArgs e)
{
lock (this) {
- if (options.Verbosity >= 2 || (options.Verbosity >= 1 && !e.Data.StartsWith("(:name"))) {
- Console.WriteLine("[SMT-OUT] {0}", e.Data);
+ if (e.Data != null) {
+ if (options.Verbosity >= 2 || (options.Verbosity >= 1 && !e.Data.StartsWith("(:name "))) {
+ Console.WriteLine("[SMT-OUT] {0}", e.Data);
+ }
+ proverOutput.Enqueue(e.Data);
+ Monitor.Pulse(this);
}
- proverOutput.Enqueue(e.Data);
- Monitor.Pulse(this);
}
}
void prover_ErrorDataReceived(object sender, DataReceivedEventArgs e)
{
lock (this) {
- if (options.Verbosity >= 1)
- Console.WriteLine("[SMT-ERR] {0}", e.Data);
- proverErrors.Enqueue(e.Data);
- Monitor.Pulse(this);
+ if (e.Data != null) {
+ if (options.Verbosity >= 1)
+ Console.WriteLine("[SMT-ERR] {0}", e.Data);
+ proverErrors.Enqueue(e.Data);
+ Monitor.Pulse(this);
+ }
}
}
#endregion