Assignment #3 Solution

$35.00 $24.00

This assignment includes both conceptual and code questions. It must be completed individually. You may not collaborate with other students, share code, or exchange partial answers. Questions involving answers or code must be emailed to the instructor or TAs directly or discussed during o ce hours. Your answers to the conceptual questions must be uploaded…

You’ll get a: . zip file solution

 

 
Categorys:

Description

5/5 – (2 votes)

This assignment includes both conceptual and code questions. It must be completed individually. You may not collaborate with other students, share code, or exchange partial answers. Questions involving answers or code must be emailed to the instructor or TAs directly or discussed during o ce hours. Your answers to the conceptual questions must be uploaded to Moodle as a pdf le titled \Assign3 UnityID.pdf”. Your sourcecode must be submitted as a self-contained zip. All code must be clear, readable, and well-commented. Note: The code will be tested on the NCSU VCL system(\CSC520 VCL”). You are advised to test your code there before submission.

 

Question 1 (20 pts)

 

Consider the following English sentences.

 

Sodium is an alkali metal.

 

Some alkali metals can react with all nonmetals except the noble gases. If the nonmetal is a noble gas, then no alkali metal can react with it. Xenon is a nonmetalic noble gas.

 

  1. (5 pts) Convert the sentences into rst-order predicate logic. Use the following lexicon:

 

 

alkali (X) X is an alkali metal. nonmetal(X) – X is a nonmetal. noble (Y) Y is a noble gas. react (X, Y) X can react with Y.

 

 

  1. (10 pts) Follow the steps on text book to convert the logic statements into CNF.

 

  1. (5 pts) ) Using FOPL resolution prove the conclusion that Xenon cannot react with Sodium. Number your clauses, and indicate explicitly step-by-step what resolves together, and under what substitution.

 

 

 

 

Question 2 (30 pts)

 

Here is a database of facts and rules.

 

 

There are two types of animals: Carnivores and Herbivores. Deer is a type of Herbivore.

 

Bat is another type of herbivore. Ron is a Bat.

 

Buckshot is a deer. Junior is a deer.

 

Dexter is a Carnivore.

 

  1. (5 pts) Draw this taxonomy as a frame-based knowledge base and label the edges and nodes appropriately.

 

  1. (5 pts) Using as a top-level rule head the syntax rel(SourceNode, RelationshipType, Destina-tionNode) and any other predicates you need, write a set of one or more rules to allow the inference that:

 

  1. Ron is a Bat, it is also a herbivore, and also an animal.

 

  1. Buckshot is a deer, it is also a herbivore, and also an animal.

 

  1. Junior is a deer, it is also a herbivore, and also an animal.

 

  1. Dexter is a carnivore, and an animal.

 

Your rules must follow strict Prolog syntax, and should allow inference over hierarchies of any depth, not just the depth in this example.

 

  1. (10 pts)Now enhance your knowledge base optained in part (a) to represent following knowl-edge and show the complete gure:

 

  1. Animals’ habitat is land but Bat’s is Air.

 

  1. Skin color of a deer is yellow but Buckshot is black.

 

  1. Animals have 4 legs but Dexter and Ron have 2 legs.

 

  1. Ron and Buckshot are friends of each other.

 

  1. Junior is a friend of Dexter but Dexter is not a friend of Junior.

 

 

 

 

  1. (5 pts) Add prolog rule(s) to allow the inference that :

 

  1. Ron’s habitat is air.

 

  1. Junior’s habitat is land.

 

  1. Buckshot is black.

 

  1. Ron has 2 legs.

 

  1. Junior is a friend of Dexter and so are Ron and Buckshot .

 

Note: Submit one le for each of the sub-questions above named 32b.pl 32d.pl respectively. The nal Prolog code should derive all the inferences whether di-rectly stated or implied from the knowledge base and not just those stated in above parts.

 

 

 

Question 3 Extra Credit (25pts)

 

Consider the following English sentences.

 

Tom is in the client user group.

 

Some user in the client group can access all databases that have no password protection. If the database has password protection, no user in the client group can access it.

MongoDB has password protection.

 

  1. (5 pts) Convert the sentences into rst-order predicate logic. Use the following lexicon:

 

 

client(X) { X is in the client user group. password(Y) { database Y is password protected. access(X,Y) { X can access the database Y.

 

 

  1. (10 pts) Following the steps on text book to convert the logic statements into CNF.

 

  1. (5 pts) Using FOPL resolution prove the conclusion that Tom can’t access MongoDB. Number your clauses, and indicate explicitly step-by-step what resolves together, and under what substitution.

 

  1. (5pts) Implement a prolog database of rules that mirrors the logic above and is capable of executing the same query. Submit one le named 33d.pl.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

3