Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Programming Language Expert

prepare Prolog programs for each of given problems. For each of your programs:

a) Execute your code and draw a graph of search space.
b) Modify the rule ordering to produce alternative solution paths.

problem 1: A Prolog code to answer Wirth’s “I am my own grandfather” problem:

I married a widow (let’s call her W) who has a grown-up daughter (call her D). My father (F), who visited us quite frequently, fell in love with my step-daughter and married her. Therefore my father became my son-in-law and my step-daughter became my mother. Some months later, my wife gave birth to a son (S1), who became the brother-in-law of my father, and also my uncle. The wife of my father, that is, my step-daughter, as well had a son (S2).

problem 2: A Prolog code to solve the farmer, wolf, goat and cabbage problem:

A farmer with his wolf, goat and cabbage come to the edge of the river they wish to cross. There is a boat at the river’s edge, however of course, only the farmer can row. The boat as well can carry only two things, including the rower, at a time. If the wolf is ever left alone with the goat, the wolf will eat the goat; likewise if the goat is left alone with the cabbage, the goat will eat the cabbage. Devise a series of crossings of the river so that all four characters arrive safely on the other side of river.

problem 3: A Prolog code for the missionary and cannibal problem:

Three missionaries and three cannibals come to the bank of a river they wish to cross. Three is a boat which will hold only two, and any of the group is capable to row. If there are ever more missionaries than cannibals on any side of the river the cannibals will get converted. Devise a series of moves to get all the people across the river with no conversions.

problem 4: A Prolog code for the water jugs problem:

There are two jugs, one holding 3 and the other 5 gallons of water. A number of things can be completed with the jugs: they can be filled, emptied and dumped one into the other either till the poured-into jug is full or till the poured-out-of jug is empty. Devise a sequence of actions which will produce 4 gallons of water in the larger jug.

Programming Language, Programming

  • Category:- Programming Language
  • Reference No.:- M9896
  • Price:- $110

Guranteed 48 Hours Delivery, In Price:- $110

Have any Question?


Related Questions in Programming Language

Background informationthis assignment tests your

Background Information This assignment tests your understanding of and ability to apply the programming concepts we have covered throughout the unit. The concepts covered in the second half of the unit build upon the fun ...

Question 1 what is a computer program what is structured

Question: 1. What is a Computer program? What is structured programming? 2. What is modular programming? Why we use it? 3. Please evaluate Sin (x) by infinite series. Then write an algorithm to implement it with up to th ...

Structs and enumsoverviewin this task you will create a

Structs and Enums Overview In this task you will create a knight database to help Camelot keep track of all of their knights. Instructions Lets get started. 1. What the topic 5 videos, these will guide you through buildi ...

Question - create a microsoft word macro using vba visual

Question - Create a Microsoft Word macro using VBA (Visual Basic for Applications). Name the macro "highlight." The macro should highlight every third line of text in a document. (Imagine creating highlighting that will ...

Assignment - horse race meetingthe assignment will assess

Assignment - Horse Race Meeting The Assignment will assess competencies for ICTPRG524 Develop high level object-oriented class specifications. Summary The assignment is to design the classes that are necessary for the ad ...

Assignment - horse race meetingthe assignment will assess

Assignment - Horse Race Meeting The Assignment will assess competencies for ICTPRG524 Develop high level object-oriented class specifications. Summary The assignment is to design the classes that are necessary for the ad ...

Task silly name testeroverviewcontrol flow allows us to

Task: Silly Name Tester Overview Control flow allows us to alter the order in which our programs execute. Building on our knowledge of variables, we can now use control flow to create programs that perform more than just ...

Task working with arraysoverviewin this task you will

Task: Working with Arrays Overview In this task you will create a simple program which will create and work with an array of strings. This array will then be populated with values, printed out to the console, and then, w ...

Assignmentquestion onegiving the following code snippet

Assignment Question One Giving the following code snippet. What kind of errors you will get and how can you correct it. A. public class HelloJava { public static void main(String args[]) { int x=10; int y=2; System.out.p ...

Assignment - haskell program for regular expression

Assignment - Haskell Program for Regular Expression Matching Your assignment is to modify the slowgrep.hs Haskell program presented in class and the online notes, according to the instructions below. You may carry out th ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As