2
(** Print Assumption and opaque modules :
4
Print Assumption used to consider as axioms the modular fields
5
unexported by their signature, cf bug report #2186. This should
6
now be fixed, let's test this here. *)
8
(* First, a minimal test-case *)
17
Module Hide. (* An entire sub-module could be hidden *)
20
Definition bar := Hide.x.
24
Definition y := X.bar. (* A non-exported field *)
30
Print Assumptions M.bar. (* Should answer: foo *)
31
Print Assumptions P.bar. (* Should answer: foo *)
34
(* The original test-case of the bug-report *)
38
Axiom extensionality : forall P Q (f g:P -> Q),
39
(forall x, f x = g x) -> f = g.
41
Module Type ADD_COMM_EXT.
42
Axiom add_comm_ext : forall n, (fun x => x + n) = (fun x => n + x).
45
Module AddCommExt_Opaque : ADD_COMM_EXT.
46
Lemma add_comm_ext : forall n, (fun x => x + n) = (fun x => n + x).
48
intro n; apply extensionality; auto with arith.
50
End AddCommExt_Opaque.
52
Module AddCommExt_Transparent <: ADD_COMM_EXT.
53
Lemma add_comm_ext : forall n, (fun x => x + n) = (fun x => n + x).
55
intro n; apply extensionality; auto with arith.
57
End AddCommExt_Transparent.
59
Print Assumptions AddCommExt_Opaque.add_comm_ext.
60
(* Should answer: extensionality *)
62
Print Assumptions AddCommExt_Transparent.add_comm_ext.
63
(* Should answer: extensionality *)
65
Lemma add1_comm_ext_opaque :
66
(fun x => x + 1) = (fun x => 1 + x).
67
Proof (AddCommExt_Opaque.add_comm_ext 1).
69
Lemma add1_comm_ext_transparent :
70
(fun x => x + 1) = (fun x => 1 + x).
71
Proof (AddCommExt_Transparent.add_comm_ext 1).
73
Print Assumptions add1_comm_ext_opaque.
74
(* Should answer: extensionality *)
76
Print Assumptions add1_comm_ext_transparent.
77
(* Should answer: extensionality *)
79
Module Type FALSE_POSITIVE.
80
Axiom add_comm : forall n x, x + n = n + x.
83
Module false_positive : FALSE_POSITIVE.
84
Lemma add_comm : forall n x, x + n = n + x.
85
Proof. auto with arith. Qed.
87
Print Assumptions add_comm.
88
(* Should answer : Closed under the global context *)
91
Lemma comm_plus5 : forall x,
93
Proof (false_positive.add_comm 5).
95
Print Assumptions comm_plus5.
96
(* Should answer : Closed under the global context *)