3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-23 09:05:31 +00:00
This commit is contained in:
Nikolaj Bjorner 2023-04-08 17:14:39 -07:00
parent af9c760a68
commit e6ea81546e
4 changed files with 29 additions and 1 deletions

View file

@ -47,6 +47,7 @@ func_decl * special_relations_decl_plugin::mk_func_decl(
if (!m_manager->is_bool(range)) {
m_manager->raise_exception("range type is expected to be Boolean for special relations");
}
m_has_special_relation = true;
func_decl_info info(m_family_id, k, num_parameters, parameters);
symbol name;
switch(k) {

View file

@ -37,6 +37,7 @@ class special_relations_decl_plugin : public decl_plugin {
symbol m_plo;
symbol m_to;
symbol m_tc;
bool m_has_special_relation = false;
public:
special_relations_decl_plugin();
@ -50,6 +51,8 @@ public:
void get_op_names(svector<builtin_name> & op_names, symbol const & logic) override;
sort * mk_sort(decl_kind k, unsigned num_parameters, parameter const * parameters) override { return nullptr; }
bool has_special_relation() const { return m_has_special_relation; }
};
enum sr_property {
@ -82,6 +85,8 @@ class special_relations_util {
}
public:
special_relations_util(ast_manager& m) : m(m), m_fid(null_family_id) { }
bool has_special_relation() const { return static_cast<special_relations_decl_plugin*>(m.get_plugin(m.mk_family_id("specrels")))->has_special_relation(); }
bool is_special_relation(func_decl* f) const { return f->get_family_id() == fid(); }
bool is_special_relation(app* e) const { return is_special_relation(e->get_decl()); }