Jonathan Tran on 19 Sep 2008 09:12:36 -0700


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [Qi] Fwd: book deal goes through with printer

  • From: "Jonathan Tran" <jonnytran@gmail.com>
  • To: philly-lambda@googlegroups.com
  • Subject: Re: [Qi] Fwd: book deal goes through with printer
  • Date: Fri, 19 Sep 2008 12:12:24 -0400
  • Authentication-results: mx.google.com; spf=pass (google.com: domain of jonnytran@gmail.com designates 209.85.217.12 as permitted sender) smtp.mail=jonnytran@gmail.com; dkim=pass (test mode) header.i=@gmail.com
  • Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=beta; h=domainkey-signature:received:received:x-sender:x-apparently-to :received:received:received-spf:authentication-results:received :dkim-signature:domainkey-signature:received:received:message-id :date:from:to:subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references:reply-to :sender:precedence:x-google-loop:mailing-list:list-id:list-post :list-help:list-unsubscribe:x-beenthere-env:x-beenthere; bh=1CwfqzCYIR2cliZ4D10tXAB8CJ6sKrMWA+31N9+9CDM=; b=tIkZYRBmr8VdDfMXzZxmY4w7y3nGqpnwDOuKTct8qgiQQPJLKB86dxdF2KABnwQJfF uZDvS/Wsxsz+LFoLEgBvC9Z59FSrxtW8lC9l7fBo53Mfwnb/rAs8sWFUIrV20HkOS4oW yuU4Dy+GH9KlDYKV9uc7fxH6Lkqcr9r58fs9A=
  • Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=Eok36pgEBleS3A7q2NDgygBj+j1IHbFUeEYU5aGGdZU=; b=DetVrjMqaqvkOMTdV/F3lQRuEKLN5edR2FsfoN26adQJ9Hu+nOB0z3rAbGr4T1fj4D co547LQfxgv8ut/JDmZJFCxNoE7gw14o1ze/oNLXNeosl1BGTl6HqPUGIQoC85LJXcQi TkXxDgr9B2mnsqFC0Agb3X608CD6/cshHyiSI=
  • Mailing-list: list philly-lambda@googlegroups.com; contact philly-lambda+owner@googlegroups.com
  • Reply-to: philly-lambda@googlegroups.com
  • Sender: philly-lambda@googlegroups.com

I hadn't heard of total functional programming before. But it looks
very interesting. Thanks.

On Fri, Sep 19, 2008 at 11:52 AM, Mark Dominus
<mjd-phillylambda@plover.com> wrote:
>
>
>> >> Don't know if any of you guys are following Qi,
>
> I wasn't, but I will now.  Thanks for the pointer.  Using sequent
> calculus is a really clever idea.
>
> I'll also ask the Penn library to obtain a copy of the book.
>
>> That is, in fact, one aspect of Qi that is invisible in most other
>> languages: the type-system in Qi has the halting problem.
>
> Lately I've been reading a bunch of papers about languages that go in
> the other direction, and which aren't subject to the halting problem
> at all.
>
> This turns out to be unexpectedly useful.
>
> Such languages can't express every possible algorithm, but it's not
> that important, because in typical programming contexts we only write
> functions that are guaranteed to halt anyway; this is the usual
> definition of "algorithm".
>
> One example is the paper "Total Functional Programming", by D. A. Turner.
> http://www.jucs.org/jucs_10_7/total_functional_programming/jucs_10_07_0751_0768_turner.pdf
>
>         Abstract: The driving idea of functional programming is to
>         make programming more closely related to mathematics. A
>         program in a functional language such as Haskell or Miranda
>         consists of equations which are both computation rules and a
>         basis for simple algebraic reasoning about the functions and
>         data structures they define. The existing model of functional
>         programming, although elegant and powerful, is compromised to
>         a greater extent than is commonly recognised by the presence
>         of partial functions. We consider a simple discipline of
>         total functional programming designed to exclude the
>         possibility of non-termination. Among other things this
>         requires a type distinction between data, which is finite,
>         and codata, which is potentially infinite.
>
> Turner's initial point is that the presence of _|_ values in languages
> like Haskell spoils one's ability to reason from the program
> specification.  His basic example is simple:
>
>        loop :: Integer -> Integer
>        loop x = 1 + loop x
>
> Taking the function definition as an equation, we subtract (loop x)
> from both sides and get
>
>        0 = 1
>
> which is wrong.  The problem is that while subtracting (loop x) from
> both sides is valid reasoning over the integers, it's not valid over
> the Haskell Integer type, because Integer contains a _|_ value for
> which that law doesn't hold: 1 /= 0, but 1 + _|_ == 0 + _|_.
>
> Before you can use reasoning as simple and as familiar as subtracting
> an expression from both sides, you first have to prove that the value
> of the expression you're subtracting is not _|_.
>
> By banishing nonterminating functions, one also banishes _|_ values,
> and familiar mathematical reasoning is rescued.
>
> Also:
>
>        http://en.wikipedia.org/wiki/Total_functional_programming
>
> Sorry, that turned out to be a much longer digression than I expected.
> I did not mean to distract attention from Qi.
>
> I wish Professor tarver had not written his web pages in white text on
> a black background.
>
>