Re: [Haskell-cafe] Clarification on proof section of HS: The Craft of FP

2005-05-03 Thread David Menendez
Benjamin Franksen writes: > On Wednesday 04 May 2005 01:32, Ben Rudiak-Gould wrote: > > This doesn't work in Haskell because Haskell types aren't > > constructed in this way. It's harder to prove properties of types > > in Haskell (and fewer properties actually hold). > > Could you explain why th

Re: [Haskell-cafe] Clarification on proof section of HS: The Craft of FP

2005-05-03 Thread Benjamin Franksen
On Wednesday 04 May 2005 01:32, Ben Rudiak-Gould wrote: > This doesn't work in Haskell because Haskell types aren't constructed in > this way. It's harder to prove properties of types in Haskell (and fewer > properties actually hold). Could you explain why this is so? Or rather, what the appropria

Re: [Haskell-cafe] Clarification on proof section of HS: The Craft of FP

2005-05-03 Thread Ben Rudiak-Gould
Echo Nolan wrote: My copy of HS: The Craft Of FP just arrived and I was reading section 8.5 about induction. On page 141, Simon Thompson gives a method of proving properties of functions on lists: 1) Prove that the property holds for the null list 2) Prove that the property

Re: [Haskell-cafe] Clarification on proof section of HS: The Craft of FP

2005-05-03 Thread Daniel Fischer
Am Dienstag, 3. Mai 2005 03:48 schrieben Sie: > Daniel Fischer writes: > > Due to lazyness, we can have infinite lists (and other infinite > > structures) in Haskell (of course, in finite time, only a finite > > portion of those can be evaluated), e.g. ns = [1 .. ] :: [Integer] is > > an infinite l

Re: [Haskell-cafe] Clarification on proof section of HS: The Craft of FP

2005-05-02 Thread David Menendez
Daniel Fischer writes: > Due to lazyness, we can have infinite lists (and other infinite > structures) in Haskell (of course, in finite time, only a finite > portion of those can be evaluated), e.g. ns = [1 .. ] :: [Integer] is > an infinite list which is often used. And now consider the property

Re: [Haskell-cafe] Clarification on proof section of HS: The Craft of FP

2005-05-02 Thread Clive Brettingham-Moore
Although the answer to the original question was sort of embedded in the discussion, a quick read of the replies suggested that no one had made the simple clarification. 2) Prove that the property holds for (x:xs) under the assumption that the property holds for xs. It's

Re: [Haskell-cafe] Clarification on proof section of HS: The Craft of FP

2005-05-02 Thread Cale Gibbard
On 5/2/05, Cale Gibbard <[EMAIL PROTECTED]> wrote: > On 5/2/05, robert dockins <[EMAIL PROTECTED]> wrote: > > > Well, yes, but I'd argue that ordinary (transfinite) mathematical > > > induction will work just fine here. It's just that the set we're doing > > > mathematical induction over is one lar

Re: [Haskell-cafe] Clarification on proof section of HS: The Craft of FP

2005-05-02 Thread Conor McBride
Stefan Holdermans wrote: Daniel, Interestingly, we can also use induction to reason about infinite list. To this end, we use _|_ (`bottom' or `undefined') as a base case. To prove something for both finite and infinite lists, one uses two base cases (_|_, and []) and takes the inductive step. Ar

Re: [Haskell-cafe] Clarification on proof section of HS: The Craft of FP

2005-05-02 Thread Cale Gibbard
On 5/2/05, robert dockins <[EMAIL PROTECTED]> wrote: > > Well, yes, but I'd argue that ordinary (transfinite) mathematical > > induction will work just fine here. It's just that the set we're doing > > mathematical induction over is one larger (in the ordinal sense) than > > usual. Let S = N union

Re: [Haskell-cafe] Clarification on proof section of HS: The Craft of FP

2005-05-02 Thread Jerzy Karczmarczuk
robert dockins wrote: Assign finite completely defined lists their usual lengths, and every _|_ terminated or infinite list, length w. So every infinite object has a special length denoted "w". I assume we wish to make the following statements about "w" w = w ~(w < w) Without which "=" and "<"

Re: [Haskell-cafe] Clarification on proof section of HS: The Craft of FP

2005-05-02 Thread robert dockins
Well, yes, but I'd argue that ordinary (transfinite) mathematical induction will work just fine here. It's just that the set we're doing mathematical induction over is one larger (in the ordinal sense) than usual. Let S = N union {w}, where N is the usual set of naturals and w is an additional new

Re: [Haskell-cafe] Clarification on proof section of HS: The Craft of FP

2005-05-02 Thread Cale Gibbard
On 5/2/05, robert dockins <[EMAIL PROTECTED]> wrote: > >Well, I also omited the word "countable". I figure it's understood > >since computers only deal with finite data. And given an infinite > >list, any finite "head" of it would meet the criteria, so the > >distinction is moot. Un

Re: [Haskell-cafe] Clarification on proof section of HS: The Craft of FP

2005-05-02 Thread robert dockins
Well, I also omited the word "countable". I figure it's understood since computers only deal with finite data. And given an infinite list, any finite "head" of it would meet the criteria, so the distinction is moot. Unless Haskell has some neat property I am not aware of :-) Due to lazyness, we can

Re: [Haskell-cafe] Clarification on proof section of HS: The Craft of FP

2005-05-02 Thread Jan-Willem Maessen
On May 2, 2005, at 8:29 AM, Henning Thielemann wrote: On Mon, 2 May 2005, Echo Nolan wrote: Hello all, My copy of HS: The Craft Of FP just arrived and I was reading section 8.5 about induction. On page 141, Simon Thompson gives a method of proving properties of functions on lists: 1

Re: [Haskell-cafe] Clarification on proof section of HS: The Craft of FP

2005-05-02 Thread Stefan Holdermans
Daniel, Interestingly, we can also use induction to reason about infinite list. To this end, we use _|_ (`bottom' or `undefined') as a base case. To prove something for both finite and infinite lists, one uses two base cases (_|_, and []) and takes the inductive step. HTH, Stefan __

Re: [Haskell-cafe] Clarification on proof section of HS: The Craft of FP

2005-05-02 Thread Cale Gibbard
On 5/2/05, Daniel Fischer <[EMAIL PROTECTED]> wrote: > Am Montag, 2. Mai 2005 16:16 schrieb Daniel Carrera: > > Henning Thielemann wrote: > > >> Well, I also omited the word "countable". I figure it's understood > > >> since computers only deal with finite data. And given an infinite > > >> list, a

Re: [Haskell-cafe] Clarification on proof section of HS: The Craft of FP

2005-05-02 Thread Daniel Fischer
Am Montag, 2. Mai 2005 16:16 schrieb Daniel Carrera: > Henning Thielemann wrote: > >> Well, I also omited the word "countable". I figure it's understood > >> since computers only deal with finite data. And given an infinite > >> list, any finite "head" of it would meet the criteria, so the > >> dis

Re: [Haskell-cafe] Clarification on proof section of HS: The Craft of FP

2005-05-02 Thread Daniel Carrera
Henning Thielemann wrote: Well, I also omited the word "countable". I figure it's understood since computers only deal with finite data. And given an infinite list, any finite "head" of it would meet the criteria, so the distinction is moot. Unless Haskell has some neat property I am not aware

Re: [Haskell-cafe] Clarification on proof section of HS: The Craft of FP

2005-05-02 Thread Cale Gibbard
This is, as others pointed out, an example of mathematical induction at work. This is actually a slightly nontrivial instance of it, as there is one more case than usual to be treated: lists can be infinite. What happens to our proof when our list is infinite? Have we really shown that the function

Re: [Haskell-cafe] Clarification on proof section of HS: The Craft of FP

2005-05-02 Thread Henning Thielemann
On Mon, 2 May 2005, Daniel Carrera wrote: Daniel Fischer wrote: Both do, but in Explanation 2, you omitted 'finite' a couple of times. Well, I also omited the word "countable". I figure it's understood since computers only deal with finite data. And given an infinite list, any finite "head" of it

Re: [Haskell-cafe] Clarification on proof section of HS: The Craft of FP

2005-05-02 Thread Daniel Carrera
Daniel Fischer wrote: Both do, but in Explanation 2, you omitted 'finite' a couple of times. Well, I also omited the word "countable". I figure it's understood since computers only deal with finite data. And given an infinite list, any finite "head" of it would meet the criteria, so the distincti

Re: [Haskell-cafe] Clarification on proof section of HS: The Craft of FP

2005-05-02 Thread Daniel Fischer
Am Montag, 2. Mai 2005 14:20 schrieb Daniel Carrera: > Hi Echo, > > I'm totally new at Haskell btw. But I'll comment a bit. :-) > > > My copy of HS: The Craft Of FP just arrived > > Is it good? Do you recommend it? Should I get a copy too? It is good. Best would be to have an extensive look and de

Re: [Haskell-cafe] Clarification on proof section of HS: The Craft of FP

2005-05-02 Thread Henning Thielemann
On Mon, 2 May 2005, Echo Nolan wrote: Hello all, My copy of HS: The Craft Of FP just arrived and I was reading section 8.5 about induction. On page 141, Simon Thompson gives a method of proving properties of functions on lists: 1) Prove that the property holds for the null list

Re: [Haskell-cafe] Clarification on proof section of HS: The Craft of FP

2005-05-02 Thread Daniel Carrera
Hi Echo, I'm totally new at Haskell btw. But I'll comment a bit. :-) My copy of HS: The Craft Of FP just arrived Is it good? Do you recommend it? Should I get a copy too? and I was reading section 8.5 about induction. On page 141, Simon Thompson gives a method of proving properties of functions on

[Haskell-cafe] Clarification on proof section of HS: The Craft of FP

2005-05-02 Thread Echo Nolan
Hello all, My copy of HS: The Craft Of FP just arrived and I was reading section 8.5 about induction. On page 141, Simon Thompson gives a method of proving properties of functions on lists: 1) Prove that the property holds for the null list 2) Prove that the property holds f