Haskell/Solutions/Denotational semantics: Difference between revisions

From testwiki
Jump to navigation Jump to search
imported>Strange quark
Remove excess category
 
(No difference)

Latest revision as of 14:47, 11 September 2017

Template:Haskell solution

Template:Exercises

Remember that:

power2 0 = 1
power2 n = 2 * power2 (n-1)

First, we need to consider whether ⊥ - 1 is or not. Using similar reasoning to the ⊥ + 1 case, we can determine that ⊥ - 1 is indeed . From there, we know that power2 ⊥ is 2 * power2 ⊥. Since this recurses indefinitely, it is equivalent to .