aboutsummaryrefslogtreecommitdiff
path: root/tactics
diff options
context:
space:
mode:
authorYves Bertot2013-03-02 14:00:46 -0500
committerMatthieu Sozeau2014-05-06 09:58:57 +0200
commit8a905458039b631165d068bbf62f88e11eb36eb1 (patch)
treef4f96ea7b7d482fc79acb6edb3b1c96aec2555a5 /tactics
parent29794b8acf407518716f8c02c2ed20729f8802e5 (diff)
Adapt Y. Bertot's path on private inductives (now the keyword is "Private").
A quick and dirty approach to private inductive types Types for which computable functions are provided, but pattern-matching is disallowed. This kind of type can be used to simulate simple forms of higher inductive types, with convertibility for applications of the inductive principle to 0-constructors Conflicts: intf/vernacexpr.mli kernel/declarations.ml kernel/declarations.mli kernel/entries.mli kernel/indtypes.ml library/declare.ml parsing/g_vernac.ml4 plugins/funind/glob_term_to_relation.ml pretyping/indrec.ml pretyping/tacred.mli printing/ppvernac.ml toplevel/vernacentries.ml Conflicts: kernel/declarations.mli kernel/declareops.ml kernel/indtypes.ml kernel/modops.ml
Diffstat (limited to 'tactics')
-rw-r--r--tactics/equality.ml6
1 files changed, 4 insertions, 2 deletions
diff --git a/tactics/equality.ml b/tactics/equality.ml
index 57931f6006..eb8d27f253 100644
--- a/tactics/equality.ml
+++ b/tactics/equality.ml
@@ -755,7 +755,8 @@ let descend_then sigma env head dirn =
try find_rectype env sigma (get_type_of env sigma head)
with Not_found ->
error "Cannot project on an inductive type derived from a dependency." in
- let (ind,_),_ = dest_ind_family indf in
+ let indp,_ = (dest_ind_family indf) in
+ let ind, _ = check_privacy env indp in
let (mib,mip) = lookup_mind_specif env ind in
let cstr = get_constructors env indf in
let dirn_nlams = cstr.(dirn-1).cs_nargs in
@@ -804,7 +805,8 @@ let construct_discriminator sigma env dirn c sort =
errorlabstrm "Equality.construct_discriminator"
(str "Cannot discriminate on inductive constructors with \
dependent types.") in
- let ((ind,_),_) = dest_ind_family indf in
+ let (indp,_) = dest_ind_family indf in
+ let ind, _ = check_privacy env indp in
let (mib,mip) = lookup_mind_specif env ind in
let (true_0,false_0,sort_0) = build_coq_True(),build_coq_False(),Prop Null in
let deparsign = make_arity_signature env true indf in