Ask Question, Ask an Expert


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

In this lab you will write a program that simulates the

In this lab you will write a program that simulates the dialing of a phone number. The phone number may have either digits, letters, or both. (See sample output below) Here are the letters associated with each digit. 0 5 ...

Assignmentstatementfirst design an interface

Assignment Statement First, design an interface InteractiveGame that generalizes the playing of any two-person game between a human player and the computer. Design two actual games, Nim and another game of your choice, e ...

Lab stackslab exerciseimplement the following classesclass

Lab: Stacks Lab Exercise: Implement the following classes: Class Course that includes three instance variables: private int ID; // course ID private String Name; // course name private Course next; // link next Your clas ...

Programming assignmentthis question has two parts a and

Programming Assignment This question has two parts (a) and (b): Develop a program to read in five exam-scores (in the range of 0-100) of a student in HIST220 class. (a) You program should compute and store in memory the ...

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 ...

Programming logic and design questions1 given the

Programming Logic and Design Questions 1 given the following pseudocode module header: module calculate something (real x,real y, real z,) when the following call executes: call calculate something (21.6, 43.1, 15.2) sho ...

Rainfall programwrite a rainfall program that stores the

Rainfall Program Write a RainFall program that stores the total rainfall for each of 12 months into an array of doubles. The program should have methods that return the following: * The total rainfall for the year * The ...

1 write a program that reads input as a stream of

1. Write a program that reads input as a stream of characters until encountering EOF. Have the program report the number of uppercase characters, the number of lowercase characters, and the number of other characters rea ...

Retail transaction programming projectproject requirements1

Retail Transaction Programming Project Project Requirements: 1. Develop a program to emulate a purchase transaction at a retail store. This program will have two classes, a LineItem class and a Transaction class. The Lin ...

Assignmentgoalsto learn about separate compilation classes

Assignment Goals To learn about separate compilation, classes, and vector manipulation. Your Assignment In this assignment the main has been written for you in the file phone_book_main.cpp. You will also notice that a cl ...

  • 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