Programming Languages Review for Test 2

In addition to anything you were weak on in the last test, you should be in control of the following concepts:

A.  List the six different functional elements present in every programming language we have studied, and show an example of each, or explain how each is implemented, in

1.  Java

2.  Smalltalk

3.  Scheme

4.  Prolog

B.  Functional Programming:
1.  What is the chief programming tool in functional programming? What two parts must be present for recursion to work?

2.  Of the six functional elements above, which are formally disallowed in a functional language? How can you get the same computational effect without using explicit assignments and loops?

3.  What is the fundamental data structure used in the most popular functional programming languages? What three intrinsic functions are used to manipulate lists?

4.  Write a small recursive function to do something -- possibly one of the following...

a.  Do something (like sum or product) with all the integers between m and n

b.  Make a list of all the integers between m and n

c.  Copy a list with the nth element deleted or changed or inserted

d.  Copy a list with the elements reversed or sorted or otherwise rearranged

C.  Logic Programming:
0.  Be familiar with these symbols and how to use them: «, », , $, "

1.  Define Horn clause.

2.  Forward and backward chaining -- What is the difference? How do they work? Which is used in Prolog?

3.  Instantiation and unification -- Define these terms. How does Prolog use them?

4.  Define Robinson's Resolution. How does it work in Prolog?

5.  What are the limitations of Prolog?

D.  Object-Oriented Programming (OOP):
1.  Give two different definitions for OOP

2.  What is different between OOP and its predecessors? What is the same?

E.  Concurrency and exceptions:
1.  What are the major concerns in concurrent programs?

2.  What mechanisms do languages typically provide to deal with these concern(s)?

3.  What mechanism(s) do languages typically provide to deal with exceptions?

Rev. 2003 April 14