Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Start this Prolog assignment by entering the following five facts and two in-rules into your Prolog engine inFact(bangor,penobscotCounty). inFact(portland,cumberlandCounty). inFact(penobscotCounty,maine). inFact(cumberlandCounty,maine). inFact(maine,newEngland). contains(A,B):-inFact(B,A). contains(A,B):-inFact(C,A),contains(C,B). 1.

Start this Prolog assignment by entering the following five facts and two in-rules into your Prolog engine

inFact(bangor,penobscotCounty).

inFact(portland,cumberlandCounty).

inFact(penobscotCounty,maine).

inFact(cumberlandCounty,maine).

inFact(maine,newEngland).

contains(A,B):-inFact(B,A).

contains(A,B):-inFact(C,A),contains(C,B).

1. What are the differences of the relations in Fact and the relation contains? Describe the difference in terms of the relation properties covered in the last homework.For the following queries and rules, do not use your intuition, but follow exactly the wording of the queries, even if you think the query could be reworded or if you think that the query would make more sense if reworded.

2. Write a query to determine all items that newEnglandcontains. Why does orono not show up as something newEnglandcontainswhen you query your data set?

3. Write a query to determine all items that maine contains and cumberland Countycontains. Briefly discuss the query result youobtained.

4. Write a query to determine all items that newHampshire contains.Briefly discuss the query result you obtained.

5.Write a rulein(A,B)that captures whether something A is in something B.Try to find the most concise way to formulate this rule.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

What are Measures in OLAP Cubes?

Answered: 1 week ago

Question

How do OLAP Databases provide for Drilling Down into data?

Answered: 1 week ago

Question

How are OLAP Cubes different from Production Relational Databases?

Answered: 1 week ago