Geometry of Recursive Programs 2006 9 15 I. 2 • • • • • 3 — • • • 4 5 6 recursion I II III IV 7 II. 8 fact(x) ≡ if x = 0 then 1 else x × fact(x−1) F F(f)(x) ≡ if x = 0 then 1 else x × f(x−1) fact = F(fact) 9 fact(4) (fact = F(fact)) = F(fact)(4) (F ) = if 4 = 0 then 1 else 4 × fact(4−1) (4 �= 0) = 4 × fact(3) (fact = F(fact)) = 4 × F(fact)(3) (F ) = 4 × (if 3 = 0 then 1 else 3 × fact(3−1)) (3 �= 0