lean4-htt/tests/lean/run/decl_olean.lean
Leonardo de Moura 0ba60e62d7 feat(kernel/quotient/quotient): make quotient module robust against users that define their own prelude's
Before this commit, an user could define their own prelude and change
the types of quot, quot.mk, quot.lift or quot.ind.
By doing that, they could prove false.

This commit prevents this kind of abuse.
It also modifies the definition of `quot` and avoids the `setoid`
dependency.
The previous `quot` type is now called `quotient`, and it is defined
using the new `quot` type provided by the kernel.

See discussion at #1330
2017-01-24 15:59:38 -08:00

18 lines
529 B
Text

open tactic
def g : nat → nat :=
λ n, 0
meta def show_pos (n : name) : command :=
do env ← get_env,
pos ← returnopt (env^.decl_pos_info n),
olean ← returnopt (env^.decl_olean n) <|> return "current file",
trace $ to_string n ++ " was defined at " ++ olean ++ " : " ++ to_string pos
run_command show_pos `add
run_command show_pos `nat.succ
run_command show_pos `subsingleton.intro
run_command show_pos `subsingleton.rec
run_command show_pos `nat.add
run_command show_pos `quotient
run_command show_pos `g