Debian Codegraph @

test-suite/success/hyps_inclusion.v

raw
1 (* Simplified example for bug #1325 *)
2
3 (* Explanation: the proof engine see section variables as goal
4 variables; especially, it can change their types so that, at
5 type-checking, the section variables are not recognized
6 (Typeops.check_hyps_inclusion raises "types do no match"). It
7 worked before the introduction of polymorphic inductive types because
8 tactics were using Typing.type_of and not Typeops.typing; the former
9 was not checking hyps inclusion so that the discrepancy in the types
10 of section variables seen as goal variables was not a problem (at the
11 end, when the proof is completed, the section variable recovers its
12 original type and all is correct for Typeops) *)
13
14 Section A.
15 Variable H:not True.
16 Lemma f:nat->nat. destruct H. exact I. Defined.
17 Goal f 0=f 1.
18 red in H.
19 (* next tactic was failing wrt bug #1325 because type-checking the goal
20 detected a syntactically different type for the section variable H *)
21 case 0.
22 Abort.
23 End A.
24
25 (* Variant with polymorphic inductive types for bug #1325 *)
26
27 Section B.
28 Variable H:not True.
29 Inductive I (n:nat) : Type := C : H=H -> I n.
30 Goal I 0.
31 red in H.
32 case 0.
33 Abort.
34 End B.