From 05c87ba330a9b4d02b150c196e390b9dd30be341 Mon Sep 17 00:00:00 2001 From: Matthieu Sozeau Date: Thu, 31 Oct 2013 11:56:30 +0100 Subject: Fix interface for template polymorphism, cleaning up code in all typing algorithms. --- proofs/logic.ml | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'proofs') diff --git a/proofs/logic.ml b/proofs/logic.ml index fb88b87546..47645d2957 100644 --- a/proofs/logic.ml +++ b/proofs/logic.ml @@ -379,16 +379,14 @@ let rec mk_refgoals sigma goal goalacc conclty trm = | App (f,l) -> let (acc',hdty,sigma,applicand) = - match kind_of_term f with - | Ind _ | Const _ - when (isInd f || has_polymorphic_type (fst (destConst f))) -> - let sigma, ty = - (* Sort-polymorphism of definition and inductive types *) - type_of_global_reference_knowing_conclusion env sigma f conclty - in - goalacc, ty, sigma, f - | _ -> - mk_hdgoals sigma goal goalacc f + if is_template_polymorphic env f then + let sigma, ty = + (* Template sort-polymorphism of definition and inductive types *) + type_of_global_reference_knowing_conclusion env sigma f conclty + in + goalacc, ty, sigma, f + else + mk_hdgoals sigma goal goalacc f in let ((acc'',conclty',sigma), args) = mk_arggoals sigma goal acc' hdty l in let sigma = check_conv_leq_goal env sigma trm conclty' conclty in -- cgit v1.2.3