/* Copyright (C) Wolfgang Menzel, Universität Hamburg, 2003-06-27 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ :- nl. :- write_ln('a simple English grammar with structure building'). :- write_ln('call: ?- s([the, man, was, nice],Structure).'). :- nl. det(det(the)) --> [the]. n(n(man)) --> [man]. n(n(men)) --> [men]. n(n(woman)) --> [woman]. n(n(women)) --> [women]. n(n(fish)) --> [fish]. adj(adj(good)) --> [good]. adj(adj(happy)) --> [happy]. adj(adj(nice)) --> [nice]. cop(cop(are)) --> [are]. cop(cop(is)) --> [is]. cop(cop(was)) --> [was]. cop(cop(were)) --> [were]. s(s(NP,VP)) --> np(NP), vp(VP). np(np(D,NBAR)) --> det(D), nbar(NBAR). nbar(nbar(N)) --> n(N). vp(vp(C,AP)) --> cop(C), advp(AP). advp(advp(A)) --> adj(A). s(Sentence,Structure) :- s(Structure,Sentence,[ ]).