kandi background
Explore Kits

rgl | RGL is a framework for graph data structures and algorithms in Ruby.

 by   monora Ruby Version: v0.5.7 License: Non-SPDX

 by   monora Ruby Version: v0.5.7 License: Non-SPDX

Download this library from

kandi X-RAY | rgl Summary

rgl is a Ruby library typically used in User Interface, Example Codes applications. rgl has no vulnerabilities and it has low support. However rgl has 1 bugs and it has a Non-SPDX License. You can download it from GitHub.
RGL is a framework for graph data structures and algorithms. The design of the library is much influenced by the Boost Graph Library (BGL) which is written in C++. Refer to http://www.boost.org/libs/graph/doc for further links and documentation on graph data structures and algorithms and the design rationales of BGL. A comprehensive summary of graph terminology can be found in the graph section of the Dictionary of Algorithms and Data Structures at http://www.nist.gov/dads/HTML/graph.html or Wikipedia.
Support
Support
Quality
Quality
Security
Security
License
License
Reuse
Reuse

kandi-support Support

  • rgl has a low active ecosystem.
  • It has 316 star(s) with 51 fork(s). There are 14 watchers for this library.
  • It had no major release in the last 12 months.
  • There are 0 open issues and 25 have been closed. On average issues are closed in 61 days. There are 3 open pull requests and 0 closed requests.
  • It has a neutral sentiment in the developer community.
  • The latest version of rgl is v0.5.7
rgl Support
Best in #Ruby
Average in #Ruby
rgl Support
Best in #Ruby
Average in #Ruby

quality kandi Quality

  • rgl has 1 bugs (0 blocker, 0 critical, 1 major, 0 minor) and 56 code smells.
rgl Quality
Best in #Ruby
Average in #Ruby
rgl Quality
Best in #Ruby
Average in #Ruby

securitySecurity

  • rgl has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
  • rgl code analysis shows 0 unresolved vulnerabilities.
  • There are 0 security hotspots that need review.
rgl Security
Best in #Ruby
Average in #Ruby
rgl Security
Best in #Ruby
Average in #Ruby

license License

  • rgl has a Non-SPDX License.
  • Non-SPDX licenses can be open source with a non SPDX compliant license, or non open source licenses, and you need to review them closely before use.
rgl License
Best in #Ruby
Average in #Ruby
rgl License
Best in #Ruby
Average in #Ruby

buildReuse

  • rgl releases are available to install and integrate.
  • Installation instructions, examples and code snippets are available.
  • rgl saves you 1866 person hours of effort in developing the same functionality from scratch.
  • It has 4116 lines of code, 403 functions and 53 files.
  • It has medium code complexity. Code complexity directly impacts maintainability of the code.
rgl Reuse
Best in #Ruby
Average in #Ruby
rgl Reuse
Best in #Ruby
Average in #Ruby
Top functions reviewed by kandi - BETA

kandi has reviewed rgl and discovered the below as its top functions. This is intended to give you an instant insight into rgl implemented functionality, and help decide if they suit your requirements.

  • Computes the terminal transformation of the terminal .
  • Creates a new visualization graph .
  • Returns the probability of the given block .
  • Convert graph to graph graph graph
  • Perform a visit block on each vertex .
  • Recurse through vertices
  • returns an array of vertices
  • Relocate a vertex with the graph .
  • Iterates through the connected graph of the connected graph
  • Refresh the edge between vertices

rgl Key Features

RGL is a framework for graph data structures and algorithms in Ruby.

Installation

copy iconCopydownload iconDownload
% gem install rgl

Running tests

copy iconCopydownload iconDownload
% bundle install

Example irb session with RGL

copy iconCopydownload iconDownload
% irb -Ilib

irb> require 'rgl/adjacency'
irb> dg=RGL::DirectedAdjacencyGraph[1,2 ,2,3 ,2,4, 4,5, 6,4, 1,6]
# Use DOT to visualize this graph:
irb> require 'rgl/dot'
irb> dg.write_to_graphic_file('jpg')
"graph.jpg"

Plotting a simple plane in 3D

copy iconCopydownload iconDownload
planes3d(beta2, -1, beta3, beta1)
plot3d(x1, y, x3, xlab = "x_1", ylab = "f(x)", zlab = "x_3")
-----------------------
planes3d(beta2, -1, beta3, beta1)
plot3d(x1, y, x3, xlab = "x_1", ylab = "f(x)", zlab = "x_3")

Using Fractions in GF

copy iconCopydownload iconDownload
mkSymb : Str -> Symb  ;     -- x
symb   : Symb -> Card ;     -- n (number)
oper myMkCard : Str -> Card = \s -> symb (mkSymb s) ;
resource Fractions = open SymbolicGer, SyntaxGer, LexiconGer in {
  oper
    one_and_half_Card : Card = symb (mkSymb "eineinhalb") ;

    one_and_half_NP : NP = mkNP (mkDet one_and_half_Card) ; -- standalone NP
    one_and_half_cats_NP : NP = mkNP one_and_half_Card cat_N ; -- determiner for cat_N
}
> cc -unqual -table one_and_half_cats_NP
s . NPC Nom => eineinhalb Katzen
s . NPC Acc => eineinhalb Katzen
s . NPC Dat => eineinhalb Katzen
s . NPC Gen => eineinhalb Katzen
s . NPP CAnDat => an eineinhalb Katzen
s . NPP CInAcc => in eineinhalb Katzen
s . NPP CInDat => in eineinhalb Katzen
s . NPP CZuDat => zu eineinhalb Katzen
s . NPP CVonDat => von eineinhalb Katzen
a . Ag Fem Pl P3
-----------------------
mkSymb : Str -> Symb  ;     -- x
symb   : Symb -> Card ;     -- n (number)
oper myMkCard : Str -> Card = \s -> symb (mkSymb s) ;
resource Fractions = open SymbolicGer, SyntaxGer, LexiconGer in {
  oper
    one_and_half_Card : Card = symb (mkSymb "eineinhalb") ;

    one_and_half_NP : NP = mkNP (mkDet one_and_half_Card) ; -- standalone NP
    one_and_half_cats_NP : NP = mkNP one_and_half_Card cat_N ; -- determiner for cat_N
}
> cc -unqual -table one_and_half_cats_NP
s . NPC Nom => eineinhalb Katzen
s . NPC Acc => eineinhalb Katzen
s . NPC Dat => eineinhalb Katzen
s . NPC Gen => eineinhalb Katzen
s . NPP CAnDat => an eineinhalb Katzen
s . NPP CInAcc => in eineinhalb Katzen
s . NPP CInDat => in eineinhalb Katzen
s . NPP CZuDat => zu eineinhalb Katzen
s . NPP CVonDat => von eineinhalb Katzen
a . Ag Fem Pl P3
-----------------------
mkSymb : Str -> Symb  ;     -- x
symb   : Symb -> Card ;     -- n (number)
oper myMkCard : Str -> Card = \s -> symb (mkSymb s) ;
resource Fractions = open SymbolicGer, SyntaxGer, LexiconGer in {
  oper
    one_and_half_Card : Card = symb (mkSymb "eineinhalb") ;

    one_and_half_NP : NP = mkNP (mkDet one_and_half_Card) ; -- standalone NP
    one_and_half_cats_NP : NP = mkNP one_and_half_Card cat_N ; -- determiner for cat_N
}
> cc -unqual -table one_and_half_cats_NP
s . NPC Nom => eineinhalb Katzen
s . NPC Acc => eineinhalb Katzen
s . NPC Dat => eineinhalb Katzen
s . NPC Gen => eineinhalb Katzen
s . NPP CAnDat => an eineinhalb Katzen
s . NPP CInAcc => in eineinhalb Katzen
s . NPP CInDat => in eineinhalb Katzen
s . NPP CZuDat => zu eineinhalb Katzen
s . NPP CVonDat => von eineinhalb Katzen
a . Ag Fem Pl P3
-----------------------
mkSymb : Str -> Symb  ;     -- x
symb   : Symb -> Card ;     -- n (number)
oper myMkCard : Str -> Card = \s -> symb (mkSymb s) ;
resource Fractions = open SymbolicGer, SyntaxGer, LexiconGer in {
  oper
    one_and_half_Card : Card = symb (mkSymb "eineinhalb") ;

    one_and_half_NP : NP = mkNP (mkDet one_and_half_Card) ; -- standalone NP
    one_and_half_cats_NP : NP = mkNP one_and_half_Card cat_N ; -- determiner for cat_N
}
> cc -unqual -table one_and_half_cats_NP
s . NPC Nom => eineinhalb Katzen
s . NPC Acc => eineinhalb Katzen
s . NPC Dat => eineinhalb Katzen
s . NPC Gen => eineinhalb Katzen
s . NPP CAnDat => an eineinhalb Katzen
s . NPP CInAcc => in eineinhalb Katzen
s . NPP CInDat => in eineinhalb Katzen
s . NPP CZuDat => zu eineinhalb Katzen
s . NPP CVonDat => von eineinhalb Katzen
a . Ag Fem Pl P3

how to draw part of a cone in rgl?

copy iconCopydownload iconDownload
pts <- cbind(c(0, 0), c(0, 1), c(0, 0))   # the centers
radii <- c(0.2, 0.4)
cone <- cylinder3d(pts, radii, sides = 64)
shade3d(cone, col = "lightblue")

R: rgl link multiple plots to a single widget

copy iconCopydownload iconDownload
library(rgl)

open3d() # Remove the earlier display

layout3d(matrix(c(1,2), nrow=1), sharedMouse = T)

next3d()
sub1 <- subsceneInfo()$id
setosa <- with(subset(iris, Species == "setosa"), 
                             spheres3d(Sepal.Length, Sepal.Width, Petal.Length, 
                                                col="black",
                                                radius = 0.211))
versicolor <- with(subset(iris, Species == "versicolor"), 
                                     spheres3d(Sepal.Length, Sepal.Width, Petal.Length, 
                                                        col="red",
                                                        radius = 0.211))

next3d()
sub2 <- subsceneInfo()$id
setosa2 <- with(subset(iris, Species == "setosa"), 
                                spheres3d(Sepal.Length, Sepal.Width, Petal.Length, 
                                                    col="yellow",
                                                    radius = 0.211))
versicolor2 <- with(subset(iris, Species == "versicolor"), 
                                        spheres3d(Sepal.Length, Sepal.Width, Petal.Length, 
                                                            col="blue",
                                                            radius = 0.211))


rglwidget() %>%
    playwidget(start = 0, stop = 2, interval = 1,
                         list(subsetControl(1, subscenes = sub1, subsets = list(
                            All = c(setosa, versicolor),
                            Setosa = setosa,
                            Versicolor = versicolor
                         )),
                         subsetControl(1, subscenes = sub2, subsets = list(
                            All = c(setosa2, versicolor2),
                            Setosa = setosa2,
                            Versicolor = versicolor2
                         ))))

Proper names with determiners in GF

copy iconCopydownload iconDownload
abstract Song = {
  flags startcat = Sentence ;
  cat
    Sentence ;
    Person ;
    Artist ;

  fun
    wantToListen : Person -> Artist -> Sentence ;
    Jack : Person ;
    Taylor, Ariana : Artist ;
}
concrete SongEng of Song = open SyntaxEng, ParadigmsEng, LexiconEng in {

  lincat
    Sentence = Utt ;
    Person = NP ;
    Artist = AP ; -- cheat in English

  lin
    -- : Person -> Artist -> Sentence ;
    wantToListen person artist =
      let artistsSong : CN = mkCN artist song_N ;
          listenToSong : VP = mkVP listen_V2 (mkNP a_Det artistsSong) ;
       in mkUtt (mkS (mkCl person want_VV listenToSong)) ;

    -- : Person
    Jack = mkNP (mkPN "Jack") ;

    -- : Artist
    Taylor = mkAP (mkA "Taylor") ;
    Ariana = mkAP (mkA "Ariana") ;
}
$ gf SongEng.gf
…
Song> gt | l -treebank
Song: wantToListen Jack Ariana
SongEng: Jack wants to listen to an Ariana song

Song: wantToListen Jack Taylor
SongEng: Jack wants to listen to a Taylor song
abstract Song2 = Song ** {
  flags startcat = Sentence ;
  fun
    TheBeatles : Artist ;
    isGood : Artist -> Sentence ;
}
concrete Song2Eng of Song2 = open SyntaxEng, ParadigmsEng, LexiconEng in {

  lincat
    Sentence = Utt ;
    Person = NP ;
    Artist = LinArtist ; -- {independent : NP ; modifier : AP}

  lin
    -- : Person -> Artist -> Sentence ;
    wantToListen person artist =
      let artistsSong : CN = mkCN artist.modifier song_N ;
          listenToSong : VP = mkVP listen_V2 (mkNP a_Det artistsSong) ;
       in mkUtt (mkS (mkCl person want_VV listenToSong)) ;

    -- : Artist -> Sentence
    isGood artist = mkUtt (mkS (mkCl artist.independent good_A)) ;

    -- : Person
    Jack = mkNP (mkPN "Jack") ;

    -- : Artist
    Taylor = mkArtist "Taylor" ;
    Ariana = mkArtist "Ariana" ;
    TheBeatles = mkArtist "The Beatles" "Beatles" ;

  oper
    LinArtist : Type = {independent : NP ; modifier : AP} ;
    mkArtist = overload {
      mkArtist : Str -> Str -> LinArtist = \thebeatles, beatles -> {
        independent = mkNP (mkPN thebeatles) ;
        modifier = mkAP (mkA beatles)
        } ;
      mkArtist : Str -> LinArtist = \taylor -> {
        independent = mkNP (mkN taylor) ;
        modifier = mkAP (mkA taylor)
        }
      } ;
}
Song2> gt | l
Ariana is good
Taylor is good
The Beatles is good
Jack wants to listen to an Ariana song
Jack wants to listen to a Taylor song
Jack wants to listen to a Beatles song
  oper
    mkArtist = overload {
      mkArtist : Str -> Str -> LinArtist = … ; -- same as before
      mkArtist : Str -> LinArtist = … ; -- same as before
      mkArtist : NP -> AP -> LinArtist = \thebeatles,beatles -> {
        independent = thebeatles ;
        modifier = beatles
        }
  lin
    TheBeatles =
      mkArtist
        (mkNP aPl_Det (mkN "The Beatles" "The Beatles"))
        (mkAP (mkA "Beatles")) ;
      } ;
Song2> l isGood TheBeatles 
The Beatles are good
abstract Song3 = Song2 ** {
  flags startcat = Sentence ;
  fun
    StringArtist : String -> Artist ;
}
concrete Song3Eng of Song3 = Song2Eng ** open SyntaxEng, LexiconEng, SymbolicEng in {
  lin
    -- : String -> Artist ;
    StringArtist string = {
      independent = symb string ; -- symb : String -> NP, from SymbolicEng
      modifier = <mkAP good_A : AP> ** {s = \\_ => string.s} -- hack
      } ;
}
Song3> p "Jack wants to listen to a skhdgdjgfhjkdfhjsdf song"
wantToListen Jack (StringArtist "skhdgdjgfhjkdfhjsdf")

Song3> p "9ortge94yhjerh90fpersk is good"
isGood (StringArtist "9ortge94yhjerh90fpersk")
Song3> l isGood (StringArtist "Spice Girls")
Spice Girls is good
Song3> p "Backstreet Boys is good"
The parser failed at token 2: "Boys"
-----------------------
abstract Song = {
  flags startcat = Sentence ;
  cat
    Sentence ;
    Person ;
    Artist ;

  fun
    wantToListen : Person -> Artist -> Sentence ;
    Jack : Person ;
    Taylor, Ariana : Artist ;
}
concrete SongEng of Song = open SyntaxEng, ParadigmsEng, LexiconEng in {

  lincat
    Sentence = Utt ;
    Person = NP ;
    Artist = AP ; -- cheat in English

  lin
    -- : Person -> Artist -> Sentence ;
    wantToListen person artist =
      let artistsSong : CN = mkCN artist song_N ;
          listenToSong : VP = mkVP listen_V2 (mkNP a_Det artistsSong) ;
       in mkUtt (mkS (mkCl person want_VV listenToSong)) ;

    -- : Person
    Jack = mkNP (mkPN "Jack") ;

    -- : Artist
    Taylor = mkAP (mkA "Taylor") ;
    Ariana = mkAP (mkA "Ariana") ;
}
$ gf SongEng.gf
…
Song> gt | l -treebank
Song: wantToListen Jack Ariana
SongEng: Jack wants to listen to an Ariana song

Song: wantToListen Jack Taylor
SongEng: Jack wants to listen to a Taylor song
abstract Song2 = Song ** {
  flags startcat = Sentence ;
  fun
    TheBeatles : Artist ;
    isGood : Artist -> Sentence ;
}
concrete Song2Eng of Song2 = open SyntaxEng, ParadigmsEng, LexiconEng in {

  lincat
    Sentence = Utt ;
    Person = NP ;
    Artist = LinArtist ; -- {independent : NP ; modifier : AP}

  lin
    -- : Person -> Artist -> Sentence ;
    wantToListen person artist =
      let artistsSong : CN = mkCN artist.modifier song_N ;
          listenToSong : VP = mkVP listen_V2 (mkNP a_Det artistsSong) ;
       in mkUtt (mkS (mkCl person want_VV listenToSong)) ;

    -- : Artist -> Sentence
    isGood artist = mkUtt (mkS (mkCl artist.independent good_A)) ;

    -- : Person
    Jack = mkNP (mkPN "Jack") ;

    -- : Artist
    Taylor = mkArtist "Taylor" ;
    Ariana = mkArtist "Ariana" ;
    TheBeatles = mkArtist "The Beatles" "Beatles" ;

  oper
    LinArtist : Type = {independent : NP ; modifier : AP} ;
    mkArtist = overload {
      mkArtist : Str -> Str -> LinArtist = \thebeatles, beatles -> {
        independent = mkNP (mkPN thebeatles) ;
        modifier = mkAP (mkA beatles)
        } ;
      mkArtist : Str -> LinArtist = \taylor -> {
        independent = mkNP (mkN taylor) ;
        modifier = mkAP (mkA taylor)
        }
      } ;
}
Song2> gt | l
Ariana is good
Taylor is good
The Beatles is good
Jack wants to listen to an Ariana song
Jack wants to listen to a Taylor song
Jack wants to listen to a Beatles song
  oper
    mkArtist = overload {
      mkArtist : Str -> Str -> LinArtist = … ; -- same as before
      mkArtist : Str -> LinArtist = … ; -- same as before
      mkArtist : NP -> AP -> LinArtist = \thebeatles,beatles -> {
        independent = thebeatles ;
        modifier = beatles
        }
  lin
    TheBeatles =
      mkArtist
        (mkNP aPl_Det (mkN "The Beatles" "The Beatles"))
        (mkAP (mkA "Beatles")) ;
      } ;
Song2> l isGood TheBeatles 
The Beatles are good
abstract Song3 = Song2 ** {
  flags startcat = Sentence ;
  fun
    StringArtist : String -> Artist ;
}
concrete Song3Eng of Song3 = Song2Eng ** open SyntaxEng, LexiconEng, SymbolicEng in {
  lin
    -- : String -> Artist ;
    StringArtist string = {
      independent = symb string ; -- symb : String -> NP, from SymbolicEng
      modifier = <mkAP good_A : AP> ** {s = \\_ => string.s} -- hack
      } ;
}
Song3> p "Jack wants to listen to a skhdgdjgfhjkdfhjsdf song"
wantToListen Jack (StringArtist "skhdgdjgfhjkdfhjsdf")

Song3> p "9ortge94yhjerh90fpersk is good"
isGood (StringArtist "9ortge94yhjerh90fpersk")
Song3> l isGood (StringArtist "Spice Girls")
Spice Girls is good
Song3> p "Backstreet Boys is good"
The parser failed at token 2: "Boys"
-----------------------
abstract Song = {
  flags startcat = Sentence ;
  cat
    Sentence ;
    Person ;
    Artist ;

  fun
    wantToListen : Person -> Artist -> Sentence ;
    Jack : Person ;
    Taylor, Ariana : Artist ;
}
concrete SongEng of Song = open SyntaxEng, ParadigmsEng, LexiconEng in {

  lincat
    Sentence = Utt ;
    Person = NP ;
    Artist = AP ; -- cheat in English

  lin
    -- : Person -> Artist -> Sentence ;
    wantToListen person artist =
      let artistsSong : CN = mkCN artist song_N ;
          listenToSong : VP = mkVP listen_V2 (mkNP a_Det artistsSong) ;
       in mkUtt (mkS (mkCl person want_VV listenToSong)) ;

    -- : Person
    Jack = mkNP (mkPN "Jack") ;

    -- : Artist
    Taylor = mkAP (mkA "Taylor") ;
    Ariana = mkAP (mkA "Ariana") ;
}
$ gf SongEng.gf
…
Song> gt | l -treebank
Song: wantToListen Jack Ariana
SongEng: Jack wants to listen to an Ariana song

Song: wantToListen Jack Taylor
SongEng: Jack wants to listen to a Taylor song
abstract Song2 = Song ** {
  flags startcat = Sentence ;
  fun
    TheBeatles : Artist ;
    isGood : Artist -> Sentence ;
}
concrete Song2Eng of Song2 = open SyntaxEng, ParadigmsEng, LexiconEng in {

  lincat
    Sentence = Utt ;
    Person = NP ;
    Artist = LinArtist ; -- {independent : NP ; modifier : AP}

  lin
    -- : Person -> Artist -> Sentence ;
    wantToListen person artist =
      let artistsSong : CN = mkCN artist.modifier song_N ;
          listenToSong : VP = mkVP listen_V2 (mkNP a_Det artistsSong) ;
       in mkUtt (mkS (mkCl person want_VV listenToSong)) ;

    -- : Artist -> Sentence
    isGood artist = mkUtt (mkS (mkCl artist.independent good_A)) ;

    -- : Person
    Jack = mkNP (mkPN "Jack") ;

    -- : Artist
    Taylor = mkArtist "Taylor" ;
    Ariana = mkArtist "Ariana" ;
    TheBeatles = mkArtist "The Beatles" "Beatles" ;

  oper
    LinArtist : Type = {independent : NP ; modifier : AP} ;
    mkArtist = overload {
      mkArtist : Str -> Str -> LinArtist = \thebeatles, beatles -> {
        independent = mkNP (mkPN thebeatles) ;
        modifier = mkAP (mkA beatles)
        } ;
      mkArtist : Str -> LinArtist = \taylor -> {
        independent = mkNP (mkN taylor) ;
        modifier = mkAP (mkA taylor)
        }
      } ;
}
Song2> gt | l
Ariana is good
Taylor is good
The Beatles is good
Jack wants to listen to an Ariana song
Jack wants to listen to a Taylor song
Jack wants to listen to a Beatles song
  oper
    mkArtist = overload {
      mkArtist : Str -> Str -> LinArtist = … ; -- same as before
      mkArtist : Str -> LinArtist = … ; -- same as before
      mkArtist : NP -> AP -> LinArtist = \thebeatles,beatles -> {
        independent = thebeatles ;
        modifier = beatles
        }
  lin
    TheBeatles =
      mkArtist
        (mkNP aPl_Det (mkN "The Beatles" "The Beatles"))
        (mkAP (mkA "Beatles")) ;
      } ;
Song2> l isGood TheBeatles 
The Beatles are good
abstract Song3 = Song2 ** {
  flags startcat = Sentence ;
  fun
    StringArtist : String -> Artist ;
}
concrete Song3Eng of Song3 = Song2Eng ** open SyntaxEng, LexiconEng, SymbolicEng in {
  lin
    -- : String -> Artist ;
    StringArtist string = {
      independent = symb string ; -- symb : String -> NP, from SymbolicEng
      modifier = <mkAP good_A : AP> ** {s = \\_ => string.s} -- hack
      } ;
}
Song3> p "Jack wants to listen to a skhdgdjgfhjkdfhjsdf song"
wantToListen Jack (StringArtist "skhdgdjgfhjkdfhjsdf")

Song3> p "9ortge94yhjerh90fpersk is good"
isGood (StringArtist "9ortge94yhjerh90fpersk")
Song3> l isGood (StringArtist "Spice Girls")
Spice Girls is good
Song3> p "Backstreet Boys is good"
The parser failed at token 2: "Boys"
-----------------------
abstract Song = {
  flags startcat = Sentence ;
  cat
    Sentence ;
    Person ;
    Artist ;

  fun
    wantToListen : Person -> Artist -> Sentence ;
    Jack : Person ;
    Taylor, Ariana : Artist ;
}
concrete SongEng of Song = open SyntaxEng, ParadigmsEng, LexiconEng in {

  lincat
    Sentence = Utt ;
    Person = NP ;
    Artist = AP ; -- cheat in English

  lin
    -- : Person -> Artist -> Sentence ;
    wantToListen person artist =
      let artistsSong : CN = mkCN artist song_N ;
          listenToSong : VP = mkVP listen_V2 (mkNP a_Det artistsSong) ;
       in mkUtt (mkS (mkCl person want_VV listenToSong)) ;

    -- : Person
    Jack = mkNP (mkPN "Jack") ;

    -- : Artist
    Taylor = mkAP (mkA "Taylor") ;
    Ariana = mkAP (mkA "Ariana") ;
}
$ gf SongEng.gf
…
Song> gt | l -treebank
Song: wantToListen Jack Ariana
SongEng: Jack wants to listen to an Ariana song

Song: wantToListen Jack Taylor
SongEng: Jack wants to listen to a Taylor song
abstract Song2 = Song ** {
  flags startcat = Sentence ;
  fun
    TheBeatles : Artist ;
    isGood : Artist -> Sentence ;
}
concrete Song2Eng of Song2 = open SyntaxEng, ParadigmsEng, LexiconEng in {

  lincat
    Sentence = Utt ;
    Person = NP ;
    Artist = LinArtist ; -- {independent : NP ; modifier : AP}

  lin
    -- : Person -> Artist -> Sentence ;
    wantToListen person artist =
      let artistsSong : CN = mkCN artist.modifier song_N ;
          listenToSong : VP = mkVP listen_V2 (mkNP a_Det artistsSong) ;
       in mkUtt (mkS (mkCl person want_VV listenToSong)) ;

    -- : Artist -> Sentence
    isGood artist = mkUtt (mkS (mkCl artist.independent good_A)) ;

    -- : Person
    Jack = mkNP (mkPN "Jack") ;

    -- : Artist
    Taylor = mkArtist "Taylor" ;
    Ariana = mkArtist "Ariana" ;
    TheBeatles = mkArtist "The Beatles" "Beatles" ;

  oper
    LinArtist : Type = {independent : NP ; modifier : AP} ;
    mkArtist = overload {
      mkArtist : Str -> Str -> LinArtist = \thebeatles, beatles -> {
        independent = mkNP (mkPN thebeatles) ;
        modifier = mkAP (mkA beatles)
        } ;
      mkArtist : Str -> LinArtist = \taylor -> {
        independent = mkNP (mkN taylor) ;
        modifier = mkAP (mkA taylor)
        }
      } ;
}
Song2> gt | l
Ariana is good
Taylor is good
The Beatles is good
Jack wants to listen to an Ariana song
Jack wants to listen to a Taylor song
Jack wants to listen to a Beatles song
  oper
    mkArtist = overload {
      mkArtist : Str -> Str -> LinArtist = … ; -- same as before
      mkArtist : Str -> LinArtist = … ; -- same as before
      mkArtist : NP -> AP -> LinArtist = \thebeatles,beatles -> {
        independent = thebeatles ;
        modifier = beatles
        }
  lin
    TheBeatles =
      mkArtist
        (mkNP aPl_Det (mkN "The Beatles" "The Beatles"))
        (mkAP (mkA "Beatles")) ;
      } ;
Song2> l isGood TheBeatles 
The Beatles are good
abstract Song3 = Song2 ** {
  flags startcat = Sentence ;
  fun
    StringArtist : String -> Artist ;
}
concrete Song3Eng of Song3 = Song2Eng ** open SyntaxEng, LexiconEng, SymbolicEng in {
  lin
    -- : String -> Artist ;
    StringArtist string = {
      independent = symb string ; -- symb : String -> NP, from SymbolicEng
      modifier = <mkAP good_A : AP> ** {s = \\_ => string.s} -- hack
      } ;
}
Song3> p "Jack wants to listen to a skhdgdjgfhjkdfhjsdf song"
wantToListen Jack (StringArtist "skhdgdjgfhjkdfhjsdf")

Song3> p "9ortge94yhjerh90fpersk is good"
isGood (StringArtist "9ortge94yhjerh90fpersk")
Song3> l isGood (StringArtist "Spice Girls")
Spice Girls is good
Song3> p "Backstreet Boys is good"
The parser failed at token 2: "Boys"
-----------------------
abstract Song = {
  flags startcat = Sentence ;
  cat
    Sentence ;
    Person ;
    Artist ;

  fun
    wantToListen : Person -> Artist -> Sentence ;
    Jack : Person ;
    Taylor, Ariana : Artist ;
}
concrete SongEng of Song = open SyntaxEng, ParadigmsEng, LexiconEng in {

  lincat
    Sentence = Utt ;
    Person = NP ;
    Artist = AP ; -- cheat in English

  lin
    -- : Person -> Artist -> Sentence ;
    wantToListen person artist =
      let artistsSong : CN = mkCN artist song_N ;
          listenToSong : VP = mkVP listen_V2 (mkNP a_Det artistsSong) ;
       in mkUtt (mkS (mkCl person want_VV listenToSong)) ;

    -- : Person
    Jack = mkNP (mkPN "Jack") ;

    -- : Artist
    Taylor = mkAP (mkA "Taylor") ;
    Ariana = mkAP (mkA "Ariana") ;
}
$ gf SongEng.gf
…
Song> gt | l -treebank
Song: wantToListen Jack Ariana
SongEng: Jack wants to listen to an Ariana song

Song: wantToListen Jack Taylor
SongEng: Jack wants to listen to a Taylor song
abstract Song2 = Song ** {
  flags startcat = Sentence ;
  fun
    TheBeatles : Artist ;
    isGood : Artist -> Sentence ;
}
concrete Song2Eng of Song2 = open SyntaxEng, ParadigmsEng, LexiconEng in {

  lincat
    Sentence = Utt ;
    Person = NP ;
    Artist = LinArtist ; -- {independent : NP ; modifier : AP}

  lin
    -- : Person -> Artist -> Sentence ;
    wantToListen person artist =
      let artistsSong : CN = mkCN artist.modifier song_N ;
          listenToSong : VP = mkVP listen_V2 (mkNP a_Det artistsSong) ;
       in mkUtt (mkS (mkCl person want_VV listenToSong)) ;

    -- : Artist -> Sentence
    isGood artist = mkUtt (mkS (mkCl artist.independent good_A)) ;

    -- : Person
    Jack = mkNP (mkPN "Jack") ;

    -- : Artist
    Taylor = mkArtist "Taylor" ;
    Ariana = mkArtist "Ariana" ;
    TheBeatles = mkArtist "The Beatles" "Beatles" ;

  oper
    LinArtist : Type = {independent : NP ; modifier : AP} ;
    mkArtist = overload {
      mkArtist : Str -> Str -> LinArtist = \thebeatles, beatles -> {
        independent = mkNP (mkPN thebeatles) ;
        modifier = mkAP (mkA beatles)
        } ;
      mkArtist : Str -> LinArtist = \taylor -> {
        independent = mkNP (mkN taylor) ;
        modifier = mkAP (mkA taylor)
        }
      } ;
}
Song2> gt | l
Ariana is good
Taylor is good
The Beatles is good
Jack wants to listen to an Ariana song
Jack wants to listen to a Taylor song
Jack wants to listen to a Beatles song
  oper
    mkArtist = overload {
      mkArtist : Str -> Str -> LinArtist = … ; -- same as before
      mkArtist : Str -> LinArtist = … ; -- same as before
      mkArtist : NP -> AP -> LinArtist = \thebeatles,beatles -> {
        independent = thebeatles ;
        modifier = beatles
        }
  lin
    TheBeatles =
      mkArtist
        (mkNP aPl_Det (mkN "The Beatles" "The Beatles"))
        (mkAP (mkA "Beatles")) ;
      } ;
Song2> l isGood TheBeatles 
The Beatles are good
abstract Song3 = Song2 ** {
  flags startcat = Sentence ;
  fun
    StringArtist : String -> Artist ;
}
concrete Song3Eng of Song3 = Song2Eng ** open SyntaxEng, LexiconEng, SymbolicEng in {
  lin
    -- : String -> Artist ;
    StringArtist string = {
      independent = symb string ; -- symb : String -> NP, from SymbolicEng
      modifier = <mkAP good_A : AP> ** {s = \\_ => string.s} -- hack
      } ;
}
Song3> p "Jack wants to listen to a skhdgdjgfhjkdfhjsdf song"
wantToListen Jack (StringArtist "skhdgdjgfhjkdfhjsdf")

Song3> p "9ortge94yhjerh90fpersk is good"
isGood (StringArtist "9ortge94yhjerh90fpersk")
Song3> l isGood (StringArtist "Spice Girls")
Spice Girls is good
Song3> p "Backstreet Boys is good"
The parser failed at token 2: "Boys"
-----------------------
abstract Song = {
  flags startcat = Sentence ;
  cat
    Sentence ;
    Person ;
    Artist ;

  fun
    wantToListen : Person -> Artist -> Sentence ;
    Jack : Person ;
    Taylor, Ariana : Artist ;
}
concrete SongEng of Song = open SyntaxEng, ParadigmsEng, LexiconEng in {

  lincat
    Sentence = Utt ;
    Person = NP ;
    Artist = AP ; -- cheat in English

  lin
    -- : Person -> Artist -> Sentence ;
    wantToListen person artist =
      let artistsSong : CN = mkCN artist song_N ;
          listenToSong : VP = mkVP listen_V2 (mkNP a_Det artistsSong) ;
       in mkUtt (mkS (mkCl person want_VV listenToSong)) ;

    -- : Person
    Jack = mkNP (mkPN "Jack") ;

    -- : Artist
    Taylor = mkAP (mkA "Taylor") ;
    Ariana = mkAP (mkA "Ariana") ;
}
$ gf SongEng.gf
…
Song> gt | l -treebank
Song: wantToListen Jack Ariana
SongEng: Jack wants to listen to an Ariana song

Song: wantToListen Jack Taylor
SongEng: Jack wants to listen to a Taylor song
abstract Song2 = Song ** {
  flags startcat = Sentence ;
  fun
    TheBeatles : Artist ;
    isGood : Artist -> Sentence ;
}
concrete Song2Eng of Song2 = open SyntaxEng, ParadigmsEng, LexiconEng in {

  lincat
    Sentence = Utt ;
    Person = NP ;
    Artist = LinArtist ; -- {independent : NP ; modifier : AP}

  lin
    -- : Person -> Artist -> Sentence ;
    wantToListen person artist =
      let artistsSong : CN = mkCN artist.modifier song_N ;
          listenToSong : VP = mkVP listen_V2 (mkNP a_Det artistsSong) ;
       in mkUtt (mkS (mkCl person want_VV listenToSong)) ;

    -- : Artist -> Sentence
    isGood artist = mkUtt (mkS (mkCl artist.independent good_A)) ;

    -- : Person
    Jack = mkNP (mkPN "Jack") ;

    -- : Artist
    Taylor = mkArtist "Taylor" ;
    Ariana = mkArtist "Ariana" ;
    TheBeatles = mkArtist "The Beatles" "Beatles" ;

  oper
    LinArtist : Type = {independent : NP ; modifier : AP} ;
    mkArtist = overload {
      mkArtist : Str -> Str -> LinArtist = \thebeatles, beatles -> {
        independent = mkNP (mkPN thebeatles) ;
        modifier = mkAP (mkA beatles)
        } ;
      mkArtist : Str -> LinArtist = \taylor -> {
        independent = mkNP (mkN taylor) ;
        modifier = mkAP (mkA taylor)
        }
      } ;
}
Song2> gt | l
Ariana is good
Taylor is good
The Beatles is good
Jack wants to listen to an Ariana song
Jack wants to listen to a Taylor song
Jack wants to listen to a Beatles song
  oper
    mkArtist = overload {
      mkArtist : Str -> Str -> LinArtist = … ; -- same as before
      mkArtist : Str -> LinArtist = … ; -- same as before
      mkArtist : NP -> AP -> LinArtist = \thebeatles,beatles -> {
        independent = thebeatles ;
        modifier = beatles
        }
  lin
    TheBeatles =
      mkArtist
        (mkNP aPl_Det (mkN "The Beatles" "The Beatles"))
        (mkAP (mkA "Beatles")) ;
      } ;
Song2> l isGood TheBeatles 
The Beatles are good
abstract Song3 = Song2 ** {
  flags startcat = Sentence ;
  fun
    StringArtist : String -> Artist ;
}
concrete Song3Eng of Song3 = Song2Eng ** open SyntaxEng, LexiconEng, SymbolicEng in {
  lin
    -- : String -> Artist ;
    StringArtist string = {
      independent = symb string ; -- symb : String -> NP, from SymbolicEng
      modifier = <mkAP good_A : AP> ** {s = \\_ => string.s} -- hack
      } ;
}
Song3> p "Jack wants to listen to a skhdgdjgfhjkdfhjsdf song"
wantToListen Jack (StringArtist "skhdgdjgfhjkdfhjsdf")

Song3> p "9ortge94yhjerh90fpersk is good"
isGood (StringArtist "9ortge94yhjerh90fpersk")
Song3> l isGood (StringArtist "Spice Girls")
Spice Girls is good
Song3> p "Backstreet Boys is good"
The parser failed at token 2: "Boys"
-----------------------
abstract Song = {
  flags startcat = Sentence ;
  cat
    Sentence ;
    Person ;
    Artist ;

  fun
    wantToListen : Person -> Artist -> Sentence ;
    Jack : Person ;
    Taylor, Ariana : Artist ;
}
concrete SongEng of Song = open SyntaxEng, ParadigmsEng, LexiconEng in {

  lincat
    Sentence = Utt ;
    Person = NP ;
    Artist = AP ; -- cheat in English

  lin
    -- : Person -> Artist -> Sentence ;
    wantToListen person artist =
      let artistsSong : CN = mkCN artist song_N ;
          listenToSong : VP = mkVP listen_V2 (mkNP a_Det artistsSong) ;
       in mkUtt (mkS (mkCl person want_VV listenToSong)) ;

    -- : Person
    Jack = mkNP (mkPN "Jack") ;

    -- : Artist
    Taylor = mkAP (mkA "Taylor") ;
    Ariana = mkAP (mkA "Ariana") ;
}
$ gf SongEng.gf
…
Song> gt | l -treebank
Song: wantToListen Jack Ariana
SongEng: Jack wants to listen to an Ariana song

Song: wantToListen Jack Taylor
SongEng: Jack wants to listen to a Taylor song
abstract Song2 = Song ** {
  flags startcat = Sentence ;
  fun
    TheBeatles : Artist ;
    isGood : Artist -> Sentence ;
}
concrete Song2Eng of Song2 = open SyntaxEng, ParadigmsEng, LexiconEng in {

  lincat
    Sentence = Utt ;
    Person = NP ;
    Artist = LinArtist ; -- {independent : NP ; modifier : AP}

  lin
    -- : Person -> Artist -> Sentence ;
    wantToListen person artist =
      let artistsSong : CN = mkCN artist.modifier song_N ;
          listenToSong : VP = mkVP listen_V2 (mkNP a_Det artistsSong) ;
       in mkUtt (mkS (mkCl person want_VV listenToSong)) ;

    -- : Artist -> Sentence
    isGood artist = mkUtt (mkS (mkCl artist.independent good_A)) ;

    -- : Person
    Jack = mkNP (mkPN "Jack") ;

    -- : Artist
    Taylor = mkArtist "Taylor" ;
    Ariana = mkArtist "Ariana" ;
    TheBeatles = mkArtist "The Beatles" "Beatles" ;

  oper
    LinArtist : Type = {independent : NP ; modifier : AP} ;
    mkArtist = overload {
      mkArtist : Str -> Str -> LinArtist = \thebeatles, beatles -> {
        independent = mkNP (mkPN thebeatles) ;
        modifier = mkAP (mkA beatles)
        } ;
      mkArtist : Str -> LinArtist = \taylor -> {
        independent = mkNP (mkN taylor) ;
        modifier = mkAP (mkA taylor)
        }
      } ;
}
Song2> gt | l
Ariana is good
Taylor is good
The Beatles is good
Jack wants to listen to an Ariana song
Jack wants to listen to a Taylor song
Jack wants to listen to a Beatles song
  oper
    mkArtist = overload {
      mkArtist : Str -> Str -> LinArtist = … ; -- same as before
      mkArtist : Str -> LinArtist = … ; -- same as before
      mkArtist : NP -> AP -> LinArtist = \thebeatles,beatles -> {
        independent = thebeatles ;
        modifier = beatles
        }
  lin
    TheBeatles =
      mkArtist
        (mkNP aPl_Det (mkN "The Beatles" "The Beatles"))
        (mkAP (mkA "Beatles")) ;
      } ;
Song2> l isGood TheBeatles 
The Beatles are good
abstract Song3 = Song2 ** {
  flags startcat = Sentence ;
  fun
    StringArtist : String -> Artist ;
}
concrete Song3Eng of Song3 = Song2Eng ** open SyntaxEng, LexiconEng, SymbolicEng in {
  lin
    -- : String -> Artist ;
    StringArtist string = {
      independent = symb string ; -- symb : String -> NP, from SymbolicEng
      modifier = <mkAP good_A : AP> ** {s = \\_ => string.s} -- hack
      } ;
}
Song3> p "Jack wants to listen to a skhdgdjgfhjkdfhjsdf song"
wantToListen Jack (StringArtist "skhdgdjgfhjkdfhjsdf")

Song3> p "9ortge94yhjerh90fpersk is good"
isGood (StringArtist "9ortge94yhjerh90fpersk")
Song3> l isGood (StringArtist "Spice Girls")
Spice Girls is good
Song3> p "Backstreet Boys is good"
The parser failed at token 2: "Boys"
-----------------------
abstract Song = {
  flags startcat = Sentence ;
  cat
    Sentence ;
    Person ;
    Artist ;

  fun
    wantToListen : Person -> Artist -> Sentence ;
    Jack : Person ;
    Taylor, Ariana : Artist ;
}
concrete SongEng of Song = open SyntaxEng, ParadigmsEng, LexiconEng in {

  lincat
    Sentence = Utt ;
    Person = NP ;
    Artist = AP ; -- cheat in English

  lin
    -- : Person -> Artist -> Sentence ;
    wantToListen person artist =
      let artistsSong : CN = mkCN artist song_N ;
          listenToSong : VP = mkVP listen_V2 (mkNP a_Det artistsSong) ;
       in mkUtt (mkS (mkCl person want_VV listenToSong)) ;

    -- : Person
    Jack = mkNP (mkPN "Jack") ;

    -- : Artist
    Taylor = mkAP (mkA "Taylor") ;
    Ariana = mkAP (mkA "Ariana") ;
}
$ gf SongEng.gf
…
Song> gt | l -treebank
Song: wantToListen Jack Ariana
SongEng: Jack wants to listen to an Ariana song

Song: wantToListen Jack Taylor
SongEng: Jack wants to listen to a Taylor song
abstract Song2 = Song ** {
  flags startcat = Sentence ;
  fun
    TheBeatles : Artist ;
    isGood : Artist -> Sentence ;
}
concrete Song2Eng of Song2 = open SyntaxEng, ParadigmsEng, LexiconEng in {

  lincat
    Sentence = Utt ;
    Person = NP ;
    Artist = LinArtist ; -- {independent : NP ; modifier : AP}

  lin
    -- : Person -> Artist -> Sentence ;
    wantToListen person artist =
      let artistsSong : CN = mkCN artist.modifier song_N ;
          listenToSong : VP = mkVP listen_V2 (mkNP a_Det artistsSong) ;
       in mkUtt (mkS (mkCl person want_VV listenToSong)) ;

    -- : Artist -> Sentence
    isGood artist = mkUtt (mkS (mkCl artist.independent good_A)) ;

    -- : Person
    Jack = mkNP (mkPN "Jack") ;

    -- : Artist
    Taylor = mkArtist "Taylor" ;
    Ariana = mkArtist "Ariana" ;
    TheBeatles = mkArtist "The Beatles" "Beatles" ;

  oper
    LinArtist : Type = {independent : NP ; modifier : AP} ;
    mkArtist = overload {
      mkArtist : Str -> Str -> LinArtist = \thebeatles, beatles -> {
        independent = mkNP (mkPN thebeatles) ;
        modifier = mkAP (mkA beatles)
        } ;
      mkArtist : Str -> LinArtist = \taylor -> {
        independent = mkNP (mkN taylor) ;
        modifier = mkAP (mkA taylor)
        }
      } ;
}
Song2> gt | l
Ariana is good
Taylor is good
The Beatles is good
Jack wants to listen to an Ariana song
Jack wants to listen to a Taylor song
Jack wants to listen to a Beatles song
  oper
    mkArtist = overload {
      mkArtist : Str -> Str -> LinArtist = … ; -- same as before
      mkArtist : Str -> LinArtist = … ; -- same as before
      mkArtist : NP -> AP -> LinArtist = \thebeatles,beatles -> {
        independent = thebeatles ;
        modifier = beatles
        }
  lin
    TheBeatles =
      mkArtist
        (mkNP aPl_Det (mkN "The Beatles" "The Beatles"))
        (mkAP (mkA "Beatles")) ;
      } ;
Song2> l isGood TheBeatles 
The Beatles are good
abstract Song3 = Song2 ** {
  flags startcat = Sentence ;
  fun
    StringArtist : String -> Artist ;
}
concrete Song3Eng of Song3 = Song2Eng ** open SyntaxEng, LexiconEng, SymbolicEng in {
  lin
    -- : String -> Artist ;
    StringArtist string = {
      independent = symb string ; -- symb : String -> NP, from SymbolicEng
      modifier = <mkAP good_A : AP> ** {s = \\_ => string.s} -- hack
      } ;
}
Song3> p "Jack wants to listen to a skhdgdjgfhjkdfhjsdf song"
wantToListen Jack (StringArtist "skhdgdjgfhjkdfhjsdf")

Song3> p "9ortge94yhjerh90fpersk is good"
isGood (StringArtist "9ortge94yhjerh90fpersk")
Song3> l isGood (StringArtist "Spice Girls")
Spice Girls is good
Song3> p "Backstreet Boys is good"
The parser failed at token 2: "Boys"
-----------------------
abstract Song = {
  flags startcat = Sentence ;
  cat
    Sentence ;
    Person ;
    Artist ;

  fun
    wantToListen : Person -> Artist -> Sentence ;
    Jack : Person ;
    Taylor, Ariana : Artist ;
}
concrete SongEng of Song = open SyntaxEng, ParadigmsEng, LexiconEng in {

  lincat
    Sentence = Utt ;
    Person = NP ;
    Artist = AP ; -- cheat in English

  lin
    -- : Person -> Artist -> Sentence ;
    wantToListen person artist =
      let artistsSong : CN = mkCN artist song_N ;
          listenToSong : VP = mkVP listen_V2 (mkNP a_Det artistsSong) ;
       in mkUtt (mkS (mkCl person want_VV listenToSong)) ;

    -- : Person
    Jack = mkNP (mkPN "Jack") ;

    -- : Artist
    Taylor = mkAP (mkA "Taylor") ;
    Ariana = mkAP (mkA "Ariana") ;
}
$ gf SongEng.gf
…
Song> gt | l -treebank
Song: wantToListen Jack Ariana
SongEng: Jack wants to listen to an Ariana song

Song: wantToListen Jack Taylor
SongEng: Jack wants to listen to a Taylor song
abstract Song2 = Song ** {
  flags startcat = Sentence ;
  fun
    TheBeatles : Artist ;
    isGood : Artist -> Sentence ;
}
concrete Song2Eng of Song2 = open SyntaxEng, ParadigmsEng, LexiconEng in {

  lincat
    Sentence = Utt ;
    Person = NP ;
    Artist = LinArtist ; -- {independent : NP ; modifier : AP}

  lin
    -- : Person -> Artist -> Sentence ;
    wantToListen person artist =
      let artistsSong : CN = mkCN artist.modifier song_N ;
          listenToSong : VP = mkVP listen_V2 (mkNP a_Det artistsSong) ;
       in mkUtt (mkS (mkCl person want_VV listenToSong)) ;

    -- : Artist -> Sentence
    isGood artist = mkUtt (mkS (mkCl artist.independent good_A)) ;

    -- : Person
    Jack = mkNP (mkPN "Jack") ;

    -- : Artist
    Taylor = mkArtist "Taylor" ;
    Ariana = mkArtist "Ariana" ;
    TheBeatles = mkArtist "The Beatles" "Beatles" ;

  oper
    LinArtist : Type = {independent : NP ; modifier : AP} ;
    mkArtist = overload {
      mkArtist : Str -> Str -> LinArtist = \thebeatles, beatles -> {
        independent = mkNP (mkPN thebeatles) ;
        modifier = mkAP (mkA beatles)
        } ;
      mkArtist : Str -> LinArtist = \taylor -> {
        independent = mkNP (mkN taylor) ;
        modifier = mkAP (mkA taylor)
        }
      } ;
}
Song2> gt | l
Ariana is good
Taylor is good
The Beatles is good
Jack wants to listen to an Ariana song
Jack wants to listen to a Taylor song
Jack wants to listen to a Beatles song
  oper
    mkArtist = overload {
      mkArtist : Str -> Str -> LinArtist = … ; -- same as before
      mkArtist : Str -> LinArtist = … ; -- same as before
      mkArtist : NP -> AP -> LinArtist = \thebeatles,beatles -> {
        independent = thebeatles ;
        modifier = beatles
        }
  lin
    TheBeatles =
      mkArtist
        (mkNP aPl_Det (mkN "The Beatles" "The Beatles"))
        (mkAP (mkA "Beatles")) ;
      } ;
Song2> l isGood TheBeatles 
The Beatles are good
abstract Song3 = Song2 ** {
  flags startcat = Sentence ;
  fun
    StringArtist : String -> Artist ;
}
concrete Song3Eng of Song3 = Song2Eng ** open SyntaxEng, LexiconEng, SymbolicEng in {
  lin
    -- : String -> Artist ;
    StringArtist string = {
      independent = symb string ; -- symb : String -> NP, from SymbolicEng
      modifier = <mkAP good_A : AP> ** {s = \\_ => string.s} -- hack
      } ;
}
Song3> p "Jack wants to listen to a skhdgdjgfhjkdfhjsdf song"
wantToListen Jack (StringArtist "skhdgdjgfhjkdfhjsdf")

Song3> p "9ortge94yhjerh90fpersk is good"
isGood (StringArtist "9ortge94yhjerh90fpersk")
Song3> l isGood (StringArtist "Spice Girls")
Spice Girls is good
Song3> p "Backstreet Boys is good"
The parser failed at token 2: "Boys"
-----------------------
abstract Song = {
  flags startcat = Sentence ;
  cat
    Sentence ;
    Person ;
    Artist ;

  fun
    wantToListen : Person -> Artist -> Sentence ;
    Jack : Person ;
    Taylor, Ariana : Artist ;
}
concrete SongEng of Song = open SyntaxEng, ParadigmsEng, LexiconEng in {

  lincat
    Sentence = Utt ;
    Person = NP ;
    Artist = AP ; -- cheat in English

  lin
    -- : Person -> Artist -> Sentence ;
    wantToListen person artist =
      let artistsSong : CN = mkCN artist song_N ;
          listenToSong : VP = mkVP listen_V2 (mkNP a_Det artistsSong) ;
       in mkUtt (mkS (mkCl person want_VV listenToSong)) ;

    -- : Person
    Jack = mkNP (mkPN "Jack") ;

    -- : Artist
    Taylor = mkAP (mkA "Taylor") ;
    Ariana = mkAP (mkA "Ariana") ;
}
$ gf SongEng.gf
…
Song> gt | l -treebank
Song: wantToListen Jack Ariana
SongEng: Jack wants to listen to an Ariana song

Song: wantToListen Jack Taylor
SongEng: Jack wants to listen to a Taylor song
abstract Song2 = Song ** {
  flags startcat = Sentence ;
  fun
    TheBeatles : Artist ;
    isGood : Artist -> Sentence ;
}
concrete Song2Eng of Song2 = open SyntaxEng, ParadigmsEng, LexiconEng in {

  lincat
    Sentence = Utt ;
    Person = NP ;
    Artist = LinArtist ; -- {independent : NP ; modifier : AP}

  lin
    -- : Person -> Artist -> Sentence ;
    wantToListen person artist =
      let artistsSong : CN = mkCN artist.modifier song_N ;
          listenToSong : VP = mkVP listen_V2 (mkNP a_Det artistsSong) ;
       in mkUtt (mkS (mkCl person want_VV listenToSong)) ;

    -- : Artist -> Sentence
    isGood artist = mkUtt (mkS (mkCl artist.independent good_A)) ;

    -- : Person
    Jack = mkNP (mkPN "Jack") ;

    -- : Artist
    Taylor = mkArtist "Taylor" ;
    Ariana = mkArtist "Ariana" ;
    TheBeatles = mkArtist "The Beatles" "Beatles" ;

  oper
    LinArtist : Type = {independent : NP ; modifier : AP} ;
    mkArtist = overload {
      mkArtist : Str -> Str -> LinArtist = \thebeatles, beatles -> {
        independent = mkNP (mkPN thebeatles) ;
        modifier = mkAP (mkA beatles)
        } ;
      mkArtist : Str -> LinArtist = \taylor -> {
        independent = mkNP (mkN taylor) ;
        modifier = mkAP (mkA taylor)
        }
      } ;
}
Song2> gt | l
Ariana is good
Taylor is good
The Beatles is good
Jack wants to listen to an Ariana song
Jack wants to listen to a Taylor song
Jack wants to listen to a Beatles song
  oper
    mkArtist = overload {
      mkArtist : Str -> Str -> LinArtist = … ; -- same as before
      mkArtist : Str -> LinArtist = … ; -- same as before
      mkArtist : NP -> AP -> LinArtist = \thebeatles,beatles -> {
        independent = thebeatles ;
        modifier = beatles
        }
  lin
    TheBeatles =
      mkArtist
        (mkNP aPl_Det (mkN "The Beatles" "The Beatles"))
        (mkAP (mkA "Beatles")) ;
      } ;
Song2> l isGood TheBeatles 
The Beatles are good
abstract Song3 = Song2 ** {
  flags startcat = Sentence ;
  fun
    StringArtist : String -> Artist ;
}
concrete Song3Eng of Song3 = Song2Eng ** open SyntaxEng, LexiconEng, SymbolicEng in {
  lin
    -- : String -> Artist ;
    StringArtist string = {
      independent = symb string ; -- symb : String -> NP, from SymbolicEng
      modifier = <mkAP good_A : AP> ** {s = \\_ => string.s} -- hack
      } ;
}
Song3> p "Jack wants to listen to a skhdgdjgfhjkdfhjsdf song"
wantToListen Jack (StringArtist "skhdgdjgfhjkdfhjsdf")

Song3> p "9ortge94yhjerh90fpersk is good"
isGood (StringArtist "9ortge94yhjerh90fpersk")
Song3> l isGood (StringArtist "Spice Girls")
Spice Girls is good
Song3> p "Backstreet Boys is good"
The parser failed at token 2: "Boys"
-----------------------
abstract Song = {
  flags startcat = Sentence ;
  cat
    Sentence ;
    Person ;
    Artist ;

  fun
    wantToListen : Person -> Artist -> Sentence ;
    Jack : Person ;
    Taylor, Ariana : Artist ;
}
concrete SongEng of Song = open SyntaxEng, ParadigmsEng, LexiconEng in {

  lincat
    Sentence = Utt ;
    Person = NP ;
    Artist = AP ; -- cheat in English

  lin
    -- : Person -> Artist -> Sentence ;
    wantToListen person artist =
      let artistsSong : CN = mkCN artist song_N ;
          listenToSong : VP = mkVP listen_V2 (mkNP a_Det artistsSong) ;
       in mkUtt (mkS (mkCl person want_VV listenToSong)) ;

    -- : Person
    Jack = mkNP (mkPN "Jack") ;

    -- : Artist
    Taylor = mkAP (mkA "Taylor") ;
    Ariana = mkAP (mkA "Ariana") ;
}
$ gf SongEng.gf
…
Song> gt | l -treebank
Song: wantToListen Jack Ariana
SongEng: Jack wants to listen to an Ariana song

Song: wantToListen Jack Taylor
SongEng: Jack wants to listen to a Taylor song
abstract Song2 = Song ** {
  flags startcat = Sentence ;
  fun
    TheBeatles : Artist ;
    isGood : Artist -> Sentence ;
}
concrete Song2Eng of Song2 = open SyntaxEng, ParadigmsEng, LexiconEng in {

  lincat
    Sentence = Utt ;
    Person = NP ;
    Artist = LinArtist ; -- {independent : NP ; modifier : AP}

  lin
    -- : Person -> Artist -> Sentence ;
    wantToListen person artist =
      let artistsSong : CN = mkCN artist.modifier song_N ;
          listenToSong : VP = mkVP listen_V2 (mkNP a_Det artistsSong) ;
       in mkUtt (mkS (mkCl person want_VV listenToSong)) ;

    -- : Artist -> Sentence
    isGood artist = mkUtt (mkS (mkCl artist.independent good_A)) ;

    -- : Person
    Jack = mkNP (mkPN "Jack") ;

    -- : Artist
    Taylor = mkArtist "Taylor" ;
    Ariana = mkArtist "Ariana" ;
    TheBeatles = mkArtist "The Beatles" "Beatles" ;

  oper
    LinArtist : Type = {independent : NP ; modifier : AP} ;
    mkArtist = overload {
      mkArtist : Str -> Str -> LinArtist = \thebeatles, beatles -> {
        independent = mkNP (mkPN thebeatles) ;
        modifier = mkAP (mkA beatles)
        } ;
      mkArtist : Str -> LinArtist = \taylor -> {
        independent = mkNP (mkN taylor) ;
        modifier = mkAP (mkA taylor)
        }
      } ;
}
Song2> gt | l
Ariana is good
Taylor is good
The Beatles is good
Jack wants to listen to an Ariana song
Jack wants to listen to a Taylor song
Jack wants to listen to a Beatles song
  oper
    mkArtist = overload {
      mkArtist : Str -> Str -> LinArtist = … ; -- same as before
      mkArtist : Str -> LinArtist = … ; -- same as before
      mkArtist : NP -> AP -> LinArtist = \thebeatles,beatles -> {
        independent = thebeatles ;
        modifier = beatles
        }
  lin
    TheBeatles =
      mkArtist
        (mkNP aPl_Det (mkN "The Beatles" "The Beatles"))
        (mkAP (mkA "Beatles")) ;
      } ;
Song2> l isGood TheBeatles 
The Beatles are good
abstract Song3 = Song2 ** {
  flags startcat = Sentence ;
  fun
    StringArtist : String -> Artist ;
}
concrete Song3Eng of Song3 = Song2Eng ** open SyntaxEng, LexiconEng, SymbolicEng in {
  lin
    -- : String -> Artist ;
    StringArtist string = {
      independent = symb string ; -- symb : String -> NP, from SymbolicEng
      modifier = <mkAP good_A : AP> ** {s = \\_ => string.s} -- hack
      } ;
}
Song3> p "Jack wants to listen to a skhdgdjgfhjkdfhjsdf song"
wantToListen Jack (StringArtist "skhdgdjgfhjkdfhjsdf")

Song3> p "9ortge94yhjerh90fpersk is good"
isGood (StringArtist "9ortge94yhjerh90fpersk")
Song3> l isGood (StringArtist "Spice Girls")
Spice Girls is good
Song3> p "Backstreet Boys is good"
The parser failed at token 2: "Boys"
-----------------------
abstract Song = {
  flags startcat = Sentence ;
  cat
    Sentence ;
    Person ;
    Artist ;

  fun
    wantToListen : Person -> Artist -> Sentence ;
    Jack : Person ;
    Taylor, Ariana : Artist ;
}
concrete SongEng of Song = open SyntaxEng, ParadigmsEng, LexiconEng in {

  lincat
    Sentence = Utt ;
    Person = NP ;
    Artist = AP ; -- cheat in English

  lin
    -- : Person -> Artist -> Sentence ;
    wantToListen person artist =
      let artistsSong : CN = mkCN artist song_N ;
          listenToSong : VP = mkVP listen_V2 (mkNP a_Det artistsSong) ;
       in mkUtt (mkS (mkCl person want_VV listenToSong)) ;

    -- : Person
    Jack = mkNP (mkPN "Jack") ;

    -- : Artist
    Taylor = mkAP (mkA "Taylor") ;
    Ariana = mkAP (mkA "Ariana") ;
}
$ gf SongEng.gf
…
Song> gt | l -treebank
Song: wantToListen Jack Ariana
SongEng: Jack wants to listen to an Ariana song

Song: wantToListen Jack Taylor
SongEng: Jack wants to listen to a Taylor song
abstract Song2 = Song ** {
  flags startcat = Sentence ;
  fun
    TheBeatles : Artist ;
    isGood : Artist -> Sentence ;
}
concrete Song2Eng of Song2 = open SyntaxEng, ParadigmsEng, LexiconEng in {

  lincat
    Sentence = Utt ;
    Person = NP ;
    Artist = LinArtist ; -- {independent : NP ; modifier : AP}

  lin
    -- : Person -> Artist -> Sentence ;
    wantToListen person artist =
      let artistsSong : CN = mkCN artist.modifier song_N ;
          listenToSong : VP = mkVP listen_V2 (mkNP a_Det artistsSong) ;
       in mkUtt (mkS (mkCl person want_VV listenToSong)) ;

    -- : Artist -> Sentence
    isGood artist = mkUtt (mkS (mkCl artist.independent good_A)) ;

    -- : Person
    Jack = mkNP (mkPN "Jack") ;

    -- : Artist
    Taylor = mkArtist "Taylor" ;
    Ariana = mkArtist "Ariana" ;
    TheBeatles = mkArtist "The Beatles" "Beatles" ;

  oper
    LinArtist : Type = {independent : NP ; modifier : AP} ;
    mkArtist = overload {
      mkArtist : Str -> Str -> LinArtist = \thebeatles, beatles -> {
        independent = mkNP (mkPN thebeatles) ;
        modifier = mkAP (mkA beatles)
        } ;
      mkArtist : Str -> LinArtist = \taylor -> {
        independent = mkNP (mkN taylor) ;
        modifier = mkAP (mkA taylor)
        }
      } ;
}
Song2> gt | l
Ariana is good
Taylor is good
The Beatles is good
Jack wants to listen to an Ariana song
Jack wants to listen to a Taylor song
Jack wants to listen to a Beatles song
  oper
    mkArtist = overload {
      mkArtist : Str -> Str -> LinArtist = … ; -- same as before
      mkArtist : Str -> LinArtist = … ; -- same as before
      mkArtist : NP -> AP -> LinArtist = \thebeatles,beatles -> {
        independent = thebeatles ;
        modifier = beatles
        }
  lin
    TheBeatles =
      mkArtist
        (mkNP aPl_Det (mkN "The Beatles" "The Beatles"))
        (mkAP (mkA "Beatles")) ;
      } ;
Song2> l isGood TheBeatles 
The Beatles are good
abstract Song3 = Song2 ** {
  flags startcat = Sentence ;
  fun
    StringArtist : String -> Artist ;
}
concrete Song3Eng of Song3 = Song2Eng ** open SyntaxEng, LexiconEng, SymbolicEng in {
  lin
    -- : String -> Artist ;
    StringArtist string = {
      independent = symb string ; -- symb : String -> NP, from SymbolicEng
      modifier = <mkAP good_A : AP> ** {s = \\_ => string.s} -- hack
      } ;
}
Song3> p "Jack wants to listen to a skhdgdjgfhjkdfhjsdf song"
wantToListen Jack (StringArtist "skhdgdjgfhjkdfhjsdf")

Song3> p "9ortge94yhjerh90fpersk is good"
isGood (StringArtist "9ortge94yhjerh90fpersk")
Song3> l isGood (StringArtist "Spice Girls")
Spice Girls is good
Song3> p "Backstreet Boys is good"
The parser failed at token 2: "Boys"
-----------------------
abstract Song = {
  flags startcat = Sentence ;
  cat
    Sentence ;
    Person ;
    Artist ;

  fun
    wantToListen : Person -> Artist -> Sentence ;
    Jack : Person ;
    Taylor, Ariana : Artist ;
}
concrete SongEng of Song = open SyntaxEng, ParadigmsEng, LexiconEng in {

  lincat
    Sentence = Utt ;
    Person = NP ;
    Artist = AP ; -- cheat in English

  lin
    -- : Person -> Artist -> Sentence ;
    wantToListen person artist =
      let artistsSong : CN = mkCN artist song_N ;
          listenToSong : VP = mkVP listen_V2 (mkNP a_Det artistsSong) ;
       in mkUtt (mkS (mkCl person want_VV listenToSong)) ;

    -- : Person
    Jack = mkNP (mkPN "Jack") ;

    -- : Artist
    Taylor = mkAP (mkA "Taylor") ;
    Ariana = mkAP (mkA "Ariana") ;
}
$ gf SongEng.gf
…
Song> gt | l -treebank
Song: wantToListen Jack Ariana
SongEng: Jack wants to listen to an Ariana song

Song: wantToListen Jack Taylor
SongEng: Jack wants to listen to a Taylor song
abstract Song2 = Song ** {
  flags startcat = Sentence ;
  fun
    TheBeatles : Artist ;
    isGood : Artist -> Sentence ;
}
concrete Song2Eng of Song2 = open SyntaxEng, ParadigmsEng, LexiconEng in {

  lincat
    Sentence = Utt ;
    Person = NP ;
    Artist = LinArtist ; -- {independent : NP ; modifier : AP}

  lin
    -- : Person -> Artist -> Sentence ;
    wantToListen person artist =
      let artistsSong : CN = mkCN artist.modifier song_N ;
          listenToSong : VP = mkVP listen_V2 (mkNP a_Det artistsSong) ;
       in mkUtt (mkS (mkCl person want_VV listenToSong)) ;

    -- : Artist -> Sentence
    isGood artist = mkUtt (mkS (mkCl artist.independent good_A)) ;

    -- : Person
    Jack = mkNP (mkPN "Jack") ;

    -- : Artist
    Taylor = mkArtist "Taylor" ;
    Ariana = mkArtist "Ariana" ;
    TheBeatles = mkArtist "The Beatles" "Beatles" ;

  oper
    LinArtist : Type = {independent : NP ; modifier : AP} ;
    mkArtist = overload {
      mkArtist : Str -> Str -> LinArtist = \thebeatles, beatles -> {
        independent = mkNP (mkPN thebeatles) ;
        modifier = mkAP (mkA beatles)
        } ;
      mkArtist : Str -> LinArtist = \taylor -> {
        independent = mkNP (mkN taylor) ;
        modifier = mkAP (mkA taylor)
        }
      } ;
}
Song2> gt | l
Ariana is good
Taylor is good
The Beatles is good
Jack wants to listen to an Ariana song
Jack wants to listen to a Taylor song
Jack wants to listen to a Beatles song
  oper
    mkArtist = overload {
      mkArtist : Str -> Str -> LinArtist = … ; -- same as before
      mkArtist : Str -> LinArtist = … ; -- same as before
      mkArtist : NP -> AP -> LinArtist = \thebeatles,beatles -> {
        independent = thebeatles ;
        modifier = beatles
        }
  lin
    TheBeatles =
      mkArtist
        (mkNP aPl_Det (mkN "The Beatles" "The Beatles"))
        (mkAP (mkA "Beatles")) ;
      } ;
Song2> l isGood TheBeatles 
The Beatles are good
abstract Song3 = Song2 ** {
  flags startcat = Sentence ;
  fun
    StringArtist : String -> Artist ;
}
concrete Song3Eng of Song3 = Song2Eng ** open SyntaxEng, LexiconEng, SymbolicEng in {
  lin
    -- : String -> Artist ;
    StringArtist string = {
      independent = symb string ; -- symb : String -> NP, from SymbolicEng
      modifier = <mkAP good_A : AP> ** {s = \\_ => string.s} -- hack
      } ;
}
Song3> p "Jack wants to listen to a skhdgdjgfhjkdfhjsdf song"
wantToListen Jack (StringArtist "skhdgdjgfhjkdfhjsdf")

Song3> p "9ortge94yhjerh90fpersk is good"
isGood (StringArtist "9ortge94yhjerh90fpersk")
Song3> l isGood (StringArtist "Spice Girls")
Spice Girls is good
Song3> p "Backstreet Boys is good"
The parser failed at token 2: "Boys"

R: dynamic text annotation in rglwidget playwidget()

copy iconCopydownload iconDownload
library(rgl)
clear3d()

a1 <- c(spheres3d(xyz.coords(matrix(sample.int(100, 81), ncol = 3)), col="blue", radius = 2),
        text3d(10, 10, 10, "text1"))
a2 <- c(spheres3d(xyz.coords(matrix(sample.int(100, 27), ncol = 3)), col="red", radius = 2),
        text3d(30, 5, 5, "text2"))
a3 <- c(spheres3d(xyz.coords(matrix(sample.int(100, 9), ncol = 3)), col="green", radius = 2), 
        text3d(5, 5, 50, "text3"))

rglwidget() %>%
  playwidget(start = 0, stop = 2, interval = 1,
             components = c("Reverse", "Play", "Slower", "Faster",
                            "Reset", "Slider", "Label"),
             labels = c("a1", "a2", "a3"),
             subsetControl(1, subsets = list(aa=a1,bb=a2,cc=a3)))

Extending Determiners in GF

copy iconCopydownload iconDownload
somePlM_Det : Str -> Det =
     \str ->
          somePl_Det ** {s = table {_ => "alcuni"}};
    Det     = {
      s : Gender => Case => Str ;
      n : Number ;
      s2 : Str ;            -- -ci
      sp : Gender => Case => Str ;   -- substantival: mien, mienne
      isNeg : Bool -- negative element, e.g. aucun
      } ;
   somePlF_Det : Str -> Det =
        \str ->
             somePl_Det ** {s = table {_ => table {_ => "alcune"}}};
lincat 
  N = {s : Whatever => Str ; g : Gender} ;
lincat 
  Det, Quant, A, AP, RS ... = {s : Gender => Whatever => Str} ;
-- In the abstract syntax
fun
  Modify : Modifier -> Head -> Head ;

-- In the concrete syntax (different file)
lin
  Modify mod head = {
    s = \\x => mod.s ! head.g ! x ++ head.s ! x
    } ;
$ gf 
> i -retain -no-pmcfg LangIta.gf
> cc -unqual -table many_Det
s . Masc => Nom => molti
s . Masc => Acc => molti
s . Masc => CPrep P_di => di molti
s . Masc => CPrep P_a => a molti
s . Masc => CPrep P_da => da molti
s . Masc => CPrep P_in => in molti
s . Masc => CPrep P_su => su molti
s . Masc => CPrep P_con => con molti
s . Fem => Nom => molte
s . Fem => Acc => molte
s . Fem => CPrep P_di => di molte
s . Fem => CPrep P_a => a molte
s . Fem => CPrep P_da => da molte
s . Fem => CPrep P_in => in molte
s . Fem => CPrep P_su => su molte
s . Fem => CPrep P_con => con molte
> cc -one PrepNP in_Prep (DetCN many_Det (UseN house_N))
in molte case

> cc -one PrepNP with_Prep (DetCN many_Det (UseN cat_N))
con molti gatti
> cc -one PrepNP in_Prep (DetCN (DetQuant DefArt NumPl) (UseN house_N))
nelle case   -- not "in le case"

> cc -one PrepNP with_Prep (DetCN (DetQuant DefArt NumPl) (UseN cat_N))
coi gatti    -- not "con i gatti"
> cc -one PrepNP with_Prep (DetCN somePl_Det (UseN cat_N))
alcuni gatti   -- "with" is missing!

> cc -one PrepNP in_Prep (DetCN somePl_Det (UseN house_N))
alcuni case    -- "in" is missing, and no gender agreement!
  somePl_Det = {s,sp = \\g,c => prepCase c ++ genForms "alcuni" "alcune" ! g ; n = Pl ; s2 = [] ; isNeg = False} ;
> cc -one PrepNP in_Prep (DetCN somePl_Det (UseN house_N))
in alcune case

> cc -one PrepNP with_Prep (DetCN somePl_Det (UseN cat_N))
con alcuni gatti
-----------------------
somePlM_Det : Str -> Det =
     \str ->
          somePl_Det ** {s = table {_ => "alcuni"}};
    Det     = {
      s : Gender => Case => Str ;
      n : Number ;
      s2 : Str ;            -- -ci
      sp : Gender => Case => Str ;   -- substantival: mien, mienne
      isNeg : Bool -- negative element, e.g. aucun
      } ;
   somePlF_Det : Str -> Det =
        \str ->
             somePl_Det ** {s = table {_ => table {_ => "alcune"}}};
lincat 
  N = {s : Whatever => Str ; g : Gender} ;
lincat 
  Det, Quant, A, AP, RS ... = {s : Gender => Whatever => Str} ;
-- In the abstract syntax
fun
  Modify : Modifier -> Head -> Head ;

-- In the concrete syntax (different file)
lin
  Modify mod head = {
    s = \\x => mod.s ! head.g ! x ++ head.s ! x
    } ;
$ gf 
> i -retain -no-pmcfg LangIta.gf
> cc -unqual -table many_Det
s . Masc => Nom => molti
s . Masc => Acc => molti
s . Masc => CPrep P_di => di molti
s . Masc => CPrep P_a => a molti
s . Masc => CPrep P_da => da molti
s . Masc => CPrep P_in => in molti
s . Masc => CPrep P_su => su molti
s . Masc => CPrep P_con => con molti
s . Fem => Nom => molte
s . Fem => Acc => molte
s . Fem => CPrep P_di => di molte
s . Fem => CPrep P_a => a molte
s . Fem => CPrep P_da => da molte
s . Fem => CPrep P_in => in molte
s . Fem => CPrep P_su => su molte
s . Fem => CPrep P_con => con molte
> cc -one PrepNP in_Prep (DetCN many_Det (UseN house_N))
in molte case

> cc -one PrepNP with_Prep (DetCN many_Det (UseN cat_N))
con molti gatti
> cc -one PrepNP in_Prep (DetCN (DetQuant DefArt NumPl) (UseN house_N))
nelle case   -- not "in le case"

> cc -one PrepNP with_Prep (DetCN (DetQuant DefArt NumPl) (UseN cat_N))
coi gatti    -- not "con i gatti"
> cc -one PrepNP with_Prep (DetCN somePl_Det (UseN cat_N))
alcuni gatti   -- "with" is missing!

> cc -one PrepNP in_Prep (DetCN somePl_Det (UseN house_N))
alcuni case    -- "in" is missing, and no gender agreement!
  somePl_Det = {s,sp = \\g,c => prepCase c ++ genForms "alcuni" "alcune" ! g ; n = Pl ; s2 = [] ; isNeg = False} ;
> cc -one PrepNP in_Prep (DetCN somePl_Det (UseN house_N))
in alcune case

> cc -one PrepNP with_Prep (DetCN somePl_Det (UseN cat_N))
con alcuni gatti
-----------------------
somePlM_Det : Str -> Det =
     \str ->
          somePl_Det ** {s = table {_ => "alcuni"}};
    Det     = {
      s : Gender => Case => Str ;
      n : Number ;
      s2 : Str ;            -- -ci
      sp : Gender => Case => Str ;   -- substantival: mien, mienne
      isNeg : Bool -- negative element, e.g. aucun
      } ;
   somePlF_Det : Str -> Det =
        \str ->
             somePl_Det ** {s = table {_ => table {_ => "alcune"}}};
lincat 
  N = {s : Whatever => Str ; g : Gender} ;
lincat 
  Det, Quant, A, AP, RS ... = {s : Gender => Whatever => Str} ;
-- In the abstract syntax
fun
  Modify : Modifier -> Head -> Head ;

-- In the concrete syntax (different file)
lin
  Modify mod head = {
    s = \\x => mod.s ! head.g ! x ++ head.s ! x
    } ;
$ gf 
> i -retain -no-pmcfg LangIta.gf
> cc -unqual -table many_Det
s . Masc => Nom => molti
s . Masc => Acc => molti
s . Masc => CPrep P_di => di molti
s . Masc => CPrep P_a => a molti
s . Masc => CPrep P_da => da molti
s . Masc => CPrep P_in => in molti
s . Masc => CPrep P_su => su molti
s . Masc => CPrep P_con => con molti
s . Fem => Nom => molte
s . Fem => Acc => molte
s . Fem => CPrep P_di => di molte
s . Fem => CPrep P_a => a molte
s . Fem => CPrep P_da => da molte
s . Fem => CPrep P_in => in molte
s . Fem => CPrep P_su => su molte
s . Fem => CPrep P_con => con molte
> cc -one PrepNP in_Prep (DetCN many_Det (UseN house_N))
in molte case

> cc -one PrepNP with_Prep (DetCN many_Det (UseN cat_N))
con molti gatti
> cc -one PrepNP in_Prep (DetCN (DetQuant DefArt NumPl) (UseN house_N))
nelle case   -- not "in le case"

> cc -one PrepNP with_Prep (DetCN (DetQuant DefArt NumPl) (UseN cat_N))
coi gatti    -- not "con i gatti"
> cc -one PrepNP with_Prep (DetCN somePl_Det (UseN cat_N))
alcuni gatti   -- "with" is missing!

> cc -one PrepNP in_Prep (DetCN somePl_Det (UseN house_N))
alcuni case    -- "in" is missing, and no gender agreement!
  somePl_Det = {s,sp = \\g,c => prepCase c ++ genForms "alcuni" "alcune" ! g ; n = Pl ; s2 = [] ; isNeg = False} ;
> cc -one PrepNP in_Prep (DetCN somePl_Det (UseN house_N))
in alcune case

> cc -one PrepNP with_Prep (DetCN somePl_Det (UseN cat_N))
con alcuni gatti
-----------------------
somePlM_Det : Str -> Det =
     \str ->
          somePl_Det ** {s = table {_ => "alcuni"}};
    Det     = {
      s : Gender => Case => Str ;
      n : Number ;
      s2 : Str ;            -- -ci
      sp : Gender => Case => Str ;   -- substantival: mien, mienne
      isNeg : Bool -- negative element, e.g. aucun
      } ;
   somePlF_Det : Str -> Det =
        \str ->
             somePl_Det ** {s = table {_ => table {_ => "alcune"}}};
lincat 
  N = {s : Whatever => Str ; g : Gender} ;
lincat 
  Det, Quant, A, AP, RS ... = {s : Gender => Whatever => Str} ;
-- In the abstract syntax
fun
  Modify : Modifier -> Head -> Head ;

-- In the concrete syntax (different file)
lin
  Modify mod head = {
    s = \\x => mod.s ! head.g ! x ++ head.s ! x
    } ;
$ gf 
> i -retain -no-pmcfg LangIta.gf
> cc -unqual -table many_Det
s . Masc => Nom => molti
s . Masc => Acc => molti
s . Masc => CPrep P_di => di molti
s . Masc => CPrep P_a => a molti
s . Masc => CPrep P_da => da molti
s . Masc => CPrep P_in => in molti
s . Masc => CPrep P_su => su molti
s . Masc => CPrep P_con => con molti
s . Fem => Nom => molte
s . Fem => Acc => molte
s . Fem => CPrep P_di => di molte
s . Fem => CPrep P_a => a molte
s . Fem => CPrep P_da => da molte
s . Fem => CPrep P_in => in molte
s . Fem => CPrep P_su => su molte
s . Fem => CPrep P_con => con molte
> cc -one PrepNP in_Prep (DetCN many_Det (UseN house_N))
in molte case

> cc -one PrepNP with_Prep (DetCN many_Det (UseN cat_N))
con molti gatti
> cc -one PrepNP in_Prep (DetCN (DetQuant DefArt NumPl) (UseN house_N))
nelle case   -- not "in le case"

> cc -one PrepNP with_Prep (DetCN (DetQuant DefArt NumPl) (UseN cat_N))
coi gatti    -- not "con i gatti"
> cc -one PrepNP with_Prep (DetCN somePl_Det (UseN cat_N))
alcuni gatti   -- "with" is missing!

> cc -one PrepNP in_Prep (DetCN somePl_Det (UseN house_N))
alcuni case    -- "in" is missing, and no gender agreement!
  somePl_Det = {s,sp = \\g,c => prepCase c ++ genForms "alcuni" "alcune" ! g ; n = Pl ; s2 = [] ; isNeg = False} ;
> cc -one PrepNP in_Prep (DetCN somePl_Det (UseN house_N))
in alcune case

> cc -one PrepNP with_Prep (DetCN somePl_Det (UseN cat_N))
con alcuni gatti
-----------------------
somePlM_Det : Str -> Det =
     \str ->
          somePl_Det ** {s = table {_ => "alcuni"}};
    Det     = {
      s : Gender => Case => Str ;
      n : Number ;
      s2 : Str ;            -- -ci
      sp : Gender => Case => Str ;   -- substantival: mien, mienne
      isNeg : Bool -- negative element, e.g. aucun
      } ;
   somePlF_Det : Str -> Det =
        \str ->
             somePl_Det ** {s = table {_ => table {_ => "alcune"}}};
lincat 
  N = {s : Whatever => Str ; g : Gender} ;
lincat 
  Det, Quant, A, AP, RS ... = {s : Gender => Whatever => Str} ;
-- In the abstract syntax
fun
  Modify : Modifier -> Head -> Head ;

-- In the concrete syntax (different file)
lin
  Modify mod head = {
    s = \\x => mod.s ! head.g ! x ++ head.s ! x
    } ;
$ gf 
> i -retain -no-pmcfg LangIta.gf
> cc -unqual -table many_Det
s . Masc => Nom => molti
s . Masc => Acc => molti
s . Masc => CPrep P_di => di molti
s . Masc => CPrep P_a => a molti
s . Masc => CPrep P_da => da molti
s . Masc => CPrep P_in => in molti
s . Masc => CPrep P_su => su molti
s . Masc => CPrep P_con => con molti
s . Fem => Nom => molte
s . Fem => Acc => molte
s . Fem => CPrep P_di => di molte
s . Fem => CPrep P_a => a molte
s . Fem => CPrep P_da => da molte
s . Fem => CPrep P_in => in molte
s . Fem => CPrep P_su => su molte
s . Fem => CPrep P_con => con molte
> cc -one PrepNP in_Prep (DetCN many_Det (UseN house_N))
in molte case

> cc -one PrepNP with_Prep (DetCN many_Det (UseN cat_N))
con molti gatti
> cc -one PrepNP in_Prep (DetCN (DetQuant DefArt NumPl) (UseN house_N))
nelle case   -- not "in le case"

> cc -one PrepNP with_Prep (DetCN (DetQuant DefArt NumPl) (UseN cat_N))
coi gatti    -- not "con i gatti"
> cc -one PrepNP with_Prep (DetCN somePl_Det (UseN cat_N))
alcuni gatti   -- "with" is missing!

> cc -one PrepNP in_Prep (DetCN somePl_Det (UseN house_N))
alcuni case    -- "in" is missing, and no gender agreement!
  somePl_Det = {s,sp = \\g,c => prepCase c ++ genForms "alcuni" "alcune" ! g ; n = Pl ; s2 = [] ; isNeg = False} ;
> cc -one PrepNP in_Prep (DetCN somePl_Det (UseN house_N))
in alcune case

> cc -one PrepNP with_Prep (DetCN somePl_Det (UseN cat_N))
con alcuni gatti
-----------------------
somePlM_Det : Str -> Det =
     \str ->
          somePl_Det ** {s = table {_ => "alcuni"}};
    Det     = {
      s : Gender => Case => Str ;
      n : Number ;
      s2 : Str ;            -- -ci
      sp : Gender => Case => Str ;   -- substantival: mien, mienne
      isNeg : Bool -- negative element, e.g. aucun
      } ;
   somePlF_Det : Str -> Det =
        \str ->
             somePl_Det ** {s = table {_ => table {_ => "alcune"}}};
lincat 
  N = {s : Whatever => Str ; g : Gender} ;
lincat 
  Det, Quant, A, AP, RS ... = {s : Gender => Whatever => Str} ;
-- In the abstract syntax
fun
  Modify : Modifier -> Head -> Head ;

-- In the concrete syntax (different file)
lin
  Modify mod head = {
    s = \\x => mod.s ! head.g ! x ++ head.s ! x
    } ;
$ gf 
> i -retain -no-pmcfg LangIta.gf
> cc -unqual -table many_Det
s . Masc => Nom => molti
s . Masc => Acc => molti
s . Masc => CPrep P_di => di molti
s . Masc => CPrep P_a => a molti
s . Masc => CPrep P_da => da molti
s . Masc => CPrep P_in => in molti
s . Masc => CPrep P_su => su molti
s . Masc => CPrep P_con => con molti
s . Fem => Nom => molte
s . Fem => Acc => molte
s . Fem => CPrep P_di => di molte
s . Fem => CPrep P_a => a molte
s . Fem => CPrep P_da => da molte
s . Fem => CPrep P_in => in molte
s . Fem => CPrep P_su => su molte
s . Fem => CPrep P_con => con molte
> cc -one PrepNP in_Prep (DetCN many_Det (UseN house_N))
in molte case

> cc -one PrepNP with_Prep (DetCN many_Det (UseN cat_N))
con molti gatti
> cc -one PrepNP in_Prep (DetCN (DetQuant DefArt NumPl) (UseN house_N))
nelle case   -- not "in le case"

> cc -one PrepNP with_Prep (DetCN (DetQuant DefArt NumPl) (UseN cat_N))
coi gatti    -- not "con i gatti"
> cc -one PrepNP with_Prep (DetCN somePl_Det (UseN cat_N))
alcuni gatti   -- "with" is missing!

> cc -one PrepNP in_Prep (DetCN somePl_Det (UseN house_N))
alcuni case    -- "in" is missing, and no gender agreement!
  somePl_Det = {s,sp = \\g,c => prepCase c ++ genForms "alcuni" "alcune" ! g ; n = Pl ; s2 = [] ; isNeg = False} ;
> cc -one PrepNP in_Prep (DetCN somePl_Det (UseN house_N))
in alcune case

> cc -one PrepNP with_Prep (DetCN somePl_Det (UseN cat_N))
con alcuni gatti
-----------------------
somePlM_Det : Str -> Det =
     \str ->
          somePl_Det ** {s = table {_ => "alcuni"}};
    Det     = {
      s : Gender => Case => Str ;
      n : Number ;
      s2 : Str ;            -- -ci
      sp : Gender => Case => Str ;   -- substantival: mien, mienne
      isNeg : Bool -- negative element, e.g. aucun
      } ;
   somePlF_Det : Str -> Det =
        \str ->
             somePl_Det ** {s = table {_ => table {_ => "alcune"}}};
lincat 
  N = {s : Whatever => Str ; g : Gender} ;
lincat 
  Det, Quant, A, AP, RS ... = {s : Gender => Whatever => Str} ;
-- In the abstract syntax
fun
  Modify : Modifier -> Head -> Head ;

-- In the concrete syntax (different file)
lin
  Modify mod head = {
    s = \\x => mod.s ! head.g ! x ++ head.s ! x
    } ;
$ gf 
> i -retain -no-pmcfg LangIta.gf
> cc -unqual -table many_Det
s . Masc => Nom => molti
s . Masc => Acc => molti
s . Masc => CPrep P_di => di molti
s . Masc => CPrep P_a => a molti
s . Masc => CPrep P_da => da molti
s . Masc => CPrep P_in => in molti
s . Masc => CPrep P_su => su molti
s . Masc => CPrep P_con => con molti
s . Fem => Nom => molte
s . Fem => Acc => molte
s . Fem => CPrep P_di => di molte
s . Fem => CPrep P_a => a molte
s . Fem => CPrep P_da => da molte
s . Fem => CPrep P_in => in molte
s . Fem => CPrep P_su => su molte
s . Fem => CPrep P_con => con molte
> cc -one PrepNP in_Prep (DetCN many_Det (UseN house_N))
in molte case

> cc -one PrepNP with_Prep (DetCN many_Det (UseN cat_N))
con molti gatti
> cc -one PrepNP in_Prep (DetCN (DetQuant DefArt NumPl) (UseN house_N))
nelle case   -- not "in le case"

> cc -one PrepNP with_Prep (DetCN (DetQuant DefArt NumPl) (UseN cat_N))
coi gatti    -- not "con i gatti"
> cc -one PrepNP with_Prep (DetCN somePl_Det (UseN cat_N))
alcuni gatti   -- "with" is missing!

> cc -one PrepNP in_Prep (DetCN somePl_Det (UseN house_N))
alcuni case    -- "in" is missing, and no gender agreement!
  somePl_Det = {s,sp = \\g,c => prepCase c ++ genForms "alcuni" "alcune" ! g ; n = Pl ; s2 = [] ; isNeg = False} ;
> cc -one PrepNP in_Prep (DetCN somePl_Det (UseN house_N))
in alcune case

> cc -one PrepNP with_Prep (DetCN somePl_Det (UseN cat_N))
con alcuni gatti
-----------------------
somePlM_Det : Str -> Det =
     \str ->
          somePl_Det ** {s = table {_ => "alcuni"}};
    Det     = {
      s : Gender => Case => Str ;
      n : Number ;
      s2 : Str ;            -- -ci
      sp : Gender => Case => Str ;   -- substantival: mien, mienne
      isNeg : Bool -- negative element, e.g. aucun
      } ;
   somePlF_Det : Str -> Det =
        \str ->
             somePl_Det ** {s = table {_ => table {_ => "alcune"}}};
lincat 
  N = {s : Whatever => Str ; g : Gender} ;
lincat 
  Det, Quant, A, AP, RS ... = {s : Gender => Whatever => Str} ;
-- In the abstract syntax
fun
  Modify : Modifier -> Head -> Head ;

-- In the concrete syntax (different file)
lin
  Modify mod head = {
    s = \\x => mod.s ! head.g ! x ++ head.s ! x
    } ;
$ gf 
> i -retain -no-pmcfg LangIta.gf
> cc -unqual -table many_Det
s . Masc => Nom => molti
s . Masc => Acc => molti
s . Masc => CPrep P_di => di molti
s . Masc => CPrep P_a => a molti
s . Masc => CPrep P_da => da molti
s . Masc => CPrep P_in => in molti
s . Masc => CPrep P_su => su molti
s . Masc => CPrep P_con => con molti
s . Fem => Nom => molte
s . Fem => Acc => molte
s . Fem => CPrep P_di => di molte
s . Fem => CPrep P_a => a molte
s . Fem => CPrep P_da => da molte
s . Fem => CPrep P_in => in molte
s . Fem => CPrep P_su => su molte
s . Fem => CPrep P_con => con molte
> cc -one PrepNP in_Prep (DetCN many_Det (UseN house_N))
in molte case

> cc -one PrepNP with_Prep (DetCN many_Det (UseN cat_N))
con molti gatti
> cc -one PrepNP in_Prep (DetCN (DetQuant DefArt NumPl) (UseN house_N))
nelle case   -- not "in le case"

> cc -one PrepNP with_Prep (DetCN (DetQuant DefArt NumPl) (UseN cat_N))
coi gatti    -- not "con i gatti"
> cc -one PrepNP with_Prep (DetCN somePl_Det (UseN cat_N))
alcuni gatti   -- "with" is missing!

> cc -one PrepNP in_Prep (DetCN somePl_Det (UseN house_N))
alcuni case    -- "in" is missing, and no gender agreement!
  somePl_Det = {s,sp = \\g,c => prepCase c ++ genForms "alcuni" "alcune" ! g ; n = Pl ; s2 = [] ; isNeg = False} ;
> cc -one PrepNP in_Prep (DetCN somePl_Det (UseN house_N))
in alcune case

> cc -one PrepNP with_Prep (DetCN somePl_Det (UseN cat_N))
con alcuni gatti
-----------------------
somePlM_Det : Str -> Det =
     \str ->
          somePl_Det ** {s = table {_ => "alcuni"}};
    Det     = {
      s : Gender => Case => Str ;
      n : Number ;
      s2 : Str ;            -- -ci
      sp : Gender => Case => Str ;   -- substantival: mien, mienne
      isNeg : Bool -- negative element, e.g. aucun
      } ;
   somePlF_Det : Str -> Det =
        \str ->
             somePl_Det ** {s = table {_ => table {_ => "alcune"}}};
lincat 
  N = {s : Whatever => Str ; g : Gender} ;
lincat 
  Det, Quant, A, AP, RS ... = {s : Gender => Whatever => Str} ;
-- In the abstract syntax
fun
  Modify : Modifier -> Head -> Head ;

-- In the concrete syntax (different file)
lin
  Modify mod head = {
    s = \\x => mod.s ! head.g ! x ++ head.s ! x
    } ;
$ gf 
> i -retain -no-pmcfg LangIta.gf
> cc -unqual -table many_Det
s . Masc => Nom => molti
s . Masc => Acc => molti
s . Masc => CPrep P_di => di molti
s . Masc => CPrep P_a => a molti
s . Masc => CPrep P_da => da molti
s . Masc => CPrep P_in => in molti
s . Masc => CPrep P_su => su molti
s . Masc => CPrep P_con => con molti
s . Fem => Nom => molte
s . Fem => Acc => molte
s . Fem => CPrep P_di => di molte
s . Fem => CPrep P_a => a molte
s . Fem => CPrep P_da => da molte
s . Fem => CPrep P_in => in molte
s . Fem => CPrep P_su => su molte
s . Fem => CPrep P_con => con molte
> cc -one PrepNP in_Prep (DetCN many_Det (UseN house_N))
in molte case

> cc -one PrepNP with_Prep (DetCN many_Det (UseN cat_N))
con molti gatti
> cc -one PrepNP in_Prep (DetCN (DetQuant DefArt NumPl) (UseN house_N))
nelle case   -- not "in le case"

> cc -one PrepNP with_Prep (DetCN (DetQuant DefArt NumPl) (UseN cat_N))
coi gatti    -- not "con i gatti"
> cc -one PrepNP with_Prep (DetCN somePl_Det (UseN cat_N))
alcuni gatti   -- "with" is missing!

> cc -one PrepNP in_Prep (DetCN somePl_Det (UseN house_N))
alcuni case    -- "in" is missing, and no gender agreement!
  somePl_Det = {s,sp = \\g,c => prepCase c ++ genForms "alcuni" "alcune" ! g ; n = Pl ; s2 = [] ; isNeg = False} ;
> cc -one PrepNP in_Prep (DetCN somePl_Det (UseN house_N))
in alcune case

> cc -one PrepNP with_Prep (DetCN somePl_Det (UseN cat_N))
con alcuni gatti
-----------------------
somePlM_Det : Str -> Det =
     \str ->
          somePl_Det ** {s = table {_ => "alcuni"}};
    Det     = {
      s : Gender => Case => Str ;
      n : Number ;
      s2 : Str ;            -- -ci
      sp : Gender => Case => Str ;   -- substantival: mien, mienne
      isNeg : Bool -- negative element, e.g. aucun
      } ;
   somePlF_Det : Str -> Det =
        \str ->
             somePl_Det ** {s = table {_ => table {_ => "alcune"}}};
lincat 
  N = {s : Whatever => Str ; g : Gender} ;
lincat 
  Det, Quant, A, AP, RS ... = {s : Gender => Whatever => Str} ;
-- In the abstract syntax
fun
  Modify : Modifier -> Head -> Head ;

-- In the concrete syntax (different file)
lin
  Modify mod head = {
    s = \\x => mod.s ! head.g ! x ++ head.s ! x
    } ;
$ gf 
> i -retain -no-pmcfg LangIta.gf
> cc -unqual -table many_Det
s . Masc => Nom => molti
s . Masc => Acc => molti
s . Masc => CPrep P_di => di molti
s . Masc => CPrep P_a => a molti
s . Masc => CPrep P_da => da molti
s . Masc => CPrep P_in => in molti
s . Masc => CPrep P_su => su molti
s . Masc => CPrep P_con => con molti
s . Fem => Nom => molte
s . Fem => Acc => molte
s . Fem => CPrep P_di => di molte
s . Fem => CPrep P_a => a molte
s . Fem => CPrep P_da => da molte
s . Fem => CPrep P_in => in molte
s . Fem => CPrep P_su => su molte
s . Fem => CPrep P_con => con molte
> cc -one PrepNP in_Prep (DetCN many_Det (UseN house_N))
in molte case

> cc -one PrepNP with_Prep (DetCN many_Det (UseN cat_N))
con molti gatti
> cc -one PrepNP in_Prep (DetCN (DetQuant DefArt NumPl) (UseN house_N))
nelle case   -- not "in le case"

> cc -one PrepNP with_Prep (DetCN (DetQuant DefArt NumPl) (UseN cat_N))
coi gatti    -- not "con i gatti"
> cc -one PrepNP with_Prep (DetCN somePl_Det (UseN cat_N))
alcuni gatti   -- "with" is missing!

> cc -one PrepNP in_Prep (DetCN somePl_Det (UseN house_N))
alcuni case    -- "in" is missing, and no gender agreement!
  somePl_Det = {s,sp = \\g,c => prepCase c ++ genForms "alcuni" "alcune" ! g ; n = Pl ; s2 = [] ; isNeg = False} ;
> cc -one PrepNP in_Prep (DetCN somePl_Det (UseN house_N))
in alcune case

> cc -one PrepNP with_Prep (DetCN somePl_Det (UseN cat_N))
con alcuni gatti
-----------------------
somePlM_Det : Str -> Det =
     \str ->
          somePl_Det ** {s = table {_ => "alcuni"}};
    Det     = {
      s : Gender => Case => Str ;
      n : Number ;
      s2 : Str ;            -- -ci
      sp : Gender => Case => Str ;   -- substantival: mien, mienne
      isNeg : Bool -- negative element, e.g. aucun
      } ;
   somePlF_Det : Str -> Det =
        \str ->
             somePl_Det ** {s = table {_ => table {_ => "alcune"}}};
lincat 
  N = {s : Whatever => Str ; g : Gender} ;
lincat 
  Det, Quant, A, AP, RS ... = {s : Gender => Whatever => Str} ;
-- In the abstract syntax
fun
  Modify : Modifier -> Head -> Head ;

-- In the concrete syntax (different file)
lin
  Modify mod head = {
    s = \\x => mod.s ! head.g ! x ++ head.s ! x
    } ;
$ gf 
> i -retain -no-pmcfg LangIta.gf
> cc -unqual -table many_Det
s . Masc => Nom => molti
s . Masc => Acc => molti
s . Masc => CPrep P_di => di molti
s . Masc => CPrep P_a => a molti
s . Masc => CPrep P_da => da molti
s . Masc => CPrep P_in => in molti
s . Masc => CPrep P_su => su molti
s . Masc => CPrep P_con => con molti
s . Fem => Nom => molte
s . Fem => Acc => molte
s . Fem => CPrep P_di => di molte
s . Fem => CPrep P_a => a molte
s . Fem => CPrep P_da => da molte
s . Fem => CPrep P_in => in molte
s . Fem => CPrep P_su => su molte
s . Fem => CPrep P_con => con molte
> cc -one PrepNP in_Prep (DetCN many_Det (UseN house_N))
in molte case

> cc -one PrepNP with_Prep (DetCN many_Det (UseN cat_N))
con molti gatti
> cc -one PrepNP in_Prep (DetCN (DetQuant DefArt NumPl) (UseN house_N))
nelle case   -- not "in le case"

> cc -one PrepNP with_Prep (DetCN (DetQuant DefArt NumPl) (UseN cat_N))
coi gatti    -- not "con i gatti"
> cc -one PrepNP with_Prep (DetCN somePl_Det (UseN cat_N))
alcuni gatti   -- "with" is missing!

> cc -one PrepNP in_Prep (DetCN somePl_Det (UseN house_N))
alcuni case    -- "in" is missing, and no gender agreement!
  somePl_Det = {s,sp = \\g,c => prepCase c ++ genForms "alcuni" "alcune" ! g ; n = Pl ; s2 = [] ; isNeg = False} ;
> cc -one PrepNP in_Prep (DetCN somePl_Det (UseN house_N))
in alcune case

> cc -one PrepNP with_Prep (DetCN somePl_Det (UseN cat_N))
con alcuni gatti
-----------------------
somePlM_Det : Str -> Det =
     \str ->
          somePl_Det ** {s = table {_ => "alcuni"}};
    Det     = {
      s : Gender => Case => Str ;
      n : Number ;
      s2 : Str ;            -- -ci
      sp : Gender => Case => Str ;   -- substantival: mien, mienne
      isNeg : Bool -- negative element, e.g. aucun
      } ;
   somePlF_Det : Str -> Det =
        \str ->
             somePl_Det ** {s = table {_ => table {_ => "alcune"}}};
lincat 
  N = {s : Whatever => Str ; g : Gender} ;
lincat 
  Det, Quant, A, AP, RS ... = {s : Gender => Whatever => Str} ;
-- In the abstract syntax
fun
  Modify : Modifier -> Head -> Head ;

-- In the concrete syntax (different file)
lin
  Modify mod head = {
    s = \\x => mod.s ! head.g ! x ++ head.s ! x
    } ;
$ gf 
> i -retain -no-pmcfg LangIta.gf
> cc -unqual -table many_Det
s . Masc => Nom => molti
s . Masc => Acc => molti
s . Masc => CPrep P_di => di molti
s . Masc => CPrep P_a => a molti
s . Masc => CPrep P_da => da molti
s . Masc => CPrep P_in => in molti
s . Masc => CPrep P_su => su molti
s . Masc => CPrep P_con => con molti
s . Fem => Nom => molte
s . Fem => Acc => molte
s . Fem => CPrep P_di => di molte
s . Fem => CPrep P_a => a molte
s . Fem => CPrep P_da => da molte
s . Fem => CPrep P_in => in molte
s . Fem => CPrep P_su => su molte
s . Fem => CPrep P_con => con molte
> cc -one PrepNP in_Prep (DetCN many_Det (UseN house_N))
in molte case

> cc -one PrepNP with_Prep (DetCN many_Det (UseN cat_N))
con molti gatti
> cc -one PrepNP in_Prep (DetCN (DetQuant DefArt NumPl) (UseN house_N))
nelle case   -- not "in le case"

> cc -one PrepNP with_Prep (DetCN (DetQuant DefArt NumPl) (UseN cat_N))
coi gatti    -- not "con i gatti"
> cc -one PrepNP with_Prep (DetCN somePl_Det (UseN cat_N))
alcuni gatti   -- "with" is missing!

> cc -one PrepNP in_Prep (DetCN somePl_Det (UseN house_N))
alcuni case    -- "in" is missing, and no gender agreement!
  somePl_Det = {s,sp = \\g,c => prepCase c ++ genForms "alcuni" "alcune" ! g ; n = Pl ; s2 = [] ; isNeg = False} ;
> cc -one PrepNP in_Prep (DetCN somePl_Det (UseN house_N))
in alcune case

> cc -one PrepNP with_Prep (DetCN somePl_Det (UseN cat_N))
con alcuni gatti

How can I see dates plot3D in R instead of 5 - digit integers

copy iconCopydownload iconDownload
df <- data.frame(Date = seq(as.Date("2016-02-29"), as.Date("2019-01-01"), length=100),
                 y = rnorm(100),
                 z = rnorm(100))
library(rgl)
plot3d(df, axes = FALSE)
ticks <- pretty(df$Date, 3)
labels <- format(ticks, format = "%Y-%m")
axis3d("x", at = ticks, labels = labels) # Custom on x axis
axes3d(c("y", "z"))                      # Defaults on other axes 
box3d()

R rgl library planes3d() function not displaying planes in rgl widget window

copy iconCopydownload iconDownload
library(rgl)
library(magrittr)
axes3d()
cube3d(color="black", alpha=0.1) %>% scale3d(4,4,4) %>% wire3d
planes3d(1, 0, 0, 3, col='red',alpha=1)

Spanish verbs with NP in GF

copy iconCopydownload iconDownload
Sentence =
  let vendeme : VP = mkVP <sell_V3 : V2> i_NP ; -- hack: pretend that i_NP is direct object, to get vendeme. (Unfortunately no é on véndeme.)
      esto : Adv = ParadigmsSpa.mkAdv "esto" ; -- hack: make "esto" into an adverb
   in mkUtt (mkImp (mkVP vendeme esto)) ; -- using mkVP : VP -> Adv -> VP
> l Sentence
vende &+ me esto
> l -bind Sentence
vendeme esto
Lang> gt ImpVP (ComplSlash (Slash3V3 sell_V3 (UsePron ?)) (UsePron ?)) | l
vende &+ la le
vende &+ la les
vende &+ la me
...
vende &+ te nos
vende &+ te os
vende &+ te te
-----------------------
Sentence =
  let vendeme : VP = mkVP <sell_V3 : V2> i_NP ; -- hack: pretend that i_NP is direct object, to get vendeme. (Unfortunately no é on véndeme.)
      esto : Adv = ParadigmsSpa.mkAdv "esto" ; -- hack: make "esto" into an adverb
   in mkUtt (mkImp (mkVP vendeme esto)) ; -- using mkVP : VP -> Adv -> VP
> l Sentence
vende &+ me esto
> l -bind Sentence
vendeme esto
Lang> gt ImpVP (ComplSlash (Slash3V3 sell_V3 (UsePron ?)) (UsePron ?)) | l
vende &+ la le
vende &+ la les
vende &+ la me
...
vende &+ te nos
vende &+ te os
vende &+ te te
-----------------------
Sentence =
  let vendeme : VP = mkVP <sell_V3 : V2> i_NP ; -- hack: pretend that i_NP is direct object, to get vendeme. (Unfortunately no é on véndeme.)
      esto : Adv = ParadigmsSpa.mkAdv "esto" ; -- hack: make "esto" into an adverb
   in mkUtt (mkImp (mkVP vendeme esto)) ; -- using mkVP : VP -> Adv -> VP
> l Sentence
vende &+ me esto
> l -bind Sentence
vendeme esto
Lang> gt ImpVP (ComplSlash (Slash3V3 sell_V3 (UsePron ?)) (UsePron ?)) | l
vende &+ la le
vende &+ la les
vende &+ la me
...
vende &+ te nos
vende &+ te os
vende &+ te te
-----------------------
Sentence =
  let vendeme : VP = mkVP <sell_V3 : V2> i_NP ; -- hack: pretend that i_NP is direct object, to get vendeme. (Unfortunately no é on véndeme.)
      esto : Adv = ParadigmsSpa.mkAdv "esto" ; -- hack: make "esto" into an adverb
   in mkUtt (mkImp (mkVP vendeme esto)) ; -- using mkVP : VP -> Adv -> VP
> l Sentence
vende &+ me esto
> l -bind Sentence
vendeme esto
Lang> gt ImpVP (ComplSlash (Slash3V3 sell_V3 (UsePron ?)) (UsePron ?)) | l
vende &+ la le
vende &+ la les
vende &+ la me
...
vende &+ te nos
vende &+ te os
vende &+ te te

Community Discussions

Trending Discussions on rgl
  • Plotting a simple plane in 3D
  • Using Fractions in GF
  • how to draw part of a cone in rgl?
  • Installing rgl package in R Mac OS via R-CMD-check
  • R: rgl link multiple plots to a single widget
  • Proper names with determiners in GF
  • R: dynamic text annotation in rglwidget playwidget()
  • Extending Determiners in GF
  • How can I see dates plot3D in R instead of 5 - digit integers
  • R rgl library planes3d() function not displaying planes in rgl widget window
Trending Discussions on rgl

QUESTION

Plotting a simple plane in 3D

Asked 2021-May-22 at 11:54

I am trying to plot a plane in a 3D environment in the context of a multivariate regression. I have a linear regression polynomial in the form of f(x)=beta_1 + beta_2*x_1 + beta_3 * x_3.

Obviously this formula describes a plane in R^3. I would like to plot this, but I fail to see how to do this efficiently. Obviously, what I need to do is to create a sort of grid on which I compute the values of my regression polynomial.

So far, this is what I have:

beta <- c(1, 1, 1) #  Placeholder. This is the output of my regression analysis
p <- function(k) { t(beta) %*% k }

n <- 20
m <- 50

x <- seq(from=5, to=13, length.out=n)
z <- seq(from=20, to=50, length.out=m)
M <- mesh(x, z)

Now as far as I understand it, whether I'm using plot3D or rgl, I need to compute the value of p on these grid elements and store it in a matrix of dimension m * n. Obviously, in other languages I would just iterate over both matrices and fill the values in y by hand, but this seems very ugly and unfitting for R to me. So after some research, I stumbled upon the function mapply, which applies a function over two matrices. Note that the input to p requires a 1 to be appended to the argument before the call.

mapply(function (x1, x2) { p(c(1, x1, x2)) }, M$x, M$y)

But the output for this is very, very, very ugly and far from what I expected. Could someone help me out? It surprises me that plotting a plane in 3D seems to be so difficult, because after all, all that we need to uniquely determine a plane are three points in space. And yet all frameworks require me to use fairly complicated function calls?

I am sorry if the solution to my issue is trivial. I've checked out quite a few similar threads, but I still can't quite wrap my head around what I need to do as the issue at hand should be so simple.

ANSWER

Answered 2021-May-20 at 20:01

In rgl it's much simpler: just use planes3d. That function defines planes using the parameterization a x + b y + c z + d = 0, so if we assume x1, f(x) and x3 in your notation are x, y and z in rgl notation, you would plot the plane using

planes3d(beta2, -1, beta3, beta1)

One complication is that planes are infinite, so you have to specify which part you want to plot in some other way. The usual way is to use plot3d() to set up a coordinate system, e.g.

plot3d(x1, y, x3, xlab = "x_1", ylab = "f(x)", zlab = "x_3")

Source https://stackoverflow.com/questions/67627004

Community Discussions, Code Snippets contain sources that include Stack Exchange Network

Vulnerabilities

No vulnerabilities reported

Install rgl

or download the latest sources from the git repository http://github.com/monora/rgl. If you are going to use the drawing functionalities install Graphviz.

Support

RGL's API Reference at http://rubydoc.info

DOWNLOAD this Library from

Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
over 430 million Knowledge Items
Find more libraries
Reuse Solution Kits and Libraries Curated by Popular Use Cases

Save this library and start creating your kit

Explore Related Topics

Share this Page

share link
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
over 430 million Knowledge Items
Find more libraries
Reuse Solution Kits and Libraries Curated by Popular Use Cases

Save this library and start creating your kit

  • © 2022 Open Weaver Inc.