From 307795f3853b7b5772ff0c190e7e054ac64bd777 Mon Sep 17 00:00:00 2001 From: hallgren Date: Fri, 16 May 2014 14:10:07 +0000 Subject: [PATCH] Fix an eta expansion bug in the grammar compiler Eta expansion is applied between partial evaluation and PMCFG generation. The buggy version generated type incorrect terms, but PMCFG generation apparently worked anyway. --- src/compiler/GF/Compile/GeneratePMCFG.hs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/compiler/GF/Compile/GeneratePMCFG.hs b/src/compiler/GF/Compile/GeneratePMCFG.hs index 6eaaa9bff..5a3f01c86 100644 --- a/src/compiler/GF/Compile/GeneratePMCFG.hs +++ b/src/compiler/GF/Compile/GeneratePMCFG.hs @@ -154,9 +154,7 @@ convert opts gr cenv loc term ty@(_,val) pargs = then-} normalForm cenv loc (expand ty term) -- new evaluator --else term -- old evaluator is invoked from GF.Compile.Optimize -expand ty@(context,val) = recordExpand val . etaExpand ty - -etaExpand (context,val) = mkAbs pars . flip mkApp args +expand (context,val) = mkAbs pars . recordExpand val . flip mkApp args where pars = [(Explicit,v) | v <- vars] args = map Vr vars vars = map (\(bt,x,t) -> x) context