Question: In exercise 1, create the parse tree for each sentence. Sentences which can be recognized will have a complete parse tree while unrecognized sentences will
In exercise 1, create the parse tree for each sentence. Sentences which can be recognized
will have a complete parse tree while unrecognized sentences will have incomplete parse
trees. Be sure to indicate which sentences are recognized.
develop a parse tree for below sentences
The carrot eats the carrot.
The rabbits eats the carrot.
The rabbit eats carrots
In exercise 2, list the full DCG notation for the extended grammar. Test your grammar by
using Amzi prolog.
For example, you can enter: sentence -->
np(N), vp(N). etc.
The only "trick" is how to specify the sentence to check for proper grammar. Here's how:
?- sentence([word1,word2,word3,etc],[]).
note the use of square brackets within the parentheses, each word of the sentence is
entered between commas, and the final argument [] (open bracket, close bracket). Thus to
check whether "All rabbits eat carrots" is syntactically correct, enter
?- sentence([all,rabbits,eat,carrots],[]).
Examples:
?- sentence([the,rabbit,eats,the,carrot],[]).
yes
?- sentence([rabbit,the,carrot,eats,the],[]).
no
by seeing examples solve below questions
All rabbit eat the carrot.
A rabbits eat the carrot
Every rabbits eat the carrots
Step by Step Solution
There are 3 Steps involved in it
Exercise 1 Parse Trees To develop the parse tree for the given sentences well follow a typical syntactic structure for English sentences Heres an exam... View full answer
Get step-by-step solutions from verified subject matter experts
