f177082c3b
@avigad and @fpvandoorn, I changed the metaclasses names. They were not uniform: - The plural was used in some cases (e.g., [coercions]). - In other cases a cryptic name was used (e.g., [brs]). Now, I tried to use the attribute name as the metaclass name whenever possible. For example, we write definition foo [coercion] ... definition bla [forward] ... and open [coercion] nat open [forward] nat It is easier to remember and is uniform.
53 lines
685 B
Text
53 lines
685 B
Text
prelude namespace foo
|
|
constant A : Type.{1}
|
|
constant a : A
|
|
constant x : A
|
|
constant c : A
|
|
end foo
|
|
|
|
section
|
|
open foo (renaming a->b x->y) (hiding c)
|
|
check b
|
|
check y
|
|
check c -- Error
|
|
end
|
|
|
|
section
|
|
open foo (a x)
|
|
check a
|
|
check x
|
|
check c -- Error
|
|
end
|
|
|
|
section
|
|
open foo (a x) (hiding c) -- Error
|
|
end
|
|
|
|
section
|
|
open foo
|
|
check a
|
|
check c
|
|
check A
|
|
end
|
|
|
|
namespace foo
|
|
constant f : A → A → A
|
|
infix ` * `:75 := f
|
|
end foo
|
|
|
|
section
|
|
open foo
|
|
check a * c
|
|
end
|
|
|
|
section
|
|
open [notation] foo -- use only the notation
|
|
check foo.a * foo.c
|
|
check a * c -- Error
|
|
end
|
|
|
|
section
|
|
open [decl] foo -- use only the declarations
|
|
check f a c
|
|
check a*c -- Error
|
|
end
|