Study Guide 6
Covers 3 - 3.3.3
3 - 3.1 What and why of declarativeness
- What three properties does a declarative operation possess?
- In what sense is a declarative operation independent, stateless, and deterministic?
- Why is declarativeness useful or important?
- How/why does declarativeness improve modularity?
- How/why does declarativeness make programming simpler?
- Why is the effort needed to understand a declarative program just a sum (not a multiplication) of the effort needed to understand the subcomponents?
- What is referential transparency, and how does it simplify reasoning about programs?
- What are the two main categories of declarative programming and what is the difference between them?
- HTML and XML are examples of what kind of declarative programming?
- What is the difference between observational and definitional declarative programming?
- What kinds of definitional declarativeness are there?
- True or False. It is possible for a component interface to be declarative even if its implementation is not.
- Why is there a tradeoff between expressiveness and efficiency in a language?
- Why is it true that combining declarative operations according to the operations of the declarative model always results in a declarative operation?
3.2 Iterative Computation
- What does it mean for a computation to be iterative?
- What is the general scheme of an iterative computation?
- What is significant about the implementation differences of Newton's method in Figs. 3.4 - 3.8?
- For good programming practice, where in a program should helper routines be defined?
- What is the principle behind this practice?
- What is a control abstraction?
- How can Newton's method be defined in terms of the Iterate control abstraction which takes three arguments? Compare and contrast this approach with a version implemented as a C++ 'for' loop.
3.3 Recursive Computation
- What makes a function recursive?
- What makes a data type recursive?
- Compare and constrast a substitution-based abstract machine versus an environment-based abstract machine. Which is easier to implement and why? Which is easier to reason with and why?
- A non-iterative factorial calculation performs multiplications in the following order:
(5*(4*(3*(2*(1*1))))). How can the association of operations be rearranged to make the calculation iterative?