Copyright (c) 2011 Microsoft Corporation
Module Name:
sat_probing.h
Abstract:
Probing (aka failed literal detection).
Author:
Leonardo de Moura (leonardo) 2011-06-04.
Revision History:
--*/
#pragma once
#include "sat/sat_types.h"
#include "sat/sat_big.h"
#include "util/params.h"
#include "util/statistics.h"
namespace sat {
class probing {
solver & s;
unsigned m_stopped_at;
literal_set m_assigned;
literal_vector m_to_assert;
int m_counter;
bool m_probing;
unsigned m_probing_limit;
bool m_probing_cache;
bool m_probing_binary;
unsigned long long m_probing_cache_limit;
unsigned m_num_assigned;
struct cache_entry {
bool m_available;
literal_vector m_lits;
cache_entry():m_available(false) {}
};
vector<cache_entry> m_cached_bins;
struct report;
void cache_bins(literal l, unsigned old_tr_sz);
bool try_lit(literal l, bool updt_cache);
void process(bool_var v);
void process_core(bool_var v);
svector<std::pair<literal, literal>> m_equivs;
big m_big;
bool implies(literal a, literal b);
public:
probing(solver & s, params_ref const & p);
bool operator()(bool force = false);
void reset_cache(literal l);
void updt_params(params_ref const & p);
static void collect_param_descrs(param_descrs & d);
void finalize();
void collect_statistics(statistics & st) const;
void reset_statistics();
literal_vector * cached_implied_lits(literal l) {
if (!m_probing_cache) return nullptr;
if (l.index() >= m_cached_bins.size()) return nullptr;
cache_entry & e = m_cached_bins[l.index()];
if (!e.m_available) return nullptr;
return &(e.m_lits);
}
void dec(unsigned c) { m_counter -= c; }
};
};