To: info-hol@clover.ucdavis.edu
Subject: Re: Related to binary word definitions in HOL
Date: Fri, 26 May 89 13:20:31 EDT
From: Phil Windley <pjw%air12.larc.nasa.gov@munnari.oz>

Paul wrote:
|-------------------*
|
|           Some comments on speed of Val_CONV.
|
| It seems that the speed of Val_CONV is hammered by having to do
| arithmetic using SUC. How about changing the default representation of
| natural number constants to be binary words, and change num_CONV to
| perform a binary decrement operation? Theorems and conversions can
| then be developed to do arithmetic directly on the binary
| representation.  The only hack then has to be on how to print and read
| the numbers, any radix conversion can be done at that time. If one
| really wants to do things properly, one could develop a theory of
| radix arithmetic, but that is probably overdoing things.
|-------------------*

I just happened to send a theory of decimal numbers to Mike yesterday.  Its
not complete (just does equality and addition), but its a start on a
package for treating numbers in HOL as decimals instead of using SUC.
Other than the conversions between constants of type ":num" and the decimal
representation, the whole thing is done by inference.  I used a
representation based on lists of digits, although in some repects, Tom's
vector type would have been nice.


Its quite fast, proving "~(506 = 600)" for example, in about 1.5 secs (your
milage may vary) and adding "593 + 605" in about 15 seconds (I know, that
doesn't seem fast, but relatively speaking...).  I'm sure it could be
improved if I was a better HOL/ML hacker.

The theory could easily be extended to handle multiplication, subtraction,
and inequalities (<, >, etc.), and further extended to be generalized over
the radix (though as Paul says, this might be a bit much).  I've stopped
working on it due to a few other things that have come up, but I'd be happy
for anyone to work on it.  It's available in the US via anonymous ftp from
clover.ucdavis.edu (128.120.57.1).

--phil--


















