Compilation hangs with param
variants, succeeds with record
variants
#132
Labels
bug
Something isn't working
param
variants, succeeds with record
variants
#132
TL;DR
I have a piece of code where, if I use variants inside a param:
it doesn't compile. When I change it into variants on the record level, it works just fine.
Tested with GF 3.11 and GF 3.10 (from December 2018), both have the bug.
Full example code is in my repo https://github.com/inariksit/gf-variants-bug
Now follows the long explanation.
Grammars
Abstract: TestVariants.gf
Concrete with bug: TestVariantsBugEng.gf
The category Pred is has lincat
ExtendEng.VPS
, like this.In addition, we have an
oper
that allows both contracted and uncontracted negation.The issue comes in the linearisation of
doesnt_sit_Pred
, which is defined as follows.However, this version of the same grammar compiles just fine. It's still using variants, but now they are not on the level of params, but rather the whole record.
The bug
When I try to compile the code that uses
PNegInlineVariants
, it gets stuck atdoesnt_sit_Pred
.It is stuck there in what seems to be an infinite loop. I added debug output in getFIds, and this is what it spits out:
So there's something that calls
getFIds
over and over again, the subfunctiongetFIds.variants
ends every time. This is the stack trace from when I pressed Ctrl+C:getFIds
is called most immediately fromGeneratePMCFG.addPMCFG.addRule
, but that doesn't mean the looping happens there–there are many other functions where I didn't put debug output.Other observations
I tried to make a more minimal version of the grammar, that doesn't use the RGL, but has the same inline variants.
The full grammar is at TestVariantsNoRGLNoBug.gf. I defined the parameters as follows:
But when I use
PNegInlineVariants
in the linearisation ofdoesnt_sit_Pred
, it compiles happily.The text was updated successfully, but these errors were encountered: