GrammaticalFramework / gf-core

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

Canonical GF may include record fields not specified in lincat #101

Closed johnjcamilleri closed 3 years ago

johnjcamilleri commented 3 years ago

Sometimes in canonical GF, an unused record field is removed from the lincat definitions but still referred to elsewhere. Example discovered in PhrasebookGer.gf.

After compiling to canonical format:

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

We see the following in canonical/PhrasebookGer.gf:

lincat
  VerbPhrase = {
    s : {s : ResGer_VForm => Str; aux : ResGer_VAux; particle : Str; prefix : Str; vtype : ResGer_VType};
    a1 : Str;
    a2 : Str;
    adj : Str;
    ext : Str;
    inf : {s : Str; ctrl : ResGer_Control; isAux : Prelude_Bool};
    infExt : Str;
    isAux : Prelude_Bool;
    nn : ResGer_Agr => {p1 : Str; p2 : Str; p3 : Str; p4 : Str; p5 : Str; p6 : Str};
    subjc : {s : Str; c : ResGer_PCase; isPrep : Prelude_Bool; s2 : Str}
  };
lin
  VRead = {
    s = {s = table { ... }; aux = ResGer_VHaben; particle = ""; prefix = ""; vtype = ResGer_VAct};
    a1 = "";
    a2 = "";
    adj = "";
    c2 = {s = ""; c = ResGer_NPC ResGer_Nom; isPrep = Prelude_False; s2 = ""};
    ext = "";
    inf = {s = ""; ctrl = ResGer_NoC; isAux = Prelude_True};
    infExt = "";
    isAux = Prelude_False;
    nn = table { ... };
    objCtrl = Prelude_False;
    subjc = {s = ""; c = ResGer_NPC ResGer_Nom; isPrep = Prelude_False; s2 = ""}
  };

Note how the definition of VRead contains record fields c2 and objCtrl, but these are missing from the lincat definition. This is not a GF error per se, but clearly the result of some inconsitent cleanup.

johnjcamilleri commented 3 years ago

See also #100

inariksit commented 3 years ago

Fixed via #118