2015-12-06 00:55:04 +00:00
|
|
|
/*
|
|
|
|
Copyright (c) 2015 Microsoft Corporation. All rights reserved.
|
|
|
|
Released under Apache 2.0 license as described in the file LICENSE.
|
|
|
|
|
|
|
|
Author: Leonardo de Moura
|
|
|
|
*/
|
2015-12-06 02:17:15 +00:00
|
|
|
#include <string>
|
2015-12-06 21:04:41 +00:00
|
|
|
#include "library/blast/simplifier/simplifier_strategies.h"
|
2015-12-06 00:55:04 +00:00
|
|
|
#include "library/blast/strategies/simple_strategy.h"
|
|
|
|
#include "library/blast/strategies/preprocess_strategy.h"
|
|
|
|
|
|
|
|
namespace lean {
|
|
|
|
namespace blast {
|
2015-12-06 02:17:15 +00:00
|
|
|
static optional<expr> apply_preprocess() {
|
|
|
|
return preprocess_and_then([]() { return none_expr(); })();
|
|
|
|
}
|
|
|
|
|
2015-12-06 21:04:41 +00:00
|
|
|
static optional<expr> apply_simp() {
|
|
|
|
return mk_simplify_using_hypotheses_strategy()();
|
|
|
|
}
|
|
|
|
|
|
|
|
static optional<expr> apply_simp_nohyps() {
|
|
|
|
return mk_simplify_all_strategy()();
|
|
|
|
}
|
|
|
|
|
2015-12-06 00:55:04 +00:00
|
|
|
static optional<expr> apply_simple() {
|
|
|
|
return preprocess_and_then(mk_simple_strategy())();
|
|
|
|
}
|
|
|
|
|
|
|
|
optional<expr> apply_strategy() {
|
2015-12-06 02:17:15 +00:00
|
|
|
std::string s_name(get_config().m_strategy);
|
|
|
|
if (s_name == "preprocess") {
|
|
|
|
return apply_preprocess();
|
2015-12-06 21:04:41 +00:00
|
|
|
} else if (s_name == "simp") {
|
|
|
|
return apply_simp();
|
|
|
|
} else if (s_name == "simp_nohyps") {
|
|
|
|
return apply_simp_nohyps();
|
2015-12-06 02:17:15 +00:00
|
|
|
} else if (s_name == "simple") {
|
|
|
|
return apply_simple();
|
|
|
|
} else {
|
|
|
|
// TODO(Leo): add more builtin strategies
|
|
|
|
return apply_simple();
|
|
|
|
}
|
2015-12-06 00:55:04 +00:00
|
|
|
}
|
|
|
|
}}
|