From b76cdb1c68135bb44efbfaecf3b60d6360480d32 Mon Sep 17 00:00:00 2001 From: Leonardo de Moura Date: Tue, 10 Nov 2015 11:03:54 -0800 Subject: [PATCH] refactor(library/blast): move blast options to separate module --- src/library/blast/CMakeLists.txt | 3 +- src/library/blast/blast.cpp | 37 +-------------------- src/library/blast/init_module.cpp | 3 ++ src/library/blast/options.cpp | 53 +++++++++++++++++++++++++++++++ src/library/blast/options.h | 17 ++++++++++ 5 files changed, 76 insertions(+), 37 deletions(-) create mode 100644 src/library/blast/options.cpp create mode 100644 src/library/blast/options.h diff --git a/src/library/blast/CMakeLists.txt b/src/library/blast/CMakeLists.txt index e4749b7f1..6e0e49beb 100644 --- a/src/library/blast/CMakeLists.txt +++ b/src/library/blast/CMakeLists.txt @@ -1,2 +1,3 @@ add_library(blast OBJECT expr.cpp state.cpp blast.cpp blast_tactic.cpp - init_module.cpp simplifier.cpp assumption.cpp intros.cpp proof_expr.cpp) + init_module.cpp simplifier.cpp assumption.cpp intros.cpp proof_expr.cpp + options.cpp) diff --git a/src/library/blast/blast.cpp b/src/library/blast/blast.cpp index a192f1f0f..635c6c8c1 100644 --- a/src/library/blast/blast.cpp +++ b/src/library/blast/blast.cpp @@ -6,7 +6,6 @@ Author: Leonardo de Moura */ #include #include "util/sstream.h" -#include "util/sexpr/option_declarations.h" #include "kernel/for_each_fn.h" #include "kernel/type_checker.h" #include "library/replace_visitor.h" @@ -24,38 +23,14 @@ Author: Leonardo de Moura #include "library/blast/assumption.h" #include "library/blast/intros.h" #include "library/blast/proof_expr.h" +#include "library/blast/options.h" #include "library/blast/blast_exception.h" -#ifndef LEAN_DEFAULT_BLAST_MAX_DEPTH -#define LEAN_DEFAULT_BLAST_MAX_DEPTH 128 -#endif -#ifndef LEAN_DEFAULT_BLAST_INIT_DEPTH -#define LEAN_DEFAULT_BLAST_INIT_DEPTH 1 -#endif -#ifndef LEAN_DEFAULT_BLAST_INC_DEPTH -#define LEAN_DEFAULT_BLAST_INC_DEPTH 5 -#endif - namespace lean { namespace blast { static name * g_prefix = nullptr; static name * g_tmp_prefix = nullptr; -/* Options */ -static name * g_blast_max_depth = nullptr; -static name * g_blast_init_depth = nullptr; -static name * g_blast_inc_depth = nullptr; - -unsigned get_blast_max_depth(options const & o) { - return o.get_unsigned(*g_blast_max_depth, LEAN_DEFAULT_BLAST_MAX_DEPTH); -} -unsigned get_blast_init_depth(options const & o) { - return o.get_unsigned(*g_blast_init_depth, LEAN_DEFAULT_BLAST_INIT_DEPTH); -} -unsigned get_blast_inc_depth(options const & o) { - return o.get_unsigned(*g_blast_inc_depth, LEAN_DEFAULT_BLAST_INC_DEPTH); -} - class blastenv { friend class scope_assignment; typedef std::vector tmp_type_context_pool; @@ -829,16 +804,6 @@ optional blast_goal(environment const & env, io_state const & ios, list