We will be using a very robust fast and efficient automated

Assignment Help Computer Engineering
Reference no: EM13371034

We will be using a very robust, fast, and efficient automated inferencing system with support for disjuction and functions called DLV to practice with knowledge representation and reasoning. For many people, representing knowledge in a form that can be used by a computer for automated reasoning, although really just another form of computer programming, can seem rather difficult (much in the same way that some students happy to write 500 lines of C code fall apart when asked to write a 3-line Lisp/Scheme recursion :-)  In any case, there are other ways to conceptualize the act of programming besides "imperative" (C/Java/Pascal/Fortran-like) and "functional" (Lisp/Scheme/Racket/Scala/Haskell) programming. So-called "Logic Programming" or "Declarative Programming" is one of these other ways.

Example 1: Propositional Logic

Consider the following logic puzzle:

 Mr. Black, Mr. Red, and Mr. White were having a conversation.

"It's funny," said Mr. Black to the other two men, "that we are all wearing different colors, but none of us is wearing the color that is the same as his name."

"True," agreed another man, who was wearing white.

We can represent this in DLV with the following sentences:

% Proposition mrblack_wears_red means Mr. Black wears red.
% none wear color same as name disjunctive facts

mrblack_wears_red v mrblack_wears_white.
mrwhite_wears_red v mrwhite_wears_black.
mrred_wears_black v mrred_wears_white.
% alldiff constraints
:- mrblack_wears_red, mrwhite_wears_red.
:- mrblack_wears_white, mrred_wears_white.
:- mrwhite_wears_black, mrred_wears_black.
% the clue "...agreed another man, who was wearing white"
~mrblack_wears_white.

RareVosMBP:DLV decker$ ./dlv misterRBW.txt -nofacts
DLV [build BEN/Dec 17 2012 gcc 4.2.1 (Apple Inc. build 5666) (dot 3)]
{mrblack_wears_red, mrwhite_wears_black, mrred_wears_white}
{mrblack_wears_white, mrwhite_wears_red, mrred_wears_black}

But with the last sentence back in the KB, we get only a single model, the desired solution:

RareVosMBP:DLV decker$ ./dlv misterRBW.txt -nofacts
DLV [build BEN/Dec 17 2012 gcc 4.2.1 (Apple Inc. build 5666) (dot 3)]
{mrblack_wears_red, mrwhite_wears_black, mrred_wears_white}

First-Order Logic Example

Here is the Colonel West example from the book (Section 9.3.1) in dlv:

% "... it is a crime for an American to sell weapons to hostile nations"
criminal(X) :- american(X), weapon(Y), sells(X,Y,Z), hostile(Z).
% Nono has some missiles
missile(m1).
owns(nono,m1).
% All of its missiles were sold to it by Colonel West
sells(west,X,nono) :- missile(X), owns(nono,X).
% background: missiles are weapons.
weapon(X) :- missile(X).
% background: an enemy of America is "hostile" (to America)
hostile(X) :- enemy(X,america).
% "West, who is an American..."
american(west).

% "The country of Nono, an enemy of America..."
enemy(nono,america).
"
And the only model is the desired one, which includes the predicate criminal(west) as true:

RareVosMBP:DLV decker$ ./dlv west.txt -nofacts
DLV [build BEN/Dec 17 2012 gcc 4.2.1 (Apple Inc. build 5666) (dot 3)]
{criminal(west), weapon(m1), sells(west,m1,nono), hostile(nono)}

1. Getting Acquainted. Consider the following axioms:

• Horses are faster than dogs

• There is a greyhound that is faster than every rabbit

• Harry is a horse

• Ralph is a rabbit

We would like to prove Harry is faster than Ralph

1a. Write each sentence in FOL.

1b. Write any additional assumptions that you need (world knowledge) in FOL.

1c. Convert each sentence into CNF.

1d. Convert each sentence (or your CNF) into Datalog/DLV format.

1e. By hand, do a resolution proof with the CNF version that Harry is faster than Ralph. (show your work)

1d. Use DLV to prove the same thing (e.g. Harry is faster than Ralph in all models)

2. Three people, Amy, Bob, and Cal, are each either a liar or a truth-teller. Assume that liars always lie, and truth-tellers always tell the truth. 

• Amy says, "Cal and I are truthful."
• Bob says, "Cal is a liar."
• Cal says, "Bob speaks the truth or Amy lies."

What can you conclude about the truthfulness of each?

3. Use DLV to solve problem 5 on HW#2 (the "Sara had quadruplets" problem).

4. Use DLV to play the game Mastermind.

You should have a set of rules about the game in general (the intensional KB), and a set of speci?c facts about a speci?c game (the set of guesses and their responses). Probably the best way to think about this is that you are trying to compute all the models of the game rules and given facts. If there is only one model, then that is the solution.

663_Propositional Logic.png

Develop a predicate BestGuess(color,color,color,color) that tells you what to guess next (even if there is no unique solution yet). At this point you have essentially written a full game player, although I am not asking you to hook the inputs and outputs together.

Reference no: EM13371034

Questions Cloud

Drama characterdeath of a salesman arthur miller pp : drama characterdeath of a salesman arthur miller pp. 1261-1331response to the following questions after reading the
What is an evidence planan evidence plan has two partsbulla : what is an evidence plan?an evidence plan has two partsbulla tool to help the assessor explain to the student how
1you are a bond investor and youre examining a callable : 1.you are a bond investor and youre examining a callable bond. it can be called in 5 years. it is a semiannual bond.
Mortgage loan analysis a resident in sugar land is planning : mortgage loan analysis a resident in sugar land is planning to buy a new house in march 2014. the sale price of the
We will be using a very robust fast and efficient automated : we will be using a very robust fast and efficient automated inferencing system with support for disjuction and
Prepare a term paper on do dividends grow at the same rate : prepare a term paper on do dividends grow at the same rate as earnings and is the gordon model fact or fiction?
Use the three-parameter zone finite element method or the : use the three-parameter zone finite element method or the boundary collocation method to calculate the stress intensity
For flow over a circular cylinder as shown below the : for flow over a circular cylinder as shown below the velocity outside of boundary layer can be estimated to beux 2
The assignment is to analyze the data set and identify the : the assignment is to analyze the data set and identify the companys problem . unbelievably strong hint - its job

Reviews

Write a Review

Computer Engineering Questions & Answers

  Questionin visual basic 2010 please give completed

questionin visual basic 2010. please give completed application as a .zip filea small airline has just purchased a

  Write down c program that has declaration in main() to store

Modify this display() function to alter the address in channels. Always use the expression *channels rather than *(channels + i) to retrieve the right elements.

  What is home wireless network and security

What is home wireless network and security Methodology- Review topics covered in lecture hours, from textbook, reference books plus online research, to behaviour a comprehensive study about wireless network security implementation at home.

  What can be done to minimize the errors

Where are the majority of defects found in a final program introduced? What can be completed to minimize these errors.

  Formulate a debugging strategy

Formulate a debugging strategy. What module should be debugged first, what inputs should you use, what outputs should you expect to see? How should you begin to integrate the modules? What should you do on failure?

  What are outputs and inputs to schedule control

What are the SMART criteria? What are the 5key points of using project milestones.

  Which type of network devices would be supported

You have been asked to generate a paper that compares and contrasts guided versus wireless media for inclusion in your company's knowledge database.

  Tcp and udp

UDP and TCP utilize the 1s complement for their checksums. Assume you have the following three 8-bit bytes: 01010101, 01110000, 01001100. Along with the 1s complement schema, how does receiver detect the errors?

  Performing calculations through class

Build a class known as Rational for carrying out the arithmetic with fractions. Write down a driver program in order to test your class. Addition of the two Rational numbers. Result of addition must be stored in reduced form.

  Implementing different functions

Function celsius returns the Celsius equivalent of the Fahrenheit temperature utilizing the calculation C= 5.0/9.0 * (F-32);

  Program to count the number of times page is opened

Generate a page in order to count the number of times the page is viewed by the user in a single session. Each time page is refreshed or opened in the browser during the session counts as 1 page view.

  Create c program that prompts the user for a filename

Write down a C program that prompts the user for a filename, and changes every alphabetic character in the filename to corresponding capital letter. Numbers and special characters should not be changed. Print the capitalized output to the screen.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd