feat(frontends/lean): remove unnecessary option
This commit is contained in:
parent
bd28396be0
commit
e9c8de7bdf
6 changed files with 5 additions and 27 deletions
|
@ -122,7 +122,7 @@
|
||||||
"\[coercion\]" "\[unfold-f\]" "\[constructor\]" "\[reducible\]"
|
"\[coercion\]" "\[unfold-f\]" "\[constructor\]" "\[reducible\]"
|
||||||
"\[irreducible\]" "\[semireducible\]" "\[quasireducible\]" "\[wf\]"
|
"\[irreducible\]" "\[semireducible\]" "\[quasireducible\]" "\[wf\]"
|
||||||
"\[whnf\]" "\[multiple-instances\]" "\[none\]"
|
"\[whnf\]" "\[multiple-instances\]" "\[none\]"
|
||||||
"\[decls\]" "\[declarations\]" "\[all-transparent\]" "\[coercions\]" "\[classes\]"
|
"\[decls\]" "\[declarations\]" "\[coercions\]" "\[classes\]"
|
||||||
"\[symm\]" "\[subst\]" "\[refl\]" "\[trans\]"
|
"\[symm\]" "\[subst\]" "\[refl\]" "\[trans\]"
|
||||||
"\[notations\]" "\[abbreviations\]" "\[begin-end-hints\]" "\[tactic-hints\]"
|
"\[notations\]" "\[abbreviations\]" "\[begin-end-hints\]" "\[tactic-hints\]"
|
||||||
"\[reduce-hints\]" "\[unfold-hints\]" "\[aliases\]" "\[eqv\]" "\[localrefinfo\]"))
|
"\[reduce-hints\]" "\[unfold-hints\]" "\[aliases\]" "\[eqv\]" "\[localrefinfo\]"))
|
||||||
|
|
|
@ -481,25 +481,11 @@ environment check_cmd(parser & p) {
|
||||||
return p.env();
|
return p.env();
|
||||||
}
|
}
|
||||||
|
|
||||||
class all_transparent_converter : public default_converter {
|
|
||||||
public:
|
|
||||||
all_transparent_converter(environment const & env):
|
|
||||||
default_converter(env) {
|
|
||||||
}
|
|
||||||
virtual bool is_opaque(declaration const &) const {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
environment eval_cmd(parser & p) {
|
environment eval_cmd(parser & p) {
|
||||||
bool whnf = false;
|
bool whnf = false;
|
||||||
bool all_transparent = false;
|
|
||||||
if (p.curr_is_token(get_whnf_tk())) {
|
if (p.curr_is_token(get_whnf_tk())) {
|
||||||
p.next();
|
p.next();
|
||||||
whnf = true;
|
whnf = true;
|
||||||
} else if (p.curr_is_token(get_all_transparent_tk())) {
|
|
||||||
p.next();
|
|
||||||
all_transparent = true;
|
|
||||||
}
|
}
|
||||||
expr e; level_param_names ls;
|
expr e; level_param_names ls;
|
||||||
std::tie(e, ls) = parse_local_expr(p);
|
std::tie(e, ls) = parse_local_expr(p);
|
||||||
|
@ -507,12 +493,9 @@ environment eval_cmd(parser & p) {
|
||||||
if (whnf) {
|
if (whnf) {
|
||||||
auto tc = mk_type_checker(p.env(), p.mk_ngen());
|
auto tc = mk_type_checker(p.env(), p.mk_ngen());
|
||||||
r = tc->whnf(e).first;
|
r = tc->whnf(e).first;
|
||||||
} else if (all_transparent) {
|
|
||||||
type_checker tc(p.env(), name_generator(),
|
|
||||||
std::unique_ptr<converter>(new all_transparent_converter(p.env())));
|
|
||||||
r = normalize(tc, ls, e);
|
|
||||||
} else {
|
} else {
|
||||||
r = normalize(p.env(), ls, e);
|
type_checker tc(p.env());
|
||||||
|
r = normalize(tc, ls, e);
|
||||||
}
|
}
|
||||||
flycheck_information info(p.regular_stream());
|
flycheck_information info(p.regular_stream());
|
||||||
if (info.enabled()) {
|
if (info.enabled()) {
|
||||||
|
|
|
@ -108,7 +108,7 @@ void init_token_table(token_table & t) {
|
||||||
"variables", "parameter", "parameters", "constant", "constants", "[persistent]", "[visible]", "[instance]",
|
"variables", "parameter", "parameters", "constant", "constants", "[persistent]", "[visible]", "[instance]",
|
||||||
"[none]", "[class]", "[coercion]", "[reducible]", "[irreducible]", "[semireducible]", "[quasireducible]",
|
"[none]", "[class]", "[coercion]", "[reducible]", "[irreducible]", "[semireducible]", "[quasireducible]",
|
||||||
"[parsing-only]", "[multiple-instances]", "[symm]", "[trans]", "[refl]", "[subst]",
|
"[parsing-only]", "[multiple-instances]", "[symm]", "[trans]", "[refl]", "[subst]",
|
||||||
"evaluate", "check", "eval", "[wf]", "[whnf]", "[all-transparent]", "[priority", "[unfold-f]",
|
"evaluate", "check", "eval", "[wf]", "[whnf]", "[priority", "[unfold-f]",
|
||||||
"[constructor]", "[unfold-c", "print",
|
"[constructor]", "[unfold-c", "print",
|
||||||
"end", "namespace", "section", "prelude", "help",
|
"end", "namespace", "section", "prelude", "help",
|
||||||
"import", "inductive", "record", "structure", "module", "universe", "universes", "local",
|
"import", "inductive", "record", "structure", "module", "universe", "universes", "local",
|
||||||
|
|
|
@ -75,7 +75,6 @@ static name * g_as = nullptr;
|
||||||
static name * g_none = nullptr;
|
static name * g_none = nullptr;
|
||||||
static name * g_whnf = nullptr;
|
static name * g_whnf = nullptr;
|
||||||
static name * g_wf = nullptr;
|
static name * g_wf = nullptr;
|
||||||
static name * g_all_transparent = nullptr;
|
|
||||||
static name * g_in = nullptr;
|
static name * g_in = nullptr;
|
||||||
static name * g_at = nullptr;
|
static name * g_at = nullptr;
|
||||||
static name * g_assign = nullptr;
|
static name * g_assign = nullptr;
|
||||||
|
@ -209,7 +208,6 @@ void initialize_tokens() {
|
||||||
g_none = new name("[none]");
|
g_none = new name("[none]");
|
||||||
g_whnf = new name("[whnf]");
|
g_whnf = new name("[whnf]");
|
||||||
g_wf = new name("[wf]");
|
g_wf = new name("[wf]");
|
||||||
g_all_transparent = new name("[all-transparent]");
|
|
||||||
g_in = new name("in");
|
g_in = new name("in");
|
||||||
g_at = new name("at");
|
g_at = new name("at");
|
||||||
g_assign = new name(":=");
|
g_assign = new name(":=");
|
||||||
|
@ -359,7 +357,6 @@ void finalize_tokens() {
|
||||||
delete g_none;
|
delete g_none;
|
||||||
delete g_whnf;
|
delete g_whnf;
|
||||||
delete g_wf;
|
delete g_wf;
|
||||||
delete g_all_transparent;
|
|
||||||
delete g_ellipsis;
|
delete g_ellipsis;
|
||||||
delete g_match;
|
delete g_match;
|
||||||
delete g_fun;
|
delete g_fun;
|
||||||
|
@ -480,7 +477,6 @@ name const & get_as_tk() { return *g_as; }
|
||||||
name const & get_none_tk() { return *g_none; }
|
name const & get_none_tk() { return *g_none; }
|
||||||
name const & get_whnf_tk() { return *g_whnf; }
|
name const & get_whnf_tk() { return *g_whnf; }
|
||||||
name const & get_wf_tk() { return *g_wf; }
|
name const & get_wf_tk() { return *g_wf; }
|
||||||
name const & get_all_transparent_tk() { return *g_all_transparent; }
|
|
||||||
name const & get_in_tk() { return *g_in; }
|
name const & get_in_tk() { return *g_in; }
|
||||||
name const & get_at_tk() { return *g_at; }
|
name const & get_at_tk() { return *g_at; }
|
||||||
name const & get_assign_tk() { return *g_assign; }
|
name const & get_assign_tk() { return *g_assign; }
|
||||||
|
|
|
@ -77,7 +77,6 @@ name const & get_as_tk();
|
||||||
name const & get_none_tk();
|
name const & get_none_tk();
|
||||||
name const & get_whnf_tk();
|
name const & get_whnf_tk();
|
||||||
name const & get_wf_tk();
|
name const & get_wf_tk();
|
||||||
name const & get_all_transparent_tk();
|
|
||||||
name const & get_in_tk();
|
name const & get_in_tk();
|
||||||
name const & get_at_tk();
|
name const & get_at_tk();
|
||||||
name const & get_assign_tk();
|
name const & get_assign_tk();
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import logic
|
import logic
|
||||||
eval [all-transparent] λ (A : Type) (x y : A) (H₁ : x = y) (H₂ : y = x), eq.trans H₁ H₂
|
eval λ (A : Type) (x y : A) (H₁ : x = y) (H₂ : y = x), eq.trans H₁ H₂
|
||||||
-- Should not reduce to
|
-- Should not reduce to
|
||||||
-- λ (A : Type) (x y : A), eq.trans
|
-- λ (A : Type) (x y : A), eq.trans
|
||||||
|
|
Loading…
Reference in a new issue