feat(frontends/lean): rename 'wait' to 'reveal'
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
f8e2f68ce0
commit
4e35afedcc
20 changed files with 25 additions and 25 deletions
|
@ -16,7 +16,7 @@
|
|||
"alias" "help" "environment" "options" "precedence" "reserve"
|
||||
"match" "infix" "infixl" "infixr" "notation" "postfix" "prefix"
|
||||
"tactic_infix" "tactic_infixl" "tactic_infixr" "tactic_notation" "tactic_postfix" "tactic_prefix"
|
||||
"eval" "check" "coercion" "end" "wait"
|
||||
"eval" "check" "coercion" "end" "reveal"
|
||||
"using" "namespace" "section" "fields" "find_decl"
|
||||
"attribute" "local" "set_option" "add_rewrite" "extends" "include" "omit" "classes"
|
||||
"instances" "coercions" "metaclasses" "raw" "migrate" "replacing")
|
||||
|
|
|
@ -1410,14 +1410,14 @@ environment local_attribute_cmd(parser & p) {
|
|||
return attribute_cmd_core(p, false);
|
||||
}
|
||||
|
||||
static environment wait_cmd(parser & p) {
|
||||
static environment reveal_cmd(parser & p) {
|
||||
buffer<name> ds;
|
||||
name d = p.check_constant_next("invalid 'wait' command, constant expected");
|
||||
name d = p.check_constant_next("invalid 'reveal' command, constant expected");
|
||||
ds.push_back(d);
|
||||
while (p.curr_is_identifier()) {
|
||||
ds.push_back(p.check_constant_next("invalid 'wait' command, constant expected"));
|
||||
ds.push_back(p.check_constant_next("invalid 'reveal' command, constant expected"));
|
||||
}
|
||||
return p.wait_theorems(ds);
|
||||
return p.reveal_theorems(ds);
|
||||
}
|
||||
|
||||
void register_decl_cmds(cmd_table & r) {
|
||||
|
@ -1436,7 +1436,7 @@ void register_decl_cmds(cmd_table & r) {
|
|||
add_cmd(r, cmd_info("private", "add new private definition/theorem", private_definition_cmd));
|
||||
add_cmd(r, cmd_info("protected", "add new protected definition/theorem", protected_definition_cmd));
|
||||
add_cmd(r, cmd_info("theorem", "add new theorem", theorem_cmd));
|
||||
add_cmd(r, cmd_info("wait", "wait for theorems to be processed", wait_cmd));
|
||||
add_cmd(r, cmd_info("reveal", "reveal given theorems", reveal_cmd));
|
||||
add_cmd(r, cmd_info("include", "force section parameter/variable to be included", include_cmd));
|
||||
add_cmd(r, cmd_info("attribute", "set declaration attributes", attribute_cmd));
|
||||
add_cmd(r, cmd_info("abbreviation", "declare a new abbreviation", abbreviation_cmd));
|
||||
|
|
|
@ -1821,7 +1821,7 @@ void parser::add_delayed_theorem(certified_declaration const & cd) {
|
|||
m_theorem_queue.add(cd);
|
||||
}
|
||||
|
||||
environment parser::wait_theorems(buffer<name> const & ds) {
|
||||
environment parser::reveal_theorems(buffer<name> const & ds) {
|
||||
m_theorem_queue.for_each([&](certified_declaration const & thm) {
|
||||
if (keep_new_thms()) {
|
||||
name const & thm_name = thm.get_declaration().get_name();
|
||||
|
|
|
@ -301,7 +301,7 @@ public:
|
|||
unsigned num_threads() const { return m_num_threads; }
|
||||
void add_delayed_theorem(environment const & env, name const & n, level_param_names const & ls, expr const & t, expr const & v);
|
||||
void add_delayed_theorem(certified_declaration const & cd);
|
||||
environment wait_theorems(buffer<name> const & ds);
|
||||
environment reveal_theorems(buffer<name> const & ds);
|
||||
|
||||
/** \brief Read the next token. */
|
||||
void scan() { m_curr = m_scanner.scan(m_env); }
|
||||
|
|
|
@ -103,7 +103,7 @@ void init_token_table(token_table & t) {
|
|||
{"<d", g_decreasing_prec}, {"renaming", 0}, {"extends", 0}, {nullptr, 0}};
|
||||
|
||||
char const * commands[] =
|
||||
{"theorem", "axiom", "axioms", "variable", "protected", "private", "wait",
|
||||
{"theorem", "axiom", "axioms", "variable", "protected", "private", "reveal",
|
||||
"definition", "example", "coercion", "abbreviation",
|
||||
"variables", "parameter", "parameters", "constant", "constants", "[persistent]", "[visible]", "[instance]",
|
||||
"[none]", "[class]", "[coercion]", "[reducible]", "[irreducible]", "[semireducible]", "[quasireducible]",
|
||||
|
|
|
@ -14,5 +14,5 @@ begin
|
|||
cases H₃,
|
||||
apply rfl
|
||||
end
|
||||
wait foo.eq
|
||||
reveal foo.eq
|
||||
print definition foo.eq
|
||||
|
|
|
@ -7,5 +7,5 @@ calc d == c : H₃
|
|||
... == a₂ : H₁
|
||||
... = a₁ : H₀
|
||||
|
||||
wait tst
|
||||
reveal tst
|
||||
print definition tst
|
||||
|
|
|
@ -3,7 +3,7 @@ open prod nonempty inhabited
|
|||
|
||||
theorem H {A B : Type} (H1 : inhabited A) : inhabited (Prop × A × (B → num))
|
||||
:= _
|
||||
wait H
|
||||
reveal H
|
||||
(*
|
||||
print(get_env():find("H"):value())
|
||||
*)
|
||||
|
|
|
@ -11,7 +11,7 @@ section
|
|||
|
||||
end
|
||||
|
||||
wait tst
|
||||
reveal tst
|
||||
(*
|
||||
print(get_env():find("tst"):value())
|
||||
*)
|
||||
|
|
|
@ -32,7 +32,7 @@ have h1 [visible] : inh A, from inh.intro a,
|
|||
have h2 [visible] : inh C, from inh_exists H2,
|
||||
_
|
||||
|
||||
wait T1
|
||||
reveal T1
|
||||
(*
|
||||
print(get_env():find("T1"):value())
|
||||
*)
|
||||
|
|
|
@ -5,7 +5,7 @@ theorem tst1 : inhabited (vector nat 2)
|
|||
|
||||
theorem tst2 : inhabited (Prop × (Π n : nat, vector nat n))
|
||||
|
||||
wait tst2
|
||||
reveal tst2
|
||||
(*
|
||||
print(get_env():find("tst2"):value())
|
||||
*)
|
||||
|
|
|
@ -64,5 +64,5 @@ theorem add_eq_addl : ∀ x y, x + y = x ⊕ y
|
|||
rewrite [s_add, add_eq_addl]
|
||||
end
|
||||
|
||||
wait add_eq_addl
|
||||
reveal add_eq_addl
|
||||
print definition add_eq_addl
|
||||
|
|
|
@ -10,5 +10,5 @@ begin
|
|||
end
|
||||
end
|
||||
|
||||
wait tst
|
||||
reveal tst
|
||||
print definition tst
|
||||
|
|
|
@ -22,7 +22,7 @@ begin
|
|||
end
|
||||
end
|
||||
|
||||
wait tst
|
||||
reveal tst
|
||||
print definition tst
|
||||
|
||||
theorem tst2 (a b c d : Prop) : a ∧ b ∧ c ∧ d ↔ d ∧ c ∧ b ∧ a :=
|
||||
|
@ -31,5 +31,5 @@ begin
|
|||
repeat (intro H; repeat (cases H with [H', H] | apply and.intro | assumption))
|
||||
end
|
||||
|
||||
wait tst2
|
||||
reveal tst2
|
||||
print definition tst2
|
||||
|
|
|
@ -23,7 +23,7 @@ begin
|
|||
apply (eq.rec_on Heq Hp)
|
||||
end
|
||||
|
||||
wait foo1 foo2
|
||||
reveal foo1 foo2
|
||||
|
||||
print definition foo1
|
||||
print definition foo2
|
||||
|
|
|
@ -24,6 +24,6 @@ begin
|
|||
apply (eq.rec_on Heq Hp)
|
||||
end
|
||||
|
||||
wait foo1 foo2
|
||||
reveal foo1 foo2
|
||||
print definition foo1
|
||||
print definition foo2
|
||||
|
|
|
@ -6,5 +6,5 @@ begin
|
|||
rewrite [add.assoc, {b + _}add.comm, -add.assoc]
|
||||
end
|
||||
|
||||
wait test
|
||||
reveal test
|
||||
print definition test
|
||||
|
|
|
@ -25,7 +25,7 @@ begin
|
|||
rewrite [+mul_zero, +zero_mul, +add_zero] -- in rewrite rules, + is notation for one or more
|
||||
end
|
||||
|
||||
wait test3
|
||||
reveal test3
|
||||
print definition test3
|
||||
|
||||
theorem test4 {A : Type} [s : comm_ring A] (a b c : A) : a * 0 + 0 * b + c * 0 + 0 * a = 0 :=
|
||||
|
|
|
@ -7,7 +7,7 @@ theorem tst1 {A : Type} {a b c : A} {p : A → A → Prop} (H1 : p a b) (H2 : p
|
|||
theorem tst2 {A : Type} {a b c d : A} {p : A → A → Prop} (Ha : p a c) (H1 : p a b) (Hb : p b d) (H2 : p b c) : ∃ x, p a x ∧ p x c
|
||||
:= by apply exists.intro; apply and.intro; eassumption; eassumption
|
||||
|
||||
wait tst2
|
||||
reveal tst2
|
||||
(*
|
||||
print(get_env():find("tst2"):value())
|
||||
*)
|
||||
|
|
|
@ -15,5 +15,5 @@ begin
|
|||
apply rfl
|
||||
end
|
||||
|
||||
wait foo.eq
|
||||
reveal foo.eq
|
||||
print definition foo.eq
|
||||
|
|
Loading…
Reference in a new issue