Skip to content

Commit

Permalink
Enable optimization for more prover queries.
Browse files Browse the repository at this point in the history
  • Loading branch information
wuestholz committed Dec 27, 2015
1 parent eb64daf commit 1c16dc8
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions Source/Provers/SMTLib/ProverInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -421,13 +421,7 @@ public override void BeginCheck(string descriptiveName, VCExpr vc, ErrorHandler

SendThisVC(vcString);

if (options.Solver == SolverKind.Z3 && 0 < OptimizationRequests.Count)
{
foreach (var r in OptimizationRequests)
{
SendThisVC(r);
}
}
SendOptimizationRequests();

FlushLogFile();

Expand All @@ -442,6 +436,17 @@ public override void BeginCheck(string descriptiveName, VCExpr vc, ErrorHandler
FlushLogFile();
}

private void SendOptimizationRequests()
{
if (options.Solver == SolverKind.Z3 && 0 < OptimizationRequests.Count)
{
foreach (var r in OptimizationRequests)
{
SendThisVC(r);
}
}
}

public override void Reset(VCExpressionGenerator gen)
{
if (options.Solver == SolverKind.Z3)
Expand Down Expand Up @@ -2137,6 +2142,7 @@ private void FlushPushedAssertions()

public override void Assert(VCExpr vc, bool polarity)
{
OptimizationRequests.Clear();
string a = "";
if (polarity)
{
Expand All @@ -2148,6 +2154,7 @@ public override void Assert(VCExpr vc, bool polarity)
}
AssertAxioms();
SendThisVC(a);
SendOptimizationRequests();
}

public override void DefineMacro(Macro f, VCExpr vc) {
Expand Down

0 comments on commit 1c16dc8

Please sign in to comment.