CSE341 – (Solution)

$ 24.99
Category:

Description

Grading: Each homework will be graded on the scale 100. Unless otherwise noted, the questions/parts will be weighed equal.

Part 1. [50pt] In this part of the homework, you are asked to write a simple expert system in Prolog for scheduling of classes. In your expert system, you will have rooms, courses and people.
• A room has an ID, capacity (how many people it can hold), and operations hours given in one-hour increments from 8am till 5pm. Occupancy information for a room includes the hour and the name of the course taking that hour. A room can also have special equipment such as a projector, a smart board and access for the handicapped.
• A student has an ID, and list of courses she/he attends. A student can also be handicapped.
Your expert system should be able to add a new student, course or a room to the system. It should respond to queries such as:
• Check whether there is any scheduling conflict.
• Check whether a student can be enrolled to a given class.
Part 2. In the graph below you see the possible flights between some of the cities in Turkey. Write the predicate “route(X,Y,C) – a route between X and Y exists with cost C” that checks if there is a route between any given two cities.

Your Prolog program should have all the facts and predicates/rules. See the following:
% knowledge base

flight(istanbul,izmir,2). % fact: Istanbul and Izmir has a flight with cost 2.

% rules … route(X,Y,C) :- flight(X,Y,C). % a predicate indicating there exist a route between
% X and Y if there is flight between X and Y with cost % C.

A single query to complete your program should check if there is a direct route between two given cities. Alternatively, it can list all the connected cities for a given city. See the following:
?- route(canakkale,X,C).
X = erzincan, C = 6 ;
X = antalya, C = 9 ;

Reviews

There are no reviews yet.

Be the first to review “CSE341 – (Solution)”

Your email address will not be published. Required fields are marked *