mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-09 04:59:31 -06:00
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.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user