X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=blobdiff_plain;f=exercises%2F_assignment4.mdwn;h=fa9d7c445f668675131e17b1f46818324af5d582;hp=f998e7ac73a33c66d353463a62b91aa7b403d710;hb=2e29b34f4aaeb85ead4685541bd52557ef4297e2;hpb=ea4c96609b8d02f5e83a8027cf567bab5562cb5b diff --git a/exercises/_assignment4.mdwn b/exercises/_assignment4.mdwn index f998e7ac..fa9d7c44 100644 --- a/exercises/_assignment4.mdwn +++ b/exercises/_assignment4.mdwn @@ -44,7 +44,7 @@ For instance, `fact 0 ~~> 1`, `fact 1 ~~> 1`, `fact 2 ~~> 2`, `fact 3 ~~> let fact = ... in - fac 4 + fact 4 6. For this question, we want to implement **sets** of numbers in terms of lists of numbers, where we make sure as we construct those lists that they never contain a single number more than once. (It would be even more efficient if we made sure that the lists were always sorted, but we won't try to implement that refinement here.) To enforce the idea of modularity, let's suppose you don't know the details of how the lists are implemented. You just are given the functions defined below for them (but pretend you don't see the actual definitions). These define lists in terms of [[one of the new encodings discussed last week|/topics/week3_lists#v5-lists]]. @@ -99,7 +99,7 @@ point, i.e., demonstrate that `succ ξ <~~> ξ`. We've had surprising success embedding normal arithmetic in the Lambda Calculus, modeling the natural numbers, addition, multiplication, and so on. But one thing that some versions of arithmetic supply is a -notion of infinity, which we'll write as `inf`. This object usually +notion of infinity, which we'll write as `inf`. This object sometimes satisfies the following constraints, for any finite natural number `n`: n + inf == inf @@ -107,7 +107,7 @@ satisfies the following constraints, for any finite natural number `n`: n ^ inf == inf leq n inf == true - (Note, though, that with *some* notions of infinite numbers, like [[!wikipedia ordinal numbers]], operations like `+` and `*` are defined in such a way that `inf + n` is different from `n + inf`, and does exceed `inf`.) + (Note, though, that with *some* notions of infinite numbers, like [[!wikipedia ordinal numbers]], operations like `+` are defined in such a way that `inf + n` is different from `n + inf`, and does exceed `inf`; similarly for `*` and `^`. With other notions of infinite numbers, like the [[!wikipedia cardinal numbers]], even less familiar arithmetic operations are employed.) 9. Prove that `add ξ 1 <~~> ξ`, where `ξ` is the fixed point you found in (1). What about `add ξ 2 <~~> ξ`?