diff --git a/doc/DocGFC.pdf b/doc/DocGFC.pdf deleted file mode 100644 index f1d2e39c4..000000000 Binary files a/doc/DocGFC.pdf and /dev/null differ diff --git a/doc/ParadigmsRus.tex b/doc/ParadigmsRus.tex deleted file mode 100644 index 950c88965..000000000 --- a/doc/ParadigmsRus.tex +++ /dev/null @@ -1,424 +0,0 @@ -This is an API for the user of the resource grammar for adding -lexical items. It gives functions for forming expressions of open -categories: nouns, adjectives, verbs. - -Closed categories (determiners, pronouns, conjunctions) are -accessed through the resource syntax API, {\tt Structural.gf}. - -The main difference with {\tt MorphoRus.gf} is that the types -referred to are compiled resource grammar types. We have moreover -had the design principle of always having existing forms, rather -than stems, as string arguments of the paradigms. - -The structure of functions for each word class {\tt C} is the following: -first we give a handful of patterns that aim to cover all -regular cases. Then we give a worst-case function {\tt mkC}, which serves as an -escape to construct the most irregular words of type {\tt C}. -%However, this function should only seldom be needed: we have a -%separate module {\tt IrregularEng}, which covers all irregularly inflected -words. - -The following modules are presupposed: -\begin{verbatim} - resource ParadigmsRus = open - (Predef=Predef), - Prelude, - MorphoRus, - CatRus, - NounRus - in { - - flags coding=utf8 ; -\end{verbatim} - -\textbf{Parameters} - -To abstract over gender names, we define the following identifiers. -\begin{verbatim} - oper - Gender : Type ; - - masculine : Gender ; - feminine : Gender ; - neuter : Gender ; -\end{verbatim} - -To abstract over case names, we define the following. -\begin{verbatim} - Case : Type ; - - nominative : Case ; - genitive : Case ; - dative : Case ; - accusative : Case ; - instructive : Case ; - prepositional : Case ; -\end{verbatim} - -In some (written in English) textbooks accusative case -is put on the second place. However, we follow the case order -standard for Russian textbooks. -To abstract over number names, we define the following. -\begin{verbatim} - Number : Type ; - - singular : Number ; - plural : Number ; - - Animacy: Type ; - - animate: Animacy; - inanimate: Animacy; -\end{verbatim} - -\textbf{Nouns} -Best case: indeclinabe nouns: {\cyr kofe}, {\cyr -pal\cyrsftsn{}to}, {\cyr VUZ}. -\begin{verbatim} - mkIndeclinableNoun: Str -> Gender -> Animacy -> N ; -\end{verbatim} - -Worst case - give six singular forms: -Nominative, Genetive, Dative, Accusative, Instructive and Prepositional; -corresponding six plural forms and the gender. -May be the number of forms needed can be reduced, -but this requires a separate investigation. -Animacy parameter (determining whether the Accusative form is equal -to the Nominative or the Genetive one) is actually of no help, -since there are a lot of exceptions and the gain is just one form less. -\begin{verbatim} - mkN : (nomSg, genSg, datSg, accSg, instSg, preposSg, - nomPl, genPl, datPl, accPl, instPl, preposPl: Str) - -> Gender -> Animacy -> N ; -\end{verbatim} -({\cyr \em muzhchina, muzhchinu, muzhchine, muzhchinu, -muzhchino\cyrishrt{}, muzhchine} - -\noindent {\cyr \em muzhchin\cyrery{}, muzhchin, muzhchinam, -muzhchin, muzhchinami, muzhchinah}) - -\vspace{5mm} - -The regular function captures the variants for some popular nouns -endings from the list below: -\begin{verbatim} - regN : Str -> N ; -\end{verbatim} - -Here are some common patterns. The list is far from complete. - -\subsubsection{Feminine patterns} - -\noindent feminine, inanimate, ending with "-a", Inst -"{\cyr -mashin-o\cyrishrt{}}": -\begin{verbatim} - nMashina : Str -> N ; -\end{verbatim} -feminine, inanimate, ending with "-a", Inst -"{\cyr -edinic-e\cyrishrt{}}": -\begin{verbatim} - nEdinica : Str -> N ; -\end{verbatim} -feminine, animate, ending with "-a": -\begin{verbatim} - nZhenchina : Str -> N ; -\end{verbatim} -feminine, inanimate, ending with "{\cyr g\_k\_h-a}": -\begin{verbatim} - nNoga : Str -> N ; -\end{verbatim} -feminine, inanimate, ending with "-{\cyr -iya}": -\begin{verbatim} - nMalyariya : Str -> N ; -\end{verbatim} -feminine, animate, ending with "{\cyr -ya}": -\begin{verbatim} - nTetya : Str -> N ; -\end{verbatim} -feminine, inanimate, ending with "-{\cyr \cyrsftsn{}}"(soft sign): -\begin{verbatim} - nBol : Str -> N ; -\end{verbatim} - -\subsubsection{Neuter patterns} - -\noindent neutral, inanimate, ending with "-ee": -\begin{verbatim} - nObezbolivauchee : Str -> N ; -\end{verbatim} -neutral, inanimate, ending with "-e": -\begin{verbatim} - nProizvedenie : Str -> N ; -\end{verbatim} -neutral, inanimate, ending with "-o": -\begin{verbatim} - nChislo : Str -> N ; -\end{verbatim} -neutral, inanimate, ending with "-{\cyr oe}": -\begin{verbatim} - nZhivotnoe : Str -> N ; -\end{verbatim} - -\subsubsection{Masculine patterns} - -\noindent Ending with consonant: - -\noindent masculine, inanimate, ending with "-{\cyr el}"- "{\cyr -pep-la}": -\begin{verbatim} - nPepel : Str -> N ; -\end{verbatim} -animate, "{\cyr brat-\cyrsftsn{}ya}": -\begin{verbatim} - nBrat : Str -> N ; -\end{verbatim} -same as above, but inanimate: -\begin{verbatim} - nStul : Str -> N ; -\end{verbatim} -"{\cyr malyshe\cyrishrt{}}": -\begin{verbatim} - nMalush : Str -> N ; -\end{verbatim} -"{\cyr potol-ok, potol-ka}" -\begin{verbatim} - nPotolok : Str -> N ; -\end{verbatim} -the next four differ in plural nominative and/or accusative -form(s): - -\noindent {\cyr bank-i}(Nom=Acc): -\begin{verbatim} - nBank : Str -> N ; -\end{verbatim} -same as above, but animate: -\begin{verbatim} - nStomatolog : Str -> N ; -\end{verbatim} -"{\cyr adres-a}" (Nom=Acc): -\begin{verbatim} - nAdres : Str -> N ; -\end{verbatim} -"{\cyr telefony}" (Nom=Acc): -\begin{verbatim} - nTelefon : Str -> N ; -\end{verbatim} -masculine, inanimate, ending with "{\cyr \cyrsftsn{}}" (soft -sign): -\begin{verbatim} - nNol : Str -> N ; -\end{verbatim} -masculine, inanimate, ending with "{\cyr -en\cyrsftsn{}}": -\begin{verbatim} - nUroven : Str -> N ; -\end{verbatim} - -Nouns used as functions need a preposition. The most common is with Genitive. -\begin{verbatim} - mkFun : N -> Prep -> N2 ; - mkN2 : N -> N2 ; - mkN3 : N -> Prep -> Prep -> N3 ; -\end{verbatim} - -\subsubsection{Proper names} - -{\cyr Ivan, Masha}: -\begin{verbatim} - mkPN : Str -> Gender -> Animacy -> PN ; -\end{verbatim} -\begin{verbatim} - nounPN : N -> PN ; -\end{verbatim} - -On the top level, it is maybe {\tt CN} that is used rather than {\tt N}, and -{\tt NP} rather than {\tt PN}. -\begin{verbatim} - mkCN : N -> CN ; - mkNP : Str -> Gender -> Animacy -> NP ; -\end{verbatim} - -\textbf{Adjectives} -Non-comparison (only positive degree) one-place adjectives need 28 -(4 by 7) forms in the worst case: (Masculine | Feminine | Neutral -| Plural) * (Nominative | Genitive | Dative | Accusative Inanimate -| Accusative Animate | Instructive | Prepositional). Notice that 4 -short forms, which exist for some adjectives are not included in -the current description, otherwise there would be 32 forms for -positive degree. - -The regular function captures the variants for some popular -adjective endings below. The first string agrument is the -masculine singular form, the second is comparative: -\begin{verbatim} - regA : Str -> Str -> A ; -\end{verbatim} - -\noindent Invariable adjective is a special case: {\cyr haki, -mini, hindi, netto}: -\begin{verbatim} - adjInvar : Str -> A ; -\end{verbatim} - -Some regular patterns depending on the ending. - -\noindent ending with "{\cyr y\cyrishrt{}}": -\begin{verbatim} - AStaruyj : Str -> Str -> A ; -\end{verbatim} -ending with "{\cyr i\cyrishrt{}}", Gen - "{\cyr -malen\cyrsftsn{}k-ogo}": -\begin{verbatim} - AMalenkij : Str -> Str -> A ; -\end{verbatim} -ending with "{\cyr i\cyrishrt{}}", Gen - "{\cyr horosh-ego}": -\begin{verbatim} - AKhoroshij : Str -> Str -> A ; -\end{verbatim} -ending with "{\cyr o\cyrishrt{}}", plural - "{\cyr molod-ye}": -\begin{verbatim} - AMolodoj : Str -> Str -> A ; -\end{verbatim} -ending with "{\cyr o\cyrishrt{}}", plural - "{\cyr kak-ie}": -\begin{verbatim} - AKakoj_Nibud : Str -> Str -> Str -> A ; -\end{verbatim} - -Two-place adjectives need a preposition and a case as extra arguments. - -"{\cyr delim na}": -\begin{verbatim} - mkA2 : A -> Str -> Case -> A2 ; -\end{verbatim} - -Comparison adjectives need a positive adjective (28 forms without -short forms). Taking only one comparative form (non-syntactic) and -only one superlative form (syntactic) we can produce the -comparison adjective with only one extra argument - non-syntactic -comparative form. Syntactic forms are based on the positive forms. - -\begin{verbatim} - mkADeg : A -> Str -> ADeg ; -\end{verbatim} -On top level, there are adjectival phrases. The most common case -is just to use a one-place adjective. -\begin{verbatim} - ap : A -> IsPostfixAdj -> AP ; -\end{verbatim} - -\textbf{Adverbs} -Adverbs are not inflected. %Most lexical ones have position after the verb. Some can be preverbal (e.g. {\it always}). -\begin{verbatim} - mkAdv : Str -> Adv ; -\end{verbatim} - -\textbf{Verbs} - -In our lexicon description ({\it Verbum}) there are 62 forms: 2 -(Voice) by { 1 (infinitive) + [2(number) by 3 -(person)](imperative) + [ [2(Number) by 3(Person)](present) + -[2(Number) by 3(Person)](future) + 4(GenNum)(past) ](indicative)+ -4 (GenNum) (subjunctive) } Participles (Present and Past) and -Gerund forms are not included, since they fuction more like -Adjectives and Adverbs correspondingly rather than verbs. Aspect -is regarded as an inherent parameter of a verb. Notice, that some -forms are never used for some verbs. %Actually, the majority of verbs do not have many of the forms. -\begin{verbatim} - Voice: Type; - Aspect: Type; - Tense : Type; - Bool: Type; - Conjugation: Type ; -\end{verbatim} -"{\cyr gulya-Esh\cyrsftsn{}, gulya-Em}": -\begin{verbatim} - first: Conjugation; -\end{verbatim} - -\noindent Verbs with vowel "{\cyr \cyryo}": "{\cyr -da\cyryo{}sh\cyrsftsn{}}" (give), "{\cyr -p\cyrsftsn{}\cyryo{}sh\cyrsftsn{}}" (drink): -\begin{verbatim} - firstE: Conjugation; -\end{verbatim} - -\noindent "{\cyr vid-Ish\cyrsftsn{}, vid-Im}": -\begin{verbatim} - second: Conjugation; -\end{verbatim} -"{\cyr hoch-Esh\cyrsftsn{}, hot-Im}": -\begin{verbatim} - mixed: Conjugation; -\end{verbatim} -irregular: -\begin{verbatim} - dolzhen: Conjugation; - - true: Bool; - false: Bool; - - active: Voice ; - passive: Voice ; - imperfective: Aspect; - perfective: Aspect ; -\end{verbatim} - -The worst case need 6 forms of the present tense in indicative -mood ({\cyr ya begu}, {\cyr ty bezhish\cyrsftsn{}}, {\cyr on -bezhit}, {\cyr my bezhim}, {\cyr vy bezhite}, {\cyr oni begut}), a -past form (singular, masculine: {\cyr ya bezhal}), an imperative -form (singular, second person: {\cyr begi}), an infinitive ({\cyr -bezhat\cyrsftsn{}}). Inherent aspect should also be specified. -\begin{verbatim} - mkVerbum : Aspect -> (presentSgP1,presentSgP2,presentSgP3, - presentPlP1,presentPlP2,presentPlP3, - pastSgMasculine,imperative,infinitive: Str) -> V ; -\end{verbatim} - -Common conjugation patterns are two conjugations: first - verbs -ending with {\cyr -at\cyrsftsn{}/-yat\cyrsftsn{}} and second - -{\cyr -it\cyrsftsn{}/-et\cyrsftsn{}}. Instead of 6 present forms -of the worst case, we only need a present stem and one ending -(singular, first person): {\cyr ya l\cyryu{}bl\cyryu{}}, {\cyr ya -zhdu}, etc. To determine where the border between stem and ending -lies it is sufficient to compare first person from with second -person form: {\cyr ya l\cyryu{}bl\cyryu{}}, {\cyr ty -l\cyryu{}bish\cyrsftsn{}}. Stems should be the same. So the -definition for verb {\cyr l\cyryu{}bit\cyrsftsn{}} looks like: -\texttt{regV Imperfective Second }"{\cyr l\cyryu{}b}" "{\cyr -l\cyryu{}}" "{\cyr l\cyryu{}bil}" "{\cyr l\cyryu{}bi}" "{\cyr -l\cyryu{}bit\cyrsftsn{}}"; -\begin{verbatim} - regV : Aspect -> Conjugation -> (stemPresentSgP1, - endingPresentSgP1,pastSgP1,imperative,infinitive: Str) -> V ; -\end{verbatim} - -For writing an application grammar one usually doesn't need the -whole inflection table, since each verb is used in a particular -context that determines some of the parameters (Tense and Voice -while Aspect is fixed from the beginning) for certain usage. The -{\it V} type, that have these parameters fixed. We can extract the -{\it V} from the lexicon. -\begin{verbatim} - mkV : Verbum -> Voice -> V ; - mkPresentV : Verbum -> Voice -> V ; -\end{verbatim} - -Two-place verbs, and the special case with direct object. Notice -that a particle can be included in a {\tt V}. - -\noindent "{\cyr vo\cyrishrt{}ti v dom}", "{\cyr v}", accusative: -\begin{verbatim} - mkV2 : V -> Str -> Case -> V2 ; -\end{verbatim} -{\cyr slozhit\cyrsftsn{} pic\cyrsftsn{}mo v konvert}: -\begin{verbatim} - mkV3 : V -> Str -> Str -> Case -> Case -> V3 ; -\end{verbatim} -"{\cyr videt\cyrsftsn{}}", "{\cyr l\cyryu{}bit\cyrsftsn{}}": -\begin{verbatim} - dirV2 : V -> V2 ; - tvDirDir : V -> V3 ; -\end{verbatim} - -The definitions should not bother the user of the API. So they are -hidden from the document. diff --git a/doc/release2.html b/doc/release2.html deleted file mode 100644 index d34b49cc1..000000000 --- a/doc/release2.html +++ /dev/null @@ -1,546 +0,0 @@ - - - - -
- -

Grammatical Framework Version 2

- -Release of Version 2.0 - -

- -Planned: 24 June 2004 - -

- -Aarne Ranta - -

- - - - -

Highlights

- -Module system. - -

- -Separate compilation to canonical GF. - -

- -Improved GUI. - -

- -Improved parser generation. - -

- -Improved shell (new commands and options, help, error messages). - -

- -Accurate language specification -(also of GFC). - -

- -Extended resource library. - -

- -Extended Numerals library. - - - - - - -

Module system

- -
  • Separate modules for abstract, - concrete, and resource. -
  • Replaces the file-based include system -
  • Name space handling with qualified names -
  • Hierarchic structure (single inheritance **) + - cross-cutting reuse (open) -
  • Separate compilation, one module per file -
  • Reuse of abstract+concrete as resource -
  • Parametrized modules: - interface, instance, incomplete. -
  • New experimental module types: transfer, - union. - - - - -

    Canonical format GFC

    - -
  • The target of GF compiler; to reuse, just read in. - -
  • Readable by Haskell/Java/C++/C applications (by BNFC generated parsers). - - - - - -

    New features in expression language

    - -In addition to the module system: - -

    - -

  • Disjunctive patterns P | ... | Q. -
  • String patterns "foo". -
  • (?) Integer patterns 74. -
  • Binding token &+ to glue separate tokens at unlexing phase, - and unlexer to resolve this. -
  • New syntax alternatives for local definitions: let without - braces and where. -
  • Pattern variables can be used on lhs's of oper definitions. -
  • New Unicode transliterations (by Harad Hammarström). - - - - -

    New shell commands and command functionalities

    - -
  • pi = print_info: information on an identifier in scope. -
  • h = help now in long or short form, - and on individual commands. -
  • gt = generate_trees: all trees of a given - category or instantiations of a given incomplete term, up to a - given depth. -
  • gr = generate_random can now be given - an incomplete term as an argument, to constrain generation. -
  • so = show_opers shows all ope - operations with a given value type. -
  • pm = print_multi prints the multilingual - grammar resident in the current state to a ready-compiles - .gfcm file. -
  • All commands have both long and short names (see help). Short - names are easier to type, whereas long names - make scripts more readable. -
  • Meaningless command options generate warnings. - - - - -

    New editor features

    - -
  • Active text field: click the middle button in the focus to send - in refinement through the parser. -
  • Clipboard: copy complex terms into the refine menu. -
  • Two-step refinements generated by the "Generate" operation. - - - -

    Improved implementation

    - -
  • Haskell source code is organized into subdirectories. -
  • BNF Converter is used for defining the languages GF and GFC, which also - give reliable LaTeX documentation. -
  • Lexical rules sorted out by option -cflexer for efficient - parsing with large lexica. -
  • GHC optimizations and strictness flags are used for improving performance. - - - - -

    New parser (work in progress)

    - -
  • By Peter Ljunglöf, based on MCFG. -
  • Much more efficient for morphology and discontinuous constituents. -
  • Treatment of cyclic rules. -
  • Currently lots of alternative parsers via flags -parser=newX. - - - - -

    Status (21/6/2004)

    - -Grammar compiler, editor GUIs, and shell work for all platforms -(with restrictions for Solaris). - -

    - -The updated HelpFile (accessible through h command) -marks unsupported features present in GF 1.2 with *. -They will be supported again if interested users appear. - -

    - -GF1 grammars can be automatically translated to GF2 (although the -result is not as good -as manual, since indentation and comments are destroyed). The results can be -saved in GF2 files, but this is not necessary. -Some rarely used GF1 features are no longer supported (see next section). - -

    - -It is also possible to write a GF2 grammar back to GF1, with the -command pg -printer=old. - - - - -Resource libraries -and some example grammars and have been -converted. Most old example grammars work without any changes. -There is a new resource API with -many new constructions. - -

    - -A make facility works, finding out which modules have to be recompiled. - -

    - -Soundness checking of module depencencies and completeness is not -complete. This means that some errors may show up too late. - -

    - -The environment variable GF_LIB_PATH needs some more work. - -

    - -Latex and XML printing of grammars do not work yet. - - - - - -

    How to use GF 1.* files

    - -Backward compatibility with respect to old GF grammars has been -a central goal. All GF grammars, from version 0.9, should work in -the old way in GF2. The main exceptions are some features that -are rarely used. - - -

    - -Very old GF grammars (from versions before 0.9), with the completely -different notation, do not work. They should be first converted to -GF1 by using GF version 1.2. - - - - - -The import command i can be given the option -old. E.g. -

    -  i -old tut1.Eng.g2
    -
    -But this is no more necessary: GF2 detects automatically if a grammar -is in the GF1 format. - -

    - -Importing a set of GF2 files generates, internally, three modules: -

    -  abstract tut1 = ...
    -  resource ResEng = ...
    -  concrete Eng of tut1 = open ResEng in ...
    -
    -(The names are different if the file name has fewer parts.) - - -

    - -The option -o causes GF2 to write these modules into files. - - - - -The flags -abs, -cnc, and -res can be used -to give custom names to the modules. In particular, it is good to use -the -abs flag to guarantee that the abstract syntax module -has the same name for all grammars in a multilingual environmens: -

    -  i -old -abs=Numerals hungarian.gf
    -  i -old -abs=Numerals tamil.gf
    -  i -old -abs=Numerals sanskrit.gf
    -
    - -

    - -The same flags as in the import command can be used when invoking -GF2 from the system shell. Many grammars can be imported on the same command -line, e.g. -

    -  % gf2 -old -abs=Tutorial tut1.Eng.gf tut1.Fin.gf tut1.Fra.gf
    -
    - -

    - -To write a GF2 grammar back to GF1 (as one big file), use the command -

    -  > pg -old
    -
    - - - - - - - -GF2 has more reserved words than GF 1.2. When old files are read, a preprocessor -replaces every identifier that has the shape of a new reserved word -with a variant where the last letter is replaced by Z, e.g. -instance is replaced by instancZ. This method is of course -unsafe and should be replaced by something better. - - - - - - -

    Abstract, concrete, and resource modules

    - -Judgement forms are sorted as follows: - - - - - -Example: -
    -  abstract Sums = {
    -    cat 
    -      Exp ;
    -    fun 
    -      One : Exp ;
    -      plus : Exp -> Exp -> Exp ;
    -  }
    -
    -  concrete EnglishSums of Sums = open ResEng in {
    -    lincat 
    -      Exp = {s : Str ; n : Number} ;
    -    lin
    -      One = expSg "one" ;
    -      sum x y = expSg ("the" ++ "sum" ++ "of" ++ x.s ++ "and" ++ y.s) ;
    -  }
    -
    -  resource ResEng = {
    -    param 
    -      Number = Sg | Pl ;
    -    oper 
    -      expSG : Str -> {s : Str ; n : Number} = \s -> {s = s ; n = Sg} ;
    -  }
    -
    - - - - - -

    Opening and extending modules

    - -A concrete or resource can open a -resource. This means that - -A module of any type can moreover extend a module of the same type. -This means that - -Examples of extension: -
    -  abstract Products = Sums ** {
    -    fun times : Exp -> Exp -> Exp ;
    -  }
    -  -- names exported: Exp, plus, times
    -
    -  concrete English of Products = EnglishSums ** open ResEng in {
    -    lin times x y = expSg ("the" ++ "product" ++ "of" ++ x.s ++ "and" ++ y.s) ;
    -  }
    -
    -Another important difference: -
  • extension is single -
  • opening can be multiple: open Foo, Bar, Baz in {...} - - - -Moreover: -
  • opening can be qualified -

    -Example of qualified opening: -

    -  concrete NumberSystems of Systems = open (Bin = Binary), (Dec = Decimal) in {
    -    lin 
    -      BZero = Bin.Zero ;
    -      DZero = Dec.Zero
    -  }
    -
    - - - - -

    Compiling modules

    - -Separate compilation assumes there is one module per file. - -

    - -The module header is the beginning of the module code up to the -first left bracket ({). The header gives -

    - - - - -filename = modulename . extension - -

    - -File name extensions: -

    -Only gf files should ever be written/edited manually! - - - - - - -What the make facility does when compiling Foo.gf -
      -
    1. read the module header of Foo.gf, and recursively all headers from -the modules it depends on (i.e. extends or opens) -
    2. build a dependency graph of these modules, and do topological sorting -
    3. starting from the first module in topological order, -compare the modification times of each gf and gfc file: -
        -
      • if gf is later, compile the module and all modules depending on it -
      • if gfc is later, just read in the module -
      -
    -Inside the GF shell, also time stamps of modules read into memory are -taken into account. Thus a module need not be read from a file if the -module is in the memory and the file has not been modified. - - - - -If the compilation of a grammar fails at some module, the state of the -GF shell contains all modules read up to that point. This makes it -faster to compile the faulty module again after fixing it. - -

    - -Use the command po = print_options to see what -modules are in the state. - -

    - -To force compilation: -

    - - - -

    Module search paths

    - -Modules can reside in different directories. Use the path -flag to extend the directory search path. For instance, -
    -  -path=.:../resource/russian:../prelude
    -
    -enables files to be found in three different directories. -By default, only the current directory is included. -If a path flag is given, the current directory -. must be explicitly included if it is wanted. - -

    - -The path flag can be set in any of the following -places: -

    -A flag set on a command line overrides ones set in files. - -

    - -The value of the environment variable GF_LIB_PATH is -appended to the user-given path. - - - - -

    To do

    - -Testing - -

    - -Documentation - -

    - -Packaging - - - - - -

    Nasty details

    - - -
  • Readline in Solaris - -
  • Proper treatment file search paths - -
  • Unicode fonts in GUIs - -
  • directionality of Semitic alphabets - - - - - diff --git a/doc/resource-preamble b/doc/resource-preamble deleted file mode 100644 index ac3185f42..000000000 --- a/doc/resource-preamble +++ /dev/null @@ -1,7 +0,0 @@ -\documentclass[11pt,a4paper]{article} - -\usepackage[T2A,OT1]{fontenc} -\usepackage[ot2enc]{inputenc} -\usepackage[russian,german,french,english]{babel} -\usepackage{isolatin1} % user defined package - diff --git a/doc/resource-synopsis.txt b/doc/resource-synopsis.txt deleted file mode 100644 index 383c8804b..000000000 --- a/doc/resource-synopsis.txt +++ /dev/null @@ -1,893 +0,0 @@ -==GF Resource Grammar Library: Synopsis== - - -==Syntax== - -[source ../api/Constructors.gf] - - -|| Function | Type | Example || -| ``mkText`` | ``Phr -> Text`` | //But John walks.// | -| ``mkText`` | ``Phr -> (Punct) -> (Text) -> Text`` | //John walks? Yes.// | -| ``mkText`` | ``Utt -> Text`` | //John.// | -| ``mkText`` | ``S -> Text`` | //John walked.// | -| ``mkText`` | ``Cl -> Text`` | //John walks.// | -| ``mkText`` | ``QS -> Text`` | //Did John walk?// | -| ``mkText`` | ``Imp -> Text`` | //Walk!// | -| ``emptyText`` | ``Text`` | //(empty text)// | -| ``fullStopPunct`` | ``Punct`` | //.// | -| ``questMarkPunct`` | ``Punct`` | //?// | -| ``exclMarkPunct`` | ``Punct`` | //!// | -| ``mkPhr`` | ``Utt -> Phr`` | //why// | -| ``mkPhr`` | ``(PConj) -> Utt -> (Voc) -> Phr`` | //but why John// | -| ``mkPhr`` | ``S -> Phr`` | //John walked// | -| ``mkPhr`` | ``Cl -> Phr`` | //John walks// | -| ``mkPhr`` | ``QS -> Phr`` | //did John walk// | -| ``mkPhr`` | ``Imp -> Phr`` | //walk// | -| ``mkPConj`` | ``Conj -> PConj`` | //and// | -| ``mkVoc`` | ``NP -> Voc`` | //John// | -| ``mkUtt`` | ``S -> Utt`` | //John walked// | -| ``mkUtt`` | ``Cl -> Utt`` | //John walks// | -| ``mkUtt`` | ``QS -> Utt`` | //did John walk// | -| ``mkUtt`` | ``Imp -> Utt`` | //love yourself// | -| ``mkUtt`` | ``(ImpForm) -> (Pol) -> Imp -> Utt`` | //don't love yourselves// | -| ``mkUtt`` | ``IP -> Utt`` | //who// | -| ``mkUtt`` | ``IAdv -> Utt`` | //why// | -| ``mkUtt`` | ``NP -> Utt`` | //John// | -| ``mkUtt`` | ``Adv -> Utt`` | //here// | -| ``mkUtt`` | ``VP -> Utt`` | //to walk// | -| ``lets_Utt`` | ``VP -> Utt`` | //let's walk// | -| ``positivePol`` | ``Pol`` | //(John walks) [default]// | -| ``negativePol`` | ``Pol`` | //(John doesn't walk)// | -| ``simultaneousAnt`` | ``Ant`` | //(John walks) [default]// | -| ``anteriorAnt`` | ``Ant`` | //(John has walked) --# notpresent// | -| ``presentTense`` | ``Tense`` | //(John walks) [default]// | -| ``pastTense`` | ``Tense`` | //(John walked) --# notpresent// | -| ``futureTense`` | ``Tense`` | //(John will walk) --# notpresent// | -| ``conditionalTense`` | ``Tense`` | //(John would walk) --# notpresent// | -| ``singularImpForm`` | ``ImpForm`` | //(help yourself) [default]// | -| ``pluralImpForm`` | ``ImpForm`` | //(help yourselves)// | -| ``politeImpForm`` | ``ImpForm`` | //(help yourself) (polite singular)// | -| ``mkS`` | ``Cl -> S`` | //John walks// | -| ``mkS`` | ``(Tense) -> (Ant) -> (Pol) -> Cl -> S`` | //John wouldn't have walked// | -| ``mkS`` | ``Conj -> S -> S -> S`` | //John walks and I run// | -| ``mkS`` | ``Conj -> ListS -> S`` | //John walks, I run and you sleep// | -| ``mkS`` | ``DConj -> S -> S -> S`` | //either John walk or I run// | -| ``mkS`` | ``DConj -> ListS -> S`` | //either John walks, I run or you sleep// | -| ``mkS`` | ``Adv -> S -> S`` | //today, John walks// | -| ``mkCl`` | ``NP -> V -> Cl`` | //John walks// | -| ``mkCl`` | ``NP -> V2 -> NP -> Cl`` | //John loves her// | -| ``mkCl`` | ``NP -> V3 -> NP -> NP -> Cl`` | //John sends it to her// | -| ``mkCl`` | ``NP -> VV -> VP -> Cl`` | //John wants to walk// | -| ``mkCl`` | ``NP -> VS -> S -> Cl`` | //John says that it is good// | -| ``mkCl`` | ``NP -> VQ -> QS -> Cl`` | //John wonders if it is good// | -| ``mkCl`` | ``NP -> VA -> AP -> Cl`` | //John becomes old// | -| ``mkCl`` | ``NP -> V2A ->NP -> AP -> Cl`` | //John paints it red// | -| ``mkCl`` | ``NP -> A -> Cl`` | //John is old// | -| ``mkCl`` | ``NP -> A -> NP -> Cl`` | //John is older than her// | -| ``mkCl`` | ``NP -> A2 -> NP -> Cl`` | //John is married to her// | -| ``mkCl`` | ``NP -> AP -> Cl`` | //John is very old// | -| ``mkCl`` | ``NP -> N -> Cl`` | //John is a man// | -| ``mkCl`` | ``NP -> CN -> Cl`` | //John is an old man// | -| ``mkCl`` | ``NP -> NP -> Cl`` | //John is the man// | -| ``mkCl`` | ``NP -> Adv -> Cl`` | //John is here// | -| ``mkCl`` | ``NP -> VP -> Cl`` | //John walks here// | -| ``mkCl`` | ``V -> Cl`` | //it rains// | -| ``mkCl`` | ``VP -> Cl`` | //it is raining// | -| ``mkCl`` | ``N -> Cl`` | //there is a house// | -| ``mkCl`` | ``CN -> Cl`` | //there is an old houses// | -| ``mkCl`` | ``NP -> Cl`` | //there are five houses// | -| ``mkCl`` | ``NP -> RS -> Cl`` | //it is John that walks// | -| ``mkCl`` | ``Adv -> S -> Cl`` | //it is here John walks// | -| ``genericCl`` | ``VP -> Cl`` | //one walks// | -| ``mkVP`` | ``V -> VP`` | //walk// | -| ``mkVP`` | ``V2 -> NP -> VP`` | //love her// | -| ``mkVP`` | ``V3 -> NP -> NP -> VP`` | //send it to her// | -| ``mkVP`` | ``VV -> VP -> VP`` | //want to walk// | -| ``mkVP`` | ``VS -> S -> VP`` | //know that she walks// | -| ``mkVP`` | ``VQ -> QS -> VP`` | //ask if she walks// | -| ``mkVP`` | ``VA -> AP -> VP`` | //become old// | -| ``mkVP`` | ``V2A -> NP -> AP -> VP`` | //paint it red// | -| ``mkVP`` | ``A -> VP`` | //be warm// | -| ``mkVP`` | ``AP -> VP`` | //be very warm// | -| ``mkVP`` | ``A -> NP -> VP`` | //be older than her// | -| ``mkVP`` | ``A2 -> NP -> VP`` | //be married to her// | -| ``mkVP`` | ``N -> VP`` | //be a man// | -| ``mkVP`` | ``CN -> VP`` | //be an old man// | -| ``mkVP`` | ``NP -> VP`` | //be the man// | -| ``mkVP`` | ``Adv -> VP`` | //be here// | -| ``mkVP`` | ``VP -> Adv -> VP`` | //sleep here// | -| ``mkVP`` | ``AdV -> VP -> VP`` | //always sleep// | -| ``reflexiveVP`` | ``V2 -> VP`` | //love itself// | -| ``passiveVP`` | ``V2 -> VP`` | //be loved// | -| ``passiveVP`` | ``V2 -> NP -> VP`` | //be loved by her// | -| ``progressiveVP`` | ``VP -> VP`` | //be sleeping// | -| ``mkImp`` | ``V -> Imp`` | //go// | -| ``mkImp`` | ``V2 -> NP -> Imp`` | //take it// | -| ``mkImp`` | ``VP -> Imp`` | //go there now// | -| ``mkNP`` | ``Det -> N -> NP`` | //the first man// | -| ``mkNP`` | ``Det -> CN -> NP`` | //the first old man// | -| ``mkNP`` | ``QuantSg -> N -> NP`` | //this man// | -| ``mkNP`` | ``QuantSg -> CN -> NP`` | //this old man// | -| ``mkNP`` | ``QuantPl -> N -> NP`` | //these men// | -| ``mkNP`` | ``QuantPl -> CN -> NP`` | //these old men// | -| ``mkNP`` | ``Numeral -> N -> NP`` | //twenty men// | -| ``mkNP`` | ``Numeral -> CN -> NP`` | //twenty old men// | -| ``mkNP`` | ``Int -> N -> NP`` | //45 men// | -| ``mkNP`` | ``Int -> CN -> NP`` | //45 old men// | -| ``mkNP`` | ``Num -> N -> NP`` | //almost twenty men// | -| ``mkNP`` | ``Num -> CN -> NP`` | //almost twenty old men// | -| ``mkNP`` | ``Pron -> N -> NP`` | //my man// | -| ``mkNP`` | ``Pron -> CN -> NP;`` | //my old man// | -| ``mkNP`` | ``PN -> NP`` | //John// | -| ``mkNP`` | ``Pron -> NP`` | //he// | -| ``mkNP`` | ``Predet -> NP -> NP`` | //only John// | -| ``mkNP`` | ``NP -> V2 -> NP`` | //John killed// | -| ``mkNP`` | ``NP -> Adv -> NP`` | //John in Paris// | -| ``mkNP`` | ``Conj -> NP -> NP -> NP`` | //John and I// | -| ``mkNP`` | ``Conj -> ListNP -> NP`` | //John, I, and that// | -| ``mkNP`` | ``DConj -> NP -> NP -> NP`` | //either John or I// | -| ``mkNP`` | ``DConj -> ListNP -> NP`` | //either John, I, or that// | -| ``mkDet`` | ``QuantSg -> Det`` | //this// | -| ``mkDet`` | ``QuantSg -> (Ord) -> Det`` | //this first// | -| ``mkDet`` | ``QuantPl -> Det`` | //these// | -| ``mkDet`` | ``QuantPl -> (Num) -> (Ord) -> Det`` | //these five best// | -| ``mkDet`` | ``Quant -> Det`` | //this// | -| ``mkDet`` | ``Quant -> Num -> Det`` | //these five// | -| ``mkDet`` | ``Num -> Det`` | //almost twenty// | -| ``mkDet`` | ``Numeral -> Det`` | //five// | -| ``mkDet`` | ``Int -> Det`` | //51// | -| ``mkDet`` | ``Pron -> Det`` | //my// | -| ``defSgDet`` | ``Det`` | //the (house)// | -| ``defPlDet`` | ``Det`` | //the (houses)// | -| ``indefSgDet`` | ``Det`` | //a (house)// | -| ``indefPlDet`` | ``Det`` | //(houses)// | -| ``defQuant`` | ``Quant`` | //the// | -| ``indefQuant`` | ``Quant`` | //a// | -| ``mkQuantSg`` | ``Quant -> QuantSg`` | //this// | -| ``massQuant`` | ``QuantSg`` | //(mass terms)// | -| ``mkQuantPl`` | ``Quant -> QuantPl`` | //these// | -| ``mkNum`` | ``Numeral -> Num`` | //twenty// | -| ``mkNum`` | ``Int -> Num`` | //51// | -| ``mkNum`` | ``AdN -> Num -> Num`` | //almost ten// | -| ``mkOrd`` | ``Numeral -> Ord`` | //twentieth// | -| ``mkOrd`` | ``Int -> Ord`` | //51st// | -| ``mkOrd`` | ``A -> Ord`` | //best// | -| ``mkAdN`` | ``CAdv -> AdN`` | //more than// | -| ``n1_Numeral`` | ``Numeral`` | //one// | -| ``n2_Numeral`` | ``Numeral`` | //two// | -| ``n3_Numeral`` | ``Numeral`` | //three// | -| ``n4_Numeral`` | ``Numeral`` | //four// | -| ``n5_Numeral`` | ``Numeral`` | //five// | -| ``n6_Numeral`` | ``Numeral`` | //six// | -| ``n7_Numeral`` | ``Numeral`` | //seven// | -| ``n8_Numeral`` | ``Numeral`` | //eight// | -| ``n9_Numeral`` | ``Numeral`` | //nine// | -| ``n10_Numeral`` | ``Numeral`` | //ten// | -| ``n20_Numeral`` | ``Numeral`` | //twenty// | -| ``n100_Numeral`` | ``Numeral`` | //hundred// | -| ``n1000_Numeral`` | ``Numeral`` | //thousand// | -| ``mkCN`` | ``N -> CN`` | //house// | -| ``mkCN`` | ``N2 -> NP -> CN`` | //mother of John// | -| ``mkCN`` | ``N3 -> NP -> NP -> CN`` | //distance from this city to Paris// | -| ``mkCN`` | ``N2 -> CN`` | //son// | -| ``mkCN`` | ``N3 -> CN`` | //flight// | -| ``mkCN`` | ``A -> N -> CN`` | //big house// | -| ``mkCN`` | ``A -> CN -> CN`` | //big blue house// | -| ``mkCN`` | ``AP -> N -> CN`` | //very big house// | -| ``mkCN`` | ``AP -> CN -> CN`` | //very big blue house// | -| ``mkCN`` | ``N -> RS -> CN`` | //house that John loves// | -| ``mkCN`` | ``CN -> RS -> CN`` | //big house that John loves// | -| ``mkCN`` | ``N -> Adv -> CN`` | //house in the city// | -| ``mkCN`` | ``CN -> Adv -> CN`` | //big house in the city// | -| ``mkCN`` | ``CN -> S -> CN`` | //rule that John walks// | -| ``mkCN`` | ``CN -> QS -> CN`` | //question if John walks// | -| ``mkCN`` | ``CN -> VP -> CN`` | //reason to walk// | -| ``mkCN`` | ``N -> NP -> CN`` | //king John// | -| ``mkCN`` | ``CN -> NP -> CN`` | //old king John// | -| ``mkAP`` | ``A -> AP`` | //old// | -| ``mkAP`` | ``A -> NP -> AP`` | //older than John// | -| ``mkAP`` | ``A2 -> NP -> AP`` | //married to her// | -| ``mkAP`` | ``A2 -> AP`` | //married to myself// | -| ``mkAP`` | ``AP -> S -> AP`` | //probable that John walks// | -| ``mkAP`` | ``AP -> QS -> AP`` | //uncertain if John walks// | -| ``mkAP`` | ``AP -> VP -> AP`` | //ready to go// | -| ``mkAP`` | ``AdA -> A -> AP`` | //very old// | -| ``mkAP`` | ``AdA -> AP -> AP`` | //very very old// | -| ``mkAP`` | ``Conj -> AP -> AP -> AP`` | //old and big// | -| ``mkAP`` | ``Conj -> ListAP -> AP`` | //old, big, and warm// | -| ``mkAP`` | ``DConj -> AP -> AP -> AP`` | //either old or big// | -| ``mkAP`` | ``DConj -> ListAP -> AP`` | //either old, big, or warm// | -| ``mkAdv`` | ``A -> Adv`` | //warmly// | -| ``mkAdv`` | ``Prep -> NP -> Adv`` | //with John// | -| ``mkAdv`` | ``Subj -> S -> Adv`` | //when John walks// | -| ``mkAdv`` | ``CAdv -> A -> NP -> Adv`` | //more warmly than John// | -| ``mkAdv`` | ``CAdv -> A -> S -> Adv`` | //more warmly than John walks// | -| ``mkAdv`` | ``AdA -> Adv -> Adv`` | //very warmly// | -| ``mkAdv`` | ``Conj -> Adv -> Adv -> Adv`` | //here and now// | -| ``mkAdv`` | ``Conj -> ListAdv -> Adv`` | //with John, here and now// | -| ``mkAdv`` | ``DConj -> Adv -> Adv -> Adv`` | //either here or now// | -| ``mkAdv`` | ``DConj -> ListAdv -> Adv`` | //either here, now, or with John// | -| ``mkQS`` | ``QCl -> QS`` | //who walks// | -| ``mkQS`` | ``(Tense) -> (Ant) -> (Pol) -> QCl -> QS`` | //who wouldn't have walked// | -| ``mkQS`` | ``Cl -> QS`` | //does John walk// | -| ``mkQCl`` | ``Cl -> QCl`` | //does John walk// | -| ``mkQCl`` | ``IP -> VP -> QCl`` | //who walks// | -| ``mkQCl`` | ``IP -> NP -> V2 -> QCl`` | //whom does John love// | -| ``mkQCl`` | ``IP -> Slash -> QCl`` | //whom does John love today// | -| ``mkQCl`` | ``IAdv -> Cl -> QCl`` | //why does John walk// | -| ``mkQCl`` | ``Prep -> IP -> Cl -> QCl`` | //with who does John walk// | -| ``mkQCl`` | ``IAdv -> NP -> QCl`` | //where is John// | -| ``mkQCl`` | ``IP -> QCl`` | //what is there// | -| ``mkIP`` | ``IDet -> N -> IP`` | //which city// | -| ``mkIP`` | ``IDet -> (Num) -> (Ord) -> CN -> IP`` | //which five best cities// | -| ``mkIP`` | ``IP -> Adv -> IP`` | //who in Paris// | -| ``mkIAdv`` | ``Prep -> IP -> IAdv`` | //in which city// | -| ``mkRS`` | ``RCl -> RS`` | //that walk// | -| ``mkRS`` | ``(Tense) -> (Ant) -> (Pol) -> RCl -> RS`` | //that wouldn't have walked// | -| ``mkRCl`` | ``RP -> VP -> RCl`` | //that walk// | -| ``mkRCl`` | ``RP -> NP -> V2 -> RCl`` | //which John loves// | -| ``mkRCl`` | ``RP -> Slash -> RCl`` | //which John loves today// | -| ``mkRCl`` | ``Cl -> RCl`` | //such that John loves her// | -| ``which_RP`` | ``RP`` | //which// | -| ``mkRP`` | ``Prep -> NP -> RP -> RP`` | //all the houses in which// | -| ``mkSlash`` | ``NP -> V2 -> Slash`` | //(whom) John loves// | -| ``mkSlash`` | ``NP -> VV -> V2 -> Slash`` | //(whom) John wants to see// | -| ``mkSlash`` | ``Cl -> Prep -> Slash`` | //(with whom) John walks// | -| ``mkSlash`` | ``Slash -> Adv -> Slash`` | //(whom) John loves today// | -| ``mkListS`` | ``S -> S -> ListS`` | //he walks, I run// | -| ``mkListS`` | ``S -> ListS -> ListS`` | //John walks, I run, you sleep// | -| ``mkListAdv`` | ``Adv -> Adv -> ListAdv`` | //here, now// | -| ``mkListAdv`` | ``Adv -> ListAdv -> ListAdv`` | //to me, here, now// | -| ``mkListAP`` | ``AP -> AP -> ListAP`` | //old, big// | -| ``mkListAP`` | ``AP -> ListAP -> ListAP`` | //old, big, warm// | -| ``mkListNP`` | ``NP -> NP -> ListNP`` | //John, I// | -| ``mkListNP`` | ``NP -> ListNP -> ListNP`` | //John, I, that// | - - -==Paradigms for Danish== - - -[source ../danish/ParadigmsDan.gf] - - - - -|| Function | Type | Example || -| ``Gender`` | ``Type`` | - | -| ``utrum`` | ``Gender`` | - | -| ``neutrum`` | ``Gender`` | - | -| ``Number`` | ``Type`` | - | -| ``singular`` | ``Number`` | - | -| ``plural`` | ``Number`` | - | -| ``Case`` | ``Type`` | - | -| ``nominative`` | ``Case`` | - | -| ``genitive`` | ``Case`` | - | -| ``mkPrep`` | ``Str -> Prep`` | - | -| ``noPrep`` | ``Prep`` | //empty string// | -| ``mkN`` | ``(dreng,drengen,drenge,drengene : Str) -> N`` | - | -| ``regN`` | ``Str -> N`` | - | -| ``regGenN`` | ``Str -> Gender -> N`` | - | -| ``mk2N`` | ``(bil,bilen : Str) -> N`` | - | -| ``mk3N`` | ``(bil,bilen,biler : Str) -> N`` | - | -| ``mkN2`` | ``N -> Prep -> N2`` | - | -| ``regN2`` | ``Str -> Gender -> N2`` | - | -| ``mkN3`` | ``N -> Prep -> Prep -> N3`` | - | -| ``mkPN`` | ``Str -> Gender -> PN`` | //Paris neutrum// | -| ``regPN`` | ``Str -> PN`` | //utrum gender// | -| ``nounPN`` | ``N -> PN`` | - | -| ``mkNP`` | ``Str -> Str -> Number -> Gender -> NP`` | - | -| ``mkA`` | ``(galen,galet,galne : Str) -> A`` | - | -| ``regA`` | ``Str -> A`` | - | -| ``mk2A`` | ``(stor,stort : Str) -> A`` | - | -| ``mkA2`` | ``A -> Prep -> A2`` | - | -| ``mkADeg`` | ``(stor,stort,store,storre,storst : Str) -> A`` | - | -| ``regADeg`` | ``Str -> A`` | - | -| ``irregADeg`` | ``(tung,tyngre,tyngst : Str) -> A`` | - | -| ``mk3ADeg`` | ``(galen,galet,galna : Str) -> A`` | - | -| ``mk2ADeg`` | ``(bred,bredt : Str) -> A`` | - | -| ``compoundA`` | ``A -> A`` | //-/mer/mest norsk// | -| ``mkAdv`` | ``Str -> Adv`` | - | -| ``mkAdV`` | ``Str -> AdV`` | - | -| ``mkAdA`` | ``Str -> AdA`` | - | -| ``mkV`` | ``(spise,spiser,spises,spiste,spist,spis : Str) -> V`` | - | -| ``regV`` | ``(snakke : Str) -> V`` | - | -| ``mk2V`` | ``(leve,levde : Str) -> V`` | - | -| ``irregV`` | ``(drikke, drak, drukket : Str) -> V`` | - | -| ``vaereV`` | ``V -> V`` | - | -| ``partV`` | ``V -> Str -> V`` | - | -| ``depV`` | ``V -> V`` | - | -| ``reflV`` | ``V -> V`` | - | -| ``mkV2`` | ``V -> Prep -> V2`` | - | -| ``dirV2`` | ``V -> V2`` | - | -| ``mkV3`` | ``V -> Prep -> Prep -> V3`` | //snakke, med, om// | -| ``dirV3`` | ``V -> Prep -> V3`` | //give,_,til// | -| ``dirdirV3`` | ``V -> V3`` | //give,_,_// | -| ``mkV0`` | ``V -> V0`` | - | -| ``mkVS`` | ``V -> VS`` | - | -| ``mkV2S`` | ``V -> Prep -> V2S`` | - | -| ``mkVV`` | ``V -> VV`` | - | -| ``mkV2V`` | ``V -> Prep -> Prep -> V2V`` | - | -| ``mkVA`` | ``V -> VA`` | - | -| ``mkV2A`` | ``V -> Prep -> V2A`` | - | -| ``mkVQ`` | ``V -> VQ`` | - | -| ``mkV2Q`` | ``V -> Prep -> V2Q`` | - | -| ``mkAS`` | ``A -> AS`` | - | -| ``mkA2S`` | ``A -> Prep -> A2S`` | - | -| ``mkAV`` | ``A -> AV`` | - | -| ``mkA2V`` | ``A -> Prep -> A2V`` | - | - - -==Paradigms for English== - - -[source ../english/ParadigmsEng.gf] - - - - -|| Function | Type | Example || -| ``Gender`` | ``Type`` | - | -| ``human`` | ``Gender`` | - | -| ``nonhuman`` | ``Gender`` | - | -| ``masculine`` | ``Gender`` | - | -| ``Number`` | ``Type`` | - | -| ``singular`` | ``Number`` | - | -| ``plural`` | ``Number`` | - | -| ``Case`` | ``Type`` | - | -| ``nominative`` | ``Case`` | - | -| ``genitive`` | ``Case`` | - | -| ``mkN`` | ``(flash : Str) -> N`` | - | -| ``mkN`` | ``(man,men : Str) -> N`` | - | -| ``mkN`` | ``(man,men,man's,men's : Str) -> N`` | - | -| ``mkN`` | ``Str -> N -> N`` | - | -| ``mkN2`` | ``N -> Prep -> N2`` | - | -| ``regN2`` | ``Str -> N2`` | - | -| ``mkN3`` | ``N -> Prep -> Prep -> N3`` | - | -| ``mkPN`` | ``Str -> PN`` | - | -| ``mkPN`` | ``N -> PN`` | - | -| ``mkA`` | ``(happy : Str) -> A`` | - | -| ``mkA`` | ``(fat,fatter : Str) -> A`` | - | -| ``mkA`` | ``(good,better,best,well : Str) -> A`` | - | -| ``compoundA`` | ``A -> A`` | //-/more/most ridiculous// | -| ``mkA2`` | ``A -> Prep -> A2`` | - | -| ``mkAdv`` | ``Str -> Adv`` | - | -| ``mkAdV`` | ``Str -> AdV`` | - | -| ``mkAdA`` | ``Str -> AdA`` | - | -| ``mkPrep`` | ``Str -> Prep`` | - | -| ``noPrep`` | ``Prep`` | - | -| ``mkV`` | ``(cry : Str) -> V`` | - | -| ``mkV`` | ``(stop, stopped : Str) -> V`` | - | -| ``mkV`` | ``(drink, drank, drunk : Str) -> V`` | - | -| ``mkV`` | ``(run, ran, run, running : Str) -> V`` | - | -| ``mkV`` | ``(go, goes, went, gone, going : Str) -> V`` | - | -| ``partV`` | ``V -> Str -> V`` | - | -| ``reflV`` | ``V -> V`` | - | -| ``mkV2`` | ``V -> Prep -> V2`` | //believe in// | -| ``mkV2`` | ``V -> V2`` | //kill// | -| ``mkV3`` | ``V -> Prep -> Prep -> V3`` | //speak, with, about// | -| ``dirV3`` | ``V -> Prep -> V3`` | //give,_,to// | -| ``dirdirV3`` | ``V -> V3`` | //give,_,_// | -| ``mkV0`` | ``V -> V0`` | - | -| ``mkVS`` | ``V -> VS`` | - | -| ``mkV2S`` | ``V -> Prep -> V2S`` | - | -| ``mkVV`` | ``V -> VV`` | - | -| ``mkV2V`` | ``V -> Prep -> Prep -> V2V`` | - | -| ``mkVA`` | ``V -> VA`` | - | -| ``mkV2A`` | ``V -> Prep -> V2A`` | - | -| ``mkVQ`` | ``V -> VQ`` | - | -| ``mkV2Q`` | ``V -> Prep -> V2Q`` | - | -| ``mkAS`` | ``A -> AS`` | - | -| ``mkA2S`` | ``A -> Prep -> A2S`` | - | -| ``mkAV`` | ``A -> AV`` | - | -| ``mkA2V`` | ``A -> Prep -> A2V`` | - | - - -==Paradigms for Finnish== - - -[source ../finnish/ParadigmsFin.gf] - - - - -|| Function | Type | Example || -| ``Number`` | ``Type`` | - | -| ``singular`` | ``Number`` | - | -| ``plural`` | ``Number`` | - | -| ``Case`` | ``Type`` | - | -| ``nominative`` | ``Case`` | - | -| ``genitive`` | ``Case`` | - | -| ``partitive`` | ``Case`` | - | -| ``translative`` | ``Case`` | - | -| ``inessive`` | ``Case`` | - | -| ``elative`` | ``Case`` | - | -| ``illative`` | ``Case`` | - | -| ``adessive`` | ``Case`` | - | -| ``ablative`` | ``Case`` | - | -| ``allative`` | ``Case`` | - | -| ``prePrep`` | ``Case -> Str -> Prep`` | //ilman, partitive// | -| ``postPrep`` | ``Case -> Str -> Prep`` | //takana, genitive// | -| ``postGenPrep`` | ``Str -> Prep`` | //takana// | -| ``casePrep`` | ``Case -> Prep`` | //adessive// | -| ``mkN`` | ``(talo : Str) -> N`` | - | -| ``mkN`` | ``(savi,savia : Str) -> N`` | - | -| ``mkN`` | ``(vesi,veden,vesiä : Str) -> N`` | - | -| ``mkN`` | ``(olo,oln,olona,oloa,oloon,oloina,oloissa,olojen,oloja,oloihin : Str) -> N`` | - | -| ``sgpartN`` | ``(meri : N) -> (merta : Str) -> N`` | - | -| ``nMeri`` | ``(meri : Str) -> N`` | - | -| ``nKukko`` | ``(kukko,kukon,kukkoja : Str) -> N`` | - | -| ``nTalo`` | ``(talo : Str) -> N`` | - | -| ``nLukko`` | ``(lukko : Str) -> N`` | - | -| ``nArpi`` | ``(arpi : Str) -> N`` | - | -| ``nSylki`` | ``(sylki : Str) -> N`` | - | -| ``nLinux`` | ``(linuxia : Str) -> N`` | - | -| ``nPeruna`` | ``(peruna : Str) -> N`` | - | -| ``nRae`` | ``(rae, rakeena : Str) -> N`` | - | -| ``nSusi`` | ``(susi,suden,sutta : Str) -> N`` | - | -| ``nPuu`` | ``(puu : Str) -> N`` | - | -| ``nSuo`` | ``(suo : Str) -> N`` | - | -| ``nNainen`` | ``(naista : Str) -> N`` | - | -| ``nTilaus`` | ``(tilaus,tilauksena : Str) -> N`` | - | -| ``nKulaus`` | ``(kulaus : Str) -> N`` | - | -| ``nNauris`` | ``(naurista : Str) -> N`` | - | -| ``compN`` | ``Str -> N -> N`` | - | -| ``mkN2`` | ``N -> N2`` | - | -| ``mkN2`` | ``N -> Prep -> N2`` | - | -| ``mkN3`` | ``N -> Prep -> Prep -> N3`` | - | -| ``mkPN`` | ``Str -> PN`` | - | -| ``mkPN`` | ``N -> PN`` | - | -| ``mkA`` | ``Str -> A`` | - | -| ``mkA`` | ``N -> A`` | - | -| ``mkA`` | ``N -> (kivempaa,kivinta : Str) -> A`` | - | -| ``mkA2`` | ``A -> Prep -> A2`` | - | -| ``mkV`` | ``(soutaa : Str) -> V`` | - | -| ``mkV`` | ``(soutaa,souti : Str) -> V`` | - | -| ``mkV`` | ``(soutaa,soudan,souti : Str) -> V`` | - | -| ``mkV`` | ``(tulla,tulee,tulen,tulevat,tulkaa,tullaan,tuli,tulin,tulisi,tullut,tultu,tullun : Str) -> V`` | - | -| ``mkV`` | ``V -> Case -> V`` | - | -| ``vValua`` | ``(valua : Str) -> V`` | - | -| ``vKattaa`` | ``(kattaa, katan : Str) -> V`` | - | -| ``vOstaa`` | ``(ostaa : Str) -> V`` | - | -| ``vNousta`` | ``(nousta, nousen : Str) -> V`` | - | -| ``vTuoda`` | ``(tuoda : Str) -> V`` | - | -| ``caseV`` | ``Case -> V -> V`` | - | -| ``vOlla`` | ``V`` | - | -| ``mkV2`` | ``V -> Prep -> V2`` | - | -| ``caseV2`` | ``V -> Case -> V2`` | - | -| ``dirV2`` | ``V -> V2`` | - | -| ``mkV3`` | ``V -> Prep -> Prep -> V3`` | //puhua, allative, elative// | -| ``dirV3`` | ``V -> Case -> V3`` | //siirtää, (accusative), illative// | -| ``dirdirV3`` | ``V -> V3`` | //antaa, (accusative), (allative)// | -| ``mkV0`` | ``V -> V0`` | - | -| ``mkVS`` | ``V -> VS`` | - | -| ``mkV2S`` | ``V -> Prep -> V2S`` | - | -| ``mkVV`` | ``V -> VV`` | - | -| ``mkV2V`` | ``V -> Prep -> V2V`` | - | -| ``mkVA`` | ``V -> Prep -> VA`` | - | -| ``mkV2A`` | ``V -> Prep -> Prep -> V2A`` | - | -| ``mkVQ`` | ``V -> VQ`` | - | -| ``mkV2Q`` | ``V -> Prep -> V2Q`` | - | -| ``mkAS`` | ``A -> AS`` | - | -| ``mkA2S`` | ``A -> Prep -> A2S`` | - | -| ``mkAV`` | ``A -> AV`` | - | -| ``mkA2V`` | ``A -> Prep -> A2V`` | - | - - -==Paradigms for French== - - -[source ../french/ParadigmsFre.gf] - - - - -|| Function | Type | Example || -| ``Gender`` | ``Type`` | - | -| ``masculine`` | ``Gender`` | - | -| ``feminine`` | ``Gender`` | - | -| ``Number`` | ``Type`` | - | -| ``singular`` | ``Number`` | - | -| ``plural`` | ``Number`` | - | -| ``accusative`` | ``Prep`` | - | -| ``genitive`` | ``Prep`` | - | -| ``dative`` | ``Prep`` | - | -| ``mkPrep`` | ``Str -> Prep`` | - | -| ``mkN`` | ``(cheval : Str) -> N`` | - | -| ``mkN`` | ``(foie : Str) -> Gender -> N`` | - | -| ``mkN`` | ``(oeil,yeux : Str) -> Gender -> N`` | - | -| ``mkN`` | ``N -> Str -> N`` | - | -| ``mkN2`` | ``N -> Prep -> N2`` | - | -| ``deN2`` | ``N -> N2`` | - | -| ``aN2`` | ``N -> N2`` | - | -| ``mkN3`` | ``N -> Prep -> Prep -> N3`` | - | -| ``mkPN`` | ``Str -> PN`` | - | -| ``mkPN`` | ``Str -> Gender -> PN`` | - | -| ``mkA`` | ``(cher : Str) -> A`` | - | -| ``mkA`` | ``(sec,seche : Str) -> A`` | - | -| ``mkA`` | ``(banal,banale,banaux,banalement : Str) -> A`` | - | -| ``mkA`` | ``A -> A -> A`` | - | -| ``prefixA`` | ``A -> A`` | - | -| ``mkA2`` | ``A -> Prep -> A2`` | - | -| ``mkAdv`` | ``Str -> Adv`` | - | -| ``mkAdV`` | ``Str -> AdV`` | - | -| ``mkAdA`` | ``Str -> AdA`` | - | -| ``mkV`` | ``(finir : Str) -> V`` | - | -| ``mkV`` | ``(jeter,jette,jettera : Str) -> V`` | - | -| ``mkV`` | ``V2 -> V`` | - | -| ``etreV`` | ``V -> V`` | - | -| ``reflV`` | ``V -> V`` | - | -| ``mkV2`` | ``V -> V2 = dirV2`` | - | -| ``mkV2`` | ``V -> Prep -> V2 = mmkV2`` | - | -| ``mkV3`` | ``V -> V3`` | //donner,_,_// | -| ``mkV3`` | ``V -> Prep -> V3`` | //placer,_,dans// | -| ``mkV3`` | ``V -> Prep -> Prep -> V3`` | //parler, à, de// | -| ``mkV0`` | ``V -> V0`` | - | -| ``mkVS`` | ``V -> VS`` | - | -| ``mkV2S`` | ``V -> Prep -> V2S`` | - | -| ``mkVV`` | ``V -> VV`` | //plain infinitive: "je veux parler"// | -| ``deVV`` | ``V -> VV`` | //"j'essaie de parler"// | -| ``aVV`` | ``V -> VV`` | //"j'arrive à parler"// | -| ``mkV2V`` | ``V -> Prep -> Prep -> V2V`` | - | -| ``mkVA`` | ``V -> VA`` | - | -| ``mkV2A`` | ``V -> Prep -> Prep -> V2A`` | - | -| ``mkVQ`` | ``V -> VQ`` | - | -| ``mkV2Q`` | ``V -> Prep -> V2Q`` | - | -| ``mkAS`` | ``A -> AS`` | - | -| ``mkA2S`` | ``A -> Prep -> A2S`` | - | -| ``mkAV`` | ``A -> Prep -> AV`` | - | -| ``mkA2V`` | ``A -> Prep -> Prep -> A2V`` | - | - - -==Paradigms for German== - - -[source ../german/ParadigmsGer.gf] - - - - -|| Function | Type | Example || -| ``Gender`` | ``Type`` | - | -| ``masculine`` | ``Gender`` | - | -| ``feminine`` | ``Gender`` | - | -| ``neuter`` | ``Gender`` | - | -| ``Case`` | ``Type`` | - | -| ``nominative`` | ``Case`` | - | -| ``accusative`` | ``Case`` | - | -| ``dative`` | ``Case`` | - | -| ``genitive`` | ``Case`` | - | -| ``Number`` | ``Type`` | - | -| ``singular`` | ``Number`` | - | -| ``plural`` | ``Number`` | - | -| ``mkN`` | ``(Stufe : Str) -> N`` | - | -| ``mkN`` | ``(Bild,Bilder : Str) -> Gender -> N`` | - | -| ``mkN`` | ``(x1,_,_,_,_,x6 : Str) -> Gender -> N`` | - | -| ``mkN2`` | ``Str -> N2`` | - | -| ``mkN2`` | ``N -> N2`` | - | -| ``mkN2`` | ``N -> Prep -> N2`` | - | -| ``mkN3`` | ``N -> Prep -> Prep -> N3`` | - | -| ``mkPN`` | ``Str -> PN`` | - | -| ``mkPN`` | ``(nom,gen : Str) -> PN`` | - | -| ``mkPN`` | ``(nom,acc,dat,gen : Str) -> PN`` | - | -| ``mkA`` | ``Str -> A`` | - | -| ``mkA`` | ``(gut,besser,beste : Str) -> A`` | //gut,besser,beste// | -| ``invarA`` | ``Str -> A`` | //prima// | -| ``mkA2`` | ``A -> Prep -> A2`` | - | -| ``mkAdv`` | ``Str -> Adv`` | - | -| ``mkPrep`` | ``Str -> Case -> Prep`` | - | -| ``accPrep`` | ``Prep`` | - | -| ``datPrep`` | ``Prep`` | - | -| ``genPrep`` | ``Prep`` | - | -| ``von_Prep`` | ``Prep`` | - | -| ``zu_Prep`` | ``Prep`` | - | -| ``mkV`` | ``(führen : Str) -> V`` | - | -| ``mkV`` | ``(sehen,sieht,sah,sähe,gesehen : Str) -> V`` | - | -| ``mkV`` | ``(geben, gibt, gib, gab, gäbe, gegeben : Str) -> V`` | - | -| ``mkV`` | ``Str -> V -> V`` | - | -| ``no_geV`` | ``V -> V`` | - | -| ``seinV`` | ``V -> V`` | - | -| ``habenV`` | ``V -> V`` | - | -| ``reflV`` | ``V -> Case -> V`` | - | -| ``mkV2`` | ``V -> Prep -> V2`` | - | -| ``mkV2`` | ``V -> V2`` | - | -| ``mkV2`` | ``V -> Case -> V2`` | - | -| ``mkV3`` | ``V -> Prep -> Prep -> V3`` | //sprechen, mit, über// | -| ``dirV3`` | ``V -> Prep -> V3`` | //senden,(accusative),nach// | -| ``accdatV3`` | ``V -> V3`` | //give,accusative,dative// | -| ``mkV0`` | ``V -> V0`` | - | -| ``mkVS`` | ``V -> VS`` | - | -| ``mkV2S`` | ``V -> Prep -> V2S`` | - | -| ``mkVV`` | ``V -> VV`` | - | -| ``mkV2V`` | ``V -> Prep -> V2V`` | - | -| ``mkVA`` | ``V -> VA`` | - | -| ``mkV2A`` | ``V -> Prep -> V2A`` | - | -| ``mkVQ`` | ``V -> VQ`` | - | -| ``mkV2Q`` | ``V -> Prep -> V2Q`` | - | -| ``mkAS`` | ``A -> AS`` | - | -| ``mkA2S`` | ``A -> Prep -> A2S`` | - | -| ``mkAV`` | ``A -> AV`` | - | -| ``mkA2V`` | ``A -> Prep -> A2V`` | - | - - -==Paradigms for Italian== - - -[source ../italian/ParadigmsIta.gf] - - - - -|| Function | Type | Example || -| ``Gender`` | ``Type`` | - | -| ``masculine`` | ``Gender`` | - | -| ``feminine`` | ``Gender`` | - | -| ``Number`` | ``Type`` | - | -| ``singular`` | ``Number`` | - | -| ``plural`` | ``Number`` | - | -| ``Prep`` | ``Type`` | - | -| ``accusative`` | ``Prep`` | - | -| ``genitive`` | ``Prep`` | - | -| ``dative`` | ``Prep`` | - | -| ``mkPrep`` | ``Str -> Prep`` | - | -| ``mkN`` | ``(cane : Str) -> N`` | - | -| ``mkN`` | ``(carne : Str) -> Gender -> N`` | - | -| ``mkN`` | ``(uomo,uomini : Str) -> Gender -> N`` | - | -| ``mkN`` | ``N -> Str -> N`` | - | -| ``mkN2`` | ``Str -> N2`` | - | -| ``mkN2`` | ``N -> Prep -> N2`` | - | -| ``mkN3`` | ``N -> Prep -> Prep -> N3`` | - | -| ``mkPN`` | ``Str -> PN`` | - | -| ``mkPN`` | ``Str -> Gender -> PN`` | - | -| ``mkA`` | ``(bianco : Str) -> A`` | - | -| ``mkA`` | ``(solo,sola,soli,sole,solamente : Str) -> A`` | - | -| ``mkA`` | ``A -> A -> A`` | - | -| ``prefixA`` | ``A -> A = prefA`` | - | -| ``mkA2`` | ``A -> Prep -> A2`` | - | -| ``mkAdv`` | ``Str -> Adv`` | - | -| ``mkAdV`` | ``Str -> AdV`` | - | -| ``mkAdA`` | ``Str -> AdA`` | - | -| ``mkV`` | ``Str -> V`` | - | -| ``mkV`` | ``Verbo -> V`` | - | -| ``mkV`` | ``(udire,odo,ode,udiamo,udiro,udii,udisti,udi,udirono,odi,udito : Str) -> V`` | - | -| ``essereV`` | ``V -> V`` | - | -| ``reflV`` | ``V -> V`` | - | -| ``mkV2`` | ``Str -> V2`` | - | -| ``mkV2`` | ``V -> V2`` | - | -| ``mkV2`` | ``V -> Prep -> V2`` | - | -| ``v2V`` | ``V2 -> V`` | - | -| ``mkV3`` | ``V -> Prep -> Prep -> V3`` | //parlare, a, di// | -| ``dirV3`` | ``V -> Prep -> V3`` | //dare,_,a// | -| ``dirdirV3`` | ``V -> V3`` | //dare,_,_// | -| ``mkV0`` | ``V -> V0`` | - | -| ``mkVS`` | ``V -> VS`` | - | -| ``mkV2S`` | ``V -> Prep -> V2S`` | - | -| ``mkVV`` | ``V -> VV`` | //plain infinitive: "voglio parlare"// | -| ``deVV`` | ``V -> VV`` | //"cerco di parlare"// | -| ``aVV`` | ``V -> VV`` | //"arrivo a parlare"// | -| ``mkV2V`` | ``V -> Prep -> Prep -> V2V`` | - | -| ``mkVA`` | ``V -> VA`` | - | -| ``mkV2A`` | ``V -> Prep -> Prep -> V2A`` | - | -| ``mkVQ`` | ``V -> VQ`` | - | -| ``mkV2Q`` | ``V -> Prep -> V2Q`` | - | -| ``mkAS`` | ``A -> AS`` | - | -| ``mkA2S`` | ``A -> Prep -> A2S`` | - | -| ``mkAV`` | ``A -> Prep -> AV`` | - | -| ``mkA2V`` | ``A -> Prep -> Prep -> A2V`` | - | - - -==Paradigms for Norwegian== - - -[source ../norwegian/ParadigmsNor.gf] - - - - -|| Function | Type | Example || -| ``Gender`` | ``Type`` | - | -| ``masculine`` | ``Gender`` | - | -| ``feminine`` | ``Gender`` | - | -| ``neutrum`` | ``Gender`` | - | -| ``Number`` | ``Type`` | - | -| ``singular`` | ``Number`` | - | -| ``plural`` | ``Number`` | - | -| ``Case`` | ``Type`` | - | -| ``nominative`` | ``Case`` | - | -| ``genitive`` | ``Case`` | - | -| ``mkPrep`` | ``Str -> Prep`` | - | -| ``noPrep`` | ``Prep`` | //empty string// | -| ``mkN`` | ``(dreng,drengen,drenger,drengene : Str) -> N`` | - | -| ``regN`` | ``Str -> N`` | - | -| ``regGenN`` | ``Str -> Gender -> N`` | - | -| ``mk2N`` | ``(bil,bilen : Str) -> N`` | - | -| ``mkN2`` | ``N -> Prep -> N2`` | - | -| ``regN2`` | ``Str -> Gender -> N2`` | - | -| ``mkN3`` | ``N -> Prep -> Prep -> N3`` | - | -| ``regPN`` | ``Str -> PN`` | //utrum// | -| ``regGenPN`` | ``Str -> Gender -> PN`` | - | -| ``nounPN`` | ``N -> PN`` | - | -| ``mkNP`` | ``Str -> Str -> Number -> Gender -> NP`` | - | -| ``mkA`` | ``(galen,galet,galne : Str) -> A`` | - | -| ``regA`` | ``Str -> A`` | - | -| ``mk2A`` | ``(stor,stort : Str) -> A`` | - | -| ``mkA2`` | ``A -> Prep -> A2`` | - | -| ``mkADeg`` | ``(stor,stort,store,storre,storst : Str) -> A`` | - | -| ``regADeg`` | ``Str -> A`` | - | -| ``irregADeg`` | ``(tung,tyngre,tyngst : Str) -> A`` | - | -| ``mk3ADeg`` | ``(galen,galet,galne : Str) -> A`` | - | -| ``mk2ADeg`` | ``(bred,bredt : Str) -> A`` | - | -| ``compoundA`` | ``A -> A`` | //-/mer/mest norsk// | -| ``mkAdv`` | ``Str -> Adv`` | //e.g. her// | -| ``mkAdV`` | ``Str -> AdV`` | //e.g. altid// | -| ``mkAdA`` | ``Str -> AdA`` | - | -| ``mkV`` | ``(spise,spiser,spises,spiste,spist,spis : Str) -> V`` | - | -| ``regV`` | ``(snakke : Str) -> V`` | - | -| ``mk2V`` | ``(leve,levde : Str) -> V`` | - | -| ``irregV`` | ``(drikke, drakk, drukket : Str) -> V`` | - | -| ``vaereV`` | ``V -> V`` | - | -| ``partV`` | ``V -> Str -> V`` | - | -| ``depV`` | ``V -> V`` | - | -| ``reflV`` | ``V -> V`` | - | -| ``mkV2`` | ``V -> Prep -> V2`` | - | -| ``dirV2`` | ``V -> V2`` | - | -| ``mkV3`` | ``V -> Prep -> Prep -> V3`` | //snakke, med, om// | -| ``dirV3`` | ``V -> Prep -> V3`` | //gi,_,til// | -| ``dirdirV3`` | ``V -> V3`` | //gi,_,_// | -| ``mkV0`` | ``V -> V0`` | - | -| ``mkVS`` | ``V -> VS`` | - | -| ``mkV2S`` | ``V -> Prep -> V2S`` | - | -| ``mkVV`` | ``V -> VV`` | - | -| ``mkV2V`` | ``V -> Prep -> Prep -> V2V`` | - | -| ``mkVA`` | ``V -> VA`` | - | -| ``mkV2A`` | ``V -> Prep -> V2A`` | - | -| ``mkVQ`` | ``V -> VQ`` | - | -| ``mkV2Q`` | ``V -> Prep -> V2Q`` | - | -| ``mkAS`` | ``A -> AS`` | - | -| ``mkA2S`` | ``A -> Prep -> A2S`` | - | -| ``mkAV`` | ``A -> AV`` | - | -| ``mkA2V`` | ``A -> Prep -> A2V`` | - | - - -==Paradigms for Russian== - - -[source ../russian/ParadigmsRus.gf] - -(To appear) - - -==Paradigms for Spanish== - - -[source ../spanish/ParadigmsSpa.gf] - - - - -|| Function | Type | Example || -| ``Gender`` | ``Type`` | - | -| ``masculine`` | ``Gender`` | - | -| ``feminine`` | ``Gender`` | - | -| ``Number`` | ``Type`` | - | -| ``singular`` | ``Number`` | - | -| ``plural`` | ``Number`` | - | -| ``Prep`` | ``Type`` | - | -| ``accusative`` | ``Prep`` | - | -| ``genitive`` | ``Prep`` | - | -| ``dative`` | ``Prep`` | - | -| ``mkPrep`` | ``Str -> Prep`` | - | -| ``mkN`` | ``(luz : Str) -> N`` | - | -| ``mkN`` | ``Str -> Gender -> N`` | - | -| ``mkN`` | ``(baston,bastones : Str) -> Gender -> N`` | - | -| ``compN`` | ``N -> Str -> N`` | - | -| ``mkN2`` | ``N -> Prep -> N2`` | - | -| ``deN2`` | ``N -> N2`` | - | -| ``aN2`` | ``N -> N2`` | - | -| ``mkN3`` | ``N -> Prep -> Prep -> N3`` | - | -| ``mkPN`` | ``(Anna : Str) -> PN`` | - | -| ``mkPN`` | ``(Pilar : Str) -> Gender -> PN`` | - | -| ``mkA`` | ``(util : Str) -> A`` | - | -| ``mkA`` | ``(solo,sola,solos,solas,solamiento : Str) -> A`` | - | -| ``mkA`` | ``(bueno : A) -> (mejor : A) -> A`` | - | -| ``prefixA`` | ``A -> A`` | - | -| ``mkA2`` | ``A -> Prep -> A2`` | - | -| ``mkAdv`` | ``Str -> Adv`` | - | -| ``mkAdV`` | ``Str -> AdV`` | - | -| ``mkAdA`` | ``Str -> AdA`` | - | -| ``mkV`` | ``(pagar : Str) -> V`` | - | -| ``mkV`` | ``(mostrar,muestro : Str) -> V`` | - | -| ``mkV`` | ``Verbum -> V`` | - | -| ``reflV`` | ``V -> V`` | - | -| ``special_ppV`` | ``V -> Str -> V`` | - | -| ``mkV2`` | ``Str -> V2`` | - | -| ``mkV2`` | ``V -> V2`` | - | -| ``mkV2`` | ``V -> Prep -> V2`` | - | -| ``v2V`` | ``V2 -> V`` | - | -| ``mkV3`` | ``V -> Prep -> Prep -> V3`` | //hablar, a, di// | -| ``dirV3`` | ``V -> Prep -> V3`` | //dar,(accusative),a// | -| ``dirdirV3`` | ``V -> V3`` | //dar,(dative),(accusative)// | -| ``mkV0`` | ``V -> V0`` | - | -| ``mkVS`` | ``V -> VS`` | - | -| ``mkV2S`` | ``V -> Prep -> V2S`` | - | -| ``mkVV`` | ``V -> VV`` | //plain infinitive: "quiero hablar"// | -| ``deVV`` | ``V -> VV`` | //"terminar de hablar"// | -| ``aVV`` | ``V -> VV`` | //"aprender a hablar"// | -| ``mkV2V`` | ``V -> Prep -> Prep -> V2V`` | - | -| ``mkVA`` | ``V -> VA`` | - | -| ``mkV2A`` | ``V -> Prep -> Prep -> V2A`` | - | -| ``mkVQ`` | ``V -> VQ`` | - | -| ``mkV2Q`` | ``V -> Prep -> V2Q`` | - | -| ``mkAS`` | ``A -> AS`` | - | -| ``mkA2S`` | ``A -> Prep -> A2S`` | - | -| ``mkAV`` | ``A -> Prep -> AV`` | - | -| ``mkA2V`` | ``A -> Prep -> Prep -> A2V`` | - | - - -==Paradigms for Swedish== - - -[source ../swedish/ParadigmsSwe.gf] - - - - -|| Function | Type | Example || -| ``Gender`` | ``Type`` | - | -| ``utrum`` | ``Gender`` | - | -| ``neutrum`` | ``Gender`` | - | -| ``Number`` | ``Type`` | - | -| ``singular`` | ``Number`` | - | -| ``plural`` | ``Number`` | - | -| ``Case`` | ``Type`` | - | -| ``nominative`` | ``Case`` | - | -| ``genitive`` | ``Case`` | - | -| ``mkPrep`` | ``Str -> Prep`` | - | -| ``noPrep`` | ``Prep`` | //empty string// | -| ``mkN`` | ``(apa : Str) -> N`` | - | -| ``mkN`` | ``(lik : Str) -> Gender -> N`` | - | -| ``mkN`` | ``(nyckel,nycklar : Str) -> N`` | - | -| ``mkN`` | ``(museum,museet,museer,museerna : Str) -> N`` | - | -| ``mkN2`` | ``Str -> N2`` | - | -| ``mkN2`` | ``N -> Prep -> N2`` | - | -| ``mkN3`` | ``N -> Prep -> Prep -> N3`` | - | -| ``mkPN`` | ``Str -> PN`` | - | -| ``mkPN`` | ``Str -> Gender -> PN`` | - | -| ``mkPN`` | ``(jesus,jesu : Str) -> Gender -> PN`` | - | -| ``mkA`` | ``(billig : Str) -> A`` | - | -| ``mkA`` | ``(bred,brett : Str) -> A`` | - | -| ``mkA`` | ``(tung,tyngre,tyngst : Str) -> A`` | - | -| ``mkA`` | ``(god,gott,goda,battre,bast : Str) -> A`` | - | -| ``mkA`` | ``(liten,litet,lilla,sma,mindre,minst,minsta : Str) -> A`` | - | -| ``compoundA`` | ``A -> A`` | - | -| ``mkA2`` | ``A -> Prep -> A2`` | - | -| ``mkAdv`` | ``Str -> Adv`` | //här// | -| ``mkAdV`` | ``Str -> AdV`` | //alltid// | -| ``mkAdA`` | ``Str -> AdA`` | - | -| ``mkV`` | ``(stämmer : Str) -> V`` | - | -| ``mkV`` | ``(dricka,drack,druckit : Str) -> V`` | - | -| ``mkV`` | ``(gå,går,gå,gick,gått,gången : Str) -> V`` | - | -| ``mkV`` | ``V -> Str -> V`` | - | -| ``depV`` | ``V -> V`` | - | -| ``reflV`` | ``V -> V`` | - | -| ``mkV2`` | ``Str -> V2`` | - | -| ``mkV2`` | ``V -> V2`` | - | -| ``mkV2`` | ``V -> Prep -> V2`` | - | -| ``mkV3`` | ``Str -> V3`` | - | -| ``mkV3`` | ``V -> V3`` | - | -| ``mkV3`` | ``V -> Prep -> V3`` | - | -| ``mkV3`` | ``V -> Prep -> Prep -> V3`` | - | -| ``mkV0`` | ``V -> V0`` | - | -| ``mkVS`` | ``V -> VS`` | - | -| ``mkV2S`` | ``V -> Prep -> V2S`` | - | -| ``mkVV`` | ``V -> VV`` | - | -| ``mkV2V`` | ``V -> Prep -> Prep -> V2V`` | - | -| ``mkVA`` | ``V -> VA`` | - | -| ``mkV2A`` | ``V -> Prep -> V2A`` | - | -| ``mkVQ`` | ``V -> VQ`` | - | -| ``mkV2Q`` | ``V -> Prep -> V2Q`` | - | -| ``mkAS`` | ``A -> AS`` | - | -| ``mkA2S`` | ``A -> Prep -> A2S`` | - | -| ``mkAV`` | ``A -> AV`` | - | -| ``mkA2V`` | ``A -> Prep -> A2V`` | - | - diff --git a/doc/resource.pdf b/doc/resource.pdf deleted file mode 100644 index 0efae7b50..000000000 Binary files a/doc/resource.pdf and /dev/null differ diff --git a/doc/resource.txt b/doc/resource.txt deleted file mode 100644 index 13f1f4798..000000000 --- a/doc/resource.txt +++ /dev/null @@ -1,1258 +0,0 @@ -The GF Resource Grammar Library, Version 1.2 -Authors: Aarne Ranta, Ali El Dada, Janna Khegai, and Björn Bringert -Last update: %%date(%c) - -% NOTE: this is a txt2tags file. -% Create an latex file from this file using: -% txt2tags -ttex --toc resource.txt -%!style(tex) : isolatin1 -%!postproc: "section*{" "section{" -%!postproc(tex): "#SMALL" "scriptsize" -%!postproc(tex): "#BFIG" "begin{figure}" -%!postproc(tex): "#GRAMMAR" "includegraphics[width=4in]{Grammar.epsi}" -%!postproc(tex): "#EFIG" "end{figure}" -%!postproc(tex): "#BCENTER" "begin{center}" -%!postproc(tex): "#ECENTER" "end{center}" -%!postproc(tex): "#CAPTION" "caption{" -%!postproc(tex): "#RBRACE" "end{figure}" -%!postproc(tex): "#CLEARPAGE" "clearpage" -%!postproc(tex): "#PARADIGMSRUS" "input{ParadigmsRus.tex}" -%!target:tex - -#CLEARPAGE - -%%toc - -#CLEARPAGE - -This document is a guide for using the -GF Resource Grammar Library. It presupposes knowledge of GF and its -module system, knowledge that can be acquired e.g. from the -GF tutorial. -We start with an introduction to the library, and proceed to -details with the goal of covering all that one needs to know -in order to use the library. - -How to //write// one's own resource grammar (i.e. to implement the API for -a new language), is covered by a separate Resource-HOWTO document (available in -the www address below). - -The main part of the document (the API documentation) is generated -from the actual GF code by using the ``gfdoc`` tool. This documentation -is also available on-line in HTML format in - -[``http://www.cs.chalmers.se/~aarne/GF/lib/resource-1.2/doc/`` http://www.cs.chalmers.se/~aarne/GF/lib/resource-1.2/doc/]. - - -=Motivation= - -The GF Resource Grammar Library contains grammar rules for -10 languages (in addition, 2 languages are available as incomplete -implementations, and a few more are under construction). Its purpose -is to make these rules available for application programmers, -who can thereby concentrate on the semantic and stylistic -aspects of their grammars, without having to think about -grammaticality. The targeted level of application grammarians -is that of a skilled programmer with -a practical knowledge of the target languages, but without -theoretical knowledge about their grammars. -Such a combination of -skills is typical of programmers who, for instance, want to localize -software to new languages. - -The current resource languages are -- ``Ara``bic -- ``Cat``alan -- ``Dan``ish -- ``Eng``lish -- ``Fin``nish -- ``Fre``nch -- ``Ger``man -- ``Ita``lian -- ``Nor``wegian -- ``Rus``sian -- ``Spa``nish -- ``Swe``dish - - -The first three letters (``Eng`` etc) are used in grammar module names. -The Arabic and Catalan implementations are still incomplete, but -enough to be used in many applications. - - - -==A first example== - -To give an example application, consider a system for steering -music playing devices by voice commands. In the application, -we may have a semantical category ``Kind``, examples -of ``Kind``s being ``Song`` and ``Artist``. In German, for instance, ``Song`` -is linearized into the noun "Lied", but knowing this is not -enough to make the application work, because the noun must be -produced in both singular and plural, and in four different -cases. By using the resource grammar library, it is enough to -write -``` - lin Song = mkN "Lied" "Lieder" neuter -``` -and the eight forms are correctly generated. The resource grammar -library contains a complete set of inflectional paradigms (such as -``mkN`` here), enabling the definition of any lexical items. - -The resource grammar library is not only about inflectional paradigms - it -also has syntax rules. The music player application -might also want to modify songs with properties, such as "American", -"old", "good". The German grammar for adjectival modifications is -particularly complex, because adjectives have to agree in gender, -number, and case, and also depend on what determiner is used -("ein amerikanisches Lied" vs. "das amerikanische Lied"). All this -variation is taken care of by the resource grammar function -``` - mkCN : AP -> CN -> CN -``` -(see the table in the end of this document for the list of all resource grammar -functions). The resource grammar implementation of the rule adding properties -to kinds is -``` - lin PropKind kind prop = mkCN prop kind -``` -given that -``` - lincat Prop = AP - lincat Kind = CN -``` -The resource library API is devided into language-specific -and language-independent parts. To put it roughly, -- the lexicon API is language-specific -- the syntax API is language-independent - - -Thus, to render the above example in French instead of German, we need to -pick a different linearization of ``Song``, -``` - lin Song = mkN "chanson" feminine -``` -But to linearize ``PropKind``, we can use the very same rule as in German. -The resource function ``mkCN`` has different implementations in the two -languages (e.g. a different word order in French), -but the application programmer need not care about the difference. - - - -==Note on APIs== - -From version 1.1 onwards, the resource library is available via two -APIs: -- original ``fun`` and ``oper`` definitions -- overloaded ``oper`` definitions - - -Introducing overloading in GF version 2.7 has been a success in improving -the accessibility of libraries. It has also created a layer of abstraction -between the writers and users of libraries, and thereby makes the library -easier to modify. We shall therefore use the overloaded API -in this document. The original function names are mainly interesting -for those who want to write or modify libraries. - - - -==A complete example== - -To summarize the example, and also give a template for a programmer to work on, -here is the complete implementation of a small system with songs and properties. -The abstract syntax defines a "domain ontology": -``` - abstract Music = { - - cat - Kind, - Property ; - fun - PropKind : Kind -> Property -> Kind ; - Song : Kind ; - American : Property ; - } -``` -The concrete syntax is defined by a functor (parametrized module), -independently of language, by opening -two interfaces: the resource ``Syntax`` and an application lexicon. -``` - incomplete concrete MusicI of Music = - open Syntax, MusicLex in { - lincat - Kind = CN ; - Property = AP ; - lin - PropKind k p = mkCN p k ; - Song = mkCN song_N ; - American = mkAP american_A ; - } -``` -The application lexicon ``MusicLex`` has an abstract syntax that extends -the resource category system ``Cat``. -``` - abstract MusicLex = Cat ** { - - fun - song_N : N ; - american_A : A ; - } -``` -Each language has its own concrete syntax, which opens the -inflectional paradigms module for that language: -``` - concrete MusicLexGer of MusicLex = - CatGer ** open ParadigmsGer in { - lin - song_N = mkN "Lied" "Lieder" neuter ; - american_A = mkA "amerikanisch" ; - } - - concrete MusicLexFre of MusicLex = - CatFre ** open ParadigmsFre in { - lin - song_N = mkN "chanson" feminine ; - american_A = mkA "américain" ; - } -``` -The top-level ``Music`` grammars are obtained by -instantiating the two interfaces of ``MusicI``: -``` - concrete MusicGer of Music = MusicI with - (Syntax = SyntaxGer), - (MusicLex = MusicLexGer) ; - - concrete MusicFre of Music = MusicI with - (Syntax = SyntaxFre), - (MusicLex = MusicLexFre) ; -``` -Both of these files can use the same ``path``, defined as -``` - --# -path=.:present:prelude -``` -The ``present`` category contains the compiled resources, restricted to -present tense; ``alltenses`` has the full resources. - -To localize the music player system to a new language, -all that is needed is two modules, -one implementing ``MusicLex`` and the other -instantiating ``Music``. The latter is -completely trivial, whereas the former one involves the choice of correct -vocabulary and inflectional paradigms. For instance, Finnish is added as follows: -``` - concrete MusicLexFin of MusicLex = - CatFin ** open ParadigmsFin in { - lin - song_N = mkN "kappale" ; - american_A = mkA "amerikkalainen" ; - } - - concrete MusicFin of Music = MusicI with - (Syntax = SyntaxFin), - (MusicLex = MusicLexFin) ; -``` -More work is of course needed if the language-independent linearizations in -MusicI are not satisfactory for some language. The resource grammar guarantees -that the linearizations are possible in all languages, in the sense of grammatical, -but they might of course be inadequate for stylistic reasons. Assume, -for the sake of argument, that adjectival modification does not sound good in -English, but that a relative clause would be preferrable. One can then use -restricted inheritance of the functor: -``` - concrete MusicEng of Music = - MusicI - [PropKind] - with - (Syntax = SyntaxEng), - (MusicLex = MusicLexEng) ** - open SyntaxEng in { - lin - PropKind k p = mkCN k (mkRS (mkRCl which_RP (mkVP p))) ; - } -``` -The lexicon is as expected: -``` - concrete MusicLexEng of MusicLex = - CatEng ** open ParadigmsEng in { - lin - song_N = mkN "song" ; - american_A = mkA "American" ; - } -``` - - -==Lock fields== - -//This section is only relevant as a guide to error messages that have to do with lock fields, and can be skipped otherwise.// - -FIXME: this section may become obsolete. - -When the categories of the resource grammar are used -in applications, a **lock field** is added to their linearization types. -The lock field for a category ``C`` is a record field -``` - lock_C : {} -``` -with the only possible value -``` - lock_C = <> -``` -The lock field carries no information, but its presence -makes the linearization type of ``C`` -unique, so that categories -with the same implementation are not confused with each other. -(This is inspired by the ``newtype`` discipline in Haskell.) - -For example, the lincats of adverbs and conjunctions are the same -in ``CatEng`` (and therefore in ``GrammarEng``, which inherits it): -``` - lincat Adv = {s : Str} ; - lincat Conj = {s : Str} ; -``` -But when these category symbols are used to denote their linearization -types in an application, these definitions are translated to -``` - oper Adv : Type = {s : Str ; lock_Adv : {}} ; - oper Conj : Type = {s : Str} ; lock_Conj : {}} ; -``` -In this way, the user of a resource grammar cannot confuse adverbs with -conjunctions. In other words, the lock fields force the type checker -to function as grammaticality checker. - -When the resource grammar is ``open``ed in an application grammar, -and only functions from the resource are used in type-correct way, the -lock fields are never seen (except possibly in type error messages). -If an application grammarian has to write lock fields herself, -it is a sign that the guarantees given by the resource grammar -no longer hold. But since the resource may be incomplete, the -application grammarian may occasionally have to provide the dummy -values of lock fields (always ``<>``, the empty record). -Here is an example: -``` - mkUtt : Str -> Utt ; - mkUtt s = {s = s ; lock_Utt = <>} ; -``` -Currently, missing lock field produce warnings rather than errors, -but this behaviour of GF may change in future. - - -==Parsing with resource grammars?== - -The intended use of the resource grammar is as a library for writing -application grammars. It is not designed for parsing e.g. newspaper text. There -are several reasons why this is not practical: -- Efficiency: the resource grammar uses complex data structures, in -particular, discontinuous constituents, which make parsing slow and the -parser size huge. -- Completeness: the resource grammar does not necessarily cover all rules -of the language - only enough many to be able to express everything -in one way or another. -- Lexicon: the resource grammar has a very small lexicon, only meant for test -purposes. -- Semantics: the resource grammar has very little semantic control, and may -accept strange input or deliver strange interpretations. -- Ambiguity: parsing in the resource grammar may return lots of results many -of which are implausible. - - -All of these problems should be solved in application grammars. -The task of resource grammars is just to take care of low-level linguistic -details such as inflection, agreement, and word order. - -It is for the same reasons that resource grammars are not adequate for translation. -That the syntax API is implemented for different languages of course makes -it possible to translate via it - but there is no guarantee of translation -equivalence. Of course, the use of functor implementations such as ``MusicI`` -above only extends to those cases where the syntax API does give translation -equivalence - but this must be seen as a limiting case, and bigger applications -will often use only restricted inheritance of ``MusicI``. - - - -=To find rules in the resource grammar library= - -==Inflection paradigms== - -Inflection paradigms are defined separately for each language //L// -in the module ``Paradigms``//L//. To test them, the command -``cc`` (= ``compute_concrete``) -can be used: -``` - > i -retain german/ParadigmsGer.gf - - > cc mkN "Schlange" - { - s : Number => Case => Str = table Number { - Sg => table Case { - Nom => "Schlange" ; - Acc => "Schlange" ; - Dat => "Schlange" ; - Gen => "Schlange" - } ; - Pl => table Case { - Nom => "Schlangen" ; - Acc => "Schlangen" ; - Dat => "Schlangen" ; - Gen => "Schlangen" - } - } ; - g : Gender = Fem - } -``` -For the sake of convenience, every language implements these five paradigms: -``` - oper - mkN : Str -> N ; -- regular nouns - mkA : Str -> A : -- regular adjectives - mkV : Str -> V ; -- regular verbs - mkPN : Str -> PN ; -- regular proper names - mkV2 : V -> V2 ; -- direct transitive verbs -``` -It is often possible to initialize a lexicon by just using these functions, -and later revise it by using the more involved paradigms. For instance, in -German we cannot use ``mkN "Lied"`` for ``Song``, because the result would be a -Masculine noun with the plural form ``"Liede"``. -The individual ``Paradigms`` modules -tell what cases are covered by the regular heuristics. - -As a limiting case, one could even initialize the lexicon for a new language -by copying the English (or some other already existing) lexicon. This would -produce language with correct grammar but with content words directly borrowed from -English - maybe not so strange in certain technical domains. - - - -==Syntax rules== - -Syntax rules should be looked for in the module ``Constructors``. -Below this top-level module exposing overloaded constructors, -there are around 10 abstract modules, each defining constructors for -a group of one or more related categories. For instance, the module -``Noun`` defines how to construct common nouns, noun phrases, and determiners. -But these special modules are seldom or never needed by the users of the library. - -TODO: when are they needed? - -Browsing the libraries is helped by the gfdoc-generated HTML pages, -whose LaTeX versions are included in the present document. - - -==Special-purpose APIs== - -To give an analogy with the well-known type setting software, GF can be compared -with TeX and the resource grammar library with LaTeX. -Just like TeX frees the author -from thinking about low-level problems of page layout, so GF frees the grammarian -from writing parsing and generation algorithms. But quite a lot of knowledge of -//how// to write grammars is still needed, and the resource grammar library helps -GF grammarians in a way similar to how the LaTeX macro package helps TeX authors. - -But even LaTeX is often too detailed and low-level, and users are encouraged to -develop their own macro packages. The same applies to GF resource grammars: -the application grammarian might not need all the choices that the resource -provides, but would prefer less writing and higher-level programming. -To this end, application grammarians may want to write their own views on the -resource grammar. One example of this is the overloaded predication -operation ``pred`` available in ``api/Combinators``. -Instead of the ``NP-VP`` structure, it permits clause construction directly from -verbs and adjectives and their arguments: -``` - pred : V -> NP -> Cl ; -- x converges - pred : V2 -> NP -> NP -> Cl ; -- x intersects y - pred : V3 -> NP -> NP -> NP -> Cl ; -- x intersects y at z - pred : V -> NP -> NP -> Cl ; -- x and y intersect - pred : A -> NP -> Cl ; -- x is even - pred : A2 -> NP -> NP -> Cl ; -- x is divisible by y - pred : A -> NP -> NP -> Cl ; -- x and y are equal -``` - - -==Browsing by the parser== - -A method alternative to browsing library documentation is -to use the parser. -Even though parsing is not an intended end-user application -of resource grammars, it is a useful technique for application grammarians -to browse the library. To find out which resource function implements -a particular structure, one can just parse a string that exemplifies this -structure. For instance, to find out how sentences are built using -transitive verbs, write -``` - > i english/LangEng.gf - - > p -cat=Cl -fcfg "she loves him" - - PredVP (UsePron she_Pron) (ComplV2 love_V2 (UsePron he_Pron)) -``` -The parser returns original constructors, not overloaded ones. - -Parsing with the English resource grammar has an acceptable speed, but -with most languages it takes just too much resources even to build the -parser. However, examples parsed in one language can always be linearized into -other languages: -``` - > i italian/LangIta.gf - - > l PredVP (UsePron she_Pron) (ComplV2 love_V2 (UsePron he_Pron)) - - lo ama -``` -Therefore, one can use the English parser to write an Italian grammar, and also -to write a language-independent (incomplete) grammar. One can also parse strings -that are bizarre in English but the intended way of expression in another language. -For instance, the phrase for "I am hungry" in Italian is literally "I have hunger". -This can be built by parsing "I have beer" in LanEng and then writing -``` - lin IamHungry = - let beer_N = regGenN "fame" feminine - in - PredVP (UsePron i_Pron) (ComplV2 have_V2 - (DetCN (DetSg MassDet NoOrd) (UseN beer_N))) ; -``` -which uses ParadigmsIta.regGenN. - - - -==Example-based grammar writing== - -The technique of parsing with the resource grammar can be used in GF source files, -endowed with the suffix ``.gfe`` ("GF examples"). The suffix tells GF to preprocess -the file by replacing all expressions of the form -``` - in Module.Cat "example string" -``` -by the syntax trees obtained by parsing "example string" in ``Cat`` in ``Module``. -For instance, -``` - lin IamHungry = - let beer_N = regGenN "fame" feminine - in - (in LangEng.Cl "I have beer") ; -``` -will result in the rule displayed in the previous section. The normal binding rules -of functional programming (and GF) guarantee that local bindings of identifiers -take precedence over constants of the same forms. Thus it is also possible to -linearize functions taking arguments in this way: -``` - lin - PropKind car_N old_A = in LangEng.CN "old car" ; -``` -However, the technique of example-based grammar writing has some limitations: -- Ambiguity. If a string has several parses, the first one is returned, and -it may not be the intended one. The other parses are shown in a comment, from -where they must/can be picked manually. -- Lexicality. The arguments of a function must be atomic identifiers, and are thus -not available for categories that have no lexical items. -For instance, the ``PropKind`` rule above gives the result -``` - lin - PropKind car_N old_A = AdjCN (UseN car_N) (PositA old_A) ; -``` -However, it is possible to write a special lexicon that gives atomic rules for -all those categories that can be used as arguments, for instance, -``` - fun - cat_CN : CN ; - old_AP : AP ; -``` -and then use this lexicon instead of the standard one included in ``Lang``. - - -=Overview of syntactic structures= - -==Texts. phrases, and utterances== - -The outermost linguistic structure is ``Text``. ``Text``s are composed -from Phrases (``Phr``) followed by punctuation marks - either of ".", "?" or -"!" (with their proper variants in Spanish and Arabic). Here is an -example of a ``Text`` string. -``` - John walks. Why? He doesn't want to sleep! -``` -Phrases are mostly built from Utterances (``Utt``), which in turn are -declarative sentences, questions, or imperatives - but there -are also "one-word utterances" consisting of noun phrases -or other subsentential phrases. Some Phrases are atomic, -for instance "yes" and "no". Here are some examples of Phrases. -``` - yes - come on, John - but John walks - give me the stick please - don't you know that he is sleeping - a glass of wine - a glass of wine please -``` -There is no connection between the punctuation marks and the -types of utterances. This reflects the fact that the punctuation -mark in a real text is selected as a function of the speech act -rather than the grammatical form of an utterance. The following -text is thus well-formed. -``` - John walks. John walks? John walks! -``` -What is the difference between Phrase and Utterance? Just technical: -a Phrase is an Utterance with an optional leading conjunction ("but") -and an optional tailing vocative ("John", "please"). - - -==Sentences and clauses== - -TODO: use overloaded operations in the examples. - -The richest of the categories below Utterance is ``S``, Sentence. A Sentence -is formed from a Clause (``Cl``), by fixing its Tense, Anteriority, and Polarity. -For example, each of the following strings has a distinct syntax tree -in the category Sentence: -``` - John walks - John doesn't walk - John walked - John didn't walk - John has walked - John hasn't walked - John will walk - John won't walk - ... -``` -whereas in the category Clause all of them are just different forms of -the same tree. -The difference between Sentence and Clause is thus also rather technical. -It may not correspond exactly to any standard usage of the terms -"clause" and "sentence". - -Figure 1 shows a type-annotated syntax tree of the Text "John walks." -and gives an overview of the structural levels. - -#BFIG - -``` -Node Constructor Value type Other constructors ------------------------------------------------------------ - 1. TFullStop Text TQuestMark - 2. (PhrUtt Phr - 3. NoPConj PConj but_PConj - 4. (UttS Utt UttQS - 5. (UseCl S UseQCl - 6. TPres Tense TPast - 7. ASimul Anter AAnter - 8. PPos Pol PNeg - 9. (PredVP Cl -10. (UsePN NP UsePron, DetCN -11. john_PN) PN mary_PN -12. (UseV VP ComplV2, ComplV3 -13. walk_V)))) V sleep_V -14. NoVoc) Voc please_Voc -15. TEmpty Text -``` - -#BCENTER -Figure 1. Type-annotated syntax tree of the Text "John walks." -#ECENTER - -#EFIG - -Here are some examples of the results of changing constructors. -``` - 1. TFullStop -> TQuestMark John walks? - 3. NoPConj -> but_PConj But John walks. - 6. TPres -> TPast John walked. - 7. ASimul -> AAnter John has walked. - 8. PPos -> PNeg John doesn't walk. -11. john_PN -> mary_PN Mary walks. -13. walk_V -> sleep_V John sleeps. -14. NoVoc -> please_Voc John sleeps please. -``` -All constructors cannot of course be changed so freely, because the -resulting tree would not remain well-typed. Here are some changes involving -many constructors: -``` - 4- 5. UttS (UseCl ...) -> - UttQS (UseQCl (... QuestCl ...)) Does John walk? -10-11. UsePN john_PN -> - UsePron we_Pron We walk. -12-13. UseV walk_V -> - ComplV2 love_V2 this_NP John loves this. -``` - - -==Parts of sentences== - -The linguistic phenomena mostly discussed in both traditional grammars and modern -syntax belong to the level of Clauses, that is, lines 9-13, and occasionally -to Sentences, lines 5-13. At this level, the major categories are -``NP`` (Noun Phrase) and ``VP`` (Verb Phrase). A Clause typically -consists of just an ``NP`` and a ``VP``. -The internal structure of both ``NP`` and ``VP`` can be very complex, -and these categories are mutually recursive: not only can a ``VP`` -contain an ``NP``, -``` - [VP loves [NP Mary]] -``` -but also an ``NP`` can contain a ``VP`` -``` - [NP every man [RS who [VP walks]]] -``` -(a labelled bracketing like this is of course just a rough approximation of -a GF syntax tree, but still a useful device of exposition). - -Most of the resource modules thus define functions that are used inside -NPs and VPs. Here is a brief overview: - -**Noun**. How to construct NPs. The main three mechanisms -for constructing NPs are -- from proper names: "John" -- from pronouns: "we" -- from common nouns by determiners: "this man" - - -The ``Noun`` module also defines the construction of common nouns. -The most frequent ways are -- lexical noun items: "man" -- adjectival modification: "old man" -- relative clause modification: "man who sleeps" -- application of relational nouns: "successor of the number" - - -**Verb**. -How to construct VPs. The main mechanism is verbs with their arguments, -for instance, -- one-place verbs: "walks" -- two-place verbs: "loves Mary" -- three-place verbs: "gives her a kiss" -- sentence-complement verbs: "says that it is cold" -- VP-complement verbs: "wants to give her a kiss" - - -A special verb is the copula, "be" in English but not even realized -by a verb in all languages. -A copula can take different kinds of complement: -- an adjectival phrase: "(John is) old" -- an adverb: "(John is) here" -- a noun phrase: "(John is) a man" - - -**Adjective**. -How to constuct ``AP``s. The main ways are -- positive forms of adjectives: "old" -- comparative forms with object of comparison: "older than John" - - -**Adverb**. -How to construct ``Adv``s. The main ways are -- from adjectives: "slowly" -- as prepositional phrases: "in the car" - - -==Modules and their names== - -This section is not necessary for users of the library. - -TODO: explain the overloaded API. - -The resource modules are named after the kind of -phrases that are constructed in them, -and they can be roughly classified by the "level" or "size" of expressions that are -formed in them: -- Larger than sentence: ``Text``, ``Phrase`` -- Same level as sentence: ``Sentence``, ``Question``, ``Relative`` -- Parts of sentence: ``Adjective``, ``Adverb``, ``Noun``, ``Verb`` -- Cross-cut (coordination): ``Conjunction`` - - -Because of mutual recursion such as in embedded sentences, this classification is -not a complete order. However, no mutual dependence is needed between the -modules themselves - they can all be compiled separately. This is due -to the module ``Cat``, which defines the type system common to the other modules. -For instance, the types ``NP`` and ``VP`` are defined in ``Cat``, -and the module ``Verb`` only -needs to know what is given in ``Cat``, not what is given in ``Noun``. To implement -a rule such as -``` - Verb.ComplV2 : V2 -> NP -> VP -``` -it is enough to know the linearization type of ``NP`` -(as well as those of ``V2`` and ``VP``, all -given in ``Cat``). It is not necessary to know what -ways there are to build ``NP``s (given in ``Noun``), since all these ways must -conform to the linearization type defined in ``Cat``. Thus the format of -category-specific modules is as follows: -``` - abstract Adjective = Cat ** {...} - abstract Noun = Cat ** {...} - abstract Verb = Cat ** {...} -``` - - -==Top-level grammar and lexicon== - -The module ``Grammar`` collects all the category-specific modules into -a complete grammar: -``` - abstract Grammar = - Adjective, Noun, Verb, ..., Structural, Idiom -``` -The module ``Structural`` is a lexicon of structural words (function words), -such as determiners. - -The module ``Idiom`` is a collection of idiomatic structures whose -implementation is very language-dependent. An example is existential -structures ("there is", "es gibt", "il y a", etc). - -The module ``Lang`` combines ``Grammar`` with a ``Lexicon`` of -ca. 350 content words: -``` - abstract Lang = Grammar, Lexicon -``` -Using ``Lang`` instead of ``Grammar`` as a library may give -for free some words needed in an application. But its main purpose is to -help testing the resource library, rather than as a resource itself. -It does not even seem realistic to develop -a general-purpose multilingual resource lexicon. - -The diagram in Figure 2 shows the structure of the API. - -#BFIG - -#GRAMMAR - -#BCENTER -Figure 2. The resource syntax API. -#ECENTER - -#EFIG - -==Language-specific syntactic structures== - -The API collected in ``Grammar`` has been designed to be implementable for -all languages in the resource package. It does contain some rules that -are strange or superfluous in some languages; for instance, the distinction -between definite and indefinite articles does not apply to Finnish and Russian. -But such rules are still easy to implement: they only create some superfluous -ambiguity in the languages in question. - -But the library makes no claim that all languages should have exactly the same -abstract syntax. The common API is therefore extended by language-dependent -rules. The top level of each languages looks as follows (with English as example): -``` - abstract English = Grammar, ExtraEngAbs, DictEngAbs -``` -where ``ExtraEngAbs`` is a collection of syntactic structures specific to English, -and ``DictEngAbs`` is an English dictionary -(at the moment, it consists of ``IrregEngAbs``, -the irregular verbs of English). Each of these language-specific grammars has -the potential to grow into a full-scale grammar of the language. These grammars -can also be used as libraries, but the possibility of using functors is lost. - -To give a better overview of language-specific structures, -modules like ``ExtraEngAbs`` -are built from a language-independent module ``ExtraAbs`` -by restricted inheritance: -``` - abstract ExtraEngAbs = Extra [f,g,...] -``` -Thus any category and function in ``Extra`` may be shared by a subset of all -languages. One can see this set-up as a matrix, which tells -what ``Extra`` structures -are implemented in what languages. For the common API in ``Grammar``, the matrix -is filled with 1's (everything is implemented in every language). - -Language-specific extensions and the use of restricted -inheritance is a recent addition to the resource grammar library, and -has only been exploited in a very small scale so far. - - -=API Documentation= - -==Top-level modules== - -===Grammar: the Main Module of the Resource Grammar=== - -%!include: ../lib/resource-1.0/abstract/Grammar.txt - -===Lang: a Test Module for the Resource Grammar=== - -%!include: ../lib/resource-1.0/abstract/Lang.txt - - -==Type system== - -===Cat: the Category System=== - -%!include: ../lib/resource-1.0/abstract/Cat.txt - -===Common: Structures with Common Implementations=== - -%!include: ../lib/resource-1.0/abstract/Common.txt - - -==Syntax rule modules== - -===Adjective: Adjectives and Adjectival Phrases=== - -%!include: ../lib/resource-1.0/abstract/Adjective.txt - -===Adverb: Adverbs and Adverbial Phrases=== - -%!include: ../lib/resource-1.0/abstract/Adverb.txt - -===Conjunction: Coordination=== - -%!include: ../lib/resource-1.0/abstract/Conjunction.txt - -===Idiom: Idiomatic Expressions=== - -%!include: ../lib/resource-1.0/abstract/Idiom.txt - -===Noun: Nouns, Noun Phrases, and Determiners=== - -%!include: ../lib/resource-1.0/abstract/Noun.txt - -===Numeral: Cardinal and Ordinal Numerals=== - -%!include: ../lib/resource-1.0/abstract/Numeral.txt - -===Phrase: Phrases and Utterances=== - -%!include: ../lib/resource-1.0/abstract/Phrase.txt - -===Question: Questions and Interrogative Pronouns=== - -%!include: ../lib/resource-1.0/abstract/Question.txt - -===Relative: Relative Clauses and Relative Pronouns=== - -%!include: ../lib/resource-1.0/abstract/Relative.txt - -===Sentence: Sentences, Clauses, and Imperatives=== - -%!include: ../lib/resource-1.0/abstract/Sentence.txt - -===Structural: Structural Words=== - -%!include: ../lib/resource-1.0/abstract/Structural.txt - -===Text: Texts=== - -%!include: ../lib/resource-1.0/abstract/Text.txt - -===Verb: Verb Phrases=== - -%!include: ../lib/resource-1.0/abstract/Verb.txt - - -==Inflectional paradigms== - -===Arabic=== - -%!include: ../lib/resource-1.0/arabic/ParadigmsAra.txt - -===Danish=== - -%!include: ../lib/resource-1.0/danish/ParadigmsDan.txt - -===English=== - -%!include: ../lib/resource-1.0/english/ParadigmsEng.txt - -===Finnish=== - -%!include: ../lib/resource-1.0/finnish/ParadigmsFin.txt - -===French=== - -%!include: ../lib/resource-1.0/french/ParadigmsFre.txt - -===German=== - -%!include: ../lib/resource-1.0/german/ParadigmsGer.txt - -===Italian=== - -%!include: ../lib/resource-1.0/italian/ParadigmsIta.txt - -===Norwegian=== - -%!include: ../lib/resource-1.0/norwegian/ParadigmsNor.txt - -===Russian=== - -% %!include: ../lib/resource-1.0/russian/ParadigmsRus.txt - -% %!include: ""./ParadigmsRus.tex"" - -#PARADIGMSRUS - -===Spanish=== - -%!include: ../lib/resource-1.0/spanish/ParadigmsSpa.txt - -===Swedish=== - -%!include: ../lib/resource-1.0/swedish/ParadigmsSwe.txt - - -#CLEARPAGE - -=Summary of Categories and Functions= - -These tables show all categories and functions in ``Grammar``, -except the functions in ``Structural``. -All example strings can be parsed in ``LangEng`` and therefore -translated to the other ``Lang`` languages. - - -==Categories== - - -#SMALL - -|| Category | Module | Explanation | Example | -| A2 | Cat | two place adjective | "married" -| A | Cat | one place adjective | "old" -| AdA | Common | adjective modifying adverb, | "very" -| AdN | Common | numeral modifying adverb, | "more than" -| AdV | Common | adverb directly attached to verb | "always" -| Adv | Common | verb phrase modifying adverb, | "in the house" -| Ant | Common | anteriority | simultaneous -| AP | Cat | adjectival phrase | "very old" -| CAdv | Common | comparative adverb | "more" -| Cl | Cat | declarative clause, with all tenses | "she walks" -| CN | Cat | common noun (without determiner) | "red house" -| Comp | Cat | complement of copula, such as AP | "very warm" -| Conj | Cat | conjunction, | "and" -| DConj | Cat | distributed conj. | "both" - "and" -| Det | Cat | determiner phrase | "these seven" -| Digit | Numeral | digit from 2 to 9 | "4" -| IAdv | Common | interrogative adverb | "why" -| IComp | Cat | interrogative complement of copula | "where" -| IDet | Cat | interrogative determiner | "which" -| Imp | Cat | imperative | "look at this" -| IP | Cat | interrogative pronoun | "who" -| N2 | Cat | relational noun | "brother" -| N3 | Cat | three place relational noun | "connection" -| N | Cat | common noun | "house" -| NP | Cat | noun phrase (subject or object) | "the red house" -| Num | Cat | cardinal number (used with QuantPl) | "seven" -| Numeral | Cat | cardinal or ordinal, | "five" / "fifth" -| Ord | Cat | ordinal number (used in Det) | "seventh" -| PConj | Common | phrase beginning conj. | "therefore" -| Phr | Common | phrase in a text | "but look at this please" -| PN | Cat | proper name | "Paris" -| Pol | Common | polarity | positive -| Predet | Cat | predeterminer (prefixed Quant) | "all" -| Prep | Cat | preposition, or just case | "in" -| Pron | Cat | personal pronoun | "she" -| QCl | Cat | question clause, with all tenses | "why does she walk" -| QS | Cat | question | "where did she walk" -| Quant | Cat | quantifier with both sg and pl | "this"/"these" -| QuantPl | Cat | quantifier ('nucleus' of plur. Det) | "many" -| QuantSg | Cat | quantifier ('nucleus' of sing. Det) | "every" -| RCl | Cat | relative clause, with all tenses | "in which she walks" -| RP | Cat | relative pronoun | "in which" -| RS | Cat | relative | "that she loves" -| S | Cat | declarative sentence | "she was here" -| SC | Common | embedded sentence or question | "that it rains" -| Slash | Cat | clause missing NP (S/NP in GPSG) | "she loves" - - -|| Category | Module | Explanation | Example | -| Sub10 | Numeral | numeral under 10 | "9" -| Sub100 | Numeral | numeral under 100 | "99" -| Sub1000 | Numeral | numeral under 1000 | "999" -| Sub1000000 | Numeral | numeral under million | 123456 -| Subj | Cat | subjunction, | "if" -| Tense | Common | tense | present -| Text | Common | text consisting of several phrases | "He is here. Why?" -| Utt | Common | sentence, question, word... | "be quiet" -| V2A | Cat | verb with NP and AP complement | "paint" -| V2 | Cat | two place verb | "love" -| V3 | Cat | three place verb | "show" -| VA | Cat | adjective complement verb | "look" -| V | Cat | one place verb | "sleep" -| Voc | Common | vocative or | "please" "my darling" -| VP | Cat | verb phrase | "is very warm" -| VQ | Cat | question complement verb | "ask" -| VS | Cat | sentence complement verb | "claim" -| VV | Cat | verb phrase complement verb | "want" -| [Adv] | Conjunction | adverb list | "here, oddly" -| [AP] | Conjunction | adjectival phrase list | "even, very odd" -| [NP] | Conjunction | noun phrase list | "John, all women" -| [S] | Conjunction | sentence list | "I walk, you run" - - -==Functions== - -|| Function | Module | Type | Example | -| AAnter | Common | Ant | "" -| ASimul | Common | Ant | "" -| AdAdv | Adverb | AdA -> Adv -> Adv | "very" -| AdAP | Adjective | AdA -> AP -> AP | "very old" -| AdjCN | Noun | AP -> CN -> CN | "big house" -| AdnCAdv | Adverb | CAdv -> AdN | "more than" -| AdNum | Noun | AdN -> Num -> Num | "almost ten" -| AdvCN | Noun | CN -> Adv -> CN | "house on the mountain" -| AdvIP | Question | IP -> Adv -> IP | "who in Paris" -| AdvNP | Noun | NP -> Adv -> NP | "Paris without wine" -| AdvSC | Adverb | SC -> Adv | "that he sleeps" -| AdvSlash | Sentence | Slash -> Adv -> Slash | "she sees here" -| AdVVP | Verb | AdV -> VP -> VP | "always sleep" -| AdvVP | Verb | VP -> Adv -> VP | "sleep here" -| ApposCN | Noun | CN -> NP -> CN | "number x" -| BaseAdv | Conjunction | Adv -> Adv -> [Adv] | "here" - "today" -| BaseAP | Conjunction | AP -> AP -> [AP] | "even" - "odd" -| BaseNP | Conjunction | NP -> NP -> [NP] | "the car" - "the house" -| BaseS | Conjunction | S -> S -> [S] | "I walk" - "you run" -| CleftAdv | Idiom | Adv -> S -> Cl | "it is here that she sleeps" -| CleftNP | Idiom | NP -> RS -> Cl | "it is she who sleeps" -| CompAdv | Verb | Adv -> Comp | "here" -| CompAP | Verb | AP -> Comp | "old" -| ComparA | Adjective | A -> NP -> AP | "warmer than the house" -| ComparAdvAdj | Adverb | CAdv -> A -> NP -> Adv | "more heavily than Paris" -| ComparAdvAdjS | Adverb | CAdv -> A -> S -> Adv | "more heavily than she sleeps" - - -|| Function | Module | Type | Example | -| CompIAdv | Question | IAdv -> IComp | "where" -| ComplA2 | Adjective | A2 -> NP -> AP | "married to her" -| ComplN2 | Noun | N2 -> NP -> CN | "brother of the woman" -| ComplN3 | Noun | N3 -> NP -> N2 | "connection from that city to Paris" -| ComplV2A | Verb | V2A -> NP -> AP -> VP | "paint the house red" -| ComplV2 | Verb | V2 -> NP -> VP | "love it" -| ComplV3 | Verb | V3 -> NP -> NP -> VP | "send flowers to us" -| ComplVA | Verb | VA -> AP -> VP | "become red" -| ComplVQ | Verb | VQ -> QS -> VP | "ask if she runs" -| ComplVS | Verb | VS -> S -> VP | "say that she runs" -| ComplVV | Verb | VV -> VP -> VP | "want to run" -| CompNP | Verb | NP -> Comp | "a man" -| ConjAdv | Conjunction | Conj -> [Adv] -> Adv | "here or in the car" -| ConjAP | Conjunction | Conj -> [AP] -> AP | "warm or cold" -| ConjNP | Conjunction | Conj -> [NP] -> NP | "the man or the woman" -| ConjS | Conjunction | Conj -> [S] -> S | "he walks or she runs" -| ConsAdv | Conjunction | Adv -> [Adv] -> [Adv] | "here" - "without them, with us" -| ConsAP | Conjunction | AP -> [AP] -> [AP] | "warm" - "red, old" -| ConsNP | Conjunction | NP -> [NP] -> [NP] | "she" - "you, I" -| ConsS | Conjunction | S -> [S] -> [S] | "I walk" - "she runs, he sleeps" -| DConjAdv | Conjunction | DConj -> [Adv] -> Adv | "either here or there" -| DConjAP | Conjunction | DConj -> [AP] -> AP | "either warm or cold" -| DConjNP | Conjunction | DConj -> [NP] -> NP | "either the man or the woman" -| DConjS | Conjunction | DConj -> [S] -> S | "either he walks or she runs" -| DefArt | Noun | Quant | "the" -| DetCN | Noun | Det -> CN -> NP | "the man" -| DetPl | Noun | QuantPl -> Num -> Ord -> Det | "the five best" -| DetSg | Noun | QuantSg -> Ord -> Det | "this" -| EmbedQS | Sentence | QS -> SC | "whom she loves" -| EmbedS | Sentence | S -> SC | "that you go" -| EmbedVP | Sentence | VP -> SC | "to love it" -| ExistIP | Idiom | IP -> QCl | "which cars are there" -| ExistNP | Idiom | NP -> Cl | "there is a car" -| FunRP | Relative | Prep -> NP -> RP -> RP | "all houses in which" -| GenericCl | Idiom | VP -> Cl | "one sleeps" -| IDetCN | Question | IDet -> Num -> Ord -> CN -> IP | "which five hottest songs" -| IdRP | Relative | RP | "which" -| ImpersCl | Idiom | VP -> Cl | "it rains" -| ImpPl1 | Idiom | VP -> Utt | "let's go" -| ImpVP | Sentence | VP -> Imp | "go to the house" -| IndefArt | Noun | Quant | "a" -| MassDet | Noun | QuantSg | ("beer") -| NoNum | Noun | Num | "" -| NoOrd | Noun | Ord | "" -| NoPConj | Phrase | PConj | "" -| NoVoc | Phrase | Voc | "" -| NumInt | Noun | Int -> Num | "51" -| NumNumeral | Noun | Numeral -> Num | "five hundred" -| OrdInt | Noun | Int -> Ord | "13 th" -| OrdNumeral | Noun | Numeral -> Ord | "thirteenth" -| OrdSuperl | Noun | A -> Ord | "hottest" -| PassV2 | Verb | V2 -> VP | "be seen" -| PConjConj | Phrase | Conj -> PConj | "and" -| PhrUtt | Phrase | PConj -> Utt -> Voc -> Phr | "but come here please" -| PlQuant | Noun | Quant -> QuantPl | "these" -| PositA | Adjective | A -> AP | "warm" -| PositAdvAdj | Adverb | A -> Adv | "warmly" - -|| Function | Module | Type | Example | -| PossPron | Noun | Pron -> Quant | "my" -| PPartNP | Noun | NP -> V2 -> NP | "the city seen" -| PNeg | Common | Pol | "" -| PPos | Common | Pol | "" -| PredetNP | Noun | Predet -> NP -> NP | "only the man" -| PredSCVP | Sentence | SC -> VP -> Cl | "that she sleeps is good" -| PredVP | Sentence | NP -> VP -> Cl | "she walks" -| PrepIP | Question | Prep -> IP -> IAdv | "with whom" -| PrepNP | Adverb | Prep -> NP -> Adv | "in the house" -| ProgrVP | Idiom | VP -> VP | "be sleeping" -| QuestCl | Question | Cl -> QCl | "does she walk" -| QuestIAdv | Question | IAdv -> Cl -> QCl | "why does she walk" -| QuestIComp | Question | IComp -> NP -> QCl | "where is she" -| QuestSlash | Question | IP -> Slash -> QCl | "whom does she love" -| QuestVP | Question | IP -> VP -> QCl | "who walks" -| ReflA2 | Adjective | A2 -> AP | "married to itself" -| ReflV2 | Verb | V2 -> VP | "see himself" -| RelCl | Relative | Cl -> RCl | "such that she loves him" -| RelCN | Noun | CN -> RS -> CN | "house that she buys" -| RelSlash | Relative | RP -> Slash -> RCl | "that she loves" -| RelVP | Relative | RP -> VP -> RCl | "that loves her" -| SentAP | Adjective | AP -> SC -> AP | "good that she came" -| SentCN | Noun | CN -> SC -> CN | "fact that she smokes" -| SgQuant | Noun | Quant -> QuantSg | "this" -| SlashPrep | Sentence | Cl -> Prep -> Slash | (with whom) "he walks" -| SlashV2 | Sentence | NP -> V2 -> Slash | (whom) "he sees" -| SlashVVV2 | Sentence | NP -> VV -> V2 -> Slash | (whom) "he wants to see" -| SubjS | Adverb | Subj -> S -> Adv | "when he came" -| TCond | Common | Tense | "" -| TEmpty | Text | Text | "" -| TFut | Common | Tense | "" -| TExclMark | Text | Phr -> Text -> Text | "She walks!" -| TFullStop | Text | Phr -> Text -> Text | "She walks." -| TPast | Common | Tense | "" -| TPres | Common | Tense | "" -| TQuestMark | Text | Phr -> Text -> Text | "Does she walk?" -| UseA2 | Adjective | A2 -> A | "married" -| UseCl | Sentence | Tense -> Ant -> Pol -> Cl -> S | "she wouldn't have walked" -| UseComp | Verb | Comp -> VP | "be warm" -| UseN2 | Noun | N2 -> CN | "brother" -| UseN3 | Noun | N3 -> CN | "connection" -| UseN | Noun | N -> CN | "house" -| UsePN | Noun | PN -> NP | "Paris" -| UsePron | Noun | Pron -> NP | "she" -| UseQCl | Sentence | Tense -> Ant -> Pol -> QCl -> QS | "where hadn't she walked" -| UseRCl | Sentence | Tense -> Ant -> Pol -> RCl -> RS | "that she hadn't seen" -| UseVQ | Verb | VQ -> V2 | "ask" (a question) -| UseVS | Verb | VS -> V2 | "know" (a secret) -| UseV | Verb | V -> VP | "sleep" -| UttAdv | Phrase | Adv -> Utt | "here" -| UttIAdv | Phrase | IAdv -> Utt | "why" -| UttImpPl | Phrase | Pol -> Imp -> Utt | "love yourselves" -| UttImpSg | Phrase | Pol -> Imp -> Utt | "love yourself" -| UttIP | Phrase | IP -> Utt | "who" -| UttNP | Phrase | NP -> Utt | "this man" -| UttQS | Phrase | QS -> Utt | "is it good" -| UttS | Phrase | S -> Utt | "she walks" -| UttVP | Phrase | VP -> Utt | "to sleep" -| VocNP | Phrase | NP -> Voc | "my brother" - -|| Function | Module | Type | Example | -| num | Numeral | Sub1000000 -> Numeral | "2" -| n2 | Numeral | Digit | "2" -| n3 | Numeral | Digit | "3" -| n4 | Numeral | Digit | "4" -| n5 | Numeral | Digit | "5" -| n6 | Numeral | Digit | "6" -| n7 | Numeral | Digit | "7" -| n8 | Numeral | Digit | "8" -| n9 | Numeral | Digit | "9" -| pot01 | Numeral | Sub10 | "1" -| pot0 | Numeral | Digit -> Sub10 | "3" -| pot110 | Numeral | Sub100 | "10" -| pot111 | Numeral | Sub100 | "11" -| pot1to19 | Numeral | Digit -> Sub100 | "18" -| pot0as1 | Numeral | Sub10 -> Sub100 | "3" -| pot1 | Numeral | Digit -> Sub100 | "50" -| pot1plus | Numeral | Digit -> Sub10 -> Sub100 | "54" -| pot1as2 | Numeral | Sub100 -> Sub1000 | "99" -| pot2 | Numeral | Sub10 -> Sub1000 | "600" -| pot2plus | Numeral | Sub10 -> Sub100 -> Sub1000 | "623" -| pot2as3 | Numeral | Sub1000 -> Sub1000000 | "999" -| pot3 | Numeral | Sub1000 -> Sub1000000 | "53000" -| pot3plus | Numeral | Sub1000 -> Sub1000 -> Sub1000000 | "53201" - diff --git a/doc/transfer-reference.html b/doc/transfer-reference.html deleted file mode 100644 index d858b1c06..000000000 --- a/doc/transfer-reference.html +++ /dev/null @@ -1,842 +0,0 @@ - - - - - -Transfer language reference - -

    Transfer language reference

    - -Author: Björn Bringert <bringert@cs.chalmers.se>
    -Last update: Wed Mar 1 13:52:22 2006 -
    - -

    -
    -

    - - -

    -
    -

    -

    -WARNING: The Transfer language is still experimental. Its syntax, type system and semantics may change without notice. I will try to help you with any problems this might cause, but I will not refrain from changing the language solely for reasons of backwards compatibility. -

    -

    -This document describes the features of the Transfer language. -See the Transfer tutorial -for an example of a Transfer program, and how to compile and use -Transfer programs. -

    -

    -Transfer is a dependently typed functional programming language -with eager evaluation. The language supports generalized algebraic -datatypes, pattern matching and function overloading. -

    - -

    Current implementation status

    -

    -Not all features of the Transfer language have been implemented yet. The most -important missing piece is the type checker. This means that there are almost -no checks done on Transfer programs before they are run. It also means that -the values of metavariables are not inferred. Thus metavariables cannot -be used where their values matter. For example, dictionaries for overloaded -functions must be given explicitly, not as metavariables. -

    - -

    Layout syntax

    -

    -Transfer uses layout syntax, where the indentation of a piece of code -determines which syntactic block it belongs to. -

    -

    -To give the block structure without using layout -syntax, you can enclose the block in curly braces and -separate the parts of the blocks with semicolons. -

    -

    -For example, this case expression: -

    -
    -  case x of
    -         p1 -> e1
    -         p2 -> e2
    -
    -

    -

    -is equivalent to this one: -

    -
    -  case x of {
    -         p1 -> e1 ;
    -         p2 -> e2 
    -  }
    -
    -

    -

    -Here the layout is insignificant, as the structure is given with -braces and semicolons. Thus it is equivalent to: -

    -
    -  case x of { p1 -> e1 ; p2 -> e2 }
    -
    -

    - -

    Imports

    -

    -A Transfer module starts with some imports. Most modules will have to -import the prelude, which contains definitons used by most programs: -

    -
    -  import prelude
    -
    -

    -

    -For more information about the standard prelude, see Standard prelude. -

    - -

    Function declarations

    -

    -Functions need to be given a type and a definition. The type is given -by a typing judgement on the form: -

    -
    -  f : T
    -
    -

    -

    -where f is the function's name, and T its type. See -Function types for a how the types of functions -are written. -

    -

    -The definition of the function is then given as a sequence of pattern -equations. The first equation whose patterns match the function arguments -is used when the function is called. Pattern equations are on the form: -

    -
    -  f p11 ... p1m = exp1
    -  ...
    -  f pn1 ... pnm = expn
    -
    -

    -

    -where p11 to pnm are patterns, see Patterns. -

    -

    -Pattern equations can also have guards, boolean expressions which determine -whether to use the equation when the pattern has been matched. Pattern equations -with guards are written: -

    -
    -  f p11 ... p1m | guard1 = exp1
    -  ...
    -  f pn1 ... pnm | guardn = expn
    -
    -

    -

    -Pattern equations with and without guards can be mixed in the definiton of -a function. -

    -

    -Any variables bound in the patterns are in scope in the guards and -right hand sides of each pattern equation. -

    - -

    Data type declarations

    -

    -Transfer supports Generalized Algebraic Datatypes. -They are declared thusly: -

    -
    -  data D : T where 
    -       c1 : Tc1
    -       ...
    -       cn : Tcn
    -
    -

    -

    -Here D is the name of the data type, T is the type of the type -constructor, c1 to cn are the data constructor names, and -Tc1 to Tcn are their types. -

    -

    -FIXME: explain the constraints on the types of type and data constructors. -

    - -

    Lambda expressions

    -

    -Lambda expressions are terms which express functions, without -giving names to them. For example: -

    -
    -  \x -> x + 1
    -
    -

    -

    -is the function which takes an argument, and returns the value of the -argument + 1. -

    - -

    Local definitions

    -

    -To give local definition to some names, use: -

    -
    -  let x1 = exp1
    -      ...
    -      xn = expn
    -   in exp
    -
    -

    -

    -Here, the variables x1 to xn are in scope in all the expressions -exp1 to expn, and in exp. Thus let-defined functions can be -mutually recursive. -

    - -

    Types

    - -

    Function types

    -

    -Functions types are of the form: -

    -
    -  A -> B
    -
    -

    -

    -This is the type of functions which take an argument of type -A and returns a result of type B. -

    -

    -To write functions which take more than one argument, we use currying. -A function which takes n arguments is a function which takes one -argument and returns a function which takes n-1 arguments. Thus, -

    -
    -  A -> (B -> C)
    -
    -

    -

    -or, equivalently, since -> associates to the right: -

    -
    -  A -> B -> C
    -
    -

    -

    -is the type of functions which take teo arguments, the first of type -A and the second of type B. This arrangement lets us do -partial application of function to fewer arguments than the function -is declared to take, returning a new function which takes the rest -of the arguments. -

    -

    Dependent function types

    -

    -In a function type, the value of an argument can be used later -in the type. Such dependent function types are written: -

    -
    -  (x : A) -> B
    -
    -

    -

    -Here, x is in scope in B. -

    - -

    Basic types

    -

    Integers

    -

    -The type of integers is called Integer. -Standard decmial integer literals, such as 0 and 1234 are used to -represent values of this type. -

    -

    Floating-point numbers

    -

    -The only currently supported floating-point type is Double, which supports -IEEE-754 double-precision floating-point numbers. Double literals are written -in decimal notation, e.g. 123.456. -

    -

    Strings

    -

    -There is a primitive String type. String literals are written -with double quotes, e.g. "this is a string". -FIXME: This might be replaced by a list of -characters representation in the future. -

    -

    Booleans

    -

    -Booleans are not a built-in type, though some features of the Transfer language -depend on them. The Bool type is defined in the -Standard prelude. -

    -
    -  data Bool : Type where
    -          True : Bool
    -          False : Bool
    -
    -

    -

    -In addition to normal pattern matching on booleans, you can use the built-in -if-expression: -

    -
    -  if exp1 then exp2 else exp3
    -
    -

    -

    -where exp1 must be an expression of type Bool. -

    - -

    Records

    -

    Record types

    -

    -Record types are created by using a sig expression: -

    -
    -  sig { l1 : T1; ... ; ln : Tn }
    -
    -

    -

    -Here, l1 to ln are the field labels and T1 to Tn are field types. -

    -

    Record values

    -

    -Record values are constructed using rec expressions: -

    -
    -  rec { l1 = exp1; ... ; ln = expn }
    -
    -

    -

    Record projection

    -

    -Fields are selected from records using the . operator. This expression selects -the field l from the record value r: -

    -
    -  r.l
    -
    -

    -

    Records and layout syntax

    -

    -The curly braces and semicolons are simply explicit layout syntax, so -the record type and record expression above can also be written as: -

    -
    -  sig l1 : T1
    -      ...
    -      ln : Tn
    -
    -

    -
    -  rec l1 = exp1
    -      ...
    -      ln = expn
    -
    -

    - -

    Record subtyping

    -

    -A record of some type R1 can be used as a record of any type R2 -such that for every field p1 : T1 in R2, p1 : T1 is also a -field of T1. -

    - -

    Tuples

    -

    -Tuples on the form: -

    -
    -  (exp1, ..., expn)
    -
    -

    -

    -are syntactic sugar for records with fields p1 to pn. The expression -above is equivalent to: -

    -
    -  rec { p1 = exp1; ... ; pn = expn }
    -
    -

    - -

    Lists

    -

    -The List type is not built-in, though there is some special syntax for it. -The list type is declared as: -

    -
    -  data List : Type -> Type where 
    -          Nil : (A:Type) -> List A
    -          Cons : (A:Type) -> A -> List A -> List A
    -
    -

    -

    -The empty list can be written as []. There is an operator :: which can -be used instead of Cons. These are just syntactic sugar for expressions -using Nil and Cons, with the type arguments hidden. -

    - -

    Case expressions

    -

    -Pattern matching is done in pattern equations and with the -case construct: -

    -
    -  case exp of
    -       p1 | guard1 -> rhs1
    -       ...
    -       pn | guardn -> rhsn
    -
    -

    -

    -where p1 to pn are patterns, see Patterns. -guard1 to guardn are boolean expressions. Case arms can also be written -without guards, such as: -

    -
    -       pk -> rhsk
    -
    -

    -

    -This is the same as writing: -

    -
    -       pk | True -> rhsk
    -
    -

    - -

    Patterns

    - -

    Constructor patterns

    -

    -Constructor patterns are written as: -

    -
    -  C p1 ... pn
    -
    -

    -

    -where C is a data constructor which takes n arguments. -If the value to be matched is C v1 ... vn, -then v1 to vn will be matched against p1 to pn. -

    - -

    Variable patterns

    -

    -A variable pattern is a single identifier: -

    -
    -  x
    -
    -

    -

    -A variable pattern matches any value, and binds the variable name to the -value. A variable may not occur more than once in a pattern. -Note that variable patterns may not use the same identifier as data constructors -which are in scope, since they will then be interpreted as constructor -patterns. -

    - -

    Wildcard patterns

    -

    -Wildcard patterns are written with a single underscore: -

    -
    -  _
    -
    -

    -

    -Wildcard patterns match all values and bind no variables. -

    - -

    Record patterns

    -

    -Record patterns match record values: -

    -
    -  rec { l1 = p1; ... ; ln = pn }
    -
    -

    -

    -A record value matches a record pattern if the record value has all the -fields l1 to ln, and their values match p1 to pn. -

    -

    -Note that a record value may have more fields than the record pattern. -The values of these fields do not influence the pattern matching. -

    - -

    Disjunctive patterns

    -

    -It is possible to write a pattern on the form: -

    -
    -  p1 || ... || pn
    -
    -

    -

    -A value will match this pattern if it matches any of the patterns p1 to pn. -FIXME: talk about how this is expanded -

    - -

    List patterns

    -

    -When pattern matching on lists, there are two special constructs. -A whole list can by matched be a list of patterns: -

    -
    -  [p1, ... , pn]
    -
    -

    -

    -This pattern will match lists of length n, such that each element -in the list matches the corresponding pattern. The empty list pattern: -

    -
    -  []
    -
    -

    -

    -is a special case of this. It matches the empty list, oddly enough. -

    -

    -Non-empty lists can also be matched with ::-patterns: -

    -
    -  p1::p2
    -
    -

    -

    -This pattern matches non-empty lists such that the first element of -the list matches p1 and the rest of the list matches p2. -

    - -

    Tuple patterns

    -

    -Tuples patterns on the form: -

    -
    -  (p1, ... , pn)
    -
    -

    -

    -are syntactic sugar for record patterns, in the same way as -tuple expressions, see Tuples. -

    - -

    String literal patterns

    -

    -String literals can be used as patterns. -

    - -

    Integer literal patterns

    -

    -Integer literals can be used as patterns. -

    - -

    Metavariables

    -

    -Metavariables are written as questions marks: -

    -
    -  ?
    -
    -

    -

    -A metavariable is a way to tell the type checker that: -"you should be able to figure out what this should be, -I can't be bothered to tell you". -

    -

    -Metavariables can be used to avoid having to give type -and dictionary arguments explicitly. -

    - -

    Overloaded functions

    -

    -In Transfer, functions can be overloaded by having them take a record -of functions as an argument. For example, the functions for equality -and inequality in the Transfer Prelude are defined as: -

    -
    -  Eq : Type -> Type
    -  Eq A = sig eq : A -> A -> Bool
    -  
    -  eq : (A : Type) -> Eq A -> A -> A -> Bool
    -  eq _ d = d.eq
    -  
    -  neq : (A : Type) -> Eq A -> A -> A -> Bool
    -  neq A d x y = not (eq A d x y)
    -
    -

    -

    -We call Eq a type class, though it's actually just a record type -used to pass function implementations to overloaded functions. We -call a value of type Eq A an Eq dictionary for the type A. -The dictionary is used to look up the version of some function for the -particular type we want to use the function on. Thus, in order to use -the eq function on two integers, we need a dictionary of type -Eq Integer: -

    -
    -  eq_Integer : Eq Integer
    -  eq_Integer = rec eq = prim_eq_Integer
    -
    -

    -

    -where prim_eq_Integer is the built-in equality function for -integers. To check whether two numbers x and y are equal, we -can then call the overloaded eq function with the dictionary: -

    -
    -  eq Integer eq_Integer x y
    -
    -

    -

    -Giving the type at which to use the overloaded function, and the appropriate -dictionary can be cumbersome. Metavariables come to the rescue: -

    -
    -  eq ? ? x y
    -
    -

    -

    -The type checker can in most cases figure out the values of the type and -dictionary arguments. NOTE: this is not implemented yet. -

    - -

    Type class extension

    -

    -By using record subtyping, see Record subtyping, we can -create type classes which extend other type classes. A dictionary for the -new type class can also be used as a dictionary for old type class. -

    -

    -For example, we can extend the Eq type class above to Ord, a type -class for orderings: -

    -
    -  Ord : Type -> Type
    -  Ord A = sig eq : A -> A -> Bool
    -              compare : A -> A -> Ordering
    -
    -

    -

    -To extend an existing class, we keep the fields of the class we want to -extend, and add any new fields that we want. Because of record subtyping, -for any type A, a value of type Ord A is also a value of type Eq A. -

    - -

    Extending multiple classes

    -

    -A type class can also extend several classes, by simply having all the fields -from all the classes we want to extend. The Num class in the -Standard prelude is an example of this. -

    - -

    Standard prelude

    -

    -The standard prelude, see prelude.tra, -contains definitions of a number of standard types, functions and -type classes. -

    - -

    Operators

    -

    -Most built-in operators in the Transfer language are translated -to calls to overloaded functions. This means that they can be -used at any type for which there is a dictionary for the type class -in question. -

    - -

    Unary operators

    - - - - - - - - - - - -
    OperatorPrecedenceTranslation
    -10-x => negate ? ? x
    - -

    - -

    Binary operators

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    OperatorPrecedenceAssociativityTranslation of x op y
    >>=3leftbind ? ? x y
    >>3leftbind ? ? x (\_ -> y)
    ||4rightif x then True else y
    &&5rightif x then y else False
    ==6noneeq ? ? x y
    /=6noneneq ? ? x y
    <6nonelt ? ? x y
    <=6nonele ? ? x y
    >6nonegt ? ? x y
    >=6nonege ? ? x y
    ::7rightCons ? ? x y
    +8leftplus ? ? x y
    -8leftminus ? ? x y
    *9lefttimes ? ? x y
    /9leftdiv ? ? x y
    %9leftmod ? ? x y
    - -

    - -

    Compositional functions

    - -

    do notation

    -

    -Sequences of operations in the Monad type class can be written -using do-notation, like in Haskell: -

    -
    -  do x <- f
    -     y <- g x
    -     h y
    -
    -

    -

    -is equivalent to: -

    -
    -  f >>= \x -> g x >>= \y -> h y
    -
    - - - - diff --git a/doc/transfer-reference.txt b/doc/transfer-reference.txt deleted file mode 100644 index 143780381..000000000 --- a/doc/transfer-reference.txt +++ /dev/null @@ -1,649 +0,0 @@ -Transfer language reference -Author: Björn Bringert -Last update: %%date(%c) - -% NOTE: this is a txt2tags file. -% Create an html file from this file using: -% txt2tags transfer.txt - -%!target:html -%!options(html): --toc -%!encoding:utf-8 - -**WARNING: The Transfer language is still experimental. Its syntax, type system and semantics may change without notice. I will try to help you with any problems this might cause, but I will not refrain from changing the language solely for reasons of backwards compatibility.** - -This document describes the features of the Transfer language. -See the [Transfer tutorial transfer-tutorial.html] -for an example of a Transfer program, and how to compile and use -Transfer programs. - -Transfer is a dependently typed functional programming language -with eager evaluation. The language supports generalized algebraic -datatypes, pattern matching and function overloading. - - -== Current implementation status == - -**Not all features of the Transfer language have been implemented yet**. The most -important missing piece is the type checker. This means that there are almost -no checks done on Transfer programs before they are run. It also means that -the values of metavariables are not inferred. Thus metavariables cannot -be used where their values matter. For example, dictionaries for overloaded -functions must be given explicitly, not as metavariables. - - -== Layout syntax== - -Transfer uses layout syntax, where the indentation of a piece of code -determines which syntactic block it belongs to. - -To give the block structure without using layout -syntax, you can enclose the block in curly braces and -separate the parts of the blocks with semicolons. - -For example, this case expression: - -``` -case x of - p1 -> e1 - p2 -> e2 -``` - -is equivalent to this one: - -``` -case x of { - p1 -> e1 ; - p2 -> e2 -} -``` - -Here the layout is insignificant, as the structure is given with -braces and semicolons. Thus it is equivalent to: - -``` -case x of { p1 -> e1 ; p2 -> e2 } -``` - - -== Imports == - -A Transfer module starts with some imports. Most modules will have to -import the prelude, which contains definitons used by most programs: - -``` -import prelude -``` - -For more information about the standard prelude, see [Standard prelude #prelude]. - -== Function declarations == - -Functions need to be given a type and a definition. The type is given -by a typing judgement on the form: - -``` -f : T -``` - -where ``f`` is the function's name, and ``T`` its type. See -[Function types #function_types] for a how the types of functions -are written. - -The definition of the function is then given as a sequence of pattern -equations. The first equation whose patterns match the function arguments -is used when the function is called. Pattern equations are on the form: - -``` -f p11 ... p1m = exp1 -... -f pn1 ... pnm = expn -``` - -where ``p11`` to ``pnm`` are patterns, see [Patterns #patterns]. - - -Pattern equations can also have guards, boolean expressions which determine -whether to use the equation when the pattern has been matched. Pattern equations -with guards are written: - -``` -f p11 ... p1m | guard1 = exp1 -... -f pn1 ... pnm | guardn = expn -``` - -Pattern equations with and without guards can be mixed in the definiton of -a function. - -Any variables bound in the patterns are in scope in the guards and -right hand sides of each pattern equation. - - - -== Data type declarations == - -Transfer supports Generalized Algebraic Datatypes. -They are declared thusly: - -``` -data D : T where - c1 : Tc1 - ... - cn : Tcn -``` - -Here ``D`` is the name of the data type, ``T`` is the type of the type -constructor, ``c1`` to ``cn`` are the data constructor names, and -``Tc1`` to ``Tcn`` are their types. - -FIXME: explain the constraints on the types of type and data constructors. - - -== Lambda expressions == - -//Lambda expressions// are terms which express functions, without -giving names to them. For example: - -``` -\x -> x + 1 -``` - -is the function which takes an argument, and returns the value of the -argument + 1. - - -== Local definitions == - -To give local definition to some names, use: - -``` -let x1 = exp1 - ... - xn = expn - in exp -``` - -Here, the variables ``x1`` to ``xn`` are in scope in all the expressions -``exp1`` to ``expn``, and in ``exp``. Thus let-defined functions can be -mutually recursive. - - -== Types == - -=== Function types ===[function_types] - -Functions types are of the form: - -``` -A -> B -``` - -This is the type of functions which take an argument of type -``A`` and returns a result of type ``B``. - -To write functions which take more than one argument, we use //currying//. -A function which takes n arguments is a function which takes one -argument and returns a function which takes n-1 arguments. Thus, - -``` -A -> (B -> C) -``` - -or, equivalently, since ``->`` associates to the right: - -``` -A -> B -> C -``` - -is the type of functions which take teo arguments, the first of type -``A`` and the second of type ``B``. This arrangement lets us do -//partial application// of function to fewer arguments than the function -is declared to take, returning a new function which takes the rest -of the arguments. - - -==== Dependent function types ==== - -In a function type, the value of an argument can be used later -in the type. Such dependent function types are written: - -``` -(x : A) -> B -``` - -Here, ``x`` is in scope in ``B``. - - -=== Basic types === - -==== Integers ==== - -The type of integers is called ``Integer``. -Standard decmial integer literals, such as ``0`` and ``1234`` are used to -represent values of this type. - - -==== Floating-point numbers ==== - -The only currently supported floating-point type is ``Double``, which supports -IEEE-754 double-precision floating-point numbers. Double literals are written -in decimal notation, e.g. ``123.456``. - - -==== Strings ==== - -There is a primitive ``String`` type. String literals are written -with double quotes, e.g. ``"this is a string"``. -FIXME: This might be replaced by a list of -characters representation in the future. - - -==== Booleans ==== - -Booleans are not a built-in type, though some features of the Transfer language -depend on them. The ``Bool`` type is defined in the -[Standard prelude #prelude]. - -``` -data Bool : Type where - True : Bool - False : Bool -``` - -In addition to normal pattern matching on booleans, you can use the built-in -if-expression: - -``` -if exp1 then exp2 else exp3 -``` - -where ``exp1`` must be an expression of type ``Bool``. - - - -=== Records === - -==== Record types ==== - -Record types are created by using a ``sig`` expression: - -``` -sig { l1 : T1; ... ; ln : Tn } -``` - -Here, ``l1`` to ``ln`` are the field labels and ``T1`` to ``Tn`` are field types. - -==== Record values ==== - -Record values are constructed using ``rec`` expressions: - -``` -rec { l1 = exp1; ... ; ln = expn } -``` - -==== Record projection ==== - -Fields are selected from records using the ``.`` operator. This expression selects -the field ``l`` from the record value ``r``: - -``` -r.l -``` - -==== Records and layout syntax ==== - -The curly braces and semicolons are simply explicit layout syntax, so -the record type and record expression above can also be written as: - -``` -sig l1 : T1 - ... - ln : Tn -``` - -``` -rec l1 = exp1 - ... - ln = expn -``` - - -==== Record subtyping ====[record_subtyping] - -A record of some type R1 can be used as a record of any type R2 -such that for every field ``p1 : T1`` in R2, ``p1 : T1`` is also a -field of T1. - - -=== Tuples ===[tuples] - -Tuples on the form: - -``` -(exp1, ..., expn) -``` - -are syntactic sugar for records with fields ``p1`` to ``pn``. The expression -above is equivalent to: - -``` -rec { p1 = exp1; ... ; pn = expn } -``` - - -=== Lists === - -The ``List`` type is not built-in, though there is some special syntax for it. -The list type is declared as: - -``` -data List : Type -> Type where - Nil : (A:Type) -> List A - Cons : (A:Type) -> A -> List A -> List A -``` - -The empty list can be written as ``[]``. There is an operator ``::`` which can -be used instead of ``Cons``. These are just syntactic sugar for expressions -using ``Nil`` and ``Cons``, with the type arguments hidden. - - -== Case expressions == - -Pattern matching is done in pattern equations and with the -``case`` construct: - -``` -case exp of - p1 | guard1 -> rhs1 - ... - pn | guardn -> rhsn -``` - -where ``p1`` to ``pn`` are patterns, see [Patterns #patterns]. -``guard1`` to ``guardn`` are boolean expressions. Case arms can also be written -without guards, such as: - -``` - pk -> rhsk -``` - -This is the same as writing: - -``` - pk | True -> rhsk -``` - - -== Patterns ==[patterns] - -=== Constructor patterns === - -Constructor patterns are written as: - -``` -C p1 ... pn -``` - -where ``C`` is a data constructor which takes ``n`` arguments. -If the value to be matched is ``C v1 ... vn``, -then ``v1`` to ``vn`` will be matched against ``p1`` to ``pn``. - - -=== Variable patterns === - -A variable pattern is a single identifier: - -``` -x -``` - -A variable pattern matches any value, and binds the variable name to the -value. A variable may not occur more than once in a pattern. -Note that variable patterns may not use the same identifier as data constructors -which are in scope, since they will then be interpreted as constructor -patterns. - - -=== Wildcard patterns === - -Wildcard patterns are written with a single underscore: - -``` -_ -``` - -Wildcard patterns match all values and bind no variables. - - -=== Record patterns === - -Record patterns match record values: - -``` -rec { l1 = p1; ... ; ln = pn } -``` - -A record value matches a record pattern if the record value has all the -fields ``l1`` to ``ln``, and their values match ``p1`` to ``pn``. - -Note that a record value may have more fields than the record pattern. -The values of these fields do not influence the pattern matching. - - -=== Disjunctive patterns === - -It is possible to write a pattern on the form: - -``` -p1 || ... || pn -``` - -A value will match this pattern if it matches any of the patterns ``p1`` to ``pn``. -FIXME: talk about how this is expanded - - -=== List patterns === - -When pattern matching on lists, there are two special constructs. -A whole list can by matched be a list of patterns: - -``` -[p1, ... , pn] -``` - -This pattern will match lists of length n, such that each element -in the list matches the corresponding pattern. The empty list pattern: - -``` -[] -``` - -is a special case of this. It matches the empty list, oddly enough. - -Non-empty lists can also be matched with ``::``-patterns: - -``` -p1::p2 -``` - -This pattern matches non-empty lists such that the first element of -the list matches ``p1`` and the rest of the list matches ``p2``. - - -=== Tuple patterns === - -Tuples patterns on the form: - -``` -(p1, ... , pn) -``` - -are syntactic sugar for record patterns, in the same way as -tuple expressions, see [Tuples #tuples]. - - -=== String literal patterns === - -String literals can be used as patterns. - - -=== Integer literal patterns === - -Integer literals can be used as patterns. - - -== Metavariables ==[metavariables] - -Metavariables are written as questions marks: - -``` -? -``` - -A metavariable is a way to tell the type checker that: -"you should be able to figure out what this should be, -I can't be bothered to tell you". - -Metavariables can be used to avoid having to give type -and dictionary arguments explicitly. - - -== Overloaded functions == - -In Transfer, functions can be overloaded by having them take a record -of functions as an argument. For example, the functions for equality -and inequality in the Transfer [Prelude #prelude] are defined as: - -``` -Eq : Type -> Type -Eq A = sig eq : A -> A -> Bool - -eq : (A : Type) -> Eq A -> A -> A -> Bool -eq _ d = d.eq - -neq : (A : Type) -> Eq A -> A -> A -> Bool -neq A d x y = not (eq A d x y) -``` - -We call ``Eq`` a //type class//, though it's actually just a record type -used to pass function implementations to overloaded functions. We -call a value of type ``Eq A`` an Eq //dictionary// for the type A. -The dictionary is used to look up the version of some function for the -particular type we want to use the function on. Thus, in order to use -the ``eq`` function on two integers, we need a dictionary of type -``Eq Integer``: - -``` -eq_Integer : Eq Integer -eq_Integer = rec eq = prim_eq_Integer -``` - -where ``prim_eq_Integer`` is the built-in equality function for -integers. To check whether two numbers ``x`` and ``y`` are equal, we -can then call the overloaded ``eq`` function with the dictionary: - -``` -eq Integer eq_Integer x y -``` - -Giving the type at which to use the overloaded function, and the appropriate -dictionary can be cumbersome. [Metavariables #metavariables] come to the rescue: - -``` -eq ? ? x y -``` - -The type checker can in most cases figure out the values of the type and -dictionary arguments. **NOTE: this is not implemented yet.** - - -=== Type class extension === - -By using record subtyping, see [Record subtyping #record_subtyping], we can -create type classes which extend other type classes. A dictionary for the -new type class can also be used as a dictionary for old type class. - -For example, we can extend the ``Eq`` type class above to ``Ord``, a type -class for orderings: - -``` -Ord : Type -> Type -Ord A = sig eq : A -> A -> Bool - compare : A -> A -> Ordering -``` - -To extend an existing class, we keep the fields of the class we want to -extend, and add any new fields that we want. Because of record subtyping, -for any type ``A``, a value of type ``Ord A`` is also a value of type ``Eq A``. - - -=== Extending multiple classes === - -A type class can also extend several classes, by simply having all the fields -from all the classes we want to extend. The ``Num`` class in the -[Standard prelude #prelude] is an example of this. - - -== Standard prelude ==[prelude] - -The standard prelude, see [prelude.tra ../transfer/lib/prelude.tra], -contains definitions of a number of standard types, functions and -type classes. - - -== Operators == - -Most built-in operators in the Transfer language are translated -to calls to overloaded functions. This means that they can be -used at any type for which there is a dictionary for the type class -in question. - -=== Unary operators === - -|| Operator | Precedence | Translation | -| ``-`` | 10 | ``-x => negate ? ? x`` | - - -=== Binary operators === - -|| Operator | Precedence | Associativity | Translation of ``x op y`` | -| ``>>=`` | 3 | left | ``bind ? ? x y`` | -| ``>>`` | 3 | left | ``bind ? ? x (\_ -> y)`` | -| ``||`` | 4 | right | ``if x then True else y`` | -| ``&&`` | 5 | right | ``if x then y else False`` | -| ``==`` | 6 | none | ``eq ? ? x y`` | -| ``/=`` | 6 | none | ``neq ? ? x y`` | -| ``<`` | 6 | none | ``lt ? ? x y`` | -| ``<=`` | 6 | none | ``le ? ? x y`` | -| ``>`` | 6 | none | ``gt ? ? x y`` | -| ``>=`` | 6 | none | ``ge ? ? x y`` | -| ``::`` | 7 | right | ``Cons ? ? x y`` | -| ``+`` | 8 | left | ``plus ? ? x y`` | -| ``-`` | 8 | left | ``minus ? ? x y`` | -| ``*`` | 9 | left | ``times ? ? x y`` | -| ``/`` | 9 | left | ``div ? ? x y`` | -| ``%`` | 9 | left | ``mod ? ? x y`` | - - - -== Compositional functions == - - - -== do notation == - -Sequences of operations in the Monad type class can be written -using do-notation, like in Haskell: - -``` -do x <- f - y <- g x - h y -``` - -is equivalent to: - -``` -f >>= \x -> g x >>= \y -> h y -``` diff --git a/doc/transfer-tutorial.html b/doc/transfer-tutorial.html deleted file mode 100644 index 14569344a..000000000 --- a/doc/transfer-tutorial.html +++ /dev/null @@ -1,214 +0,0 @@ - - - - - -Transfer tutorial - -

    Transfer tutorial

    - -Author: Björn Bringert <bringert@cs.chalmers.se>
    -Last update: Fri Dec 9 11:55:35 2005 -
    - -

    -
    -

    - - -

    -
    -

    -

    -WARNING: The Transfer language is still experimental. Its syntax, type system and semantics may change without notice. I will try to help you with any problems this might cause, but I will not refrain from changing the language solely for reasons of backwards compatibility. -

    - -

    Objective

    -

    -We want to write a Transfer program which we can use to do aggregation -in sentences which use conjunctions on the sentence, noun phrase and -verb phrase levels. For example, we want to be able to transform -the sentence "John walks and Mary walks" to the sentence -"John and Mary walk". We would also like to transform -"John walks and John swims" to "John walks and swims". -

    -

    -Thus that what we want to do is: -

    - - -

    -This needs to be done recursively and thoughout the sentence, to be -able to handle cases like "John walks and Mary walks and Bill walks", and -"John runs and Mary walks and Bill walks". -

    -

    -FIXME: what about John walks and Mary runs and Bill walks"? -

    - -

    Abstract syntax

    -

    -We will use the abstract syntax defined in -Abstract.gf. -

    - -

    Concrete syntax

    -

    -There is an English concrete syntax for this grammar in -English.gf. -

    - -

    Generate tree module

    -

    -To be able to write Transfer programs which use the types defined in -an abstract syntax, we first need to generate a Transfer file with -a data type defintition corresponding to the abstract syntax. -This is done with the transfer grammar printer: -

    -
    -  $ gf
    -  > i English.gf
    -  > pg -printer=transfer | wf tree.tra
    -
    -

    -

    -Note that you need to load a concrete syntax which uses the abstract -syntax that you want to create a Transfer data type for. Loading just the -abstract syntax module is not enough. FIXME: why? -

    -

    -The command sequence above writes a Transfer data type definition to the -file tree.tra. -

    - -

    Write transfer code

    -

    -We write the Transfer program -aggregate.tra. -

    -

    -FIXME: explain the code -

    - -

    Compiling Transfer programs

    -

    -Transfer programs are written in the human-friendly Transfer language, -but GF only understands the simpler Transfer Core language. Therefore, -before using a Transfer program, you must first compile it to -Transfer Core. This is done using the transferc command: -

    -
    -  $ transferc -i<lib> <transfer program>
    -
    -

    -

    -Here, <lib> is the path to search for any modules which you import -in your Transfer program. You can give several -i flags. -

    -

    -So, to compile aggregate.tra which we created above, we use: -

    -
    -  $ transferc aggregate.tra
    -
    -

    -

    -The creates the Transfer Core file aggregate.trc. -

    - -

    Using Transfer programs in GF

    - -

    Loading the grammars

    -

    -To use a Transfer Core program to transform abstract syntax terms -in GF, you must first load the grammars which you want to use the -program with. For the example above, we need the grammar English.gf -and its dependencies. We load this grammar with: -

    -
    -  > i English.gf
    -
    -

    - -

    Loading the Transfer program

    -

    -There are two steps to using a Transfer Core program in GF. First you load -the program into GF. This is done with the i command, which is also -used when loading grammar modules. To load the aggregate.trc which -we created above, we use: -

    -
    -  > i aggregate.trc
    -
    -

    - -

    Calling Transfer functions

    -

    -To call a Transfer function on a term, we use the at command. -The at command takes the name of a Transfer function and an abstract -syntax term, and applies the function to the term: -

    -
    -  > at aggregS ConjS And (Pred John Walk) (Pred Mary Walk)
    -  
    -  Pred (ConjNP And John Mary) Walk
    -
    -

    -

    -Of course, the input and output terms of the at command can -be read from and written to pipes: -

    -
    -  > p "John walks and Mary walks" | at aggregS | l
    -  
    -  John and Mary walk
    -
    -

    -

    -To see what is going on between the steps, we can use -tr flags -to the commands: -

    -
    -  > p -tr "John walks and Mary walks" | at -tr aggregS | l
    -  
    -  ConjS And (Pred John Walk) (Pred Mary Walk)
    -  
    -  Pred (ConjNP And John Mary) Walk
    -  
    -  John and Mary walk
    -
    -

    - -

    Transfer between different abstract syntaxes

    -

    -If the transfer function which you wan to call takes as input a term in one -abstract syntax, and returns a term in a different abstract syntax, you -can use the -lang flag with the at command. This is needed since the -at command type checks the result it produces, and it needs to -know which abstract sytnax to type check it in. -

    - - - - diff --git a/doc/transfer-tutorial.txt b/doc/transfer-tutorial.txt deleted file mode 100644 index ceb12693f..000000000 --- a/doc/transfer-tutorial.txt +++ /dev/null @@ -1,165 +0,0 @@ -Transfer tutorial -Author: Björn Bringert -Last update: %%date(%c) - -% NOTE: this is a txt2tags file. -% Create an html file from this file using: -% txt2tags -t html --toc darcs.txt - -%!target:html -%!options(html): --toc -%!encoding:utf-8 - -**WARNING: The Transfer language is still experimental. Its syntax, type system and semantics may change without notice. I will try to help you with any problems this might cause, but I will not refrain from changing the language solely for reasons of backwards compatibility.** - -= Objective = - -We want to write a Transfer program which we can use to do aggregation -in sentences which use conjunctions on the sentence, noun phrase and -verb phrase levels. For example, we want to be able to transform -the sentence "John walks and Mary walks" to the sentence -"John and Mary walk". We would also like to transform -"John walks and John swims" to "John walks and swims". - -Thus that what we want to do is: - -- Transform sentence conjunction where the verb phrases in the sentences - are identical to noun phrase conjunction. -- Transform sentence conjunction where the noun phrases in the sentences - are identical to verb phrase conjunction. - - -This needs to be done recursively and thoughout the sentence, to be -able to handle cases like "John walks and Mary walks and Bill walks", and -"John runs and Mary walks and Bill walks". - - -FIXME: what about John walks and Mary runs and Bill walks"? - - -= Abstract syntax = - -We will use the abstract syntax defined in -[Abstract.gf ../transfer/examples/aggregation/Abstract.gf]. - -= Concrete syntax = - -There is an English concrete syntax for this grammar in -[English.gf ../transfer/examples/aggregation/English.gf]. - -= Generate tree module = - -To be able to write Transfer programs which use the types defined in -an abstract syntax, we first need to generate a Transfer file with -a data type defintition corresponding to the abstract syntax. -This is done with the ``transfer`` grammar printer: - -``` -$ gf -> i English.gf -> pg -printer=transfer | wf tree.tra -``` - -Note that you need to load a concrete syntax which uses the abstract -syntax that you want to create a Transfer data type for. Loading just the -abstract syntax module is not enough. FIXME: why? - -The command sequence above writes a Transfer data type definition to the -file [tree.tra ../transfer/examples/aggregation/tree.tra]. - - -= Write transfer code = - -We write the Transfer program -[aggregate.tra ../transfer/examples/aggregation/aggregate.tra]. - -FIXME: explain the code - -= Compiling Transfer programs = - -Transfer programs are written in the human-friendly Transfer language, -but GF only understands the simpler Transfer Core language. Therefore, -before using a Transfer program, you must first compile it to -Transfer Core. This is done using the ``transferc`` command: - -``` -$ transferc -i -``` - -Here, ```` is the path to search for any modules which you import -in your Transfer program. You can give several ``-i`` flags. - -So, to compile ``aggregate.tra`` which we created above, we use: - -``` -$ transferc aggregate.tra -``` - -The creates the Transfer Core file ``aggregate.trc``. - - -= Using Transfer programs in GF = - -== Loading the grammars == - -To use a Transfer Core program to transform abstract syntax terms -in GF, you must first load the grammars which you want to use the -program with. For the example above, we need the grammar ``English.gf`` -and its dependencies. We load this grammar with: - -``` -> i English.gf -``` - -== Loading the Transfer program == - -There are two steps to using a Transfer Core program in GF. First you load -the program into GF. This is done with the ``i`` command, which is also -used when loading grammar modules. To load the ``aggregate.trc`` which -we created above, we use: - -``` -> i aggregate.trc -``` - -== Calling Transfer functions == - -To call a Transfer function on a term, we use the ``at`` command. -The ``at`` command takes the name of a Transfer function and an abstract -syntax term, and applies the function to the term: - -``` -> at aggregS ConjS And (Pred John Walk) (Pred Mary Walk) - -Pred (ConjNP And John Mary) Walk -``` - -Of course, the input and output terms of the ``at`` command can -be read from and written to pipes: - -``` -> p "John walks and Mary walks" | at aggregS | l - -John and Mary walk -``` - -To see what is going on between the steps, we can use ``-tr`` flags -to the commands: - -``` -> p -tr "John walks and Mary walks" | at -tr aggregS | l - -ConjS And (Pred John Walk) (Pred Mary Walk) - -Pred (ConjNP And John Mary) Walk - -John and Mary walk -``` - -=== Transfer between different abstract syntaxes === - -If the transfer function which you wan to call takes as input a term in one -abstract syntax, and returns a term in a different abstract syntax, you -can use the ``-lang`` flag with the ``at`` command. This is needed since the -``at`` command type checks the result it produces, and it needs to -know which abstract sytnax to type check it in. \ No newline at end of file diff --git a/doc/transfer.html b/doc/transfer.html deleted file mode 100644 index b45917143..000000000 --- a/doc/transfer.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - - -The GF Transfer language - -

    The GF Transfer language

    - -Author: Björn Bringert <bringert@cs.chalmers.se>
    -Last update: Fri Dec 9 11:54:38 2005 -
    - -

    -WARNING: The Transfer language is still experimental. Its syntax, type system and semantics may change without notice. I will try to help you with any problems this might cause, but I will not refrain from changing the language solely for reasons of backwards compatibility. -

    -

    -The GF Transfer language is a programming language which can be -used to write functions which work on abstract syntax terms. -

    -

    Transfer tutorial

    -

    -The Transfer tutorial shows an example of how to -write and use a simple transfer function for a GF grammar. -

    -

    Transfer reference

    -

    -The Transfer reference aims to cover -all constructs in the Transfer language. -

    - - - - diff --git a/doc/transfer.txt b/doc/transfer.txt deleted file mode 100644 index 611cfaf6b..000000000 --- a/doc/transfer.txt +++ /dev/null @@ -1,27 +0,0 @@ -The GF Transfer language -Author: Björn Bringert -Last update: %%date(%c) - -% NOTE: this is a txt2tags file. -% Create an html file from this file using: -% txt2tags transfer.txt - -%!target:html -%!encoding:utf-8 - -**WARNING: The Transfer language is still experimental. Its syntax, type system and semantics may change without notice. I will try to help you with any problems this might cause, but I will not refrain from changing the language solely for reasons of backwards compatibility.** - -The GF Transfer language is a programming language which can be -used to write functions which work on abstract syntax terms. - -= Transfer tutorial = - -The [Transfer tutorial transfer-tutorial.html] shows an example of how to -write and use a simple transfer function for a GF grammar. - - -= Transfer reference = - -The [Transfer reference transfer-reference.html] aims to cover -all constructs in the Transfer language. - diff --git a/doc/val-optimization.txt b/doc/val-optimization.txt deleted file mode 100644 index e2342876d..000000000 --- a/doc/val-optimization.txt +++ /dev/null @@ -1,183 +0,0 @@ -Idea: in GFC, represent tables as just lists values, without showing -the parameters. - -Concrete syntax: - - table T [t1 ; ... ; tn] - -where t1,...,tn are terms. This is treated as equivalent to - - table {p1 => t1 ; ... ; pn => tn} - -where p1,...,pn is the canonical listing of patterns of type T. - -Advantage: reduce the size of GFC files. - -Disadvantages: you don't get the sharing optimization, e.g. -table {A|B => v} instead of table T [v ; v] -Moreover, it is slower to select from the table, because -one first has to look up the position index of the argument. - -Usage: when compiling a module, use the -val option: - - i -val -src Foo.gf - -Summary of results, testing with lib/resource/french/TestVerbesFre.gf: - - without -val with -val ratio - compilation time 129 s 84 s 65 % - time to read back gfcm 109 s 32 s 29 % - size of generated gfcm 28 M 9 M 32 % - memory use in compilation 376 M 251 M 67 % - memory use in reading gfcm 1120 M 524 M 47 % - -No significant loss in linearization (which needs selection). - -Conclusion: for the case at hand (which prompted the experiment -at the first place), the gain is significant: compilation needs -30 % less resources, and using the compiled grammar needs -50-70 % less. - -More testing is desirable to find out if -val is always good. - -At the moment, reuse is not possible with gfc modules created -with the -val flag (although it is supported by the GF syntax -already). - - - -10/1/2004 - -Test the generation of course-of-values tables - ---------------------- -Without: - - i -src TestVerbesFre.gf - 129160 msec - - > gr -cat=V | l -table - 650 msec - -gf +RTS -K10M -s -8,469,778,952 bytes allocated in the heap -2,779,891,252 bytes copied during GC -133,108,856 bytes maximum residency (36 sample(s)) - - 32295 collections in generation 0 ( 24,25s) - 36 collections in generation 1 ( 24,68s) - - 376 Mb total memory in use - - INIT time 0,01s ( 0,04s elapsed) - MUT time 80,21s (499,76s elapsed) - GC time 48,93s ( 50,01s elapsed) - EXIT time 0,00s ( 0,00s elapsed) - Total time 129,15s (549,81s elapsed) - - %GC time 37,9% (9,1% elapsed) - - Alloc rate 105,581,886 bytes per MUT second - - Productivity 62,1% of total user, 14,6% of total elapsed - - -wc french/*.gfc french/*.gfr - 37 2533 44976 french/CategoriesFre.gfc - 0 9 62 french/ConjugNancy.gfc - 2 29 137 french/MorphoFre.gfc - 29 966 7641 french/NumeralsFre.gfc - 136 393891 4415193 french/RulesFre.gfc - 151 4211 39290 french/StructuralFre.gfc - 123 607 3259 french/SyntaxFre.gfc - 285 4702 59892 french/TestResourceFre.gfc - 6790 27179 184046 french/TestVerbesAbs.gfc - 6781 28170 198376 french/TestVerbesFre.gfc - 20 214 1245 french/TypesFre.gfc - 6494 45458 254878 french/VerbesAbs.gfc - 6494 1272600 23438292 french/VerbesFre.gfc - 6449 45143 209154 french/Vs.gfc - 6278 47836 426316 french/ConjugNancy.gfr - 14465 72471 655006 french/MorphoFre.gfr - 238250 798560 8973600 french/SyntaxFre.gfr - 492 2557 21908 french/TypesFre.gfr - 293276 2747136 38933271 total - -pm | wf test0.gfcm -55660 msec - -wc test0.gfcm - 28041 1784674 28669416 test0.gfcm - -> i test0.gfcm -+ reading test0.gfcm 103290 msec -109450 msec - -1120 Mb total memory in use - ----------------------- -After: - - - i -src -val TestVerbesFre.gf - 84650 msec - - gr -cat=V | l -table - 390 msec - -gf +RTS -K10M -s -6,061,907,436 bytes allocated in the heap -1,576,739,488 bytes copied during GC - 92,700,188 bytes maximum residency (32 sample(s)) - - 23109 collections in generation 0 ( 13,98s) - 32 collections in generation 1 ( 12,02s) - - 251 Mb total memory in use - - INIT time 0,01s ( 0,00s elapsed) - MUT time 59,28s (122,35s elapsed) - GC time 26,00s ( 26,91s elapsed) - EXIT time 0,00s ( 0,00s elapsed) - Total time 85,29s (149,26s elapsed) - - %GC time 30,5% (18,0% elapsed) - - Alloc rate 102,241,650 bytes per MUT second - - Productivity 69,5% of total user, 39,7% of total elapsed - -wc french/*.gfc french/*.gfr - 37 3894 13600 french/CategoriesFre.gfc - 0 9 62 french/ConjugNancy.gfc - 2 29 137 french/MorphoFre.gfc - 29 938 5726 french/NumeralsFre.gfc - 136 354450 3097901 french/RulesFre.gfc - 151 3738 22354 french/StructuralFre.gfc - 123 607 3259 french/SyntaxFre.gfc - 285 2437 18664 french/TestResourceFre.gfc - 6790 27179 184046 french/TestVerbesAbs.gfc - 6781 27694 191696 french/TestVerbesFre.gfc - 20 214 1245 french/TypesFre.gfc - 6494 45458 254878 french/VerbesAbs.gfc - 6494 442149 5078881 french/VerbesFre.gfc - 6449 45143 209154 french/Vs.gfc - 6278 47836 426316 french/ConjugNancy.gfr - 14465 72471 655006 french/MorphoFre.gfr - 238250 798560 8973600 french/SyntaxFre.gfr - 492 2557 21908 french/TypesFre.gfr - 293276 1875363 19158433 total - -pm | wf test1.gfcm -13030 msec - -wc test1.gfcm - 28041 912901 8894578 test1.gfcm - -> i test1.gfcm -+ reading test1.gfcm 24220 msec -32720 msec - -524 Mb total memory in use - -