home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!olivea!charnel!rat!usc!rpi!batcomputer!cornell!karr
- From: karr@cs.cornell.edu (David Karr)
- Newsgroups: comp.programming
- Subject: Re: Programming by Description of Output...
- Message-ID: <1992Dec31.154623.28659@cs.cornell.edu>
- Date: 31 Dec 92 15:46:23 GMT
- References: <1992Dec30.174004.4168@cs.cornell.edu> <C036t1.KCH@phage.cshl.org> <1992Dec30.233659.7290@black.ox.ac.uk>
- Organization: Cornell Univ. CS Dept, Ithaca NY 14853
- Lines: 37
-
- In article <1992Dec30.233659.7290@black.ox.ac.uk> ke94002@black.ox.ac.uk (Daniel J Mitchell) writes:
- >
- > This method of programming is usually called 'deriving programs'
- >-- the original work is Edsger Dijkstra's _A Discipline of
- >Programming_ (Prentice-Hall, 1976), [...]
- >
- > It also can wind up deriving /very/ elegant algorithms (qv the
- >longest upsequence problem, covered in Gries and Morgan) for
- >difficult problems.
-
- I've derived programs and the methods can indeed yield very elegant
- solutions. But I think Dijkstra intended the process to at least be
- guided by human intelligence. He once gave as an example the
- following problem:
-
- Two diagonally opposite corner squares have been removed
- from an 8x8 chessboard. Determine whether it is possible
- to "tile" the remaining squares with 31 1x2 dominoes.
-
- The problem can be solved by exhaustive search, but it is much
- better to observe that there are 32 squares of one color to be
- covered, while each domino can only cover one square of each color.
-
- > As to doing it automatically, the only thing I know of is a
- >language called ML which reputedly is a great deal higher level
- >than most languages, and comes close to being able to take
- >specifications of the above form as code. (I think. I'm probably
- >wrong about that, on reflection..)
-
- ML is a functional rather than an imperative language, but it
- still encodes "algorithms" in some sense. That is, you can define
- a function "sort" that returns the sort of a list, or you can define a
- function "sorted" that tells you if a list is sorted, but you cannot
- just give the system the definition of "sorted" and the instructions
- "make this be true."
-
- -- David Karr (karr@cs.cornell.edu)
-