Question

As mentioned in Assignment 5. Prolog can be used to solve problems that are quite difficult with other programming languages.
L Introduction Prolog Is a language that Is sultable for solvins problems in the fleld of artifical Intelligence. That is, It
7. She revtewed Vivaces show st some point later In the month than the show she sow at the Flatiron Playhousa (which fenture
The second (non-commented) line assumes the date on which Donna saw the show Rhythm is Rhythn; It also records that In that s
As mentioned in Assignment 5. Prolog can be used to solve problems that are quite difficult with other programming languages.This is mainly because of the declarative nature of the languages. What kind of difficulties do you think there will be if you are asked to write a program in another language fe.g. Python) to solve the puzzle in Assignment 5
L Introduction Prolog Is a language that Is sultable for solvins problems in the fleld of artifical Intelligence. That is, It can be used to solve problems that used to be solvable only by human brains. In this assignment you are asked to write a Prolog program to solve a logic puzdle. II. Using Prolog Gnu Prolog and SW1 Prolog have been Installed on most computers on campus. If you prefer to use prolog on your own computer, Gnu Prolog can be downloaded from http://www.gprolog.org while SWl Prolog can be downloaded from http://www.swi-prolog.org To load your program Into prolog you can use the "consult command, as In the following example: If you are using Gnu Prolog on Microsoft Windows, you can also use the "File 1 Consult...T menu selection to load the file from a chooser. Ill. The Puzzle As head critic for Footlights, New York City's oldest theater magazine. Donna usually reviews major productions, both on and off Broadway. Lait month, however, her editor decided the should take a look at the avant-garde scene, so she got tickets to five performance-art pleces, each on a different date last month, and each at a different theater. Each show was written and performed by a different performance artst, and each show featured a different strange element (one show had a live lemur on stagej that nearly struck her speechless. While Donna enjoyed these shows, she will be glad to get back to reviewing regular Broadway shows where at least she knows what to expect! From the information provided, can you determine the date (3rd, 7th, i1th, 15th, or 19th) on which she reviewed the show playing at each theater, the artist who wrote and starred in each show, and the oddity that made each show so unusual? i. Donna reviewed Rhythm (whose star wears a strange sult made entirely of tin) exactly four days after she saw Pazuzu's show but exactly four days before she saw Body Politic at the Produders Club. 2. She saw fire Escape at the Duke Theater on the 3nd 3. Id stars in Moss Media lwhich feusures a as-minute ocartna solo). 4. She saw О a's show fohlen ısn't the one which the tar rois around in 100 pound, of puddingi exactly four days before stereviewed wor GomeS 5. 5he saw the show plaving at the westrise Theater exactly four davs before she raviewed Nasca's performance Donna sati a înaw at the sı..ске, "s on tne
7. She revtewed Vivace's show st some point later In the month than the show she sow at the Flatiron Playhousa (which fentures n large cracknd mirror as a majar set placa). IV. Analysis Let's first do some book-keaping work, thare are: . 5 dates: 3rd. 7th, 11th, 15th, and 19th . 3 shows: Dody Politic, Fire Escope, Mass Media, Rhythm, and war Gomes: · 5 theaters: Bleecker 45, Duke Theater, Flatron Playhouse, Producers ab, and westside Theater: - 5 artists: Deva, Id, Nasca, Pazuzu, and vivace; and . S oddities: cracked mirror, live lemur, ocarina solo, 100 pounds of pudding, and tin sult. Now let's define a data structure to hold the information about the performance. There are many ways to do this. The following is only one of the many possiblities: Note that you only have to keep this structure in mind. You do not have to actually enter it into your Prolog program. That is why we put it here as a comment (Prolog comments are enclosed in and, you can ailso use the single line comments which start with triple percentage sign "ses" and extend untili the end of the line). Next, we define a paetormancatia: that contains the five partomancas (note that the underscore character" by itself is used to represent the "don't care or "don't know" values in Prologh: Now we can encode the hints Into the solution (the first half of Hint 1 1s encoded below for youj the frst itne savs that s is a soluton only f s is s portaansatiar. The comma at the end the ni the ruit not completed yet tat has other conditions to sakuafy There addtiona tiont are specifed in the suoinsuentines
The second (non-commented) line assumes the date on which Donna saw the show Rhythm is Rhythn; It also records that In that show, the artist wears a tin sult. The third line assumes the date on which Donna saw Pizuzu's show Is Parur. Then from Hint 1, we know that hychn must equal Paruu+ & (Note that In Prolog, equality is represented by whle Inequality Is represented by- The last condition in the rule should end with a perlod. Also note that in Prolog, names start with a lowercase letter are literals (constants), while names start with an uppercase letter are varlables. Once your program Is loaded Into Prolog, simply issuing the following command should give you the answer (Hint: There Is exactly one solution to this puzzle): V. Submission Due date: Sunday April 21. . Submit to: Canvas. . Copy and paste the following items into the fle "cao322asaoiution.dod" and submit: o The Prolog program (complete with documentation In the form of comments). output of the program-this should be the solution of the puzzle. The solution of the puzzle in the form of a table. o VI. Reference Also attached to this assignment on Canvas is an example solving a similar (but simpler) probiem.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Hey there, first of all, I will clear your doubt regarding the prolog v/s other programming languages like python.

I am listing some of the differences here.

----------------------------------------------------------------------------prolog----------------------------------------------------------------------------

1) Prolog allows the developer to perform complex searches over a database of facts and perform inferences on those facts. It does so through pattern-matching and implicit backtracking.

If your program involves a search or symbolic manipulation, Prolog is an excellent choice.

2) Prolog is one of the two classic languages for symbolic artificial intelligence programming. Prolog excels at

implementing symbolic rule-based systems. and it executes pretty fast too

-----------------------------------------------------------------------python--------------------------------------------------------------------------------

1) Python is a scripting language primarily used as a front-end for various AI libraries written in C. it can do numerical processing on its own as well, preprocessing in the Python level before the information to the AI libraries.

2)   Python It's fast to write code in, it's easy to  debug and read, it has tooooons of useful libraries

Trying to implement this kind of thing in another language tends to be a mess. The cleanest and most general solution probably involves implementing your own unification, and doing better will at the very least involve a fair bit of research, reading some headache-inducing papers.

also as per your puzzle as head critic for footlights NewYork city's oldest theatre magazine doona useful reviews major production,both on and off Broadway last month ,however her editor decides to should take a look at avant-grand scene so in this case, backtracking of data will become difficult if other programming languages are used like python because python is not as good as prolog in data matching.

Of course in the real world, key parts of your program may benefit from Prolog, but a lot of other stuff is better handled using another language. That's why a lot of Prolog compilers can interface with, e.g., C.

Add a comment
Know the answer?
Add Answer to:
As mentioned in Assignment 5. Prolog can be used to solve problems that are quite difficult with other programming languages.This is mainly because of the declarative nature of the languages....
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • you will implement the A* algorithm to solve the sliding tile puzzle game. Your goal is...

    you will implement the A* algorithm to solve the sliding tile puzzle game. Your goal is to return the instructions for solving the puzzle and show the configuration after each move. A majority of the code is written, I need help computing 3 functions in the PuzzleState class from the source code I provided below (see where comments ""TODO"" are). Also is this for Artificial Intelligence Requirements You are to create a program in Python 3 that performs the following:...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT