diff options
author | glondu <glondu@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2011-03-04 13:07:42 +0000 |
---|---|---|
committer | glondu <glondu@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2011-03-04 13:07:42 +0000 |
commit | 7cf251501d7cc1567630c947de981fb407a773c4 (patch) | |
tree | a54a3af8f79e502e1f29bb606961b80031701cf0 /checker/closure.ml | |
parent | 28a4f96caa3de3b43c3dc54eea4c221bee56b282 (diff) |
checker: add eta-expansion
Backport of changes introduced in r13443 and r13494.
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@13866 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'checker/closure.ml')
-rw-r--r-- | checker/closure.ml | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/checker/closure.ml b/checker/closure.ml index bd7347134..58c80b521 100644 --- a/checker/closure.ml +++ b/checker/closure.ml @@ -651,6 +651,12 @@ let rec get_args n tys f e stk = get_args (n-na) etys f (subs_cons(l,e)) s | _ -> (Inr {norm=Cstr;term=FLambda(n,tys,f,e)}, stk) +(* Eta expansion: add a reference to implicit surrounding lambda at end of stack *) +let rec eta_expand_stack = function + | (Zapp _ | Zfix _ | Zcase _ | Zshift _ | Zupdate _ as e) :: s -> + e :: eta_expand_stack s + | [] -> + [Zshift 1; Zapp [|{norm=Norm; term= FRel 1}|]] (* Iota reduction: extract the arguments to be passed to the Case branches *) |