diff --git a/doc/tutorial/gf-tutorial2.html b/doc/tutorial/gf-tutorial2.html index d3d390aa8..6f8ff78f1 100644 --- a/doc/tutorial/gf-tutorial2.html +++ b/doc/tutorial/gf-tutorial2.html @@ -7,7 +7,7 @@

Grammatical Framework Tutorial

Author: Aarne Ranta <aarne (at) cs.chalmers.se>
-Last update: Mon Dec 19 18:05:36 2005 +Last update: Wed Dec 21 10:29:13 2005

@@ -91,36 +91,38 @@ Last update: Mon Dec 19 18:05:36 2005
  • Free variation
  • Record extension and subtyping
  • Tuples and product types -
  • Prefix-dependent choices -
  • Predefined types and operations +
  • Record and tuple patterns +
  • Prefix-dependent choices +
  • Predefined types and operations -
  • More features of the module system +
  • More features of the module system -
  • More concepts of abstract syntax +
  • More concepts of abstract syntax -
  • Transfer modules -
  • Practical issues +
  • Transfer modules +
  • Practical issues -
  • Case studies +
  • Case studies @@ -1996,6 +1998,44 @@ Product types and tuples are syntactic sugar for record types and records: Thus the labels p1, p2,...` are hard-coded.

    +

    Record and tuple patterns

    +

    +Record types of parameter types are also parameter types. +A typical example is a record of agreement features, e.g. French +

    +
    +    oper Agr : PType = {g : Gender ; n : Number ; p : Person} ;
    +
    +

    +Notice the term PType rather than just Type referring to +parameter types. Every PType is also a Type. +

    +

    +Pattern matching is done in the expected way, but it can moreover +utilize partial records: the branch +

    +
    +    {g = Fem} => t
    +
    +

    +in a table of type Agr => T means the same as +

    +
    +    {g = Fem ; n = _ ; p = _} => t
    +
    +

    +Tuple patterns are translated to record patterns in the +same way as tuples to records; partial patterns make it +possible to write, slightly surprisingly, +

    +
    +    case <g,n,p> of {
    +      <Fem> => t
    +      ...
    +      }
    +
    +

    +

    Prefix-dependent choices

    The construct exemplified in @@ -2024,7 +2064,7 @@ This very example does not work in all situations: the prefix } ;

    - +

    Predefined types and operations

    GF has the following predefined categories in abstract syntax: @@ -2047,11 +2087,11 @@ they can be used as arguments. For example: -- e.g. (StreetAddress 10 "Downing Street") : Address

    - -

    More features of the module system

    -

    Interfaces, instances, and functors

    +

    More features of the module system

    +

    Interfaces, instances, and functors

    +

    Resource grammars and their reuse

    A resource grammar is a grammar built on linguistic grounds, @@ -2104,17 +2144,19 @@ The rest of the modules (black) come from the resource.

    - -

    Restricted inheritance and qualified opening

    -

    More concepts of abstract syntax

    +

    Restricted inheritance and qualified opening

    -

    Dependent types

    +

    More concepts of abstract syntax

    -

    Higher-order abstract syntax

    +

    Dependent types

    -

    Semantic definitions

    +

    Higher-order abstract syntax

    +

    Semantic definitions

    + +

    List categories

    +

    Transfer modules

    Transfer means noncompositional tree-transforming operations. @@ -2133,9 +2175,9 @@ See the transfer language documentation for more information.

    - +

    Practical issues

    - +

    Lexers and unlexers

    Lexers and unlexers can be chosen from @@ -2171,7 +2213,7 @@ Given by help -lexer, help -unlexer:

    - +

    Efficiency of grammars

    Issues: @@ -2182,7 +2224,7 @@ Issues:

  • parsing efficiency: -mcfg vs. others - +

    Speech input and output

    Thespeak_aloud = sa command sends a string to the speech @@ -2212,7 +2254,7 @@ The method words only for grammars of English. Both Flite and ATK are freely available through the links above, but they are not distributed together with GF.

    - +

    Multilingual syntax editor

    The @@ -2229,18 +2271,29 @@ Here is a snapshot of the editor: The grammars of the snapshot are from the Letter grammar package.

    - +

    Interactive Development Environment (IDE)

    Forthcoming.

    - +

    Communicating with GF

    Other processes can communicate with the GF command interpreter, -and also with the GF syntax editor. +and also with the GF syntax editor. Useful flags when invoking GF are

    - + + +

    Embedded grammars in Haskell, Java, and Prolog

    GF grammars can be used as parts of programs written in the @@ -2252,15 +2305,15 @@ following languages. The links give more documentation.

  • Prolog - +

    Alternative input and output grammar formats

    A summary is given in the following chart of GF grammar compiler phases:

    - +

    Case studies

    - +

    Interfacing formal and natural languages

    Formal and Informal Software Specifications, @@ -2273,6 +2326,6 @@ English and German. A simpler example will be explained here.

    - +