mirror of
https://github.com/Z3Prover/z3
synced 2025-04-08 10:25:18 +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
|
@ -52,11 +52,12 @@ namespace sat {
|
|||
for (unsigned i = 0; i < r.size(); ++i) {
|
||||
literal u = r[i];
|
||||
for (unsigned j = i + 1; j < r.size(); ++j) {
|
||||
// add r[i] -> ~r[j]
|
||||
literal v = ~r[j];
|
||||
// add ~r[i] -> r[j]
|
||||
literal v = r[j];
|
||||
literal u = ~r[j];
|
||||
m_roots[v.index()] = false;
|
||||
m_dag[u.index()].push_back(v);
|
||||
// add r[j] -> ~r[i]
|
||||
// add ~r[j] -> r[i]
|
||||
v.neg();
|
||||
u.neg();
|
||||
m_roots[u.index()] = false;
|
||||
|
|
|
@ -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…
Reference in a new issue