23 lines
649 B
C++
23 lines
649 B
C++
/*
|
|
Copyright (c) 2016 Microsoft Corporation. All rights reserved.
|
|
Released under Apache 2.0 license as described in the file LICENSE.
|
|
|
|
Author: Leonardo de Moura
|
|
*/
|
|
#include "library/annotation.h"
|
|
|
|
namespace lean {
|
|
static name * g_by_name = nullptr;
|
|
|
|
expr mk_by(expr const & e) { return mk_annotation(*g_by_name, e); }
|
|
bool is_by(expr const & e) { return is_annotation(e, *g_by_name); }
|
|
expr const & get_by_arg(expr const & e) { lean_assert(is_by(e)); return get_annotation_arg(e); }
|
|
|
|
void initialize_elaborate() {
|
|
g_by_name = new name("by");
|
|
register_annotation(*g_by_name);
|
|
}
|
|
void finalize_elaborate() {
|
|
delete g_by_name;
|
|
}
|
|
}
|