summaryrefslogtreecommitdiff
path: root/src/runtime/haskell-bind/PGF2.hsc
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/haskell-bind/PGF2.hsc')
-rw-r--r--src/runtime/haskell-bind/PGF2.hsc9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/runtime/haskell-bind/PGF2.hsc b/src/runtime/haskell-bind/PGF2.hsc
index 4523279dd..54c413a34 100644
--- a/src/runtime/haskell-bind/PGF2.hsc
+++ b/src/runtime/haskell-bind/PGF2.hsc
@@ -39,6 +39,8 @@ module PGF2 (-- * PGF
mkFloat,unFloat,
mkMeta,unMeta,
mkCId,
+ treeProbability,
+
-- ** Types
Type, Hypo, BindType(..), startCat,
readType, showType,
@@ -314,6 +316,13 @@ compute (PGF p _) (Expr c_expr touch1) =
gu_pool_free exprPl
throwIO (PGFError msg)
+treeProbability :: PGF -> Expr -> Float
+treeProbability (PGF p _) (Expr c_expr touch1) =
+ unsafePerformIO $ do
+ res <- pgf_compute_tree_probability p c_expr
+ touch1
+ return (realToFrac res)
+
-----------------------------------------------------------------------------
-- Graphviz