mirror of
https://github.com/Z3Prover/z3
synced 2025-09-09 11:11:25 +00:00
Cleanup fixedpoint options
Replace pdr options with spacer Repace fixedpoint module with fp
This commit is contained in:
parent
619f681d28
commit
9109968e55
23 changed files with 344 additions and 353 deletions
|
@ -18,5 +18,5 @@ z3_add_component(muz
|
|||
smt
|
||||
smt2parser
|
||||
PYG_FILES
|
||||
fixedpoint_params.pyg
|
||||
fp_params.pyg
|
||||
)
|
||||
|
|
|
@ -27,7 +27,7 @@ Revision History:
|
|||
#include "ast/ast_smt2_pp.h"
|
||||
#include "ast/datatype_decl_plugin.h"
|
||||
#include "ast/scoped_proof.h"
|
||||
#include "muz/base/fixedpoint_params.hpp"
|
||||
#include "muz/base/fp_params.hpp"
|
||||
#include "ast/ast_pp_util.h"
|
||||
|
||||
|
||||
|
@ -152,15 +152,15 @@ namespace datalog {
|
|||
|
||||
class context::restore_rules : public trail<context> {
|
||||
rule_set* m_old_rules;
|
||||
void reset() {
|
||||
dealloc(m_old_rules);
|
||||
void reset() {
|
||||
dealloc(m_old_rules);
|
||||
m_old_rules = nullptr;
|
||||
}
|
||||
public:
|
||||
restore_rules(rule_set& r): m_old_rules(alloc(rule_set, r)) {}
|
||||
|
||||
~restore_rules() override {}
|
||||
|
||||
|
||||
void undo(context& ctx) override {
|
||||
ctx.replace_rules(*m_old_rules);
|
||||
reset();
|
||||
|
@ -189,7 +189,7 @@ namespace datalog {
|
|||
throw default_exception("there are no backtracking points to pop to");
|
||||
}
|
||||
throw default_exception("pop operation is not supported");
|
||||
m_trail.pop_scope(1);
|
||||
m_trail.pop_scope(1);
|
||||
}
|
||||
|
||||
// -----------------------------------
|
||||
|
@ -203,7 +203,7 @@ namespace datalog {
|
|||
m_register_engine(re),
|
||||
m_fparams(fp),
|
||||
m_params_ref(pa),
|
||||
m_params(alloc(fixedpoint_params, m_params_ref)),
|
||||
m_params(alloc(fp_params, m_params_ref)),
|
||||
m_decl_util(m),
|
||||
m_rewriter(m),
|
||||
m_var_subst(m),
|
||||
|
@ -235,7 +235,7 @@ namespace datalog {
|
|||
|
||||
context::~context() {
|
||||
reset();
|
||||
dealloc(m_params);
|
||||
dealloc(m_params);
|
||||
}
|
||||
|
||||
void context::reset() {
|
||||
|
@ -291,14 +291,14 @@ namespace datalog {
|
|||
bool context::similarity_compressor() const { return m_params->datalog_similarity_compressor(); }
|
||||
unsigned context::similarity_compressor_threshold() const { return m_params->datalog_similarity_compressor_threshold(); }
|
||||
unsigned context::soft_timeout() const { return m_fparams.m_timeout; }
|
||||
unsigned context::initial_restart_timeout() const { return m_params->datalog_initial_restart_timeout(); }
|
||||
unsigned context::initial_restart_timeout() const { return m_params->datalog_initial_restart_timeout(); }
|
||||
bool context::generate_explanations() const { return m_params->datalog_generate_explanations(); }
|
||||
bool context::explanations_on_relation_level() const { return m_params->datalog_explanations_on_relation_level(); }
|
||||
bool context::magic_sets_for_queries() const { return m_params->datalog_magic_sets_for_queries(); }
|
||||
symbol context::tab_selection() const { return m_params->tab_selection(); }
|
||||
bool context::xform_coi() const { return m_params->xform_coi(); }
|
||||
bool context::xform_slice() const { return m_params->xform_slice(); }
|
||||
bool context::xform_bit_blast() const { return m_params->xform_bit_blast(); }
|
||||
bool context::xform_bit_blast() const { return m_params->xform_bit_blast(); }
|
||||
bool context::karr() const { return m_params->xform_karr(); }
|
||||
bool context::scale() const { return m_params->xform_scale(); }
|
||||
bool context::magic() const { return m_params->xform_magic(); }
|
||||
|
@ -428,7 +428,7 @@ namespace datalog {
|
|||
}
|
||||
|
||||
|
||||
void context::set_predicate_representation(func_decl * pred, unsigned relation_name_cnt,
|
||||
void context::set_predicate_representation(func_decl * pred, unsigned relation_name_cnt,
|
||||
symbol const * relation_names) {
|
||||
if (relation_name_cnt > 0) {
|
||||
ensure_engine();
|
||||
|
@ -438,9 +438,9 @@ namespace datalog {
|
|||
}
|
||||
}
|
||||
|
||||
func_decl * context::mk_fresh_head_predicate(symbol const & prefix, symbol const & suffix,
|
||||
func_decl * context::mk_fresh_head_predicate(symbol const & prefix, symbol const & suffix,
|
||||
unsigned arity, sort * const * domain, func_decl* orig_pred) {
|
||||
func_decl* new_pred =
|
||||
func_decl* new_pred =
|
||||
m.mk_fresh_func_decl(prefix, suffix, arity, domain, m.mk_bool_sort());
|
||||
|
||||
register_predicate(new_pred, true);
|
||||
|
@ -473,7 +473,7 @@ namespace datalog {
|
|||
//
|
||||
// Update a rule with a new.
|
||||
// It requires basic subsumption.
|
||||
//
|
||||
//
|
||||
void context::update_rule(expr* rl, symbol const& name) {
|
||||
datalog::rule_manager& rm = get_rule_manager();
|
||||
proof* p = nullptr;
|
||||
|
@ -494,13 +494,13 @@ namespace datalog {
|
|||
rule* old_rule = nullptr;
|
||||
for (unsigned i = 0; i < size_before; ++i) {
|
||||
if (rls[i]->name() == name) {
|
||||
if (old_rule) {
|
||||
if (old_rule) {
|
||||
std::stringstream strm;
|
||||
strm << "Rule " << name << " occurs twice. It cannot be modified";
|
||||
m_rule_set.del_rule(r);
|
||||
throw default_exception(strm.str());
|
||||
}
|
||||
old_rule = rls[i];
|
||||
old_rule = rls[i];
|
||||
}
|
||||
}
|
||||
if (old_rule) {
|
||||
|
@ -556,7 +556,7 @@ namespace datalog {
|
|||
ensure_engine();
|
||||
m_engine->add_cover(level, pred, property);
|
||||
}
|
||||
|
||||
|
||||
void context::add_invariant(func_decl* pred, expr *property)
|
||||
{
|
||||
ensure_engine();
|
||||
|
@ -566,11 +566,11 @@ namespace datalog {
|
|||
void context::check_rules(rule_set& r) {
|
||||
m_rule_properties.set_generate_proof(generate_proof_trace());
|
||||
switch(get_engine()) {
|
||||
case DATALOG_ENGINE:
|
||||
case DATALOG_ENGINE:
|
||||
m_rule_properties.collect(r);
|
||||
m_rule_properties.check_quantifier_free();
|
||||
m_rule_properties.check_uninterpreted_free();
|
||||
m_rule_properties.check_nested_free();
|
||||
m_rule_properties.check_nested_free();
|
||||
m_rule_properties.check_infinite_sorts();
|
||||
break;
|
||||
case SPACER_ENGINE:
|
||||
|
@ -582,12 +582,12 @@ namespace datalog {
|
|||
case BMC_ENGINE:
|
||||
m_rule_properties.collect(r);
|
||||
m_rule_properties.check_for_negated_predicates();
|
||||
break;
|
||||
break;
|
||||
case QBMC_ENGINE:
|
||||
m_rule_properties.collect(r);
|
||||
m_rule_properties.check_existential_tail();
|
||||
m_rule_properties.check_for_negated_predicates();
|
||||
break;
|
||||
break;
|
||||
case TAB_ENGINE:
|
||||
m_rule_properties.collect(r);
|
||||
m_rule_properties.check_existential_tail();
|
||||
|
@ -650,7 +650,7 @@ namespace datalog {
|
|||
add_fact(pred, rfact);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void context::add_table_fact(func_decl * pred, unsigned num_args, unsigned args[]) {
|
||||
if (pred->get_arity() != num_args) {
|
||||
std::ostringstream out;
|
||||
|
@ -682,7 +682,7 @@ namespace datalog {
|
|||
reopen();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void context::reopen() {
|
||||
SASSERT(m_closed);
|
||||
m_rule_set.reopen();
|
||||
|
@ -695,7 +695,7 @@ namespace datalog {
|
|||
transformer.register_plugin(plugin);
|
||||
transform_rules(transformer);
|
||||
}
|
||||
|
||||
|
||||
void context::transform_rules(rule_transformer& transf) {
|
||||
SASSERT(m_closed); //we must finish adding rules before we start transforming them
|
||||
TRACE("dl", display_rules(tout););
|
||||
|
@ -724,7 +724,7 @@ namespace datalog {
|
|||
}
|
||||
|
||||
void context::collect_params(param_descrs& p) {
|
||||
fixedpoint_params::collect_param_descrs(p);
|
||||
fp_params::collect_param_descrs(p);
|
||||
insert_timeout(p);
|
||||
}
|
||||
|
||||
|
@ -732,8 +732,8 @@ namespace datalog {
|
|||
m_params_ref.copy(p);
|
||||
if (m_engine.get()) m_engine->updt_params();
|
||||
m_generate_proof_trace = m_params->generate_proof_trace();
|
||||
m_unbound_compressor = m_params->datalog_unbound_compressor();
|
||||
m_default_relation = m_params->datalog_default_relation();
|
||||
m_unbound_compressor = m_params->datalog_unbound_compressor();
|
||||
m_default_relation = m_params->datalog_default_relation();
|
||||
}
|
||||
|
||||
expr_ref context::get_background_assertion() {
|
||||
|
@ -748,7 +748,7 @@ namespace datalog {
|
|||
|
||||
void context::assert_expr(expr* e) {
|
||||
TRACE("dl", tout << mk_ismt2_pp(e, m) << "\n";);
|
||||
m_background.push_back(e);
|
||||
m_background.push_back(e);
|
||||
}
|
||||
|
||||
void context::cleanup() {
|
||||
|
@ -785,7 +785,7 @@ namespace datalog {
|
|||
return;
|
||||
}
|
||||
symbol e = m_params->engine();
|
||||
|
||||
|
||||
if (e == symbol("datalog")) {
|
||||
m_engine_type = DATALOG_ENGINE;
|
||||
}
|
||||
|
@ -811,7 +811,7 @@ namespace datalog {
|
|||
if (m_engine_type == LAST_ENGINE) {
|
||||
expr_fast_mark1 mark;
|
||||
engine_type_proc proc(m);
|
||||
m_engine_type = DATALOG_ENGINE;
|
||||
m_engine_type = DATALOG_ENGINE;
|
||||
for (unsigned i = 0; m_engine_type == DATALOG_ENGINE && i < m_rule_set.get_num_rules(); ++i) {
|
||||
rule * r = m_rule_set.get_rule(i);
|
||||
quick_for_each_expr(proc, mark, r->get_head());
|
||||
|
@ -893,15 +893,15 @@ namespace datalog {
|
|||
m_rel = dynamic_cast<rel_context_base*>(m_engine.get());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
lbool context::rel_query(unsigned num_rels, func_decl * const* rels) {
|
||||
lbool context::rel_query(unsigned num_rels, func_decl * const* rels) {
|
||||
m_last_answer = nullptr;
|
||||
ensure_engine();
|
||||
return m_engine->query(num_rels, rels);
|
||||
}
|
||||
|
||||
|
||||
expr* context::get_answer_as_formula() {
|
||||
if (m_last_answer) {
|
||||
return m_last_answer.get();
|
||||
|
@ -954,7 +954,7 @@ namespace datalog {
|
|||
|
||||
void context::display(std::ostream & out) const {
|
||||
display_rules(out);
|
||||
if (m_rel) m_rel->display_facts(out);
|
||||
if (m_rel) m_rel->display_facts(out);
|
||||
}
|
||||
|
||||
void context::display_profile(std::ostream& out) const {
|
||||
|
@ -990,10 +990,10 @@ namespace datalog {
|
|||
bool context::result_contains_fact(relation_fact const& f) {
|
||||
return m_rel && m_rel->result_contains_fact(f);
|
||||
}
|
||||
|
||||
|
||||
// NB: algebraic data-types declarations will not be printed.
|
||||
|
||||
static void collect_free_funcs(unsigned sz, expr* const* exprs,
|
||||
static void collect_free_funcs(unsigned sz, expr* const* exprs,
|
||||
ast_pp_util& v,
|
||||
mk_fresh_name& fresh_names) {
|
||||
v.collect(sz, exprs);
|
||||
|
@ -1005,7 +1005,7 @@ namespace datalog {
|
|||
fresh_names.add(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void context::get_raw_rule_formulas(expr_ref_vector& rules, svector<symbol>& names, unsigned_vector &bounds) {
|
||||
for (unsigned i = 0; i < m_rule_fmls.size(); ++i) {
|
||||
expr_ref r = bind_vars(m_rule_fmls[i].get(), true);
|
||||
|
@ -1018,7 +1018,7 @@ namespace datalog {
|
|||
void context::get_rules_as_formulas(expr_ref_vector& rules, expr_ref_vector& queries, svector<symbol>& names) {
|
||||
expr_ref fml(m);
|
||||
rule_manager& rm = get_rule_manager();
|
||||
|
||||
|
||||
// ensure that rules are all using bound variables.
|
||||
for (unsigned i = m_rule_fmls_head; i < m_rule_fmls.size(); ++i) {
|
||||
m_free_vars(m_rule_fmls[i].get());
|
||||
|
@ -1067,7 +1067,7 @@ namespace datalog {
|
|||
}
|
||||
for (unsigned i = m_rule_fmls_head; i < m_rule_fmls.size(); ++i) {
|
||||
rules.push_back(m_rule_fmls[i].get());
|
||||
names.push_back(m_rule_names[i]);
|
||||
names.push_back(m_rule_names[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1080,7 +1080,7 @@ namespace datalog {
|
|||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
|
||||
void context::display_smt2(unsigned num_queries, expr* const* qs, std::ostream& out) {
|
||||
ast_manager& m = get_manager();
|
||||
ast_pp_util visitor(m);
|
||||
|
@ -1109,7 +1109,7 @@ namespace datalog {
|
|||
for (unsigned i = 0; i < sz; ++i) {
|
||||
func_decl* f = visitor.coll.get_func_decls()[i];
|
||||
if (f->get_family_id() != null_family_id) {
|
||||
//
|
||||
//
|
||||
}
|
||||
else if (is_predicate(f) && use_fixedpoint_extensions) {
|
||||
rels.insert(f);
|
||||
|
@ -1122,12 +1122,12 @@ namespace datalog {
|
|||
if (!use_fixedpoint_extensions) {
|
||||
out << "(set-logic HORN)\n";
|
||||
}
|
||||
for (func_decl * f : rels)
|
||||
for (func_decl * f : rels)
|
||||
visitor.remove_decl(f);
|
||||
|
||||
visitor.display_decls(out);
|
||||
|
||||
for (func_decl * f : rels)
|
||||
for (func_decl * f : rels)
|
||||
display_rel_decl(out, f);
|
||||
|
||||
if (use_fixedpoint_extensions && do_declare_vars) {
|
||||
|
@ -1143,7 +1143,7 @@ namespace datalog {
|
|||
PP(axioms[i]);
|
||||
out << ")\n";
|
||||
}
|
||||
for (unsigned i = 0; i < rules.size(); ++i) {
|
||||
for (unsigned i = 0; i < rules.size(); ++i) {
|
||||
out << (use_fixedpoint_extensions?"(rule ":"(assert ");
|
||||
expr* r = rules[i].get();
|
||||
symbol nm = names[i];
|
||||
|
@ -1156,7 +1156,7 @@ namespace datalog {
|
|||
while (fresh_names.contains(nm)) {
|
||||
std::ostringstream s;
|
||||
s << nm << "!";
|
||||
nm = symbol(s.str().c_str());
|
||||
nm = symbol(s.str().c_str());
|
||||
}
|
||||
fresh_names.add(nm);
|
||||
display_symbol(out, nm) << ")";
|
||||
|
@ -1182,7 +1182,7 @@ namespace datalog {
|
|||
args.push_back(m.mk_var(j, m_free_vars[j]));
|
||||
}
|
||||
qfn = m.mk_implies(q, m.mk_app(fn, args.size(), args.c_ptr()));
|
||||
|
||||
|
||||
out << "(assert ";
|
||||
PP(qfn);
|
||||
out << ")\n";
|
||||
|
@ -1209,7 +1209,7 @@ namespace datalog {
|
|||
smt2_pp_environment_dbg env(m);
|
||||
out << "(declare-rel ";
|
||||
display_symbol(out, f->get_name()) << " (";
|
||||
for (unsigned i = 0; i < f->get_arity(); ++i) {
|
||||
for (unsigned i = 0; i < f->get_arity(); ++i) {
|
||||
ast_smt2_pp(out, f->get_domain(i), env);
|
||||
if (i + 1 < f->get_arity()) {
|
||||
out << " ";
|
||||
|
@ -1239,12 +1239,12 @@ namespace datalog {
|
|||
void context::declare_vars(expr_ref_vector& rules, mk_fresh_name& fresh_names, std::ostream& out) {
|
||||
//
|
||||
// replace bound variables in rules by 'var declarations'
|
||||
// First remove quantifers, then replace bound variables
|
||||
// First remove quantifers, then replace bound variables
|
||||
// by fresh constants.
|
||||
//
|
||||
//
|
||||
smt2_pp_environment_dbg env(m);
|
||||
var_subst vsubst(m, false);
|
||||
|
||||
|
||||
expr_ref_vector fresh_vars(m), subst(m);
|
||||
expr_ref res(m);
|
||||
obj_map<sort, unsigned_vector> var_idxs;
|
||||
|
@ -1257,7 +1257,7 @@ namespace datalog {
|
|||
quantifier* q = to_quantifier(r);
|
||||
if (!q->is_forall()) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (has_quantifiers(q->get_expr())) {
|
||||
continue;
|
||||
}
|
||||
|
@ -1287,7 +1287,7 @@ namespace datalog {
|
|||
fresh_vars.push_back(m.mk_const(name, s));
|
||||
out << "(declare-var " << name << " ";
|
||||
ast_smt2_pp(out, s, env);
|
||||
out << ")\n";
|
||||
out << ")\n";
|
||||
}
|
||||
subst.push_back(fresh_vars[vars[max_var]].get());
|
||||
}
|
||||
|
@ -1299,4 +1299,3 @@ namespace datalog {
|
|||
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ Revision History:
|
|||
#include "muz/base/bind_variables.h"
|
||||
#include "muz/base/rule_properties.h"
|
||||
|
||||
struct fixedpoint_params;
|
||||
struct fp_params;
|
||||
|
||||
namespace datalog {
|
||||
|
||||
|
@ -98,7 +98,7 @@ namespace datalog {
|
|||
relation_fact(ast_manager & m) : app_ref_vector(m) {}
|
||||
relation_fact(ast_manager & m, unsigned sz) : app_ref_vector(m) { resize(sz); }
|
||||
relation_fact(context & ctx);
|
||||
|
||||
|
||||
iterator begin() const { return c_ptr(); }
|
||||
iterator end() const { return c_ptr()+size(); }
|
||||
|
||||
|
@ -126,7 +126,7 @@ namespace datalog {
|
|||
virtual bool has_facts(func_decl * pred) const = 0;
|
||||
virtual void store_relation(func_decl * pred, relation_base * rel) = 0;
|
||||
virtual void inherit_predicate_kind(func_decl* new_pred, func_decl* orig_pred) = 0;
|
||||
virtual void set_predicate_representation(func_decl * pred, unsigned relation_name_cnt,
|
||||
virtual void set_predicate_representation(func_decl * pred, unsigned relation_name_cnt,
|
||||
symbol const * relation_names) = 0;
|
||||
virtual bool output_profile() const = 0;
|
||||
virtual void collect_non_empty_predicates(func_decl_set& preds) = 0;
|
||||
|
@ -147,7 +147,7 @@ namespace datalog {
|
|||
public:
|
||||
contains_pred(context& ctx): ctx(ctx) {}
|
||||
~contains_pred() override {}
|
||||
|
||||
|
||||
bool operator()(expr* e) override {
|
||||
return ctx.is_predicate(e);
|
||||
}
|
||||
|
@ -170,7 +170,7 @@ namespace datalog {
|
|||
register_engine_base& m_register_engine;
|
||||
smt_params & m_fparams;
|
||||
params_ref m_params_ref;
|
||||
fixedpoint_params* m_params;
|
||||
fp_params* m_params;
|
||||
bool m_generate_proof_trace; // cached configuration parameter
|
||||
bool m_unbound_compressor; // cached configuration parameter
|
||||
symbol m_default_relation; // cached configuration parameter
|
||||
|
@ -227,7 +227,7 @@ namespace datalog {
|
|||
|
||||
void push();
|
||||
void pop();
|
||||
|
||||
|
||||
bool saturation_was_run() const { return m_saturation_was_run; }
|
||||
void notify_saturation_was_run() { m_saturation_was_run = true; }
|
||||
|
||||
|
@ -236,7 +236,7 @@ namespace datalog {
|
|||
ast_manager & get_manager() const { return m; }
|
||||
rule_manager & get_rule_manager() { return m_rule_manager; }
|
||||
smt_params & get_fparams() const { return m_fparams; }
|
||||
fixedpoint_params const& get_params() const { return *m_params; }
|
||||
fp_params const& get_params() const { return *m_params; }
|
||||
DL_ENGINE get_engine() { configure_engine(); return m_engine_type; }
|
||||
register_engine_base& get_register_engine() { return m_register_engine; }
|
||||
th_rewriter& get_rewriter() { return m_rewriter; }
|
||||
|
@ -251,7 +251,7 @@ namespace datalog {
|
|||
symbol default_table() const;
|
||||
symbol default_relation() const;
|
||||
void set_default_relation(symbol const& s);
|
||||
symbol default_table_checker() const;
|
||||
symbol default_table_checker() const;
|
||||
symbol check_relation() const;
|
||||
bool default_table_checked() const;
|
||||
bool dbg_fpr_nonempty_relation_signature() const;
|
||||
|
@ -275,7 +275,7 @@ namespace datalog {
|
|||
bool compress_unbound() const;
|
||||
bool quantify_arrays() const;
|
||||
bool instantiate_quantifiers() const;
|
||||
bool xform_bit_blast() const;
|
||||
bool xform_bit_blast() const;
|
||||
bool xform_slice() const;
|
||||
bool xform_coi() const;
|
||||
bool array_blast() const;
|
||||
|
@ -291,9 +291,9 @@ namespace datalog {
|
|||
void register_variable(func_decl* var);
|
||||
|
||||
/*
|
||||
Replace constants that have been registered as
|
||||
Replace constants that have been registered as
|
||||
variables by de-Bruijn indices and corresponding
|
||||
universal (if is_forall is true) or existential
|
||||
universal (if is_forall is true) or existential
|
||||
quantifier.
|
||||
*/
|
||||
expr_ref bind_vars(expr* fml, bool is_forall);
|
||||
|
@ -303,7 +303,7 @@ namespace datalog {
|
|||
/**
|
||||
Register datalog relation.
|
||||
|
||||
If named is true, we associate the predicate with its name, so that it can be
|
||||
If named is true, we associate the predicate with its name, so that it can be
|
||||
retrieved by the try_get_predicate_decl() function. Auxiliary predicates introduced
|
||||
e.g. by rule transformations do not need to be named.
|
||||
*/
|
||||
|
@ -326,7 +326,7 @@ namespace datalog {
|
|||
/**
|
||||
\brief If a predicate name has a \c func_decl object assigned, return pointer to it;
|
||||
otherwise return 0.
|
||||
|
||||
|
||||
Not all \c func_decl object used as relation identifiers need to be assigned to their
|
||||
names. Generally, the names coming from the parses are registered here.
|
||||
*/
|
||||
|
@ -334,13 +334,13 @@ namespace datalog {
|
|||
func_decl * res = nullptr;
|
||||
m_preds_by_name.find(pred_name, res);
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
\brief Create a fresh head predicate declaration.
|
||||
|
||||
*/
|
||||
func_decl * mk_fresh_head_predicate(symbol const & prefix, symbol const & suffix,
|
||||
func_decl * mk_fresh_head_predicate(symbol const & prefix, symbol const & suffix,
|
||||
unsigned arity, sort * const * domain, func_decl* orig_pred=nullptr);
|
||||
|
||||
|
||||
|
@ -365,13 +365,13 @@ namespace datalog {
|
|||
/**
|
||||
\brief Assign names of variables used in the declaration of a predicate.
|
||||
|
||||
These names are used when printing out the relations to make the output conform
|
||||
These names are used when printing out the relations to make the output conform
|
||||
to the one of bddbddb.
|
||||
*/
|
||||
void set_argument_names(const func_decl * pred, const svector<symbol> & var_names);
|
||||
symbol get_argument_name(const func_decl * pred, unsigned arg_index);
|
||||
|
||||
void set_predicate_representation(func_decl * pred, unsigned relation_name_cnt,
|
||||
void set_predicate_representation(func_decl * pred, unsigned relation_name_cnt,
|
||||
symbol const * relation_names);
|
||||
|
||||
void set_output_predicate(func_decl * pred) { m_rule_set.set_output_predicate(pred); }
|
||||
|
@ -385,9 +385,9 @@ namespace datalog {
|
|||
void add_fact(func_decl * pred, const relation_fact & fact);
|
||||
|
||||
bool has_facts(func_decl * pred) const;
|
||||
|
||||
|
||||
void add_rule(rule_ref& r);
|
||||
|
||||
|
||||
void assert_expr(expr* e);
|
||||
expr_ref get_background_assertion();
|
||||
unsigned get_num_assertions() { return m_background.size(); }
|
||||
|
@ -397,7 +397,7 @@ namespace datalog {
|
|||
Method exposed from API for adding rules.
|
||||
*/
|
||||
void add_rule(expr* rl, symbol const& name, unsigned bound = UINT_MAX);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
Update a named rule.
|
||||
|
@ -421,9 +421,9 @@ namespace datalog {
|
|||
at 'level+1', 'level+2' etc, and include level=-1.
|
||||
*/
|
||||
expr_ref get_cover_delta(int level, func_decl* pred);
|
||||
|
||||
|
||||
/**
|
||||
Add a property of predicate 'pred' at 'level'.
|
||||
Add a property of predicate 'pred' at 'level'.
|
||||
It gets pushed forward when possible.
|
||||
*/
|
||||
void add_cover(int level, func_decl* pred, expr* property);
|
||||
|
@ -432,7 +432,7 @@ namespace datalog {
|
|||
Add an invariant of predicate 'pred'.
|
||||
*/
|
||||
void add_invariant (func_decl *pred, expr *property);
|
||||
|
||||
|
||||
/**
|
||||
\brief Check rule subsumption.
|
||||
*/
|
||||
|
@ -471,15 +471,15 @@ namespace datalog {
|
|||
proof_converter_ref& get_proof_converter() { return m_pc; }
|
||||
void add_proof_converter(proof_converter* pc) { m_pc = concat(m_pc.get(), pc); }
|
||||
|
||||
void transform_rules(rule_transformer& transf);
|
||||
void transform_rules(rule_transformer& transf);
|
||||
void transform_rules(rule_transformer::plugin* plugin);
|
||||
void replace_rules(rule_set const& rs);
|
||||
void record_transformed_rules();
|
||||
|
||||
void apply_default_transformation();
|
||||
void apply_default_transformation();
|
||||
|
||||
void collect_params(param_descrs& r);
|
||||
|
||||
|
||||
void updt_params(params_ref const& p);
|
||||
|
||||
void display_rules(std::ostream & out) const {
|
||||
|
@ -507,7 +507,7 @@ namespace datalog {
|
|||
/**
|
||||
\brief check if query 'q' is satisfied under asserted rules and background.
|
||||
|
||||
If successful, return OK and into \c result assign a relation with all
|
||||
If successful, return OK and into \c result assign a relation with all
|
||||
tuples matching the query. Otherwise return reason for failure and do not modify
|
||||
\c result.
|
||||
|
||||
|
@ -515,7 +515,7 @@ namespace datalog {
|
|||
starting from zero.
|
||||
|
||||
The caller becomes an owner of the relation object returned in \c result. The
|
||||
relation object, however, should not outlive the datalog context since it is
|
||||
relation object, however, should not outlive the datalog context since it is
|
||||
linked to a relation plugin in the context.
|
||||
*/
|
||||
|
||||
|
@ -524,7 +524,7 @@ namespace datalog {
|
|||
lbool query_from_lvl (expr* q, unsigned lvl);
|
||||
/**
|
||||
\brief retrieve model from inductive invariant that shows query is unsat.
|
||||
|
||||
|
||||
\pre engine == 'pdr' || engine == 'duality' - this option is only supported
|
||||
for PDR mode and Duality mode.
|
||||
*/
|
||||
|
@ -532,7 +532,7 @@ namespace datalog {
|
|||
|
||||
/**
|
||||
\brief retrieve proof from derivation of the query.
|
||||
|
||||
|
||||
\pre engine == 'pdr' || engine == 'duality'- this option is only supported
|
||||
for PDR mode and Duality mode.
|
||||
*/
|
||||
|
@ -606,7 +606,7 @@ namespace datalog {
|
|||
/**
|
||||
Just reset all tables.
|
||||
*/
|
||||
void reset_tables();
|
||||
void reset_tables();
|
||||
|
||||
|
||||
void flush_add_rules();
|
||||
|
@ -627,4 +627,3 @@ namespace datalog {
|
|||
};
|
||||
|
||||
#endif /* DL_CONTEXT_H_ */
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
def_module_params('fixedpoint',
|
||||
def_module_params('fp',
|
||||
description='fixedpoint parameters',
|
||||
export=True,
|
||||
params=(('timeout', UINT, UINT_MAX, 'set timeout'),
|
Loading…
Add table
Add a link
Reference in a new issue