bugfix for hasLinearization in the Haskell binding

This commit is contained in:
Krasimir Angelov
2017-08-30 18:11:59 +02:00
parent fd56b4b5f3
commit cd53269f96
4 changed files with 6 additions and 5 deletions

View File

@@ -580,8 +580,9 @@ parseWithOracle lang cat sent (predict,complete,literal) =
-- | Returns True if there is a linearization defined for that function in that language
hasLinearization :: Concr -> Fun -> Bool
hasLinearization lang id = unsafePerformIO $
withGuPool $ \pl ->
newUtf8CString id pl >>= pgf_has_linearization (concr lang)
withGuPool $ \pl -> do
res <- newUtf8CString id pl >>= pgf_has_linearization (concr lang)
return (res /= 0)
-- | Linearizes an expression as a string in the language
linearize :: Concr -> Expr -> String