mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-20 16:42:51 -06:00
fixed bugs in optimization of multiple application
This commit is contained in:
@@ -81,7 +81,7 @@ computeTermOpt rec gr = comp where
|
|||||||
h' <- comp g h
|
h' <- comp g h
|
||||||
as' <- mapM (comp g) as
|
as' <- mapM (comp g) as
|
||||||
case h' of
|
case h' of
|
||||||
|
_ | not (null [() | FV _ <- as']) -> compApp g (mkApp h' as')
|
||||||
c@(QC _ _) -> do
|
c@(QC _ _) -> do
|
||||||
return $ mkApp c as'
|
return $ mkApp c as'
|
||||||
Q (IC "Predef") f -> do
|
Q (IC "Predef") f -> do
|
||||||
@@ -92,7 +92,8 @@ computeTermOpt rec gr = comp where
|
|||||||
let (xs,b) = termFormCnc h'
|
let (xs,b) = termFormCnc h'
|
||||||
let g' = (zip xs as') ++ g
|
let g' = (zip xs as') ++ g
|
||||||
let as2 = drop (length xs) as'
|
let as2 = drop (length xs) as'
|
||||||
b' <- comp g' b
|
let xs2 = drop (length as') xs
|
||||||
|
b' <- comp g' (mkAbs xs2 b)
|
||||||
if null as2 then return b' else comp g (mkApp b' as2)
|
if null as2 then return b' else comp g (mkApp b' as2)
|
||||||
|
|
||||||
_ -> compApp g (mkApp h' as')
|
_ -> compApp g (mkApp h' as')
|
||||||
|
|||||||
Reference in New Issue
Block a user