summaryrefslogtreecommitdiff
path: root/src/compiler/GF/Compile
AgeCommit message (Collapse)Author
2013-11-06Remove PGF.Signaturehallgren
This module should not be part of the public PGF library API, and it was only used in GF.CompileToAPI, so the code was moved there. The module defined constFuncs and syntaxFuncs, but only syntaxFuncs was used.
2013-11-06the content of ParseEngAbs3.probs is now merged with ParseEngAbs.probs. The ↵kr.angelov
later is now retrained. Once the grammar is compiled with the .probs file now it doesn't need anything more to do robust parsing. The robustness itself is controlled by the flags 'heuristic_search_factor', 'meta_prob' and 'meta_token_prob' in ParseEngAbs.gf
2013-11-05Eliminate mutual dependencies between the GF compiler and the PGF libraryhallgren
+ References to modules under src/compiler have been eliminated from the PGF library (under src/runtime/haskell). Only two functions had to be moved (from GF.Data.Utilities to PGF.Utilities) to make this possible, other apparent dependencies turned out to be vacuous. + In gf.cabal, the GF executable no longer directly depends on the PGF library source directory, but only on the exposed library modules. This means that there is less duplication in gf.cabal and that the 30 modules in the PGF library will no longer be compiled twice while building GF. To make this possible, additional PGF library modules have been exposed, even though they should probably be considered for internal use only. They could be collected in a PGF.Internal module, or marked as "unstable", to make this explicit. + Also, by using the -fwarn-unused-imports flag, ~220 redundant imports were found and removed, reducing the total number of imports by ~15%.
2013-10-30added the linref construction in GF. The PGF version number is now bumpedkr.angelov
2013-10-02something in the typeinferencer of the latest GHC has changed. I need to add ↵kr.angelov
a type signature for GF.Compile.GrammarToPGF.genCncFuns in order to compile.
2013-09-23the compiler now sorts the list of sequences in the PGF fileskr.angelov
2013-09-27a major refactoring in the C and the Haskell runtimes. Note incompatible ↵kr.angelov
change in the PGF format!!! The following are the outcomes: - Predef.nonExist is fully supported by both the Haskell and the C runtimes - Predef.BIND is now an internal compiler defined token. For now it behaves just as usual for the Haskell runtime, i.e. it generates &+. However, the special treatment will let us to handle it properly in the C runtime. - This required a major change in the PGF format since both nonExist and BIND may appear inside 'pre' and this was not supported before.
2013-09-23GrammarToPGF now looks only at the top modules for the PGF flagskr.angelov
2013-09-23fix a warning in the compilerkr.angelov
2013-09-23GF.Grammar.Grammar.allExtends now returns a list of source modules instead ↵kr.angelov
of just the module names. This saves extra lookups later
2013-09-19Introduce type RawIdent; only 9 imports of Data.ByteString.Char8 remainhallgren
The fact that identifiers are represented as ByteStrings is now an internal implentation detail in module GF.Infra.Ident. Conversion between ByteString and identifiers is only needed in the lexer and the Binary instances.
2013-09-19Make Ident abstract; imports of Data.ByteString.Char8 down from 29 to 16 moduleshallgren
Most of the explicit uses of ByteStrings were eliminated by using identS, identS = identC . BS.pack which was found in GF.Grammar.CF and moved to GF.Infra.Ident. The function prefixIdent :: String -> Ident -> Ident allowed one additional import of ByteString to be eliminated. The functions isArgIdent :: Ident -> Bool getArgIndex :: Ident -> Maybe Int were needed to eliminate explicit pattern matching on Ident from two modules.
2013-09-10Some code verbosity reductionhallgren
2013-09-10Workaround for a problem with lock fieldshallgren
This problem showed up after delaing eta expansion until just before partial evaluation
2013-05-30new-comp: delay eta expansion until just before partial evaluationhallgren
This seems to work for the most part, but a problem showed up in WordsCat.gf in the phrasebook.
2013-09-09Nonlinear patterns in concrete syntax are now detected and reported as errorshallgren
Before, they were silently converted to linear patterns. Nonlinear patterns in MorphoCat.gf, ParadigmsGre.gf and ParadigmsFin.gf have been make linear by renaming pattern variables.
2013-09-09partial evaluator: prettier complaint about nonlinears patternshallgren
2013-09-09partial evaluator: complain about nonlinear patternshallgren
2013-09-09Fix an old name shadowing bug in concrete syntax by removing the refresh passhallgren
The refresh pass does not correctly keep track of the scope of local variables and can convert things like \x->(\x->x) x into \x1->(\x2->x2) x2. Fortunately, it appears that the refresh pass is not needed anymore, so it has been removed.
2013-09-03fix in the GF compiler and runtime which let us to define pre construct ↵kr.angelov
detecting whether this is the last token.
2013-08-23nonExist now does the expected thingkr.angelov
2013-07-24hs datatype generation for empty abstract types addedaarne
2013-04-22a bit more informative error message in GrammarToPGFkr.angelov
2013-04-10gf -s/-q now silences "no linearization of" warningshallgren
2013-03-16Fix a problem with pattern macros in pre { } expressionshallgren
The old partial evaluator has special rules to convert pattern macros in pre { } expressions. These rules were missing in the new partial evaluator.
2013-03-12partial evaluator: push predefined functions inside variantshallgren
This should prevent errors like Internal error in Compute.ConcreteNew: Applying Predef.drop: Expected a value of type String, got VFV [VString "gewandt",VString "gewendet"]
2013-03-09ghc-7.6: allow directory-1.2Sergei Trofimovich
Get rid of old-time depend (and ClockTime in favour of UTCTime). time-compat helps to retain backward compatibility with directory-1.1 and lower.
2013-02-27Faster regular expression pattern matching in the grammar compiler.hallgren
The sequence operator (x+y) was implemented by splitting the string to be matched at all positions and trying to match the parts against the two subpatterns. To reduce the number of splits, we now estimate the minimum and maximum length of the string that the subpatterns could match. For common cases, where one of the subpatterns is a string of known length, like in (x+"y") or (x + ("a"|"o"|"u"|"e")+"y"), only one split will be tried.
2013-02-12now the beam size for the statistical parser can be configured by using the ↵kr.angelov
flag beam_size in the top-level concrete module
2013-01-29Better error message for unsupported token gluinghallgren
Instead of "Internal error in ...", you now get a proper error message with a source location and a function name.
2013-01-29Fix a bug with record extensionhallgren
Add a conversion rule for ({ l1 = e } ** x).l2 in PMCFG generation. (A rule for the symmetric case (x ** { l1 = e }).l2 was added some time ago.)
2013-01-28Better error message for Predef.errorhallgren
+ Instead of "Internal error in ...", you now get a proper error message with a source location and a function name. + Also added some missing error value propagation in the partial evaluator. + Also some other minor cleanup and error handling fixes.
2013-01-28improved error message for overloading in case the given signature looks the ↵aarne
same as one of the expected ones: it shows full records rather than just lock fields.
2013-01-11partial evaluator: fix token glueing bughallgren
"a"+("b"++"c") was simplified to "bb"++"c" instead of "ab"++c.
2012-12-20bug fix in the new partial evaluatorhallgren
It can leave wildcard tables in their origial form, but it easy to handle them in the unfactor function in GeneratePMCFG.
2012-12-19partial evaluator bug fixhallgren
It failed to delay table selection when the selector contains a run-time variable, causing "gf: Prelude.(!!): index too large" instead. Also: + Show better source locations on unexpected errors, to aid bug hunting. + Removed unused SourceGrammar argument to value2term.
2012-12-19GF.Grammar.Lookup: new function lookupResDefLochallgren
It's like lookupResDef but it includes a source location in the output.
2012-12-18partial evaluator bug fixhallgren
Int was missing from the list of predefined canonical constants.
2012-12-14The first prototype for exhaustive generation in the C runtime. The trees ↵kr.angelov
are always listed in decreasing probability order. There is also an API for generation from Python
2012-12-14Add language extension for ghc<7.4hallgren
FlexibleInstances does not imply TypeSynonymInstances, apparently.
2012-12-14More work on the new partial evaluatorhallgren
The work done by the partial evaluator is now divied in two stages: - A static "term traversal" stage that happens only once per term and uses only statically known information. In particular, the values of lambda bound variables are unknown during this stage. Some tables are transformed to reduce the cost of pattern matching. - A dynamic "function application" stage, where function bodies can be evaluated repeatedly with different arguments, without the term traversal overhead and without recomputing statically known information. Also the treatment of predefined functions has been reworked to take advantage of the staging and better handle partial applications.
2012-12-11partial evaluator workhallgren
* Evaluate operators once, not every time they are looked up * Remember the list of parameter values instead of recomputing it from the pattern type every time a table selection is made. * Quick fix for partial application of some predefined functions.
2012-12-10Compute.ConcreteNew: add missing case for variant functionshallgren
Also adding a test case in the test suite for this.
2012-12-06Compute.ConcreteNew: bug fix for indirectly defined pattern macroshallgren
More changes are probably needed to make pattern macros first class values. Also includes minor changes related to variants and error messages.
2012-12-02produce error message instead of failure of irrefutable pattern Ok ty_C in ↵aarne
GrammarToPGF, to help find compilation errors; the ones I've found are because an inherited abstract excludes something that the inherited concrete does not exclude.
2012-11-16new-comp: rewrite f (x|y) into (f x|f y)hallgren
With this change, all languages in molto/mgl/mixture except German and Polish can be compiled.
2012-11-13Adding a new experimental partial evalutatorhallgren
GF.Compile.Compute.ConcreteNew + two new modules contain a new partial evaluator intended to solve some performance problems with the old partial evalutator in GF.Compile.Compute.ConcreteLazy. It has been around for a while, but is now complete enough to compile the RGL and the Phrasebook. The old partial evaluator is still used by default. The new one can be activated in two ways: - by using the command line option -new-comp when invoking GF. - by using cabal configure -fnew-comp to make -new-comp the default. In this case you can also use the command line option -old-comp to revert to the old partial evaluator. In the GF shell, the cc command uses the old evaluator regardless of -new-comp for now, but you can use "cc -new ..." to invoke the new evaluator. With -new-comp, computations happen in GF.Compile.GeneratePMCFG instead of GF.Compile.Optimize. This is implemented by testing the flag optNewComp in both modules, to omit calls to the old partial evaluator from GF.Compile.Optimize and add calls to the new partial evaluator in GF.Compile.GeneratePMCFG. This also means that -new-comp effectively implies -noexpand. In GF.Compile.CheckGrammar, there is a check that restricted inheritance is used correctly. However, when -noexpand is used, this check causes unexpected errors, so it has been converted to generate warnings, for now. -new-comp no longer enables the new type checker in GF.Compile.Typeckeck.ConcreteNew. The GF version number has been bumped to 3.3.10-darcs
2012-11-08Eliminate warnings about deprecated use of catch and tryhallgren
This is also needed for compatibility with GHC 7.6.
2012-10-24Compute.ConcreteNew: support variantshallgren
Also add a missing check for Predef values in apply.
2012-10-24GeneratePMCFG: prefix messages about "impossible" errors with 'Internal error:'hallgren
Just to make them easier to spot when wading through thousands of lines of warnings...