History log of /seL4-l4v-10.1.1/HOL4/src/real/realSimps.sml
Revision Date Author Comments
# 7a5f60ec 04-Dec-2015 Anthony Fox <anthony.fox@cl.cam.ac.uk>

Provide support for evaluating float to int and real to int operations.

For example, the following weren't working before (with intLib and realLib loaded):

EVAL ``NUM_FLOOR (-0.5)``; (* |- flr (-0.5) = 0 *)
EVAL ``NUM_CEILING 0.5``; (* |- clg 0.5 = 1 *)
EVAL ``INT_FLOOR 0.5``; (* |- flr 0.5 = 0 *)
EVAL ``INT_CEILING 0.5``; (* |- clg 0.5 = 1 *)


# 11b6c7f2 13-Mar-2013 Anthony Fox <anthony.fox@cl.cam.ac.uk>

Improvements to evaluation coverage for realTheory.

Previously, the follow terms were failing to evaluate:

``sum (1, 4) real_of_num``
``1 > 1 / 2``
``1 >= 1 / 2``
``flr (232 / 3)``

The operation "sum" is now introduced using Define.


# 730f9a26 08-Feb-2013 Anthony Fox <anthony.fox@cl.cam.ac.uk>

Evaluation was not occurring for terms such as ``1 / 2 * 0r`` and ``0r * 1 / 2``.


# 3c3bfcf2 25-May-2011 Anthony Fox <anthony.fox@cl.cam.ac.uk>

Fix calculation bug (see test).


# 4761143b 10-Aug-2009 Tjark Weber <Tjark.Weber@cl.cam.ac.uk>

Removed trailing whitespace from all .sml and .sig files.

This affects over 900 files and was done using emacs's delete-trailing-whitespace
function in batch mode. Building the system with Poly/ML and Moscow ML seems to
work, so I'm hoping these changes don't break anything. Please complain if
they do!


# aed05f4e 20-Jul-2008 Konrad Slind <konrad.slind@gmail.com>

A whole mess of small changes intended
at making simpsets prettyprint informatively
in the interactive loop. Very possibly
I haven't updated all the files in the examples
directories.


# a156bcaa 25-Jun-2006 Michael Norrish <Michael.Norrish@nicta.com.au>

Fix a silly hole in the automatic simplification of real number arithmetic.


# 115d66cf 14-May-2006 Michael Norrish <Michael.Norrish@nicta.com.au>

Fix a number of calculation bugs, mostly calculations involving zero.
The new tests all used to fail.


# 4cddaa12 12-Jul-2005 Michael Norrish <Michael.Norrish@nicta.com.au>

Changed a couple of misleading/annoying names. The type ssdata is now
called ssfrag (to bring it into line with documentation that talks about
simpset fragments), and the constructor SIMPSET is now called SSFRAG.
It never created a simpset, so the latter was a stupid name.


# 007e43f2 31-May-2005 Konrad Slind <konrad.slind@gmail.com>

Follow-on fixes to changing Term to Parse.Term and Type to Parse.Type
in the quotation pre-processor. A mass of trivial changes, but the
new way of dealing with files containing code that does parsing
(not script files) is to

* grab the ambient grammar(s)
* set the current grammar(s) to the right values
for parsing quotations in the file
* the body of the file
* reset the current grammar to the ambient grammar

For an example, see src/taut/tautLib.sml


# c038ea1c 30-May-2005 Konrad Slind <konrad.slind@gmail.com>

Follow-on to the change to the pre-processor. There's a significant
problem, in that the heretofore standard way of protecting a
piece of code from alterations to the grammar(s) used to parse
terms in that piece of code ... no longer works after the change.

The previous recommendation was to re-bind Type and Term with

val (Type,Term) = Parse.parse_from_grammars <grms>

which allowed subsequent

Term ` .... `

to parse with the specified grammar. However, also

`` ... ``

would subsequently use the specified grammar as well. But I
changed the pre-processor, and this broke the usage of

`` ... ``

with the specified grammar.

The fix is to do as in src/real/RealArith.sml: get the
ambient grammar, set the desired grammar, execute the
body of code, then reset to the ambient grammar. Works
provided the code doesn't alter the grammar.

This probably needs to be documented in a more visible place,
once Michael comments.


# e310b999 03-Feb-2005 Michael Norrish <Michael.Norrish@nicta.com.au>

Real number reduction wasn't working on terms of the form
0 = x / y
or
x / y = 0
Fixed, and test added to selftest regression.


# e745a68f 12-Jan-2005 Michael Norrish <Michael.Norrish@nicta.com.au>

My last check-in broke the building of the n-bit word theories (should
always try the -selftest option to build to catch this) because the
implementation of relevance analysis didn't believe that SUC a <= 2 ** WL
was relevant to proving 0 < 2 ** WL. The solution is to realise that
even ground terms may end up being treated as variables by decision
procedures. So, there is now an additional parameter to RCACHE : a function
that takes a term and returns a list of terms that should be treated
as free variables in the relevance analysis.


# 05545cf9 11-Jan-2005 Michael Norrish <Michael.Norrish@nicta.com.au>

A better cache function, RCACHE that does relevance analysis to speed
up the rejection of formulas that are sure to fail.


# fceeee5e 16-Dec-2004 Michael Norrish <Michael.Norrish@nicta.com.au>

The problem was that we weren't reducing double negations. Now fixed.


# 6fde6a05 15-Dec-2004 Michael Norrish <Michael.Norrish@nicta.com.au>

Add handling of absolute value terms to the "reduce" simpset.


# c6048466 23-Aug-2004 Michael Norrish <Michael.Norrish@nicta.com.au>

REAL_REDUCE_ss wasn't reducing (ground) terms of the form
max 0 <somenumber>
or terms with min, either.


# f355f22d 29-Jul-2004 Michael Norrish <Michael.Norrish@nicta.com.au>

REAL_REDUCE_ss was reducing more than just ground formulae.
Also, be slightly more careful about rewrite generation to avoid
duplicates.


# 5723a200 09-Jul-2004 Konrad Slind <konrad.slind@gmail.com>

Added DIVMOD to arithmeticScript, which helps complete the suite
of generated code. Unfortunately, arithmetic then depends on pairs,
which I had been trying to avoid, for purely aesthetic reasons.

Also fixed up more of the ML code generation business.


# 3b9afa98 07-Jul-2004 Konrad Slind <konrad.slind@gmail.com>

Changed NUMERAL_BIT1 and NUMERAL_BIT2 to BIT1 and BIT2, respectively.
Sorry, they were just too long. Also, ALT_ZERO is now named ZERO.


# c1bc52cb 23-Apr-2004 Michael Norrish <Michael.Norrish@nicta.com.au>

Make the real arithmetic decision procedure available as a (cached)
procedure inside the simplifier. Just include REAL_ARITH_ss to see
ARITH_ss-like simplifications made to terms involving linear real
arithmetic.


# af6ef7a9 10-Nov-2003 Michael Norrish <Michael.Norrish@nicta.com.au>

Handle exponentiation in the "real reduction" functionality. Done through
one big rewrite theorem (pow_rat) proved in realScript.sml.


# c3c83e42 01-Jul-2003 Michael Norrish <Michael.Norrish@nicta.com.au>

When a library file uses the parser, must must must must must include a line
specifying which grammars to parse with.


# 7dbe5abd 30-Jun-2003 Michael Norrish <Michael.Norrish@nicta.com.au>

Provide elimination of common factors, and also properly extend real_ss
so that it does real number reductions, and doesn't just leave calculations
halfway through, waiting for natural number reductions to fire.
Unfortunately, this does break one of Joe's probability proofs, which
relied on seeing SUC 0, rather than 1. Fixed this too.


# cc721fdc 30-Jun-2003 Michael Norrish <Michael.Norrish@nicta.com.au>

Make specialisations more specific (pick &(NUMERAL n) and ~&(NUMERAL n)
instead of just &n and ~&n), and also include the x/x = 1 rewrite for
non-zero x.


# 70bd7c6a 30-Jun-2003 Michael Norrish <Michael.Norrish@nicta.com.au>

First cut at calculation with the reals. Doesn't include a treatment of
exponentiation, nor does it eliminate divisors in fractions. Updates
stateful rewriter and global compset, so that EVAL will do calculations
with fractions.
Am about to go home with build just in the middle of probability. If
I've broken anything, apologies! Fix the bug by commenting out
++ REAL_REDUCE_ss
in the definition of real_ss in realSimps.sml


# e18ade2d 27-Jun-2003 Michael Norrish <Michael.Norrish@nicta.com.au>

Little more progress with this stuff.


# 72d00f8b 26-Jun-2003 Michael Norrish <Michael.Norrish@nicta.com.au>

Moving towards calculation with the reals.


# e4f6ae1d 15-Dec-2002 Joe Hurd <joe@gilith.com>

A really useful theorem about supremums: for any 0 < e, you can
always gets within e of the supremum.


# dce55f69 03-Dec-2002 Joe Hurd <joe@gilith.com>

More real simplifications, and more theorems about pos, max and min.


# 495a35f0 02-Dec-2002 Joe Hurd <joe@gilith.com>

As predicted, I need a few more simplifying rewrites.


# 432f2556 01-Dec-2002 Joe Hurd <joe@gilith.com>

Finally got around to fleshing out the real simpset (the other changes are
the ramifications of this!)

Major changes:

1. Got rid of AC rewrites for + and *. If you want them (perhaps for
compatibility with the old real_ss), use real_ac_ss.

2. Added a huge bunch of useful rewrites to real_ss, though I'm sure
I'll need to add a huge bunch more before I'm finished with it.


# de343a0a 18-Jun-2001 Konrad Slind <konrad.slind@gmail.com>

Changing arithLib to numLib. And RealSS to realSimps.