2014-09-22 17:27:48 +00:00
|
|
|
/*
|
|
|
|
Copyright (c) 2014 Microsoft Corporation. All rights reserved.
|
|
|
|
Released under Apache 2.0 license as described in the file LICENSE.
|
|
|
|
|
|
|
|
Author: Leonardo de Moura
|
|
|
|
*/
|
2014-09-24 16:18:53 +00:00
|
|
|
#include "util/stackinfo.h"
|
2014-09-24 19:51:04 +00:00
|
|
|
#include "util/thread.h"
|
2014-09-22 22:26:41 +00:00
|
|
|
#include "util/init_module.h"
|
2014-09-24 17:10:12 +00:00
|
|
|
#include "util/numerics/init_module.h"
|
2014-09-22 17:27:48 +00:00
|
|
|
#include "util/sexpr/init_module.h"
|
2014-09-22 22:26:41 +00:00
|
|
|
#include "kernel/init_module.h"
|
2014-09-23 00:30:29 +00:00
|
|
|
#include "kernel/inductive/inductive.h"
|
2014-09-22 17:27:48 +00:00
|
|
|
#include "library/init_module.h"
|
|
|
|
#include "library/tactic/init_module.h"
|
2014-09-24 16:18:53 +00:00
|
|
|
#include "library/print.h"
|
2014-09-22 17:27:48 +00:00
|
|
|
#include "frontends/lean/init_module.h"
|
2014-09-24 16:18:53 +00:00
|
|
|
#include "frontends/lua/register_modules.h"
|
2014-09-22 17:27:48 +00:00
|
|
|
#include "init/init.h"
|
|
|
|
|
|
|
|
namespace lean {
|
|
|
|
void initialize() {
|
2014-09-24 16:18:53 +00:00
|
|
|
save_stack_info();
|
2014-09-22 22:26:41 +00:00
|
|
|
initialize_util_module();
|
2014-09-24 17:10:12 +00:00
|
|
|
initialize_numerics_module();
|
2014-09-22 17:27:48 +00:00
|
|
|
initialize_sexpr_module();
|
2014-09-22 22:26:41 +00:00
|
|
|
initialize_kernel_module();
|
2014-09-23 00:30:29 +00:00
|
|
|
initialize_inductive_module();
|
2014-09-22 17:27:48 +00:00
|
|
|
initialize_library_module();
|
|
|
|
initialize_tactic_module();
|
|
|
|
initialize_frontend_lean_module();
|
2014-09-24 16:18:53 +00:00
|
|
|
init_default_print_fn();
|
|
|
|
register_modules();
|
2014-09-22 17:27:48 +00:00
|
|
|
}
|
|
|
|
void finalize() {
|
2014-09-24 19:51:04 +00:00
|
|
|
run_thread_finalizers();
|
2014-09-22 17:27:48 +00:00
|
|
|
finalize_frontend_lean_module();
|
|
|
|
finalize_tactic_module();
|
|
|
|
finalize_library_module();
|
2014-09-23 00:30:29 +00:00
|
|
|
finalize_inductive_module();
|
2014-09-22 22:26:41 +00:00
|
|
|
finalize_kernel_module();
|
2014-09-22 17:27:48 +00:00
|
|
|
finalize_sexpr_module();
|
2014-09-24 17:10:12 +00:00
|
|
|
finalize_numerics_module();
|
2014-09-22 22:26:41 +00:00
|
|
|
finalize_util_module();
|
2014-09-24 19:51:04 +00:00
|
|
|
run_post_thread_finalizers();
|
2014-09-22 17:27:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
initializer::initializer() {
|
|
|
|
initialize();
|
|
|
|
}
|
|
|
|
|
|
|
|
initializer::~initializer() {
|
|
|
|
finalize();
|
|
|
|
}
|
|
|
|
}
|