mirror of
https://github.com/Z3Prover/z3
synced 2025-04-24 01:25:31 +00:00
fix bugs, add soft timeout to opt frontend
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
4f630f2a00
commit
a0b5f6937b
2 changed files with 11 additions and 3 deletions
|
@ -9,6 +9,8 @@ Copyright (c) 2015 Microsoft Corporation
|
|||
#include<time.h>
|
||||
#include "util/gparams.h"
|
||||
#include "util/timeout.h"
|
||||
#include "util/cancel_eh.h"
|
||||
#include "util/scoped_timer.h"
|
||||
#include "ast/ast_util.h"
|
||||
#include "ast/arith_decl_plugin.h"
|
||||
#include "ast/ast_pp.h"
|
||||
|
@ -101,6 +103,11 @@ static unsigned parse_opt(std::istream& in, opt_format f) {
|
|||
break;
|
||||
}
|
||||
try {
|
||||
cancel_eh<reslimit> eh(m.limit());
|
||||
unsigned timeout = std::stoi(gparams::get_value("timeout"));
|
||||
unsigned rlimit = std::stoi(gparams::get_value("rlimit"));
|
||||
scoped_timer timer(timeout, &eh);
|
||||
scoped_rlimit _rlimit(m.limit(), rlimit);
|
||||
lbool r = opt.optimize();
|
||||
switch (r) {
|
||||
case l_true: std::cout << "sat\n"; break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue