Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!asuvax!ncar!elroy.jpl.nasa.gov!sdd.hp.com!spool.mu.edu!uunet!mcsun!ukc!newcastle.ac.uk!turing!ncmh From: Chris.Holt@newcastle.ac.uk (Chris Holt) Newsgroups: comp.software-eng Subject: Re: Tolerance (was Re: Reusability considered harmful??(!!)) Message-ID: <1991Feb5.153917.20752@newcastle.ac.uk> Date: 5 Feb 91 15:39:17 GMT References: <1401@ucl-cs.uucp> <27A9B451.48BF@tct.uucp> <15863.27ad36b6@levels.sait.edu.au> <777@caslon.cs.arizona.edu> <785@caslon.cs.arizona.edu> Sender: news@newcastle.ac.uk Organization: University of Newcastle upon Tyne, UK, NE1 7RU Lines: 35 dave@cs.arizona.edu (Dave P. Schaumann) writes: [about "close is good enough" programming] >Ok, so I stand corrected. There are a lot of applications out there that >don't need exact answers. But my question was in the context of code re-use. >How could you say something like, "well, I really need a stack, but I'll >settle for something sort of stacky"? Will we see code like this in the >future: > assert( stackyness(re_used_type) > 0.9 ) ; /* stackyness(a real stack)=1.0 */ >I can't see how the "tolerence paradigm" could possibly lead to a reasonable >means of code re-use. Imagine you've got two objects/modules that you want to stick together; e.g. A calls B, which returns something to A. Suppose both of their specifications are defined in terms of tolerances, so that A sends a value with tolerance t to B; A requires a result with tolerance u from B. Then B's specification has to be such that given a tolerance t', it returns a result with tolerance u'; and we have to show that t<=t', u'<=u. Given this, the combination is proved okay. Applications? Who's to know? Perhaps, for example: Find the least element of a nearly sorted sequence. If the sequence has tolerance Each element is no more than 3 positions from where it would be in the ordered sequence, then only the first 4 elements need be examined. This might mean that the result could be returned within some given time constraint, e.g. delta_t; and the proof would require knowing the time constraint of a single comparison, and how many processors were available. ----------------------------------------------------------------------------- Chris.Holt@newcastle.ac.uk Computing Lab, U of Newcastle upon Tyne, UK ----------------------------------------------------------------------------- "[War's] glory is all moonshine... War is hell." - General Sherman, 1879