rupesh4514 / grammatical-framework

Automatically exported from code.google.com/p/grammatical-framework
0 stars 0 forks source link

Generating with probabilities sometimes results in "Generate.hs: Non-exhaustive patterns in function hit" #58

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
When random-generating with probabilities, getting this error:

   src/runtime/haskell/PGF/Generate.hs:(171,7)-(174,45): Non-exhaustive patterns in function hit 

Using:

Grammatical Framework (GF) version 3.3.11-darcs
80 recorded changes since SNAPSHOT-3.3.11
Last recorded change: Thu Jan 24 14:31:34 CET 2013  gregoire.detrez@gu.se
Built on linux/x86_64 with ghc-7.4, flags: interrupt server new-comp

And this grammar:

https://github.com/Attempto/ACE-in-GF/commit/af61daedd32020c3f54c33f0ee1d0fe092d
e2548

Original issue reported on code.google.com by kaljurand on 28 Jan 2013 at 2:02

GoogleCodeExporter commented 9 years ago
This appears to be caused by accumulating rounding errors in floating point 
calculations with probabilities. We made a quick fix to prevent the crash, but 
to honour the specified probability distribution more accurately, the code 
needs to be rewritten to avoid the accumulating error.

Original comment by hallg...@chalmers.se on 29 Jan 2013 at 2:01