diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2011-04-08 15:35:59 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2011-04-08 15:35:59 -0700 |
commit | 5222f382af8c6d9174359da92f44abee4afa0331 (patch) | |
tree | f88b424d57e36b20f03244778043b13e91c1c2d6 /src/sat | |
parent | 234fb8c7e323679d5ce9daa161bb1a0bba07a96b (diff) | |
download | abc-5222f382af8c6d9174359da92f44abee4afa0331.tar.gz abc-5222f382af8c6d9174359da92f44abee4afa0331.tar.bz2 abc-5222f382af8c6d9174359da92f44abee4afa0331.zip |
Adding SAT-solver-level timeouts to the BMC engines.
Diffstat (limited to 'src/sat')
-rw-r--r-- | src/sat/bsat/satSolver.c | 2 | ||||
-rw-r--r-- | src/sat/bsat/satSolver.h | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/src/sat/bsat/satSolver.c b/src/sat/bsat/satSolver.c index aa8c7f08..de186047 100644 --- a/src/sat/bsat/satSolver.c +++ b/src/sat/bsat/satSolver.c @@ -1521,6 +1521,8 @@ int sat_solver_solve(sat_solver* s, lit* begin, lit* end, ABC_INT64_T nConfLimit // printf( "Reached the limit on the number of implications (%d).\n", s->nInsLimit ); break; } + if ( s->nRuntimeLimit && clock() > s->nRuntimeLimit ) + break; } if (s->verbosity >= 1) printf("==============================================================================\n"); diff --git a/src/sat/bsat/satSolver.h b/src/sat/bsat/satSolver.h index 2b148328..a33c7240 100644 --- a/src/sat/bsat/satSolver.h +++ b/src/sat/bsat/satSolver.h @@ -164,6 +164,7 @@ struct sat_solver_t ABC_INT64_T nConfLimit; // external limit on the number of conflicts ABC_INT64_T nInsLimit; // external limit on the number of implications + int nRuntimeLimit; // external limit on runtime veci act_vars; // variables whose activity has changed double* factors; // the activity factors @@ -220,7 +221,12 @@ static int sat_solver_final(sat_solver* s, int ** ppArray) return s->conf_final.size; } - +static int sat_solver_set_runtime_limit(sat_solver* s, int Limit) +{ + int nRuntimeLimit = s->nRuntimeLimit; + s->nRuntimeLimit = Limit; + return nRuntimeLimit; +} ABC_NAMESPACE_HEADER_END |