26.12.2013 Views

A computational grammar and lexicon for Maltese

A computational grammar and lexicon for Maltese

A computational grammar and lexicon for Maltese

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

param P = P1 | P2 | P3 | P4 ;<br />

lincat<br />

S = Str ;<br />

A = P => P => {s:Str ; b:Bool} ;<br />

lin<br />

Start a = (a!P1!P1).s;<br />

It = \\ _,_ => {s="abc" ; b=True} ;<br />

}<br />

When compiling this valid GF module with gf<br />

produced:<br />

--verbose, the following debug message is<br />

+ Start 65536 (1,1)<br />

This indicates that the compilation of the Start function produces 65536 productions in the<br />

resulting PMCFG. This number fits with the number of possible functions of type P → P →<br />

Bool, which is 2 4×4 . Removing the boolean field from the type gives instead 1 4×4 functions,<br />

<strong>and</strong> the size explosion disappears 10 . This behaviour means record types containing non-strings<br />

(such the Maybe type above) should not be used inside tables. Alternative factorisations need<br />

to be found in such cases, in order to avoid exponential explosions during compile time.<br />

10 Thanks to Thomas Hallgren <strong>for</strong> helping with finding a minimal example <strong>and</strong> explaining the arithmetic behind<br />

the explosion.<br />

46

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!