Skip to content

Fix test-gen-support win32 compilation #1045

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/solvers/prop/prop.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Author: Daniel Kroening, [email protected]

// decision procedure wrapper for boolean propositional logics

#include <stdint.h>

#include <util/message.h>
#include <util/threeval.h>

Expand Down
22 changes: 21 additions & 1 deletion src/solvers/sat/satcheck_minisat2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,17 @@ void satcheck_minisat2_baset<T>::lcnf(const bvt &bv)
clause_counter++;
}

#ifndef _WIN32

static Minisat::Solver *solver_to_interrupt=nullptr;

static void interrupt_solver(int signum)
{
solver_to_interrupt->interrupt();
}

#endif

template<typename T>
propt::resultt satcheck_minisat2_baset<T>::prop_solve()
{
Expand Down Expand Up @@ -161,6 +165,10 @@ propt::resultt satcheck_minisat2_baset<T>::prop_solve()
Minisat::vec<Minisat::Lit> solver_assumptions;
convert(assumptions, solver_assumptions);

using Minisat::lbool;

#ifndef _WIN32

void (*old_handler)(int)=SIG_ERR;

if(time_limit_seconds!=0)
Expand All @@ -173,7 +181,6 @@ propt::resultt satcheck_minisat2_baset<T>::prop_solve()
alarm(time_limit_seconds);
}

using Minisat::lbool;
lbool solver_result=solver->solveLimited(solver_assumptions);

if(old_handler!=SIG_ERR)
Expand All @@ -183,6 +190,19 @@ propt::resultt satcheck_minisat2_baset<T>::prop_solve()
solver_to_interrupt=solver;
}

#else // _WIN32

if(time_limit_seconds!=0)
{
messaget::warning() <<
"Time limit ignored (not supported on Win32 yet)" << messaget::eom;
}

lbool solver_result=
solver->solve(solver_assumptions) ? l_True : l_False;

#endif

if(solver_result==l_True)
{
messaget::status() <<
Expand Down