Purchase Solution

Language evaluation

Not what you're looking for?

Ask Custom Question

Here is the problem:

Neither functional programming languages nor logic programming languages are thought of as 'practical' programming languages. Choose either Lisp or Prolog and recommend changes to the language which you think would increase acceptance of the language in mainstream programming.
Justify your recommendations

Purchase this Solution

Solution Preview

Programming Languages
Introductory Notes
Language Types,
1) Imperative model
You are acquainted with the imperative model - a statement like
pay = hours * 6.65;
changes the state of the processor. In this case, the memory location referenced by the variable pay has its content changed to the result of fetching the content of the memory address referenced by hours and multiplying it by the constant. A program is a sequence of changes of state.Much of the course will be devoted to pointing out variations in the imperative model.

2) Logic-oriented model
You are not so familiar with the logic-oriented model. Our example language will be Prolog. In Prolog we can write databases of facts, like
father(anne,buck).
father(alice,buck).
father(buck,charles).
father(barbara,calvin).
mother(anne,barbara).
mother(alice,barbara).
mother(buck,cora).
mother(barbara,celeste).
mother(celeste,doris).
Then we can add some intelligence to our database. It ought to be easy to figure out from the facts when a person Y is a grandmother of a person X, so we write
grandmother(X,Y) :- mother(X,Z), mother(Z,Y).
grandmother(X,Y) :- father(X,Z), mother(Z,Y).
Instead of writing a procedure to figure out when Y is a grandmother of X, as we would in an imperative language, we define what it means to be a grandmother in terms of the facts we have. The symbol ":-" means "if". Now we can write a query like
?- grandmother(anne,Who).
and we expect ...

Solution provided by:
Education
  • BSc (Hons), University of Colombo - Sri Lanka
  • MEngSc, University of Melbourne
  • Certificate IV in Training & Assessment , Australian Business Council
Recent Feedback
  • "Thank you!"
  • "Thank you."
  • "Thanks a lot for you help and support"
  • "Sorry about the late payment but the assignment was sufficient and appreciated. Good work"
  • "Great description! Thank you for your quick response."
Purchase this Solution


Free BrainMass Quizzes
Basic Networking Questions

This quiz consists of some basic networking questions.

Word 2010: Table of Contents

Ever wondered where a Table of Contents in a Word document comes from? Maybe you need a refresher on the topic? This quiz will remind you of the keywords and options used when working with a T.O.C. in Word 2010.

Java loops

This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.

Javscript Basics

Quiz on basics of javascript programming language.

Basic Computer Terms

We use many basic terms like bit, pixel in our usual conversations about computers. Are we aware of what these mean? This little quiz is an attempt towards discovering that.