I kept a few core methods (e.g., exact_core and apply_core). Reason:
if we use default parameters
meta constant exact (e : expr) (md := semireducible) : tactic unit
then, we will not be able to write
to_expr p >>= exact
The workaround is
do t <- to_expr p, exact t
or
to_expr p >>= (fun x, exact x)
One alternative is to change how we handle default parameters, and
eta-expand applications that involve default parameters.
We may also have an attribute [eta_expand]. Then
attribute [eta_expand] foo
instructs the elaborator to automatically eta-expand foo-applications.
The attribute would give users more control, and avoid potential
performance problems. Without the attribute, then for every function
application the elaborator has to check the type and decide whether it
must be eta-expanded or not.
@gebner @kha What do you think?
21 lines
659 B
Text
21 lines
659 B
Text
open tactic name list
|
|
|
|
definition foo (a : nat) := a + 1 > 0
|
|
attribute [reducible]
|
|
definition boo (a : nat) := a + 1 > 0
|
|
|
|
example : ∀ (a b : nat), foo a → boo a → a + 1 > 0 → foo a :=
|
|
by do
|
|
intro_lst [`_, `_, `H1, `H2, `H3],
|
|
trace_state,
|
|
h1 ← get_local_type `H1,
|
|
h2 ← get_local_type `H2,
|
|
h3 ← get_local_type `H3,
|
|
unify h1 h2,
|
|
unify h2 h3,
|
|
unify h1 h3,
|
|
(unify h1 h2 reducible <|> trace "H1 =?= H2 failed if only reducible constants can be unfolded"),
|
|
unify h2 h3 reducible,
|
|
(unify h1 h3 reducible <|> trace "H1 =?= H3 failed if only reducible constants can be unfolded"),
|
|
assumption,
|
|
return ()
|