History log of /seL4-l4v-master/HOL4/src/real/realSimps.sml
Revision Date Author Comments
# d6167e99 01-Nov-2020 Michael Norrish <michael.norrish@data61.csiro.au>

Make global simpset state easier to recreate with "logged_update"

This entry-point records that a change to the global simpset has
happened within a piece of code (rather than a script). The change is
made (as before), but the change is also recorded so that it can be
recreated/applied to different base simpsets.


# bc2b57c2 21-Sep-2020 Michael Norrish <michael.norrish@data61.csiro.au>

Fix a bug in normalisation of ℝ-multiplication

Use of MATCH_MP caused avoidance of variables occurring in assumptions
and introduction of unwanted priming. Assumptions can get pulled in
to goals through the use of arithmetic decision procedures that suck
in everything they think might be relevant.

Closes #844


# d2b57f01 29-May-2020 Arve Gengelbach <arve.gengelbach@it.uu.se>

align numeric syntax: 'great' becomes 'greater' The earlier names are inconsistent with numSyntax and less descriptive.

The changes are:
intSyntax.great_tm -> intSyntax.greater_tm
intSyntax.dest_great -> intSyntax.dest_greater
intSyntax.mk_great -> intSyntax.mk_greater

int_arithTheory.add_to_great -> int_arithTheory.add_to_greater

realSyntax.great_tm -> realSyntax.greater_tm
realSyntax.dest_great -> realSyntax.dest_greater
realSyntax.mk_great -> realSyntax.mk_greater

github issue #629


# 0a982e3f 18-May-2020 Michael Norrish <michael.norrish@data61.csiro.au>

Ensure ℕ and ℝ dp's have different names when embedded in simplifier

Now they are NUM_ARITH_DP and REAL_ARITH_DP, which are the names to
use when "Excl"-uding them from simplifier invocations. The
NUM_ARITH_DP also does normalisation over additive ℕ-terms.


# d0b4f135 15-May-2020 Michael Norrish <michael.norrish@data61.csiro.au>

Fix a MULRELNORM instance: 2 * x = inv 2 * y should canonicalise


# 2160f504 15-May-2020 Michael Norrish <michael.norrish@data61.csiro.au>

Fix a REALMULCANON bug to do with inv applied to real literals


# e2f002ce 15-Mar-2020 Michael Norrish <michael.norrish@data61.csiro.au>

Further fixes (with tests) to ℝ-multiplication-normalisation


# fb6bec88 11-Mar-2020 Michael Norrish <michael.norrish@data61.csiro.au>

More ℝ-normalisation, removing inverted factors where possible

Previously, the code would collect up

...x... <= ... x...

for various possible exponents of x, but the normalisation would only
trigger if the x was present on both sides. Now, if the exponent is
negative, a lone x will shift to the other side of the relation
regardless.

This applies also to fractions, so that

x <= 3/4 * y

will turn into

4 * x <= 3 * y

Fixes in src/probability and more explicit regression tests.


# 6126ac65 04-Mar-2020 Michael Norrish <michael.norrish@data61.csiro.au>

Make ℝ-relation-normalisation first canonicalise arguments to rel'n


# 3d9b7e1f 03-Mar-2020 Michael Norrish <michael.norrish@data61.csiro.au>

Fix canonicalisation of terms with leading fraction coefficients


# 7815eb6e 03-Mar-2020 Michael Norrish <michael.norrish@data61.csiro.au>

Further extend normalisation of multiplications on ℝ

In particular, fractions are handled better so that something like

4 * x * inv 2

will turn into

2 * x

Also normalise so that something that would otherwise appear as

-1 * (f1 * f2 * ...)

will become

-(f1 * f2 * ...)


# d0a0dfd3 24-Feb-2020 Michael Norrish <michael.norrish@data61.csiro.au>

Further improve ℝ normalisation

More test-cases, more automatic rewrites, better code.


# 32cb5f65 21-Feb-2020 Michael Norrish <michael.norrish@data61.csiro.au>

Normalise ℝ multiplications on either side of relation symbols

This can factor out things like

8 * x <= 12 * y ~~~> 2 * x <= 3 * y

as well as

x pow 10 * z < y * x⁻¹ pow 6 ~~~> x pow 16 * z < y

though the latter relies on being able to discharge the side condition
that x <> 0.

Put into srw_ss() and problems arising fixed


# 8751db67 20-Feb-2020 Michael Norrish <michael.norrish@data61.csiro.au>

Tweaks to multiplicative normalisation over ℝ

Includes some new automatic rewrites


# 5283d5f6 19-Feb-2020 Michael Norrish <michael.norrish@data61.csiro.au>

Add RMULCANON to automatic simplification

Builds up to selftest level 1.


# bbb3ac95 17-Feb-2020 Michael Norrish <michael.norrish@data61.csiro.au>

Extend/improve REALMULCANON normalisation


# be0fdac4 12-Feb-2020 Michael Norrish <michael.norrish@data61.csiro.au>

More work on getting better simplification/normalisation over reals


# bb0dcafa 05-Feb-2020 Michael Norrish <michael.norrish@data61.csiro.au>

Change "thm-names" (used in various places) to be Thy-Name record

This saves on pulling things apart and looking for dots and the like.
It changes the simpLib API (most significantly for the SSFRAG function
which builds simpset fragments).


# f1b09c58 29-Mar-2019 Michael Norrish <Michael.Norrish@nicta.com.au>

Add canonicalisation convs for real addition and multiplication

These should be included in default simplification for the real
numbers.


# 3f970ed8 17-Dec-2018 Michael Norrish <Michael.Norrish@nicta.com.au>

Give theorems names in simpsets

This is to allow them to be removed easily. System builds on -t1, but
there are still two things to be done

1. the names associated with export_rewrites calls aren't passed on to
the simpsets yet
2. there is not yet an API for removing them

Also, perhaps just as an interim measure, I removed the unused
entrypoint for removing rewrites by pattern matching against their
LHSes (simpLib.remove_theorems).


# 4888f523 15-Oct-2017 Michael Norrish <Michael.Norrish@nicta.com.au>

Remove eqtype declaration for term type


# 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.