diff options
| author | aarne <aarne@cs.chalmers.se> | 2008-01-06 21:27:26 +0000 |
|---|---|---|
| committer | aarne <aarne@cs.chalmers.se> | 2008-01-06 21:27:26 +0000 |
| commit | e1dda4b5d82d99bffd4045865700597f07e74299 (patch) | |
| tree | dcd8e0c1a73c756f561d72835dc1c30539ae375b /src | |
| parent | fc65b10e0f689a51f2f856b43abfb6d266889a9b (diff) | |
fixed bugs in optimization of multiple application
Diffstat (limited to 'src')
| -rw-r--r-- | src/GF/Grammar/Compute.hs | 5 |
1 files 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') |
