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
Step: 1
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...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started