home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.programming
- Path: sparky!uunet!news.uiowa.edu!hobbes.physics.uiowa.edu!zaphod.mps.ohio-state.edu!darwin.sura.net!jvnc.net!phage!boutell
- From: boutell@isis.cshl.org (Tom Boutell)
- Subject: Re: Programming by Description of Output...
- Message-ID: <C036t1.KCH@phage.cshl.org>
- Sender: news@phage.cshl.org
- Organization: Cold Spring Harbor Labs
- References: <C01yxr.BGF@phage.cshl.org> <1992Dec30.174004.4168@cs.cornell.edu>
- Date: Wed, 30 Dec 1992 19:15:01 GMT
- Lines: 64
-
- In article <1992Dec30.174004.4168@cs.cornell.edu> karr@cs.cornell.edu (David Karr) writes:
- >In article <C01yxr.BGF@phage.cshl.org> boutell@isis.cshl.org (Tom Boutell) writes:
- >>Initial state:
- >>Array A[] contains n whole numbers...
-
- >This sounds like automatic programming, which is an old idea.
- >Frederick P. Brooks mentioned it in an article a couple of years ago,
- >entitled (I think) "No Silver Bullet."
-
- Interesting. I know a lot of discussion of the subject has been done.
-
- >How much easier is it to specify a program by predicates on its input
- >and output rather than by an algorithm?
-
- An excellent question. I gather Prolog programmers have discovered
- it is often as much or more work than writing the algorithm, as
- you point out.
-
- >I contend it's not as easy
- >as one might hope. For example, is the following legal I/O for your
- >specification:
- >
- >A[] (input): 3 2 1 3 2 1 3 2 1
- >B[] (output): 1 2 3 3 3 3 3 3 3
- >
- >Each element of A[] appears in B[], but not with the same count of
- >repetitions. Is this what you intended?
-
- Interesting point. An extension of the terminology is needed to
- express this problem succinctly, which in turn requires its own
- mathematical definition; and I imagine similar difficulties will
- appear in describing most problems.
-
- This doesn't mean it's not worth pursuing the notion, though,
- so attempting to respond:
-
- The following definitions are made:
-
- All objects have values. Objects exist independent of their values;
- two distinct objects, for instance, may have the value 3.
-
- Arrays are objects whose value is an ordered, uniquely indexed
- list of objects.
-
- Now, the description of B[] is amended to read:
-
- One duplicate of each object in A[] appears in B[]...
-
- These are reasonable definitions and they seem to handle the
- problem you pointed out. I recognize that the amount of time spent
- on this could have been spent, say, devising a sorting
- algorithm, but the idea (and it is only an idea, and may not
- work well in practice) is that one only has to make these
- definitions and get the hang of them once.
-
- >
- >-- David Karr (karr@cs.cornell.edu)
-
- -T
-
- --
- Tom Boutell, boutell@cshl.org
-
- Clausthaler is the best non - alcoholic beer in the known universe.
-