1/*  Copyright 1986-2020 David H. D. Warren and Fernando C. N. Pereira
    2
    3    Permission is hereby granted, free of charge, to any person obtaining a
    4    copy of this software and associated documentation files (the
    5    "Software"), to deal in the Software without restriction, including
    6    without limitation the rights to use, copy, modify, merge, publish,
    7    distribute, sublicense, and/or sell copies of the Software, and to
    8    permit persons to whom the Software is furnished to do so, subject to
    9    the following conditions:
   10
   11    The above copyright notice and this permission notice shall be included
   12    in all copies or substantial portions of the Software.
   13
   14    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
   15    OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
   16    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
   17    IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
   18    CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
   19    TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
   20    SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
   21*/
   22
   23/* Nouns */
   24
   25property(area,measure&area,X,feature&place&_,Y,area(Y,X),[],_,_).
   26property(capital,feature&city,X,feature&place&country,Y,
   27         capital(Y,X),[],_,_).
   28property(latitude,
   29         measure&position,X,feature&_,Y,latitude(Y,X),[],_,_).
   30property(longitude,measure&position,X,feature&_,Y,
   31         longitude(Y,X),[],_,_).
   32property(population,
   33         measure&heads,X,feature&_,Y,population(Y,X),[],_,_).
   34
   35thing(place,feature&place&_,X,place(X),[],_).
   36thing(area,measure&area,X,area(X),[],_).
   37thing(capital,feature&city,X,capital(X),[],_).
   38thing(city,feature&city,X,city(X),[],_).
   39thing(continent,feature&place&continent,X,continent(X),[],_).
   40thing(country,feature&place&country,X,country(X),[],_).
   41thing(latitude,measure&position,X,latitude(X),[],_).
   42thing(longitude,measure&position,X,longitude(X),[],_).
   43thing(ocean,feature&place&seamass,X,ocean(X),[],_).
   44thing(person,_,X,person(X),[],_).
   45thing(population,measure&heads,X,population(X),[],_).
   46thing(region,feature&place&_,X,region(X),[],_).
   47thing(river,feature&river,X,river(X),[],_).
   48thing(sea,feature&place&seamass,X,sea(X),[],_).
   49thing(seamass,feature&place&seamass,X,seamass(X),[],_).
   50
   51aggr_noun(average,_,_,average).
   52aggr_noun(sum,_,_,total).
   53aggr_noun(total,_,_,total).
   54
   55meta_noun(number,_,V,feature&_,X,P,numberof(X,P,V)).
   56
   57/* Proper nouns */
   58
   59name_template(X,feature&circle) :- circle_of_latitude(X).
   60name_template(X,feature&city) :- city(X).
   61name_template(X,feature&place&continent) :- continent(X).
   62name_template(X,feature&place&country) :- country(X).
   63name_template(X,feature&place&_) :- region(X).
   64name_template(X,feature&river) :- river(X).
   65name_template(X,feature&place&seamass) :- seamass(X).
   66
   67/* Verbs */
   68
   69trans(border,
   70      feature&place&_,X,feature&place&_,Y,borders(X,Y),[],_,_).
   71trans(contain,feature&place&_,X,feature&_,Y,in(Y,X),[],_,_).
   72trans(exceed,measure&Type,X,measure&Type,Y,exceeds(X,Y),[],_,_).
   73
   74intrans(drain,feature&river,X,drains(X,Y),
   75   [slot(prep(into),feature&place&_,Y,_,free)],_).
   76intrans(flow,feature&river,X,flows(X,Y),
   77   [slot(prep(through),feature&place&_,Y,_,free)],_).
   78intrans(flow,feature&river,X,flows(X,Y,Z),
   79   [slot(prep(into),feature&place&_,Z,_,free),
   80    slot(prep(from),feature&place&_,Y,_,free)],_).
   81intrans(rise,feature&river,X,rises(X,Y),
   82   [slot(prep(in),feature&place&_,Y,_,free)],_).
   83
   84/* Adjectives */
   85
   86restriction(african,feature&_,X,african(X)).
   87restriction(american,feature&_,X,american(X)).
   88restriction(asian,feature&_,X,asian(X)).
   89restriction(european,feature&_,X,european(X)).
   90
   91attribute(large,feature&place&_,X,measure&area,Y,area(X,Y)).
   92attribute(small,feature&place&_,X,measure&area,Y,area(X,Y)).
   93attribute(great,measure&Type,X,measure&Type,Y,X=Y).
   94attribute(populous,feature&_,X,measure&heads,Y,population(Y,X)).
   95
   96aggr_adj(average,_,_,average).
   97aggr_adj(total,_,_,total).
   98aggr_adj(minimum,_,_,minimum).
   99aggr_adj(maximum,_,_,maximum).
  100
  101/* Prepositions */
  102
  103adjunction(in,feature&_-X,feature&place&_-Y,in(X,Y)).
  104adjunction(eastof,feature&_-X,feature&_-Y,eastof(X,Y)).
  105adjunction(westof,feature&_-X,feature&_-Y,westof(X,Y)).
  106adjunction(northof,feature&_-X,feature&_-Y,northof(X,Y)).
  107adjunction(southof,feature&_-X,feature&_-Y,southof(X,Y)).
  108
  109/* Measure */
  110
  111measure(ksqmile,measure&area,[],ksqmiles).
  112measure(sqmile,measure&area,[],sqmiles).
  113measure(degree,measure&position,[],degrees).
  114measure(thousand,measure&heads,[],thousand).
  115measure(million,measure&heads,[],million).
  116
  117units(large,measure&_).
  118units(small,measure&_).
  119
  120chat_sign(large,+).
  121chat_sign(small,-).
  122chat_sign(great,+).
  123
  124/* Proportions and the like */
  125
  126comparator(proportion,_,V,[],proportion(V)).
  127comparator(percentage,_,V,[],proportion(V))