[Shootout-list] Ray tracer

John Skaller skaller@users.sourceforge.net
Mon, 20 Jun 2005 11:43:53 +1000


On Sun, 2005-06-19 at 16:05 +0200, Bengt Kleberg wrote:
> On 2005-06-19 15:11, Jon Harrop wrote:
> ...deleted
> > Giving a program is the easiest way to get a "formal" specification.
> 
> imho a program is over-specific. it contains lots of implementation 
> details that should not be part of the sought after definition.

That doesn't matter, the specification is that the output
will be the same as produced by a particular program,
which is a rigid formal definition (modulo the formality
with which the language itself is defined :)

In addition to formality, specification by a program has
a major operational advantage: you can run it to produce
correct output for comparison with other systems.

The disadvantage of using a programming language is that

(a) it might be hard to understand if you don't know the language
(b) it may not compute what is actually intended

In my opinion, and simple natural language or mathematical
specification is better when possible, for example, for
Ackermann's function the 'About this test' provides a perfectly
good definition of the function: the specification is lacking
only in precisely defining the output format.

Ideally, one would provide *both*: in the C and C++ Standards
for example, you will see the formal text annotated by explanatory
examples (they're not normative but they're expected help both
the reader *and* the standard writers understand the formal
description).