summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Valentin Wüstholz <wuestholz@gmail.com>2015-05-22 13:43:51 +0200
committerGravatar Valentin Wüstholz <wuestholz@gmail.com>2015-05-22 13:43:51 +0200
commit846dd8fd2c345e20e3d85d4a07d73ddfab5ac45c (patch)
treeba1bb815362870d82ca11e038da5cb2e4c9ad903
parent53cd63deeb418ce49c7c26f7613cb83e8e77e919 (diff)
Improve support for diagnosing timeouts.
-rw-r--r--Source/Provers/SMTLib/ProverInterface.cs29
1 files changed, 16 insertions, 13 deletions
diff --git a/Source/Provers/SMTLib/ProverInterface.cs b/Source/Provers/SMTLib/ProverInterface.cs
index 594f2509..e09eabcb 100644
--- a/Source/Provers/SMTLib/ProverInterface.cs
+++ b/Source/Provers/SMTLib/ProverInterface.cs
@@ -1269,28 +1269,24 @@ namespace Microsoft.Boogie.SMTLib
SendThisVC("; begin timeout diagnostics");
var unverified = new SortedSet<int>(ctx.TimeoutDiagnosticIDToAssertion.Keys);
- var lastCnt = unverified.Count + 1;
- var mod = 2;
+ var lastCnt = 0;
var timeLimit = options.TimeLimit;
var timeLimitFactor = 1;
+ var frac = 2;
while (true)
{
- // TODO(wuestholz): Try out different ways for splitting up the work.
- var split0 = new SortedSet<int>(unverified.Where((val, idx) => idx % mod == 0));
- var split1 = new SortedSet<int>(unverified.Except(split0));
-
int cnt = unverified.Count;
-
if (cnt == 0)
{
result = Outcome.Valid;
break;
}
- else if (lastCnt == cnt)
+
+ if (lastCnt == cnt)
{
- if (mod < cnt)
+ if ((2 * frac) < cnt)
{
- mod++;
+ frac *= 2;
}
else if (timeLimitFactor <= 3 && 0 < timeLimit)
{
@@ -1312,13 +1308,19 @@ namespace Microsoft.Boogie.SMTLib
}
else
{
- mod = 2;
+ frac = 2;
}
lastCnt = cnt;
+ // TODO(wuestholz): Try out different ways for splitting up the work (e.g., randomly).
+ var cnt0 = cnt / frac;
+ var split0 = new SortedSet<int>(unverified.Where((val, idx) => idx < cnt0));
+ var split1 = new SortedSet<int>(unverified.Except(split0));
+
if (0 < split0.Count)
{
- var result0 = CheckSplit(split0, ref popLater, timeLimitFactor * timeLimit);
+ var stl = 0 < timeLimit ? split0.Count * ((timeLimit / cnt) + 1) : timeLimit;
+ var result0 = CheckSplit(split0, ref popLater, timeLimitFactor * stl);
if (result0 == Outcome.Valid)
{
unverified.ExceptWith(split0);
@@ -1332,7 +1334,8 @@ namespace Microsoft.Boogie.SMTLib
if (0 < split1.Count)
{
- var result1 = CheckSplit(split1, ref popLater, timeLimitFactor * timeLimit);
+ var stl = 0 < timeLimit ? split1.Count * ((timeLimit / cnt) + 1) : timeLimit;
+ var result1 = CheckSplit(split1, ref popLater, timeLimitFactor * stl);
if (result1 == Outcome.Valid)
{
unverified.ExceptWith(split1);