Comments on: Generatingfunctorology http://comonad.com/reader/2008/generatingfunctorology/ types, (co)monads, substructural logic Sat, 29 Dec 2012 15:18:06 -0800 http://wordpress.org/?v=2.8.4 hourly 1 By: Đồ sơ sinh trọn gói http://comonad.com/reader/2008/generatingfunctorology/comment-page-1/#comment-106754 Đồ sơ sinh trọn gói Tue, 27 Nov 2012 05:19:28 +0000 http://comonad.com/reader/2008/generatingfunctorology/#comment-106754 <strong>Đồ sơ sinh trọn gói...</strong> [...]The Comonad.Reader » Generatingfunctorology[...]... Đồ sơ sinh trọn gói…

[...]The Comonad.Reader » Generatingfunctorology[...]…

]]>
By: pozorvlak http://comonad.com/reader/2008/generatingfunctorology/comment-page-1/#comment-1504 pozorvlak Thu, 29 May 2008 01:20:01 +0000 http://comonad.com/reader/2008/generatingfunctorology/#comment-1504 aed: it's common in category theory to use + for coproduct, which in the category of sets is indeed disjoint union. If you allow a natural number n to be represented by the finite set {1, 2, ... n}, then + becomes ordinary addition :-) aed: it’s common in category theory to use + for coproduct, which in the category of sets is indeed disjoint union. If you allow a natural number n to be represented by the finite set {1, 2, … n}, then + becomes ordinary addition :-)

]]>
By: aed http://comonad.com/reader/2008/generatingfunctorology/comment-page-1/#comment-1366 aed Sat, 17 May 2008 23:35:01 +0000 http://comonad.com/reader/2008/generatingfunctorology/#comment-1366 Oh -- I think I should stop seeing "+" as addition, and more as algabraic union -- the possible values of Maybe x are 1 or x. So generating fuctions enumerate out the return values of a function (the "clothesline" upon which we hang numbers), but also can be composed together and manipulated with finite calculus and such. Ach! So confusing. Oh — I think I should stop seeing “+” as addition, and more as algabraic union — the possible values of Maybe x are 1 or x. So generating fuctions enumerate out the return values of a function (the “clothesline” upon which we hang numbers), but also can be composed together and manipulated with finite calculus and such.

Ach! So confusing.

]]>
By: Edward Kmett http://comonad.com/reader/2008/generatingfunctorology/comment-page-1/#comment-1355 Edward Kmett Sat, 17 May 2008 04:06:02 +0000 http://comonad.com/reader/2008/generatingfunctorology/#comment-1355 Well, D is affine, as well as being singular in the fashion described. Also, I think some of the usual isomorphisms such as the x^2 -> 2*x^2/2 one break down for the same reason the connection between ~~a and a breaks down, because we are working in an intuitionistic setting. (At least my hand-wavy attempts to try to realize negative values as continuations accepting a given value type seemed to run into that) Well, D is affine, as well as being singular in the fashion described.

Also, I think some of the usual isomorphisms such as the x^2 -> 2*x^2/2 one break down for the same reason the connection between ~~a and a breaks down, because we are working in an intuitionistic setting.

(At least my hand-wavy attempts to try to realize negative values as continuations accepting a given value type seemed to run into that)

]]>
By: Dan P http://comonad.com/reader/2008/generatingfunctorology/comment-page-1/#comment-1353 Dan P Sat, 17 May 2008 03:11:22 +0000 http://comonad.com/reader/2008/generatingfunctorology/#comment-1353 Ah...it's called affine logic. I don't know the terminology. Ah…it’s called affine logic. I don’t know the terminology.

]]>
By: Edward Kmett http://comonad.com/reader/2008/generatingfunctorology/comment-page-1/#comment-1345 Edward Kmett Fri, 16 May 2008 19:14:37 +0000 http://comonad.com/reader/2008/generatingfunctorology/#comment-1345 Hrmm. Just an observation: If D^2 = 0, then given a functor F described by a generating function F x = a_0 + a_1*x + a_2*x^2 + ... then F D = a_0 + a_1*D cuts off the series. It also seems that D as a 'singleton pattern' is affine (permits weakening), because nothing currently prevents you from 'not using' the D, as evidenced by the possibility of a_0 being non-zero. Hrmm. Just an observation:

If D^2 = 0, then given a functor F described by a generating function

F x = a_0 + a_1*x + a_2*x^2 + …

then

F D = a_0 + a_1*D

cuts off the series.

It also seems that D as a ’singleton pattern’ is affine (permits weakening), because nothing currently prevents you from ‘not using’ the D, as evidenced by the possibility of a_0 being non-zero.

]]>
By: Edward Kmett http://comonad.com/reader/2008/generatingfunctorology/comment-page-1/#comment-1341 Edward Kmett Fri, 16 May 2008 17:31:45 +0000 http://comonad.com/reader/2008/generatingfunctorology/#comment-1341 Dan, I love the notion of D as a singleton type. I've been thinking about the idea of trying to represent the infinite cases using bivariate generating functions. The idea would be that you 'hang up on the number line' quantities based on two parameters. One the number of traversals of the structure of size >= m that touch n values to give you an idea of the branching structure. Then clearly for n > m, the tail of the series = 0. You then count the number of cases involved in using productive corecursion to visit n values in the structure rather than the number of distinct ways you can use well-founded recursion to build a structure of a given size. I haven't had time in the last couple of days to investigate the idea any further though. [Edit: this doesn't appear to be sufficient and I haven't been able to find any good closed forms this way yet] Dan,

I love the notion of D as a singleton type.

I’ve been thinking about the idea of trying to represent the infinite cases using bivariate generating functions.

The idea would be that you ‘hang up on the number line’ quantities based on two parameters. One the number of traversals of the structure of size >= m that touch n values to give you an idea of the branching structure. Then clearly for n > m, the tail of the series = 0.

You then count the number of cases involved in using productive corecursion to visit n values in the structure rather than the number of distinct ways you can use well-founded recursion to build a structure of a given size.

I haven’t had time in the last couple of days to investigate the idea any further though.

[Edit: this doesn't appear to be sufficient and I haven't been able to find any good closed forms this way yet]

]]>
By: Edward Kmett http://comonad.com/reader/2008/generatingfunctorology/comment-page-1/#comment-1318 Edward Kmett Thu, 15 May 2008 06:11:58 +0000 http://comonad.com/reader/2008/generatingfunctorology/#comment-1318 Ah, nice. My 'naive encoding' was apparently better than I thought =) Currently mining the material written on species and what is in that Flajolet/Sedgewick book. Awesome link, aed. Thanks! Ah, nice. My ‘naive encoding’ was apparently better than I thought =)

Currently mining the material written on species and what is in that Flajolet/Sedgewick book.

Awesome link, aed. Thanks!

]]>
By: Pseudonym http://comonad.com/reader/2008/generatingfunctorology/comment-page-1/#comment-1317 Pseudonym Thu, 15 May 2008 05:40:41 +0000 http://comonad.com/reader/2008/generatingfunctorology/#comment-1317 In fact, that <i>is</i> a fairly efficient representation for trees. I've used something very close to it before, in C. You have to remember that C(n) is 4^n/n^1.5 times some constant. So to store a number between 0 and C(n), you need 2n - 1.5 log n bits. If you think about that for a moment, it's easy to do with exactly 2n bits: Introduce a parallel array of 2n bits, each element of which represents whether or not each node has a left or right child. If you were compressing this bit vector, you could get closer to the asymptotic behaviour by noting that there's some redundancy: In your array of 2n bits, exactly n-1 of them will be 1 and the remaining n+1 of them will be 0. It's probably not hard to exploit this and recover a representation that's optimal in an asymptotic sense. In fact, that is a fairly efficient representation for trees. I’ve used something very close to it before, in C.
You have to remember that C(n) is 4^n/n^1.5 times some constant. So to store a number between 0 and C(n), you need 2n – 1.5 log n bits.
If you think about that for a moment, it’s easy to do with exactly 2n bits: Introduce a parallel array of 2n bits, each element of which represents whether or not each node has a left or right child.
If you were compressing this bit vector, you could get closer to the asymptotic behaviour by noting that there’s some redundancy: In your array of 2n bits, exactly n-1 of them will be 1 and the remaining n+1 of them will be 0. It’s probably not hard to exploit this and recover a representation that’s optimal in an asymptotic sense.

]]>
By: Dan P http://comonad.com/reader/2008/generatingfunctorology/comment-page-1/#comment-1311 Dan P Wed, 14 May 2008 23:24:33 +0000 http://comonad.com/reader/2008/generatingfunctorology/#comment-1311 Edward, Did you ever read <a href="http://sigfpe.blogspot.com/2006/06/taylor-series-for-types.html" rel="nofollow">this</a> or <a href="http://sigfpe.blogspot.com/2006/09/infinitesimal-types.html" rel="nofollow">this</a>? I spent lots of time thinking similar thoughts but eventually got stuck. Edward,

Did you ever read this or this? I spent lots of time thinking similar thoughts but eventually got stuck.

]]>