Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Determine a) what the knowledge base is looking for, b) Is the knowledge base correct (does it return the right answer for every input query,

Determine a) what the knowledge base is looking for, b) Is the knowledge base correct (does it return the right answer for every input query, and if there are improper/incorrect/missing elements, what are they?), and c) Give two queries that will return True and two that will return False, assuming each is possible (if it is impossible to get true or false, state why)

* a) What each Knowledge Base is looking for

* b) Is the Knowledge Base correct (i.e. will it always return the right answer for every query).

* A wrong answer could be returned from several different results.

* 1) Missing statements or rules

* 2) Improper statements or rules

* 3) Poor end conditions

* If there are errors inside the Knowledge Bases, what steps are needed to fix them?

* i.e. what changes or new rules would be added in?

* c) What are two (valid) queries that will return True from each Knowledge Base, and what are two

* queries that will return False from each. */

% KNOWLEDGE BASE 1

start(X) :- check1(X), check2(X).

check1([X|Y]) :- other(Y).

check1([]).

other([X|Y]) :- check1(Y).

check2([0|X]) :- check2(X).

check2([1|X]) :- step1(X).

step1([0|X]) :- check2(X).

step1([1|X]) :- step2(X).

step2([0|X]) :- step2(X).

step2([1|X]) :- step2(X).

step3([0|X]) :- step4(X).

step3([1|X]) :- step1(X).

step4([]).

step4([0|X]) :- check2(X).

step4([1|X]) :- step1(X).

% KNOWLEDGE BASE 2

victory(X,Y) :- X\=Y, phase1(X,Y), phase2(X), phase3(X,Y).

phase1(X,Y) :- attr(X), attr(Y).

attr(tim).

attr(joe).

attr(bill).

attr(jane).

attr(ashley).

attr(bob).

attr(phyllis).

attr(sara).

phase2(X,Y) :- work(X), work(Y).

work(tim).

work(ashley).

work(bob).

work(sara).

work(claire).

work(chris).

phase3(X,Y) :- learn(Y), learn(X).

learn(X) :- work(X), pass(X).

pass(claire).

pass(chris).

pass(tim).

pass(sara).

pass(bob).

pass(ashley).

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

Data Structures and Algorithm Analysis in Java

Authors: Mark A. Weiss

3rd edition

132576279, 978-0132576277

More Books

Students also viewed these Programming questions

Question

Explain the statement, In the long run, there are no fixed costs.

Answered: 1 week ago