fix(library/definitional): add missing files
This commit is contained in:
parent
c306bfa83c
commit
edd94c00df
2 changed files with 36 additions and 0 deletions
24
src/library/definitional/eq.cpp
Normal file
24
src/library/definitional/eq.cpp
Normal file
|
@ -0,0 +1,24 @@
|
|||
/*
|
||||
Copyright (c) 2014 Microsoft Corporation. All rights reserved.
|
||||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
|
||||
Author: Leonardo de Moura
|
||||
*/
|
||||
#include "kernel/environment.h"
|
||||
|
||||
namespace lean {
|
||||
bool has_eq_decls(environment const & env) {
|
||||
auto d = env.find(name({"eq", "refl"}));
|
||||
if (!d)
|
||||
return false;
|
||||
if (length(d->get_univ_params()) != 1)
|
||||
return false;
|
||||
expr type = d->get_type();
|
||||
if (!is_pi(type) || !is_pi(binding_body(type)))
|
||||
return false;
|
||||
type = get_app_fn(binding_body(binding_body(type)));
|
||||
if (!is_constant(type))
|
||||
return false;
|
||||
return const_name(type) == "eq";
|
||||
}
|
||||
}
|
12
src/library/definitional/eq.h
Normal file
12
src/library/definitional/eq.h
Normal file
|
@ -0,0 +1,12 @@
|
|||
/*
|
||||
Copyright (c) 2014 Microsoft Corporation. All rights reserved.
|
||||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
|
||||
Author: Leonardo de Moura
|
||||
*/
|
||||
#pragma once
|
||||
#include "kernel/environment.h"
|
||||
|
||||
namespace lean {
|
||||
bool has_eq_decls(environment const & env);
|
||||
}
|
Loading…
Reference in a new issue