McCarthy's Transformation

Exercise     Construct a functional program from the following flowchart:


In general,  associate function with each point in program between  2 steps.

Exit  function produces final value.

Entry  function takes overall parameters.

Other functions are inter-related, possibly by mutual recursion.

We call this McCarthy's Transformation.


Assignment Stmt

The relationship  is

f(...V...) = g(...Exp...);

    

  same position

f(x,y) = g(x+1,y);

 

Relationship :

  f(...vars...) = P(...vars...)?

                  g(...vars...)

                : h(...vars...)

 

To Next Slide To Previous Slide To Contents