Kyle R. Burton on 19 Sep 2008 09:14:01 -0700


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

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

  • From: "Kyle R. Burton" <kyle.burton@gmail.com>
  • To: philly-lambda@googlegroups.com
  • Subject: Re: [Qi] Fwd: book deal goes through with printer
  • Date: Fri, 19 Sep 2008 12:13:50 -0400
  • Authentication-results: mx.google.com; spf=pass (google.com: domain of kyle.burton@gmail.com designates 209.85.198.224 as permitted sender) smtp.mail=kyle.burton@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=3DDTLDErF5SPuQkg/2W0LfVyqS2bPoZsCg+ypgFyDjo=; b=EmkbyxHzKZrgmu5T0xzOFeIklXTUhLfVMkRhalGM/GiSqpKDIumltwOXd2ds2C21O6 6Qi77MTLj6GH0sd/dAla+SkazPoe0AAgAr0wY+RjqtQXoTp606u4gzI6IaKoHN1A101v jRZfr2UP6Vpq+u5TCPhdyYZLDyforyyPbQ+cM=
  • 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=PY8IF6qatCTT4aZMbSIDT3QCYfbewWwYkxc7s/2zIUU=; b=rl/kBazeHOfYOWQA0VCNnSD2M2ghkjmqfoTXyyjQ8ioKojtUlPUO0VkRrdM/qFgE25 4d/SQKnnFgptelVvODuQAjwHk1d3kvYDNMZ7mU/fqpjzMNldt6FCHM3wk1Uh9hs7CH31 RONeJ1/uaXl1vBeOgpafTfUkdCBb+NTlvvXok=
  • Mailing-list: list philly-lambda@googlegroups.com; contact philly-lambda+owner@googlegroups.com
  • Reply-to: philly-lambda@googlegroups.com
  • Sender: philly-lambda@googlegroups.com

> 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.

Come on, do you have links or at least pointers to more information?

> This turns out to be unexpectedly useful.

I'll bet!

> 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".

Right, in most cases it's fine.  I find myself creating DSLs for users
that can't express every possible algorithm - but it makes for more
guarantees about the system, which better serves the users.

> 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

> 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.

I think I kinda get this...

> Also:
>
>        http://en.wikipedia.org/wiki/Total_functional_programming

"For example, any algorithm which has had an asymptotic upper bound
calculated for it can be trivially transformed into a
provably-terminating function by using the upper bound as an extra
argument which is decremented upon each iteration or recursion"

is an interesting insight.

> Sorry, that turned out to be a much longer digression than I expected.
> I did not mean to distract attention from Qi.

This is exactly the kind of discussion I have been looking for from
Philly Lambda.

> I wish Professor tarver had not written his web pages in white text on
> a black background.

Yes :)


Thanks for the discussion.

Kyle