Prolog-Modern Programming Languages-Assignment, Exercises of Programming Languages

I am student at Baddi University of Emerging Sciences and Technologies. To help my friends in other universities, I am uploading my assignments of different courses. Its for Modern Programming Languages course. Other can see if they are searching following: Modern, Programming, Languages, Environmental, System, Premier, Web-Based, , Software, Solutions, Prolog

Typology: Exercises

2011/2012

Uploaded on 08/01/2012

parmitaaaaa
parmitaaaaa 🇮🇳

4.2

(111)

173 documents

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Modern Programming Languages (CS508)
SPRING 2012
Assignment No. 3
Total Marks: 20 Dead line: June 06, 2012
Purpose of Assignment:
Intended purpose of this assignment is to give students an exercise using Prolog
programming language and to make use of Prolog's fast incremental development cycle
and rapid prototyping capabilities that have encouraged the use of the language as a tool
for solving complex problems while working in any professional software development
environments.
After attempting this assignment students will be able to:
Familiarize with the Logical and declarative aspects and programming techniques
used in the programming language like Prolog
Learn the basic syntax of Prolog as a highest level general-purpose language
widely used today
Students will get comprehensive understanding of Working with Rules and Facts
in Prolog.
Application:
AlstraSoft Expert System Application:
Scenario:
Suppose you are developing an expert Environmental system at Alstrasoft Pvt Ltd that
strives to be the premier provider of web-based software solutions for businesses
worldwide. As a web development and software company, Alstrasoft specialize mainly in
web design and software programming.
Evaluation:
Now In the same Environmental systems that predict the weather, analyze water supplies,
and so on. There is a need to develop an expert system in Prolog named Weather
Modeling System, for National Center for Atmospheric Research .This expert system
will provide relatively detailed, short term forecast of meteorological conditions. It is
used particularly to model pollutant dispersion (for instance, acid rain deposition).
Answer the following questions based on the scenario provided.
docsity.com
pf3

Partial preview of the text

Download Prolog-Modern Programming Languages-Assignment and more Exercises Programming Languages in PDF only on Docsity!

Modern Programming Languages (CS508)

SPRING 2012

Assignment No. 3

Total Marks: 20 Dead line: June 06, 2012

Purpose of Assignment:

Intended purpose of this assignment is to give students an exercise using Prolog programming language and to make use of Prolog's fast incremental development cycle and rapid prototyping capabilities that have encouraged the use of the language as a tool for solving complex problems while working in any professional software development environments. After attempting this assignment students will be able to:

 Familiarize with the Logical and declarative aspects and programming techniques used in the programming language like Prolog

 Learn the basic syntax of Prolog as a highest level general-purpose language widely used today

 Students will get comprehensive understanding of Working with Rules and Facts in Prolog.

Application:

AlstraSoft Expert System Application:

Scenario:

Suppose you are developing an expert Environmental system at Alstrasoft Pvt Ltd that strives to be the premier provider of web-based software solutions for businesses worldwide. As a web development and software company, Alstrasoft specialize mainly in web design and software programming.

Evaluation:

Now In the same Environmental systems that predict the weather, analyze water supplies, and so on. There is a need to develop an expert system in Prolog named ‘ Weather Modeling System’ , for National Center for Atmospheric Research .This expert system will provide relatively detailed, short term forecast of meteorological conditions. It is used particularly to model pollutant dispersion (for instance, acid rain deposition). Answer the following questions based on the scenario provided.

a) Why is PROLOG the language of choice for developers to develop expert system like ‘ Weather Modeling System’? [5]

b ) Write Prolog equivalent for the following statements? [5]

  1. Weather is cloudy and rainy.
  2. Dust storm is expected today.
  3. Mike carries umbrella for John.
  4. Is there a forecast for rain today?
  5. Is the earth round.

c) Consider a program that has following four facts and one rule. What will be the response of following queries in PROLOG also justify your answer against each query? [10]

Facts:

cloudy(South Carolina).

cloudy(Oslo). cold(Oslo). snowy(Toronto)

The rule is:

foggy(X) :- cloudy(X), cold(X).

Queries:

?- foggy(Oslo).

?- foggy(South Carolina).

?- foggy(Toronto).

?- foggy(C). C = X

?- foggy(Sweden).