Ask Question, Ask an Expert

+1-415-315-9853

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

Create a class named order that performs order processing

Create a class named Order that performs order processing of a single item. The class has the following five fields: Customer name Customer number Quantity ordered Unit price Total price Include set and get methods for e ...

Enable geometricobject comparable modify the

(Enable GeometricObject comparable) Modify the GeometricObject class to implement the Comparable interface, and define a static max method in the GeometricObject class for finding the larger of two GeometricObject object ...

Write a program containing two classes named student and

Write a program containing two classes named student and roster, respectively. The program will maintain a current roster of students within a given course. Student data for the program includes student ID, first name, l ...

Pseudocodes and flowchartxyz company employees work for 8

Pseudocodes and flowchart XYZ company employees work for 8 hours a day and 40 hours in a week. The employees are paid overtime at the rate of half of the salary. Employees who get more than 15000 must pay a supplementary ...

Assignmentthe csit racing club is a group that runs amateur

Assignment The CSIT Racing Club is a group that runs amateur car racing events throughout the US. In This project, write a program that will help the club determine the winner of their Fall Rally Race. You will need to d ...

Write a function that returns a number given an uppercase

Write a function that returns a number, given an uppercase letter, as follows: def getNumber(uppercaseLetter): Write a test program that prompts the user to enter a phone number as a string. The input number may contain ...

Along with your name include your student id and discussion

? Along with your name, include your student ID# and discussion section at the top of your Assignment. ? There are eight problems; we will go over them in dicussion section after the due date. ? The textbook in this cont ...

Assignment1 you are a manager who is employed by a game

Assignment 1. You are a manager who is employed by a game production company. Your team is responsible for coding one of the game modules. You have two newly hired programmers working for you who believe that the followi ...

Generate code for the given three-address statements

Generate code for the given three-address statements assuming all variables are stored in memory locations. a) x = 1 b) x = a c) x = a + 1 d) x = a + b e) The two statements x = b * c y = a + x

Most languages are case sensitive so keywords can be

Most languages are case sensitive, so keywords can be written only one way, and the regular expressions describing their lexemes are very simple. However, some languages, like SQL, are case insensitive, so a keyword can ...

  • 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

Section onea in an atwood machine suppose two objects of

SECTION ONE (a) In an Atwood Machine, suppose two objects of unequal mass are hung vertically over a frictionless

Part 1you work in hr for a company that operates a factory

Part 1: You work in HR for a company that operates a factory manufacturing fiberglass. There are several hundred empl

Details on advanced accounting paperthis paper is intended

DETAILS ON ADVANCED ACCOUNTING PAPER This paper is intended for students to apply the theoretical knowledge around ac

Create a provider database and related reports and queries

Create a provider database and related reports and queries to capture contact information for potential PC component pro

Describe what you learned about the impact of economic

Describe what you learned about the impact of economic, social, and demographic trends affecting the US labor environmen