GrammaticalFramework / gf-core

Grammatical Framework core: compiler, shell & runtimes
https://www.grammaticalframework.org
Other
131 stars 35 forks source link

Canonical GF may include references to undefined parameters #100

Closed johnjcamilleri closed 3 years ago

johnjcamilleri commented 3 years ago

Sometimes in canonical GF, an unused parameter is removed from the param definitions but still referred to elsewhere. Example discovered in PhrasebookBul.gf:

$ gf --batch --output-format=canonical_gf PhrasebookBul.gf
Writing canonical/Phrasebook.gf...
Writing canonical/PhrasebookBul.gf...

$ gf --batch canonical/PhrasebookBul.gf 
- compiling canonical/Phrasebook.gf...   write file canonical/Phrasebook.gfo
- compiling canonical/PhrasebookBul.gf... 
canonical/PhrasebookBul.gf:245703-245727:
  Happened in the renaming of Zoo
   constant not found: ResBul_Pref
   given PhrasebookBul
...

The parameter-cleaning code is probably slightly too enthusiastic.

johnjcamilleri commented 3 years ago

Turns out this is a special case of #101