mirror of
https://github.com/Z3Prover/z3
synced 2025-08-17 16:52:15 +00:00
Isolating reg_decl_plugins
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
69ce24a6ce
commit
641db30660
33 changed files with 140 additions and 70 deletions
|
@ -25,13 +25,6 @@ Revision History:
|
|||
#include"string_buffer.h"
|
||||
#include"ast_util.h"
|
||||
#include"ast_smt2_pp.h"
|
||||
#include"arith_decl_plugin.h"
|
||||
#include"array_decl_plugin.h"
|
||||
#include"bv_decl_plugin.h"
|
||||
#include"datatype_decl_plugin.h"
|
||||
#include"dl_decl_plugin.h"
|
||||
#include"seq_decl_plugin.h"
|
||||
#include"float_decl_plugin.h"
|
||||
|
||||
// -----------------------------------
|
||||
//
|
||||
|
@ -1403,30 +1396,6 @@ void ast_manager::register_plugin(symbol const & s, decl_plugin * plugin) {
|
|||
register_plugin(id, plugin);
|
||||
}
|
||||
|
||||
void ast_manager::register_decl_plugins() {
|
||||
if (!get_plugin(get_family_id(symbol("arith")))) {
|
||||
register_plugin(symbol("arith"), alloc(arith_decl_plugin));
|
||||
}
|
||||
if (!get_plugin(get_family_id(symbol("bv")))) {
|
||||
register_plugin(symbol("bv"), alloc(bv_decl_plugin));
|
||||
}
|
||||
if (!get_plugin(get_family_id(symbol("array")))) {
|
||||
register_plugin(symbol("array"), alloc(array_decl_plugin));
|
||||
}
|
||||
if (!get_plugin(get_family_id(symbol("datatype")))) {
|
||||
register_plugin(symbol("datatype"), alloc(datatype_decl_plugin));
|
||||
}
|
||||
if (!get_plugin(get_family_id(symbol("datalog_relation")))) {
|
||||
register_plugin(symbol("datalog_relation"), alloc(datalog::dl_decl_plugin));
|
||||
}
|
||||
if (!get_plugin(get_family_id(symbol("seq")))) {
|
||||
register_plugin(symbol("seq"), alloc(seq_decl_plugin));
|
||||
}
|
||||
if (!get_plugin(get_family_id(symbol("float")))) {
|
||||
register_plugin(symbol("float"), alloc(float_decl_plugin));
|
||||
}
|
||||
}
|
||||
|
||||
decl_plugin * ast_manager::get_plugin(family_id fid) const {
|
||||
return m_plugins.get(fid, 0);
|
||||
}
|
||||
|
|
|
@ -1283,8 +1283,6 @@ enum proof_gen_mode {
|
|||
//
|
||||
// -----------------------------------
|
||||
|
||||
class arith_decl_plugin;
|
||||
|
||||
class ast_manager {
|
||||
protected:
|
||||
protected:
|
||||
|
@ -1411,8 +1409,6 @@ public:
|
|||
|
||||
void register_plugin(family_id id, decl_plugin * plugin);
|
||||
|
||||
void register_decl_plugins();
|
||||
|
||||
decl_plugin * get_plugin(family_id fid) const;
|
||||
|
||||
bool has_plugin(family_id fid) const { return get_plugin(fid) != 0; }
|
||||
|
|
|
@ -23,6 +23,7 @@ Revision History:
|
|||
#include "datatype_decl_plugin.h"
|
||||
#include "dl_decl_plugin.h"
|
||||
#include "warning.h"
|
||||
#include "reg_decl_plugins.h"
|
||||
|
||||
namespace datalog {
|
||||
|
||||
|
@ -621,7 +622,7 @@ namespace datalog {
|
|||
dl_decl_util::ast_plugin_registrator::ast_plugin_registrator(ast_manager& m)
|
||||
{
|
||||
// ensure required plugins are installed into the ast_manager
|
||||
m.register_decl_plugins();
|
||||
reg_decl_plugins(m);
|
||||
}
|
||||
|
||||
dl_decl_util::dl_decl_util(ast_manager& m):
|
||||
|
|
51
src/ast/reg_decl_plugins.cpp
Normal file
51
src/ast/reg_decl_plugins.cpp
Normal file
|
@ -0,0 +1,51 @@
|
|||
/*++
|
||||
Copyright (c) 2012 Microsoft Corporation
|
||||
|
||||
Module Name:
|
||||
|
||||
reg_decl_plugins
|
||||
|
||||
Abstract:
|
||||
|
||||
Goodie for installing all available declarations
|
||||
plugins in an ast_manager
|
||||
|
||||
Author:
|
||||
|
||||
Leonardo de Moura (leonardo) 2012-10-24.
|
||||
|
||||
Revision History:
|
||||
|
||||
--*/
|
||||
#include"ast.h"
|
||||
#include"arith_decl_plugin.h"
|
||||
#include"array_decl_plugin.h"
|
||||
#include"bv_decl_plugin.h"
|
||||
#include"datatype_decl_plugin.h"
|
||||
#include"dl_decl_plugin.h"
|
||||
#include"seq_decl_plugin.h"
|
||||
#include"float_decl_plugin.h"
|
||||
|
||||
void reg_decl_plugins(ast_manager & m) {
|
||||
if (!get_plugin(get_family_id(symbol("arith")))) {
|
||||
register_plugin(symbol("arith"), alloc(arith_decl_plugin));
|
||||
}
|
||||
if (!get_plugin(get_family_id(symbol("bv")))) {
|
||||
register_plugin(symbol("bv"), alloc(bv_decl_plugin));
|
||||
}
|
||||
if (!get_plugin(get_family_id(symbol("array")))) {
|
||||
register_plugin(symbol("array"), alloc(array_decl_plugin));
|
||||
}
|
||||
if (!get_plugin(get_family_id(symbol("datatype")))) {
|
||||
register_plugin(symbol("datatype"), alloc(datatype_decl_plugin));
|
||||
}
|
||||
if (!get_plugin(get_family_id(symbol("datalog_relation")))) {
|
||||
register_plugin(symbol("datalog_relation"), alloc(datalog::dl_decl_plugin));
|
||||
}
|
||||
if (!get_plugin(get_family_id(symbol("seq")))) {
|
||||
register_plugin(symbol("seq"), alloc(seq_decl_plugin));
|
||||
}
|
||||
if (!get_plugin(get_family_id(symbol("float")))) {
|
||||
register_plugin(symbol("float"), alloc(float_decl_plugin));
|
||||
}
|
||||
}
|
27
src/ast/reg_decl_plugins.h
Normal file
27
src/ast/reg_decl_plugins.h
Normal file
|
@ -0,0 +1,27 @@
|
|||
/*++
|
||||
Copyright (c) 2012 Microsoft Corporation
|
||||
|
||||
Module Name:
|
||||
|
||||
reg_decl_plugins
|
||||
|
||||
Abstract:
|
||||
|
||||
Goodie for installing all available declarations
|
||||
plugins in an ast_manager
|
||||
|
||||
Author:
|
||||
|
||||
Leonardo de Moura (leonardo) 2012-10-24.
|
||||
|
||||
Revision History:
|
||||
|
||||
--*/
|
||||
#ifndef _REG_DECL_PLUGINS_H_
|
||||
#define _REG_DECL_PLUGINS_H_
|
||||
|
||||
class ast_manager;
|
||||
|
||||
void reg_decl_plugins(ast_manager & m);
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue