Intro
 
Lession 1
 
Lession 2
 
Lession 3
 
Lession 4
 
Lession 5
 
Lession 6
 
Lession 7
 
Lession 8
 
Lession 9
 
Lession 10
 
Lession 11
 
Lession 12
 
Lession 13
 
Lession 14
 
Lession 15
 
Lession 16
 
Lession 17
 
Lession 18
 
Contact
 
 

 
Home | Text version
 

Learn Definite Clause Grammars (DCG) with Toki Pona

Lession 4

In this lesson we describe the grammar rules of the the Toki Pona lesson Prepositions I: lon, kepeken, tawa.

Until now we use only transitive verbs plus "e" plus direct objects. For intransitive verbs we add "verb_intransitive" to the rules "verb_phrase". Because between an intransitive verb and an object is no "e" we add the rules "intrans_objects" without an "e" in it.

verb_phrase              --> verb_transitive_compound,      direct_objects,   prepositional_objects.
verb_phrase              --> verb_intransitive_compound,    intrans_objects,  prepositional_objects.

intrans_objects         --> [].      
intrans_objects         --> intrans_object.
intrans_object          --> noun_compound.                  
intrans_object          --> pronoun_compound.                  

There are a third version of objects in Toki Pona: The prepositional object. It need a preposition first.

prepositional_objects   --> [].                       
prepositional_objects   --> prepositional_object, prepositional_objects.
prepositional_object    --> preposition(_),       noun_compound.
prepositional_object    --> preposition(_),       pronoun_compound. 

In Toki Pona we often use compound sentences with colon, for example: "mi wile e ni: ...".

sentence_declarative     -->             sentence_simple.                                                  
sentence_declarative     -->             sentence_simple,   separator(':'),              sentence_simple. 

sentence_simple          --> noun_phrase,          verb_phrases. 

Here are the source code of toki-pona-04.pro.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Learn Definite Clause Grammars with Toki Pona
% Toki Pona - Lession 04 - Prepositions, Transitive and Intransitive Verbs
% by Robert Warnke http://rowa.giso.de
% released under the GNU General Public License 
%
% ['toki-pona-04.pro'].
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Grammar  
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% sentence types:

sentence                 --> sentence_declarative,                                                       separator('.').   % A declarative sentence states a fact or an argument and ends with a full stop.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% definitions of the sentence types:

sentence_declarative     -->             sentence_simple.                                                                  % A declarative sentence can be an simple sentence. 
sentence_declarative     -->             sentence_simple,   separator(':'),              sentence_simple.                  % A declarative sentence can build of two simple sentences separated by a colon (sentence_hint).


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% special sentences:

sentence_simple          --> noun_phrase,          verb_phrases.                                                           % A simple sentence consist of a noun phrase and verb phrases. 


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  phrases:

noun_phrase              --> pronoun_no_li.
noun_phrase              --> pronoun_with_li,                                  separator(li).
noun_phrase              --> noun_compound,                                    separator(li).

verb_phrases             --> verb_phrase,         verb_phrase_add.
verb_phrase              --> verb_transitive_compound,                                       direct_objects,   prepositional_objects.
verb_phrase              --> verb_intransitive_compound,                                     intrans_objects,  prepositional_objects.
verb_phrase              --> adjectiv(_),               adjectives.                                                                     % In toki pona is no verb "to be". 
verb_phrase              --> pronoun_compound.                                                                                          % In toki pona is no verb "to be".
verb_phrase              --> noun_compound.                                                                                             % In toki pona is no verb "to be". 
verb_phrase_add          --> [].
verb_phrase_add          --> separator(li),       verb_phrase,          verb_phrase_add.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% objects:

direct_objects           --> [].                                                                                                        % no direct object
direct_objects           --> direct_object,       direct_objects.   
direct_object            --> separator(e),        noun_compound.
direct_object            --> separator(e),        pronoun_compound.

intrans_objects         --> [].      
intrans_objects         --> intrans_object.
intrans_object          --> noun_compound.                  
intrans_object          --> pronoun_compound.                  

prepositional_objects   --> [].                       
prepositional_objects   --> prepositional_object, prepositional_objects.
prepositional_object    --> preposition(_),       noun_compound.
prepositional_object    --> preposition(_),       pronoun_compound. 


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% pronouns:

pronoun_optional        --> [].
pronoun_optional        --> pronoun(_).

pronoun_no_li           --> pronoun(mi).                                                                                             % "mi" or "sina" need no "li".
pronoun_no_li           --> pronoun(sina).                                                                                           % "mi" or "sina" need no "li".
pronoun_with_li         --> pronoun(P), {P\=mi,P\=sina}.                                                                             % These pronouns need a "li".
pronoun_with_li         --> pronoun(_),                               adjectiv(mute).                                                % These compund pronouns need a "li".
pronoun_compound        --> pronoun(_),                               adjectives.                                                    % All (compound) pronouns.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% nouns:

noun_compound            -->  noun(_),     adjectives.                                                                                   % A compound noun can be build with a noun and optional adjectives.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% verbs:

verb_transitive_compound   --> verb_pre_optional,   adverbs,   verb_transitive(_),      adverbs.

verb_intransitive_compound --> verb_pre_optional,   adverbs,   verb_intransitive(_),    adverbs.

verb_pre_optional          --> [].
verb_pre_optional          --> verb_pre(_).


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% adjectives:

adjectives              --> adjectives_pure,     pronoun_optional.

adjectives_pure         --> [].                                                                                                        % no adjectiv
adjectives_pure         --> adjectiv(_).                                                                                               % only one adjectiv
adjectives_pure         --> adjectiv(A), adjectiv(B),                           {A\=B}.                                                % two adjectives
adjectives_pure         --> adjectiv(A), adjectiv(B), adjectiv(C),              {A\=B,A\=C,B\=C}.              


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% adverbs:

adverbs                  --> [].                                                                                                         % no adverb
adverbs                  --> adverb(_).                                                                                                  % only one adverb
adverbs                  --> adverb(A),    adverb(B),                { A\=B } .                                                          % several adverbs
adverbs                  --> adverb(A),    adverb(B),   adverb(C),   { A\=B, A\=C , B\=C} .                                              % max. 3 different adverbs


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Words 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

adjectiv(Adjectiv) --> [Adjectiv], { member(Adjectiv, [     
     ijo,          % of something
     ike,          % bad, negative, wrong, evil, overly complex, (figuratively) unhealthy
     jaki,         % dirty, gross, filthy
     jan,          % human, somebody's, personal, of people
     jo,           % private, personal
     kama,         % coming, future
     kili,         % fruity
     kiwen,        % hard, solid, stone-like, made of stone or metal
     kon,          % air-like, ethereal, gaseous
     lawa,         % main, leading, in charge
     len,          % dressed, clothed, costumed, dressed up 
     lili,         % small, little, young, a bit, short, few, less
     lukin,        % visual(ly)
     moku,         % eating
     mute,         % many, very, much, several, a lot, abundant, numerous, more
     nasa,         % silly, crazy, foolish, drunk, strange, stupid, weird
     pakala,       % destroyed, ruined, demolished, shattered, wrecked
     pana,         % generous
     pona,         % good, simple, positive, nice, correct, right
     seli,         % hot, warm, cooked
     sewi,         % superior, elevated, religious, formal
     suli,         % big, tall, long, adult, important
     suno,         % sunny, sunnily
     tawa,         % moving, mobile
     telo,         % wett, slobbery, moist, damp, humid, sticky, sweaty, dewy, drizzly
     toki,         % speaking, eloquent, linguistic, verbal, grammatical
     tomo,         % urban, domestic, household
     unpa,         % erotic, sexual
     utala         % fighting
%     wile          % necessary
 ])
}.

adverb(Adverb) --> [Adverb], { member(Adverb, [
     ijo,           % of something
     ike,           % bad, negative, wrong, evil, overly complex, (figuratively) unhealthy
     jaki,          % dirty, gross, filthy
     jan,           % human, somebody's, personal, of people
     kama,          % coming, future
     kili,          % fruity
     kiwen,         % hard, solid, stone-like, made of stone or metal
     kon,           % air-like, ethereal, gaseous
     lawa,          % main, leading, in charge
     lili,          % small, little, young, a bit, short, few, less
     lukin,         % visual(ly)
     moku,          % eating
     mute,          % many, very, much, several, a lot, abundant, numerous, more
     nasa,          % silly, crazy, foolish, drunk, strange, stupid, weird
     pakala,        % destroyed, ruined, demolished, shattered, wrecked
     pona,          % good, simple, positive, nice, correct, right
     seli,          % hot, warm, cooked
     sewi,          % superior, elevated, religious, formal
     suli,          % big, tall, long, adult, important
     suno,          % sunny, sunnily
     tawa,          % moving, mobile
     telo,          % wett, slobbery, moist, damp, humid, sticky, sweaty, dewy, drizzly
     toki,          % speaking, eloquent, linguistic, verbal, grammatical
     tomo,          % urban, domestic, household
     unpa,          % erotic, sexual
     utala          % fighting
%     wile           % necessary
 ])
}.

noun(Noun) --> [Noun], { member(Noun, [   
     ijo,          % thing, something, stuff, anything, object
     ike,          % negativity, badness, evil
     ilo,          % tool, device, machine, thing used for a specific purpose
     jaki,         % dirt, pollution, garbage, filth
     jan,          % person, people, human, being, somebody, anybody
     jo,           % having
     kama,         % event, happening, chance, arrival, beginning
     kili,         % fruit, pulpy vegetable, mushroom
     kiwen,        % hard thing, rock, stone, metal, mineral, clay
     kon,          % air, wind, smell, soul
     lawa,         % head, mind
     len,          % clothing, cloth, fabric
     lili,         % smallness, youth, immaturity
     lukin,        % view, look, glance, sight, gaze, glimpse, seeing, vision, sight 
     ma,           % land, earth, country, (outdoor) area
     moku,         % food, meal
     mute,         % amount, quantity
     nasa,         % stupidity, foolishness, silliness, nonsense, idiocy, inanity, obtuseness, ninny, muddler
     pakala,       % blunder, accident, mistake, destruction, damage, breaking
     pana,         % giving, transfer, exchange
     pipi,         % bug, insect, spider
     poka,         % side, hip, next to
     poki,         % container, box, bowl, cup, glass
     pona,         % good, simplicity, positivity
     seli,         % fire, warmth, heat
     sewi,         % high, up, above, top, over, on
     suli,         % size
     suno,         % sun, light
     tawa,         % movement, transportation
     telo,         % water, liquid, juice, sauce
     toki,         % language, speech, tongue, lingo, jargon, 
     tomo,         % indoor constructed space, e.g. house, home, room, building
     unpa,         % sex, sexuality
     utala         % conflict, disharmony, competition, fight, war, battle, attack, blow, argument, physical or verbal violence
%     wile          % desire, need, will
 ])
}.

preposition(Preposition) --> [Preposition], { member(Preposition, [
     kepeken,     % with
     lon,         % be (located) in/at/on
     tawa         % to, in order to, towards, for, until
 ])
}.

pronoun(Pronoun) --> [Pronoun], { member(Pronoun, [
     mi,          % I, we (pronoun 1. person)
     sina,        % you (pronoun 2. person)
     ona,         % she, he, it, they (pronoun 3. person)
     ni           % this, that (pronoun determiner)
 ])
}.

separator(Separator) --> [Separator], { member(Separator, [
     e,             % introduces a direct object
     li,            % between any subject except mi and sina and its verb
     '.',           % At the end of a sentence.
     ':'            % Between an hint sentences and a sentences.
 ])
}.

verb_intransitive(Verb_intransitive) --> [Verb_intransitive], { member(Verb_intransitive, [
     ike,           % to be bad, to suck
     kama,          % come, become, arrive, happen, pursue actions to arrive to (a certain state), manage to, start to
     kepeken,       % use
     lon,           % be there, be present, be real/true, exist, be awake
     lukin,         % look, watch out, pay attention
     pakala,        % screw up, fall apart, break
     sewi,          % to get up 
     tawa,          % go to, walk, travel, move, leave
     toki,          % talk, chat, communicate
     unpa           % have sex
 ])
}.

verb_transitive(Verb_transitive) --> [Verb_transitive], { member(Verb_transitive, [
     ijo,           % objectify
     ike,           % to make bad, to worsen, to have a negative effect upon
     jaki,          % pollute, dirty
     jan,           % personify, humanize, personalize
     jo,            % have, contain
     kama,          % bring about, summon
     kiwen,         % to solidify, to harden, to petrify, to fossilize
     lawa,          % lead, control, rule, steer
     len,           % to wear, to be dressed, to dress
     lili,          % reduce, shorten, shrink, lessen
     lukin,         % see, look at, watch, read
     moku,          % eat, drink, swallow, ingest, consume
     mute,          % make many or much
     nasa,          % drive crazy, make weird
     pakala,        % screw up, fuck up, botch, ruin, break, hurt, injure, damage, spoil, ruin
     pana,          % give, put, send, place, release, emit, cause
     pona,          % improve, fix, repair, make good
     seli,          % heat, warm up, cook
     sewi,          % to lift
     suli,          % enlarge, lengthen
     suno,         % to light, to illumine
     tawa,          % move, displace
     telo,          % water, wash with water
     toki,          % speak, talk, say, pronounce, discourse
     unpa,          % have sex with, sleep with, fuck
     utala,         % hit, strike, attack, compete against
     wile           % to want, need, wish, have to, must, will, should
 ])
}.

verb_pre(Verb_pre) --> [Verb_pre], { member(Verb_pre, [
     kama,          % to become, to mange to
     lukin,         % to seek to, try to
     wile           % to want, need, wish, have to, must, will, should
 ])
}.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% For a user friendly input:
:- ['check_grammar.pro']. 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Possible queries
% 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Possible queries with the syntax of the Difference Lists:

?- verb_transitive(X,_,_).
?- verb_intransitive(X,_,_).
?- preposition(X,_,_).


% Sentences with right grammar:

mi lon tomo.
mi moku lon tomo.
suno li lon sewi.
mi telo e mi lon tomo telo.
kili li lon poki.
mi wile lon tomo.
mi wile e ni.
mi lon tomo.
sina toki e ni tawa mi.
sina moku.
mi kepeken ilo.
sina wile kepeken ilo.
mi kepeken poki ni.
mi moku kepeken ilo moku.
mi lukin kepeken ilo suno.
mi tawa tomo mi.
ona mute li tawa utala.
sina wile tawa telo suli.                                            % many variants!
ona li tawa sewi kiwen.                                              % many variants!
mi toki tawa sina.
ona li lawa e jan tawa ma pona.
ona li kama tawa ma mi.
ni li pona tawa mi.
ni li ike tawa mi.
kili li pona tawa mi.
toki li pona tawa mi.
utala li ike tawa mi.
telo suli li ike tawa mi.
mi lukin e ma.
ni li pona tawa mi.
ma li pona lukin.
mi pana e tomo tawa sina.
mi tawa e kiwen.
ona li tawa e len mi.
ona li kama tawa tomo mi.                                            % many variants!
mi kama e pakala.
mi kama jo e telo.
mi pona e ilo suno kepeken ilo lili.
toki pona li pona tawa mi.
mi mute li pana e moku tawa ona mute.                                % many variants!
ni li tawa jan pona mi.
ilo li lon poki.
poki ni li lon jaki.
mi wile tawa tomo ona kepeken tomo tawa mi.
ona mute li utala toki.
sina wile kama tawa tomo toki.                                       % many variants!
jan li toki kepeken toki pona lon tomo toki.
mi tawa tomo toki.                                                   % many variants!
ona li pona tawa mi.
sina kama jo e jan pona lon ni.
mi pana e tomo e telo tawa ona mute.
mi wile e ni: mi lon tomo.
sina toki e ni tawa mi: sina moku.
sina kama e ni: mi wile moku.


% Sentences with wrong grammar:

?- check_grammar.
|: sina: mi wile moku.
false

?- check_grammar.
|: mi kepeken e ilo.
false

?- check_grammar.
|: sina wile kepeken e ilo.
false

?- check_grammar.
|: mi kepeken e poki ni.
false
*/

 


rowa.giso.de | contact | Berlin (Good Old Europe)
This unofficial fan site by Robert Warnke is based on the official Toki Pona book and website: tokipona.org