lean2/tests/lean/run/tactic26.lean
Leonardo de Moura a23118d357 feat(frontends/lean): add tactic_notation command
This addresses the first part of issue #461

We still need support for tactic definitions
2015-04-27 17:46:13 -07:00

27 lines
838 B
Text

import logic data.num
open tactic inhabited
namespace foo
inductive sum (A : Type) (B : Type) : Type :=
| inl : A → sum A B
| inr : B → sum A B
theorem inl_inhabited {A : Type} (B : Type) (H : inhabited A) : inhabited (sum A B)
:= inhabited.destruct H (λ a, inhabited.mk (sum.inl B a))
theorem inr_inhabited (A : Type) {B : Type} (H : inhabited B) : inhabited (sum A B)
:= inhabited.destruct H (λ b, inhabited.mk (sum.inr A b))
notation `(` h `|` r:(foldl `|` (e r, tactic.or_else r e) h) `)` := r
infixl `;`:15 := tactic.and_then
definition my_tac := fixpoint (λ t, ( apply @inl_inhabited; t
| apply @inr_inhabited; t
| apply @num.is_inhabited
))
tactic_hint my_tac
theorem T : inhabited (sum false num)
end foo