lean4-htt/tests/lean/inst.lean
Sebastian Ullrich 8bbcbb14cf chore(library, tests): use new attribute chaining syntax
sed -E -i 's/(attribute(\s*(\w|\.)+)* \[[^]]+)\] \[/\1, /' {library,tests}/**/*.lean  # repeat as needed
2016-08-16 13:49:03 -07:00

26 lines
567 B
Text

--
set_option pp.notation false
inductive C [class] (A : Type) :=
mk : A → C A
definition val {A : Type} (c : C A) : A :=
C.rec (λa, a) c
constant magic (A : Type) : A
attribute [instance, priority std.priority.max]
definition C_magic (A : Type) : C A :=
C.mk (magic A)
attribute [instance]
definition C_prop : C Prop :=
C.mk true
attribute [instance]
definition C_prod {A B : Type} (Ha : C A) (Hb : C B) : C (prod A B) :=
C.mk (pair (val Ha) (val Hb))
-- C_magic will be used because it has max priority
definition test : C (prod Prop Prop) := _
eval test