mirror of
https://github.com/Z3Prover/z3
synced 2025-04-07 01:54:08 +00:00
allow using sls engine (for bit-vectors) with the new core. Examples z3 sat.smt=true tactic.default_tactic=smt /v:1 smt.sls.enable=true smt.bv.solver=0 /st C:\QF_BV_SAT\bench_10.smt2 z3 sat.smt=true tactic.default_tactic=smt /v:1 smt.sls.enable=true smt.bv.solver=2 /st C:\QF_BV_SAT\bench_10.smt2 z3 C:\QF_BV_SAT\bench_11100.smt2 sat.smt=true tactic.default_tactic=smt /v:1 smt.sls.enable=true smt.bv.solver=2 /st
77 lines
2.1 KiB
C++
77 lines
2.1 KiB
C++
/*++
|
|
Copyright (c) 2020 Microsoft Corporation
|
|
|
|
Module Name:
|
|
|
|
sls_solver
|
|
|
|
Abstract:
|
|
|
|
Interface to Concurrent SLS solver
|
|
|
|
Author:
|
|
|
|
Nikolaj Bjorner (nbjorner) 2024-02-21
|
|
|
|
--*/
|
|
#pragma once
|
|
|
|
#include <thread>
|
|
#include "util/rlimit.h"
|
|
#include "ast/sls/bv_sls.h"
|
|
#include "sat/smt/sat_th.h"
|
|
|
|
|
|
namespace euf {
|
|
class solver;
|
|
}
|
|
|
|
namespace sls {
|
|
|
|
class solver : public euf::th_euf_solver {
|
|
std::atomic<lbool> m_result;
|
|
std::atomic<bool> m_completed, m_has_units;
|
|
std::thread m_thread;
|
|
std::mutex m_mutex;
|
|
scoped_ptr<ast_manager> m_m;
|
|
scoped_ptr<bv::sls> m_bvsls;
|
|
model_ref m_model;
|
|
unsigned m_trail_lim = 0;
|
|
expr_ref_vector m_units;
|
|
statistics m_st;
|
|
|
|
void run_local_search();
|
|
void init_local_search();
|
|
void sample_local_search();
|
|
|
|
bool is_unit(expr*);
|
|
public:
|
|
solver(euf::solver& ctx);
|
|
~solver();
|
|
|
|
void simplify() override;
|
|
void init_search() override;
|
|
|
|
void push_core() override;
|
|
void pop_core(unsigned n) override;
|
|
|
|
sat::literal internalize(expr* e, bool sign, bool root) override { UNREACHABLE(); return sat::null_literal; }
|
|
void internalize(expr* e) override { UNREACHABLE(); }
|
|
th_solver* clone(euf::solver& ctx) override { return alloc(solver, ctx); }
|
|
void collect_statistics(statistics& st) const override { st.copy(m_st); }
|
|
|
|
model_ref get_model() { return m_model; }
|
|
|
|
void finalize() override;
|
|
|
|
bool unit_propagate() override;
|
|
void get_antecedents(sat::literal l, sat::ext_justification_idx idx, sat::literal_vector & r, bool probing) override { UNREACHABLE(); }
|
|
sat::check_result check() override;
|
|
std::ostream & display(std::ostream & out) const override { return out; }
|
|
std::ostream & display_justification(std::ostream & out, sat::ext_justification_idx idx) const override { UNREACHABLE(); return out; }
|
|
std::ostream & display_constraint(std::ostream & out, sat::ext_constraint_idx idx) const override { UNREACHABLE(); return out; }
|
|
|
|
};
|
|
|
|
}
|