Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider the following facts: predicates parent(symbol,symbol). likes(symbol,symbol). clauses parent (pam, bob). parent (tom, bob). parent (tom, liz). parent (bob, ann). parent (bob, pat). parent (pat,

Consider the following facts:
predicates parent(symbol,symbol). likes(symbol,symbol).
clauses
parent (pam, bob). parent (tom, bob). parent (tom, liz). parent (bob, ann). parent (bob, pat). parent (pat, jim). likes(pam,pizza). likes(tom,hamburger). likes(bob,pizza). likes(ann,sandwich). likes(pat,hamburger). likes(jim, sandwich).
Write queries in Prolog language for the following:
i)(2 points). Who likes sandwich and is a child of Bob? ii)(2 points). Who is a grandparent of Jim?
image text in transcribed
b) Consider the following facts: predicates parent(symbol,symbol). likes(symbol.symbol). clauses parent (pam, bob). parent (tom, bob). parent (tom, liz). parent (bob, ann). parent (bob, pat). parent (pat, jim). likes(pam,pizza). likes tom,hamburger) likes(bob.pizza). likes(ann,sandwich). likes(pat, hamburger) likes jim, sandwich) Write queries in Prolog language for the following: D(2 points), Who likes sandwich and is a child of Bob? ib (2 points), Who is a grandparent of Jim

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

Step: 3

blur-text-image

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

Students also viewed these Databases questions