diff options
| author | herbelin | 2002-03-21 15:21:34 +0000 |
|---|---|---|
| committer | herbelin | 2002-03-21 15:21:34 +0000 |
| commit | 04117381b1130ed2cde716c7b80f34e625b9b276 (patch) | |
| tree | c52449205e9be4f936f8239dd38f187bbf510af3 | |
| parent | 6de9782f097b11b023629abfebae01aa9cff98c1 (diff) | |
Décomposition de l'application n-aire en application binaire pour que Pattern réussisse sur des motifs partiellement appliqués
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@2560 85f007b7-540e-0410-9357-904b9bb8a0f7
| -rw-r--r-- | pretyping/termops.ml | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/pretyping/termops.ml b/pretyping/termops.ml index 11afda96bc..fec2a92549 100644 --- a/pretyping/termops.ml +++ b/pretyping/termops.ml @@ -215,8 +215,12 @@ let map_constr_with_binders_left_to_right g f l c = match kind_of_term c with let t' = f l t in let c' = f (g (na,Some b,t) l) c in mkLetIn (na, b', t', c') - | App (c,al) -> - let c' = f l c in mkApp (c', array_map_left (f l) al) + | App (c,[||]) -> assert false + | App (c,al) -> + (*Special treatment to be able to recognize partially applied subterms*) + let a = al.(Array.length al - 1) in + let hd = f l (mkApp (c, Array.sub al 0 (Array.length al - 1))) in + mkApp (hd, [| f l a |]) | Evar (e,al) -> mkEvar (e, array_map_left (f l) al) | Case (ci,p,c,bl) -> let p' = f l p in let c' = f l c in |
