From: Andrea Asperti Date: Fri, 22 Dec 2006 10:43:54 +0000 (+0000) Subject: Collapse_head_metas transforms all terms "not-recongnized" into a X-Git-Tag: 0.4.95@7852~710 X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=commitdiff_plain;h=d0a8a10b94687500347e677bcfd14b0016c775b4;p=helm.git Collapse_head_metas transforms all terms "not-recongnized" into a meta. --- diff --git a/components/tactics/universe.ml b/components/tactics/universe.ml index 1de149270..c8d370f04 100644 --- a/components/tactics/universe.ml +++ b/components/tactics/universe.ml @@ -44,15 +44,31 @@ let rec unfold context = function Cic.Prod(name,s,t') | t -> ProofEngineReduction.unfold context t -let rec collapse_head_metas = function - | Cic.Appl(a::l) -> - let a' = collapse_head_metas a in - (match a' with - | Cic.Meta(n,m) -> Cic.Meta(n,m) - | t -> - let l' = List.map collapse_head_metas l in - Cic.Appl(t::l')) - | t -> t +let rec collapse_head_metas t = + match t with + | Cic.Appl([]) -> assert false + | Cic.Appl(a::l) -> + let a' = collapse_head_metas a in + (match a' with + | Cic.Meta(n,m) -> Cic.Meta(n,m) + | t -> + let l' = List.map collapse_head_metas l in + Cic.Appl(t::l')) + | Cic.Rel _ + | Cic.Var _ + | Cic.Meta _ + | Cic.Sort _ + | Cic.Implicit _ + | Cic.Const _ + | Cic.MutInd _ + | Cic.MutConstruct _ -> t + | Cic.LetIn _ + | Cic.Lambda _ + | Cic.Prod _ + | Cic.Cast _ + | Cic.MutCase _ + | Cic.Fix _ + | Cic.CoFix _ -> Cic.Meta(-1,[]) ;; let rec dummies_of_coercions =