; Questions and Answers for Generative Designs
(
("Data Analysis and Definition"

"to understand what kinds of information are to be processed and
 how to represent the information as data (see \\aref{structural0}{the
 structural design recipe} for the relevant questions)"
) 

;; ------------------------------------------------------------------------

("Contract and Header"

"to formulate examples of the program's input-output behavior based on the
 problem statement; to specify the behavior informally (also see
 \\aref{structural0}{the structural design recipe} for hints)"
)

;; ------------------------------------------------------------------------
("Program Examples"

"to understand how the suggested process produces answers for a variety of inputs"

("What does the problem statement say about easily solvable problems?"
 "Create input samples that represent such problems. Show what the output
 should be.") 

("{\\em What\\/} are complex versions of the problem?" 
 "Create examples that represent complex problems. Show {\\em what\\/} the
 output {\\em should\\/} be.")

("{\\em How\\/} should the algorithm proceed on these complex examples?"
 "Give a step by step account of what the process should be. Pay special
  attention to 
   \\begin{enumerate}
     \\item how the new problems are generated 
     \\item how their solutions are combined to obtain a solution for the
       original problem. 
   \\end{enumerate}")
)

;; ------------------------------------------------------------------------

("Process Template"

"to translate the informal process descriptions into Scheme expressions and
functions" 

("Are there different classes of easily solvable problems?" 
 "Deal with each one by working out a separate \scheme{cond}-clause.")

("Can a Scheme primitive recognize that the input represents an easily
  solvable problem?"
 "If so, use it. If not, specify a function that determines whether or not
  the input data represents an easily solvable problem.")

("Is the solution of an easily solvable problem a plain Scheme constant or
  something that can be computed with Scheme primitives from the input
  data?" 
 "If so, write down the appropriate expression. If not, specify a function
  that determines the solution of an easily solvable problem.")

("Are there different classes of complex problems?" 
 "Deal with each one by working out a separate \scheme{cond}-clause.
  For each class, determine a way to recognize the input data that belong
  to the class. Then deal with each one as suggested by the following
  questions.")

("Can a combination of Scheme primitives generate new problems from inputs
  for specific problems?" 
 "If so, formulate an expression that does so. Otherwise, specify a
  function that does it.")

("How is it possible to generate a solution for the given problem from 
  the solution(s) for the newly generated problem(s)?"
 "Formulate a Scheme expression that combines the solution(s) and parts of
  the given input. Or, specify a function that consumes the solution(s) and
  the given input and produces the solution for the original problem.")
) 

;;  ------------------------------------------------------------------------

("Body"

"to produce a complete program by writing all auxiliary functions"

("Which parts of the template require auxiliary functions?"  "These
 functions should already be specified with header, contract, and purpose
 statement. Work out their definitions. They are probably going to process
 the data in a structural fashion.")
)

;; ------------------------------------------------------------------------

("Test"
"to test the program's behavior on the specified examples"

("Use the examples from ``Program Examples'' to test the program." "If
an actual answer differs from a corresponding expected one, it is possible
that
\\begin{enumerate}
  \\item the original caculation or
  \\item the program formulation
\\end{enumerate}
 contains a mistake. In rare cases, it is also possible that both answers
 are wrong because both parts contain mistakes.")
)

("Termination Argument"
 "to provide an argument why the program always produces an output"

("Are the newly generated problems in some sense smaller than the original
  problem?" 

 "If so, explain how. For example, a list may contain fewer items. Or,
  it might contain fewer items that have a certain property. An interval
  may have gotten smaller. A tree might have fewer components on one side.
 ")

("Is it possible that the algorithm does not produce an output for certain
  inputs?" 
 "Give examples. Explain how the examples differ from other inputs.")
)
)
