GrammaticalFramework / gftest

Automatic test case generation for GF grammars
GNU General Public License v3.0
9 stars 5 forks source link

!! partiality #1

Open odanoburu opened 6 years ago

odanoburu commented 6 years ago
bruno@bruno-inspiron-N5010:~/sites/gf/lib/src/portuguese$ gftest -g Lang.pgf -e
[...lots of stuff...]
Prelude.!!: index too large

this does not happen with LangEng, though. I'd like to test with LangFre, but my computer can't compile it :disappointed:

pgf file for reference: Lang.pgf.tar.gz

inariksit commented 5 years ago

@odanoburu just so you know, I'm working on it! So far I've narrowed down the reason to the fact that all these function IDs, sequence IDs, argument indices and such are just Ints in PGF2. Though that's not an excuse why I didn't newtype them when I first wrote gftest :-P Anyway, working on it!

odanoburu commented 5 years ago

cool! now that I know a bit more about PGF I think it makes sense to use partial functions since they should always work for compliant PGF.. why it doesn't though is another matter :P thank you!!

inariksit commented 5 years ago

It seems pretty tricky! I've been looking at it all day and no luck. I did manage to fix a similar error for -u (appeared in Latin) where the error was in Main, not in Grammar. But I can't find a reason for -e or -q; the amount of SeqIds that a function of a goal category C has should correspond to the number of fields (as seen e.g. here) so I have no clue where the too large index comes from. I tried to use :trace in ghci, but it just said that the previously considered symbol was NoPConj and then it jumps to the category VV and tries to access field index 42 (what a suitable number) when there are only 0-41. Just leaving this brain dump here, now I need to run for choir rehearsal. :-D