From 1b05ba58b36fb8e73f9f885d7a7cfb160a0321d4 Mon Sep 17 00:00:00 2001 From: aarne Date: Sun, 6 Jan 2008 21:27:26 +0000 Subject: [PATCH] fixed bugs in optimization of multiple application --- src/GF/Grammar/Compute.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/GF/Grammar/Compute.hs b/src/GF/Grammar/Compute.hs index e43cb5b8c..f2377f12e 100644 --- a/src/GF/Grammar/Compute.hs +++ b/src/GF/Grammar/Compute.hs @@ -81,7 +81,7 @@ computeTermOpt rec gr = comp where h' <- comp g h as' <- mapM (comp g) as case h' of - + _ | not (null [() | FV _ <- as']) -> compApp g (mkApp h' as') c@(QC _ _) -> do return $ mkApp c as' Q (IC "Predef") f -> do @@ -92,7 +92,8 @@ computeTermOpt rec gr = comp where let (xs,b) = termFormCnc h' let g' = (zip xs as') ++ g 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) _ -> compApp g (mkApp h' as')