Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

use SWI-Prolog to do the problem, show the program screenshots Problem 3: Simple inheritance network % Implement isa and aka predicates in Prolog. % isa(Name,

use SWI-Prolog to do the problem, show the program screenshots

Problem 3: Simple inheritance network % Implement isa and aka predicates in Prolog. % isa(Name, Class): returns true if entity Name is a member of Class. % aka(SubC, Class): returns true if SubC is a Subclass of Class. % Given two types of facts: % prop(Name, type, Class): Name isa member of Class without using % inheritance. % prop(SubC, subclass, Class): Subc is a subclass of Class without % using inheritance % Test data: prop(tweety, type, canary). prop(snoopy, type, beagle). prop(canary, subclass, bird). prop(beagle, subclass, dog). prop(bird, subclass, animal). prop(dog, subclass, animal).

% Implement isa and aka using recursion. DO NOT use assert! % You can implement this problem in 4 rules! % Hints: implement aka using aka and prop, % implement isa using prop and aka.

% test cases: % ?- isa(tweety, canary). (Note: No inheritance used) % true. % ?- isa(tweety, bird). (Note: Inheritance used) % true. % ?- isa(tweety, animal). % true. % ?- isa(tweety, dog). % false. % ?- aka(canary, bird). (Note: no inheritance used) % true. % ?- aka(canary, animal). (Note: inheritance used) % true. % ?- aka(snoopy, animal). % false. (Because snoopy is a member of animal, not a subclass!)

% Type your solution here:

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

Samsung Galaxy S23 Ultra Comprehensive User Manual

Authors: Leo Scott

1st Edition

B0BVPBJK5Q, 979-8377286455

More Books

Students also viewed these Databases questions

Question

1. What is Ebola ? 2.Heart is a muscle? 3. Artificial lighting?

Answered: 1 week ago

Question

4. Describe cultural differences that influence perception

Answered: 1 week ago