3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-12 12:08:18 +00:00

Reorganizing the code

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
Leonardo de Moura 2012-10-20 20:42:28 -07:00
parent d8cd3fc3ab
commit 6bdb009c3e
74 changed files with 67 additions and 27 deletions

View file

@ -8,16 +8,13 @@
############################################ ############################################
from mk_util import * from mk_util import *
BUILD_DIR='build-test' set_build_dir('build-test')
SRC_DIR='src' set_src_dir('src')
MODES=['Debug', 'Release'] set_modes(['Debug', 'Release'])
PLATFORMS=['Win32', 'x64'] set_platforms(['Win32', 'x64'])
VS_COMMON_OPTIONS='WIN32;_WINDOWS;ASYNC_COMMANDS' set_vs_options('WIN32;_WINDOWS;ASYNC_COMMANDS',
VS_DBG_OPTIONS='Z3DEBUG;_TRACE;_DEBUG' 'Z3DEBUG;_TRACE;_DEBUG',
VS_RELEASE_OPTIONS='NDEBUG;_EXTERNAL_RELEASE' 'NDEBUG;_EXTERNAL_RELEASE')
# Initialization
mk_dir(BUILD_DIR)
add_lib('util', []) add_lib('util', [])
add_lib('polynomial', ['util']) add_lib('polynomial', ['util'])
@ -32,5 +29,8 @@ add_lib('simplifier', ['util', 'ast', 'rewriter'])
# Model module should not depend on simplifier module. # Model module should not depend on simplifier module.
# We must replace all occurrences of simplifier with rewriter. # We must replace all occurrences of simplifier with rewriter.
add_lib('model', ['util', 'ast', 'rewriter', 'simplifier']) add_lib('model', ['util', 'ast', 'rewriter', 'simplifier'])
add_lib('tactic', ['util', 'ast']) # Old (non-modular) parameter framework. It has been subsumed by util\params.h.
# However, it is still used by many old components.
add_lib('old_params', ['util', 'ast', 'simplifier', 'model'])
add_lib('framework', ['util', 'ast', 'model', 'old_params', 'simplifier', 'rewriter'])

View file

@ -9,6 +9,38 @@
import os import os
import glob import glob
BUILD_DIR='build'
SRC_DIR='src'
MODES=[]
PLATFORMS=[]
def set_build_dir(d):
global BUILD_DIR
BUILD_DIR = d
mk_dir(BUILD_DIR)
def set_src_dir(d):
global SRC_DIR
SRC_DIR = d
def set_modes(l):
global MODES
MODES=l
def set_platforms(l):
global PLATFORMS
PLATFORMS=l
VS_COMMON_OPTIONS='WIN32'
VS_DBG_OPTIONS='_DEBUG'
VS_RELEASE_OPTIONS='NDEBUG'
def set_vs_options(common, dbg, release):
global VS_COMMON_OPTIONS, VS_DBG_OPTIONS, VS_RELEASE_OPTIONS
VS_COMMON_OPTIONS = common
VS_DBG_OPTIONS = dbg
VS_RELEASE_OPTIONS = release
def is_debug(mode): def is_debug(mode):
return mode == 'Debug' return mode == 'Debug'

1
src/framework/README Normal file
View file

@ -0,0 +1 @@
tactic and command context frameworks.

View file

@ -27,7 +27,6 @@ Notes:
#include"cmd_util.h" #include"cmd_util.h"
#include"simplify_cmd.h" #include"simplify_cmd.h"
#include"eval_cmd.h" #include"eval_cmd.h"
#include"qe_cmd.h"
class help_cmd : public cmd { class help_cmd : public cmd {
svector<symbol> m_cmds; svector<symbol> m_cmds;
@ -770,5 +769,4 @@ void install_ext_basic_cmds(cmd_context & ctx) {
ctx.insert(alloc(builtin_cmd, "reset", 0, "reset the shell (all declarations and assertions will be erased)")); ctx.insert(alloc(builtin_cmd, "reset", 0, "reset the shell (all declarations and assertions will be erased)"));
install_simplify_cmd(ctx); install_simplify_cmd(ctx);
install_eval_cmd(ctx); install_eval_cmd(ctx);
install_qe_cmd(ctx);
} }

View file

@ -21,6 +21,7 @@ Revision History:
#include"array_decl_plugin.h" #include"array_decl_plugin.h"
#include"bv_decl_plugin.h" #include"bv_decl_plugin.h"
#include"ast_pp.h" #include"ast_pp.h"
#include"for_each_expr.h"
struct check_logic::imp { struct check_logic::imp {
ast_manager & m; ast_manager & m;

View file

@ -19,7 +19,7 @@ Revision History:
#ifndef _CHECK_LOGIC_H_ #ifndef _CHECK_LOGIC_H_
#define _CHECK_LOGIC_H_ #define _CHECK_LOGIC_H_
#include"assertion_set.h" #include"ast.h"
class check_logic { class check_logic {
struct imp; struct imp;

View file

@ -16,6 +16,7 @@ Notes:
--*/ --*/
#include<signal.h> #include<signal.h>
#include"front_end_params.h"
#include"tptr.h" #include"tptr.h"
#include"cmd_context.h" #include"cmd_context.h"
#include"func_decl_dependencies.h" #include"func_decl_dependencies.h"
@ -36,6 +37,7 @@ Notes:
#include"decl_collector.h" #include"decl_collector.h"
#include"well_sorted.h" #include"well_sorted.h"
#include"model_evaluator.h" #include"model_evaluator.h"
#include"for_each_expr.h"
func_decls::func_decls(ast_manager & m, func_decl * f): func_decls::func_decls(ast_manager & m, func_decl * f):
m_decls(TAG(func_decl*, f, 0)) { m_decls(TAG(func_decl*, f, 0)) {
@ -321,7 +323,7 @@ cmd_context::cmd_context(front_end_params & params, bool main_ctx, ast_manager *
SASSERT(m != 0 || !has_manager()); SASSERT(m != 0 || !has_manager());
install_basic_cmds(*this); install_basic_cmds(*this);
install_ext_basic_cmds(*this); install_ext_basic_cmds(*this);
install_tactic_cmds(*this); install_core_tactic_cmds(*this);
SASSERT(m != 0 || !has_manager()); SASSERT(m != 0 || !has_manager());
if (m) if (m)
init_external_manager(); init_external_manager();

View file

@ -24,7 +24,6 @@ Notes:
#include<sstream> #include<sstream>
#include"ast.h" #include"ast.h"
#include"pdecl.h" #include"pdecl.h"
#include"front_end_params.h"
#include"dictionary.h" #include"dictionary.h"
#include"solver.h" #include"solver.h"
#include"datatype_decl_plugin.h" #include"datatype_decl_plugin.h"
@ -37,6 +36,8 @@ Notes:
#include"progress_callback.h" #include"progress_callback.h"
#include"scoped_ptr_vector.h" #include"scoped_ptr_vector.h"
struct front_end_params;
class func_decls { class func_decls {
func_decl * m_decls; func_decl * m_decls;
public: public:

View file

@ -58,16 +58,19 @@ public:
m_last = symbol::null; m_last = symbol::null;
} }
virtual void set_next_arg(cmd_context & ctx, sort * s) { virtual void set_next_arg(cmd_context & ctx, sort * s) {
m_params.set_sort(m_last, s); NOT_IMPLEMENTED_YET();
m_last = symbol::null; // m_params.set_sort(m_last, s);
// m_last = symbol::null;
} }
virtual void set_next_arg(cmd_context & ctx, expr * t) { virtual void set_next_arg(cmd_context & ctx, expr * t) {
m_params.set_expr(m_last, t); NOT_IMPLEMENTED_YET();
m_last = symbol::null; // m_params.set_expr(m_last, t);
// m_last = symbol::null;
} }
virtual void set_next_arg(cmd_context & ctx, func_decl * f) { virtual void set_next_arg(cmd_context & ctx, func_decl * f) {
m_params.set_func_decl(m_last, f); NOT_IMPLEMENTED_YET();
m_last = symbol::null; // m_params.set_func_decl(m_last, f);
// m_last = symbol::null;
} }
}; };

View file

@ -17,7 +17,7 @@ Notes:
--*/ --*/
#include"solver.h" #include"solver.h"
#include"smt_solver.h" // #include"smt_solver.h"
unsigned solver::get_num_assertions() const { unsigned solver::get_num_assertions() const {
NOT_IMPLEMENTED_YET(); NOT_IMPLEMENTED_YET();
@ -33,6 +33,7 @@ void solver::display(std::ostream & out) const {
out << "(solver)"; out << "(solver)";
} }
#if 0
class default_solver : public solver { class default_solver : public solver {
front_end_params * m_params; front_end_params * m_params;
smt::solver * m_context; smt::solver * m_context;
@ -191,3 +192,4 @@ public:
solver * mk_default_solver() { solver * mk_default_solver() {
return alloc(default_solver); return alloc(default_solver);
} }
#endif

View file

@ -20,7 +20,6 @@ Notes:
#include"cmd_context.h" #include"cmd_context.h"
#include"cmd_util.h" #include"cmd_util.h"
#include"parametric_cmd.h" #include"parametric_cmd.h"
#include"install_tactics.h"
#include"scoped_timer.h" #include"scoped_timer.h"
#include"scoped_ctrl_c.h" #include"scoped_ctrl_c.h"
#include"cancel_eh.h" #include"cancel_eh.h"
@ -390,13 +389,12 @@ public:
}; };
void install_tactic_cmds(cmd_context & ctx) { void install_core_tactic_cmds(cmd_context & ctx) {
ctx.insert(alloc(declare_tactic_cmd)); ctx.insert(alloc(declare_tactic_cmd));
ctx.insert(alloc(get_user_tactics_cmd)); ctx.insert(alloc(get_user_tactics_cmd));
ctx.insert(alloc(help_tactic_cmd)); ctx.insert(alloc(help_tactic_cmd));
ctx.insert(alloc(check_sat_using_tactict_cmd)); ctx.insert(alloc(check_sat_using_tactict_cmd));
ctx.insert(alloc(apply_tactic_cmd)); ctx.insert(alloc(apply_tactic_cmd));
install_tactics(ctx);
} }
static tactic * mk_and_then(cmd_context & ctx, sexpr * n) { static tactic * mk_and_then(cmd_context & ctx, sexpr * n) {

View file

@ -45,7 +45,7 @@ public:
tactic * mk(ast_manager & m); tactic * mk(ast_manager & m);
}; };
void install_tactic_cmds(cmd_context & ctx); void install_core_tactic_cmds(cmd_context & ctx);
tactic * sexpr2tactic(cmd_context & ctx, sexpr * n); tactic * sexpr2tactic(cmd_context & ctx, sexpr * n);
class probe_info { class probe_info {

2
src/simplifier/README Normal file
View file

@ -0,0 +1,2 @@
Simplifier module is now obsolete.
It is still being used in many places, but we will eventually replace all occurrences with the new rewriter module.