%% WARNING: the semantics has changed slightly. See the exercises web-page %% and the new description of exercises for details. %%% A SIMPLE GRAMMAR FOR A FRAGMENT OF FINNISH % THE GRAMMAR RULES % a phrase is a sentence or a sentence together with an auxiliary sentence sU(M) --> s2U(M). sU(because(M1,M2)) --> s2U(M1), [koska], s2U(M2). sU(because(M1,M2)) --> [koska], s2U(M2), [','], s2U(M1). % The following is needed to solve a problem caused by the combination of % relative sentences ("the man _who_sleeps_ is cool") and the production % of meanings of sentences by passing the meaning of the NP as a parameter % to the VP. When synthesizing sentences from the meanings, the npU rules % are called with all variables unbound, and with relative sentences this % leads to infinite loops. The block declaration states that the npU rules % are called only when either the meaning or the sequence of words % is bound to something. When this is not the case, the call to the npU rules % is delayed, and in our grammar, the vpU in the s2U rules is handled first. :- block npU(-,?,?,-,?). % sentences s2U(M2) --> npU(M1,A,nom), vpU(M1,M2,A). % ATTENTION: the meaning of subject noun phrases is passed as an argument % to the vp (M1 in the above rule), so that the verb phrase can construct % the meaning of the sentence, including the meaning of the subject phrase. % This is like described in Allen's book in Section 9.6 "Semantic % Interpretation using Feature Unification." % 1st and 2nd person subjects are optional! s2U(M2) --> vpU(S,M2,A), { implicitsubjectU(S,A) }. implicitsubjectU(me1,s1). implicitsubjectU(you1,s2). implicitsubjectU(we1,p1). implicitsubjectU(you1,p2). % npU(M1,Agr,Case) --> np1U(M1,Agr,Case). % noun phrases with a relative clause npU((M1,M2),A,Case) --> np1U(M1,A,Case), [joka], vpU(M1,M2,A), { singular(A) }. npU((M1,M2),A,Case) --> np1U(M1,A,Case), [jotka], vpU(M1,M2,A), { plural(A) }. % Noun phrases: a noun, an adjective and a noun, or a pronoun. % In Finnish the distinction between "a" and "the" cannot be directly made. np1U(a(Agr,M1),Agr,Case) --> nounU(M1,Agr,Case). np1U(the(Agr,M1),Agr,Case) --> nounU(M1,Agr,Case). np1U((a(Agr,M2),M1),Agr,Case) --> adjU(M1,Agr,Case), nounU(M2,Agr,Case). np1U((the(Agr,M2),M1),Agr,Case) --> adjU(M1,Agr,Case), nounU(M2,Agr,Case). np1U(M1,Agr,Case) --> pronounU(M1,Agr,Case). np1U(M1,s3,Case) --> nameU(M1,Case). np1U((the(s3,M2),M1),s3,Case) --> adjU(M1,s3,Case), nameU(M2,Case). % Verbs with no NPs, an accusative NP, an accusative and an allative NP, % or a nominative NP. % verbs with no NPs vpU(S,[M1,S],Agr) --> vp2U(M1,Agr,-none). % verbs with one NP (problem: "I see old women", "I am old women") vpU(S,[M1,S,M2],Agr) --> vp2U(M1,Agr,-np:C), npU(M2,_,C). % verbs with an adjective phrase ("I am blue.") vpU(S,[M1,S,M2],Agr) --> vp2U(M1,Agr,-ap:C), adjU(M2,Agr,C). % verbs with two NPs (with ordering 1,2 and 2,1) vpU(S,[M1,S,M3,M2],Agr) --> vp2U(M1,Agr,-np:C1:C2), npU(M2,_,C1), npU(M3,_,C2). vpU(S,[M1,S,M3,M2],Agr) --> vp2U(M1,Agr,-np:C1:C2), npU(M3,_,C2), npU(M2,_,C1). vp2U(M1,Agr,Objects) --> verbU(M1,Agr,Objects). % perfect and plusquamperfect ("I have slept" and "I had slept"). vp2U((T,M1),Agr,Objects) --> auxtobeU(Agr,T), verbbaseU(M1,Agr,Objects). % THE LEXICON %% Finnish morphology is complicated, and when the number of words is %% not very high, it is much easier to give all word forms explicitly. % the verb "to see" verbU((pres,see1),s1,-np:acc) --> [näen]. verbU((pres,see1),s2,-np:acc) --> [näet]. verbU((pres,see1),s3,-np:acc) --> [näkee]. verbU((pres,see1),p1,-np:acc) --> [näemme]. verbU((pres,see1),p2,-np:acc) --> [näette]. verbU((pres,see1),p3,-np:acc) --> [näkevät]. % imperfect verbU((past,see1),s1,-np:acc) --> [näin]. verbU((past,see1),s2,-np:acc) --> [näit]. verbU((past,see1),s3,-np:acc) --> [näki]. verbU((past,see1),p1,-np:acc) --> [näimme]. verbU((past,see1),p2,-np:acc) --> [näitte]. verbU((past,see1),p3,-np:acc) --> [näkivät]. % word forms for forming perfect and plusquamperfect verbbaseU(see1,A,-np:acc) --> [nähnyt], { singular(A) }. verbbaseU(see1,A,-np:acc) --> [nähneet], { plural(A) }. % the verb "to sleep" verbU((pres,sleep1),s1,-none) --> [nukun]. verbU((pres,sleep1),s2,-none) --> [nukut]. verbU((pres,sleep1),s3,-none) --> [nukkuu]. verbU((pres,sleep1),p1,-none) --> [nukumme]. verbU((pres,sleep1),p2,-none) --> [nukutte]. verbU((pres,sleep1),p3,-none) --> [nukkuvat]. % imperfect verbU((past,sleep1),s1,-none) --> [nukuin]. verbU((past,sleep1),s2,-none) --> [nukuit]. verbU((past,sleep1),s3,-none) --> [nukkui]. verbU((past,sleep1),p1,-none) --> [nukuimme]. verbU((past,sleep1),p2,-none) --> [nukuitte]. verbU((past,sleep1),p3,-none) --> [nukkuivat]. % word forms for forming perfect and plusquamperfect verbbaseU(sleep1,A,-none) --> [nukkunut], { singular(A) }. verbbaseU(sleep1,A,-none) --> [nukkuneet], { plural(A) }. % the verb "to give" verbU((pres,give1),s1,-np:acc:all) --> [annan]. verbU((pres,give1),s2,-np:acc:all) --> [annat]. verbU((pres,give1),s3,-np:acc:all) --> [antaa]. verbU((pres,give1),p1,-np:acc:all) --> [annamme]. verbU((pres,give1),p2,-np:acc:all) --> [annatte]. verbU((pres,give1),p3,-np:acc:all) --> [antavat]. % imperfect verbU((past,give1),s1,-np:acc:all) --> [annoin]. verbU((past,give1),s2,-np:acc:all) --> [annoit]. verbU((past,give1),s3,-np:acc:all) --> [antoi]. verbU((past,give1),p1,-np:acc:all) --> [annoimme]. verbU((past,give1),p2,-np:acc:all) --> [annoitte]. verbU((past,give1),p3,-np:acc:all) --> [antoivat]. % word forms for forming perfect and plusquamperfect verbbaseU(give1,A,-np:acc:all) --> [antanut], { singular(A) }. verbbaseU(give1,A,-np:acc:all) --> [antaneet], { plural(A) }. % nominative forms of pronouns pronounU(me1,s1,nom) --> [minä]. pronounU(you1,s2,nom) --> [sinä]. pronounU(he1,s3,nom) --> [hän]. pronounU(she1,s3,nom) --> [hän]. pronounU(it1,s3,nom) --> [se]. pronounU(we1,p1,nom) --> [me]. pronounU(you2,p2,nom) --> [te]. pronounU(you3,p2,nom) --> [te]. pronounU(they1,p3,nom) --> [he]. pronounU(they2,p3,nom) --> [ne]. % non-person 3rd plural % accusative forms of pronouns pronounU(me1,s1,acc) --> [minut]. pronounU(you1,s2,acc) --> [sinut]. pronounU(he1,s3,acc) --> [hänet]. pronounU(she1,s3,acc) --> [hänet]. pronounU(it1,s3,acc) --> [sen]. pronounU(we1,p1,acc) --> [meidät]. pronounU(you2,p2,acc) --> [teidät]. pronounU(they1,p3,acc) --> [heidät]. pronounU(they2,p3,acc) --> [ne]. % allative forms of pronouns pronounU(me1,s1,all) --> [minulle]. pronounU(you1,s2,all) --> [sinulle]. pronounU(he1,s3,all) --> [hänelle]. pronounU(she1,s3,all) --> [hänelle]. pronounU(it1,s3,all) --> [sille]. pronounU(we1,p1,all) --> [meille]. pronounU(you2,p2,all) --> [teille]. pronounU(you3,p2,all) --> [teille]. pronounU(they1,p3,all) --> [heille]. pronounU(they2,p4,all) --> [niille]. % the adjective "blue" adjU(blue1,A,nom) --> [sininen], { singular(A) }. adjU(blue1,A,acc) --> [sinisen], { singular(A) }. adjU(blue1,A,all) --> [siniselle], { singular(A) }. adjU(blue1,A,nom) --> [siniset], { plural(A) }. adjU(blue1,A,acc) --> [siniset], { plural(A) }. adjU(blue1,A,all) --> [sinisille], { plural(A) }. % the adjective "wonderful" adjU(wonderful1,A,nom) --> [suurenmoinen], { singular(A) }. adjU(wonderful1,A,acc) --> [suurenmoisen], { singular(A) }. adjU(wonderful1,A,all) --> [suurenmoiselle], { singular(A) }. adjU(wonderful1,A,nom) --> [suurenmoiset], { plural(A) }. adjU(wonderful1,A,acc) --> [suurenmoiset], { plural(A) }. adjU(wonderful1,A,all) --> [suurenmoisille], { plural(A) }. % the adjective "beautiful" adjU(beautiful1,A,nom) --> [kaunis], { singular(A) }. adjU(beautiful1,A,acc) --> [kauniin], { singular(A) }. adjU(beautiful1,A,all) --> [kauniille], { singular(A) }. adjU(beautiful1,A,nom) --> [kauniit], { plural(A) }. adjU(beautiful1,A,acc) --> [kauniit], { plural(A) }. adjU(beautiful1,A,all) --> [kauniille], { plural(A) }. % the adjective "small" adjU(small1,A,nom) --> [pieni], { singular(A) }. adjU(small1,A,acc) --> [pienen], { singular(A) }. adjU(small1,A,all) --> [pienelle], { singular(A) }. adjU(small1,A,nom) --> [pienet], { plural(A) }. adjU(small1,A,acc) --> [pienet], { plural(A) }. adjU(small1,A,all) --> [pienille], { plural(A) }. % the adjective "old" adjU(old1,A,nom) --> [vanha], { singular(A) }. adjU(old1,A,acc) --> [vanhan], { singular(A) }. adjU(old1,A,all) --> [vanhalle], { singular(A) }. adjU(old1,A,nom) --> [vanhat], { plural(A) }. adjU(old1,A,acc) --> [vanhat], { plural(A) }. adjU(old1,A,all) --> [vanhoille], { plural(A) }. % the substantive "woman" nounU(woman1,s3,nom) --> [nainen]. nounU(woman1,s3,acc) --> [naisen]. nounU(woman1,s3,all) --> [naiselle]. nounU(woman1,p3,nom) --> [naiset]. nounU(woman1,p3,acc) --> [naiset]. nounU(woman1,p3,all) --> [naisille]. % the substantive "man" nounU(man1,s3,nom) --> [mies]. nounU(man1,s3,acc) --> [miehen]. nounU(man1,s3,all) --> [miehelle]. nounU(man1,p3,nom) --> [miehet]. nounU(man1,p3,acc) --> [miehet]. nounU(man1,p3,all) --> [miehille]. % the substantive "check" nounU(check1,s3,nom) --> [shekki]. nounU(check1,s3,acc) --> [shekin]. nounU(check1,s3,all) --> [shekille]. nounU(check1,p3,nom) --> [shekit]. nounU(check1,p3,acc) --> [shekit]. nounU(check1,p3,all) --> [shekeille]. % the substantive "cellular phone" nounU(cellularphone1,s3,nom) --> [kännykkä]. nounU(cellularphone1,s3,acc) --> [kännykän]. nounU(cellularphone1,s3,all) --> [kännykälle]. nounU(cellularphone1,p3,nom) --> [kännykät]. nounU(cellularphone1,p3,acc) --> [kännykät]. nounU(cellularphone1,p3,all) --> [kännyköille]. % more official word for "cellular phone" (~ "hand telephone")) nounU(cellularphone1,s3,nom) --> [käsipuhelin]. nounU(cellularphone1,s3,acc) --> [käsipuhelimen]. nounU(cellularphone1,s3,all) --> [käsipuhelimelle]. nounU(cellularphone1,p3,nom) --> [käsipuhelimet]. nounU(cellularphone1,p3,acc) --> [käsipuhelimet]. nounU(cellularphone1,p3,all) --> [käsipuhelimille]. % the verb "to be" as an auxiliary verb for forming perfect... auxtobeU(s1,perf) --> [olen]. auxtobeU(s2,perf) --> [olet]. auxtobeU(s3,perf) --> [on]. auxtobeU(p1,perf) --> [olemme]. auxtobeU(p2,perf) --> [olette]. auxtobeU(p3,perf) --> [ovat]. % and plusquamperfect auxtobeU(s1,plus) --> [olin]. auxtobeU(s2,plus) --> [olit]. auxtobeU(s3,plus) --> [oli]. auxtobeU(p1,plus) --> [olimme]. auxtobeU(p2,plus) --> [olitte]. auxtobeU(p3,plus) --> [olivat]. % the verb "to be", can take an adjective or noun object in nominative form verbU((pres,be1),A,-np:nom) --> auxtobeU(A,perf). verbU((pres,be1),A,-ap:nom) --> auxtobeU(A,perf). verbU((past,be1),A,-np:nom) --> auxtobeU(A,plus). verbU((past,be1),A,-ap:nom) --> auxtobeU(A,plus). verbbaseU(be1,A,-P:nom) --> [ollut], { singular(A) }. verbbaseU(be1,A,-P:nom) --> [olleet], { plural(A) }. nameU(name(eva),nom) --> [eva]. nameU(name(eva),acc) --> [evan]. nameU(name(eva),all) --> [evalle]. nameU(name(uta),nom) --> [uta]. nameU(name(uta),acc) --> [utan]. nameU(name(uta),all) --> [utalle]. nameU(name(bob),nom) --> [bob]. nameU(name(bob),acc) --> [bobin]. nameU(name(bob),all) --> [bobille]. nameU(name(uwe),nom) --> [uwe]. nameU(name(uwe),acc) --> [uwen]. nameU(name(uwe),all) --> [uwelle]. %% AUXILIARY PREDICATES plural(p1). plural(p2). plural(p3). singular(s1). singular(s2). singular(s3). %% Example sentences ?- sU(M,[minä,nukun,koska,olen,vanha],[]). ?- sU(M,[bob,näkee,kauniin,evan,joka,antaa,minulle,kännykän],[]).