mirror of
https://github.com/Z3Prover/z3
synced 2025-04-23 17:15:31 +00:00
debugging cardinality theory
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
27f3f7b735
commit
9467806a5c
8 changed files with 29 additions and 15 deletions
|
@ -20,7 +20,7 @@ Revision History:
|
|||
#include "card_decl_plugin.h"
|
||||
|
||||
card_decl_plugin::card_decl_plugin():
|
||||
m_at_most_sym("at_most")
|
||||
m_at_most_sym("at-most")
|
||||
{}
|
||||
|
||||
func_decl * card_decl_plugin::mk_func_decl(decl_kind k, unsigned num_parameters, parameter const * parameters,
|
||||
|
@ -29,11 +29,11 @@ func_decl * card_decl_plugin::mk_func_decl(decl_kind k, unsigned num_parameters,
|
|||
ast_manager& m = *m_manager;
|
||||
for (unsigned i = 0; i < arity; ++i) {
|
||||
if (!m.is_bool(domain[i])) {
|
||||
m.raise_exception("invalid non-Boolean sort applied to 'at_most_k'");
|
||||
m.raise_exception("invalid non-Boolean sort applied to 'at-most'");
|
||||
}
|
||||
}
|
||||
if (num_parameters != 1 || !parameters[0].is_int() || parameters[0].get_int() < 0) {
|
||||
m.raise_exception("function 'at_most_k' expects one non-negative integer parameter");
|
||||
m.raise_exception("function 'at-most' expects one non-negative integer parameter");
|
||||
}
|
||||
func_decl_info info(m_family_id, OP_AT_MOST_K, 1, parameters);
|
||||
return m.mk_func_decl(m_at_most_sym, arity, domain, m.mk_bool_sort(), info);
|
||||
|
@ -41,7 +41,7 @@ func_decl * card_decl_plugin::mk_func_decl(decl_kind k, unsigned num_parameters,
|
|||
|
||||
void card_decl_plugin::get_op_names(svector<builtin_name> & op_names, symbol const & logic) {
|
||||
if (logic == symbol::null) {
|
||||
op_names.push_back(builtin_name("at-most-k", OP_AT_MOST_K));
|
||||
op_names.push_back(builtin_name(m_at_most_sym.bare_str(), OP_AT_MOST_K));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -28,8 +28,6 @@ hence:
|
|||
#define _CARD_DECL_PLUGIN_H_
|
||||
|
||||
#include"ast.h"
|
||||
|
||||
|
||||
|
||||
enum card_op_kind {
|
||||
OP_AT_MOST_K,
|
||||
|
@ -60,9 +58,6 @@ public:
|
|||
virtual func_decl * mk_func_decl(decl_kind k, unsigned num_parameters, parameter const * parameters,
|
||||
unsigned arity, sort * const * domain, sort * range);
|
||||
virtual void get_op_names(svector<builtin_name> & op_names, symbol const & logic);
|
||||
virtual void get_sort_names(svector<builtin_name> & sort_names, symbol const & logic);
|
||||
virtual expr * get_some_value(sort * s);
|
||||
virtual bool is_fully_interp(sort const * s) const;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -25,6 +25,7 @@ Revision History:
|
|||
#include"dl_decl_plugin.h"
|
||||
#include"seq_decl_plugin.h"
|
||||
#include"float_decl_plugin.h"
|
||||
#include"card_decl_plugin.h"
|
||||
|
||||
void reg_decl_plugins(ast_manager & m) {
|
||||
if (!m.get_plugin(m.mk_family_id(symbol("arith")))) {
|
||||
|
@ -48,4 +49,7 @@ void reg_decl_plugins(ast_manager & m) {
|
|||
if (!m.get_plugin(m.mk_family_id(symbol("float")))) {
|
||||
m.register_plugin(symbol("float"), alloc(float_decl_plugin));
|
||||
}
|
||||
if (!m.get_plugin(m.mk_family_id(symbol("card")))) {
|
||||
m.register_plugin(symbol("card"), alloc(card_decl_plugin));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue