refactor(kernel): remove unnecessary module

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
Leonardo de Moura 2014-05-17 12:35:41 -07:00
parent a85a6b685b
commit 4348d5e63f
5 changed files with 1 additions and 52 deletions

View file

@ -1,5 +1,5 @@
add_library(kernel level.cpp expr.cpp expr_eq_fn.cpp for_each_fn.cpp add_library(kernel level.cpp expr.cpp expr_eq_fn.cpp for_each_fn.cpp
replace_fn.cpp free_vars.cpp abstract.cpp instantiate.cpp context.cpp replace_fn.cpp free_vars.cpp abstract.cpp instantiate.cpp
formatter.cpp definition.cpp replace_visitor.cpp environment.cpp formatter.cpp definition.cpp replace_visitor.cpp environment.cpp
justification.cpp pos_info_provider.cpp metavar.cpp converter.cpp justification.cpp pos_info_provider.cpp metavar.cpp converter.cpp
constraint.cpp type_checker.cpp error_msgs.cpp kernel_exception.cpp ) constraint.cpp type_checker.cpp error_msgs.cpp kernel_exception.cpp )

View file

@ -1,29 +0,0 @@
/*
Copyright (c) 2013 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Author: Leonardo de Moura
*/
#include <utility>
#include "util/exception.h"
#include "kernel/context.h"
namespace lean {
binder const & lookup(context const & c, unsigned i) {
auto const * it = &c;
while (*it) {
if (i == 0)
return head(*it);
--i;
it = &tail(*it);
}
throw exception("unknown free variable");
}
optional<binder> find(context const & c, unsigned i) {
try {
return optional<binder>(lookup(c, i));
} catch (exception &) {
return optional<binder>();
}
}
}

View file

@ -1,20 +0,0 @@
/*
Copyright (c) 2013 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Author: Leonardo de Moura
*/
#pragma once
#include <utility>
#include "util/list.h"
#include "util/optional.h"
#include "kernel/expr.h"
namespace lean {
// Remark: in a nonempty context C, variable 0 is head(C)
typedef list<binder> context;
inline context extend(context const & c, name const & n, expr const & t) { return cons(binder(n, t), c); }
inline context extend(context const & c, binder const & b) { return cons(b, c); }
binder const & lookup(context const & c, unsigned i);
optional<binder> find(context const & c, unsigned i);
}

View file

@ -10,7 +10,6 @@ Author: Leonardo de Moura
#include <tuple> #include <tuple>
#include "util/list.h" #include "util/list.h"
#include "kernel/environment.h" #include "kernel/environment.h"
#include "kernel/context.h"
namespace lean { namespace lean {
namespace inductive { namespace inductive {

View file

@ -8,7 +8,6 @@ Author: Leonardo de Moura
#include <vector> #include <vector>
#include "util/exception.h" #include "util/exception.h"
#include "util/sexpr/options.h" #include "util/sexpr/options.h"
#include "kernel/context.h"
#include "kernel/environment.h" #include "kernel/environment.h"
#include "kernel/formatter.h" #include "kernel/formatter.h"