History log of /seL4-l4v-master/HOL4/src/datatype/EnumType.sml
Revision Date Author Comments
# 35d5d53a 07-Mar-2019 Michael Norrish <Michael.Norrish@nicta.com.au>

Get src/datatype to build given tight equality


# 2377d821 13-Apr-2018 Michael Norrish <Michael.Norrish@nicta.com.au>

Fix bug in handling of distinctness for large enumerated types

Previous attempt at regression test for this didn't capture scenario
where srw_ss() had already been initialised and correctness relied on
TypeBase hook telling BasicProvers about newly arriving tyinfo.

Performance is still bad when theories dump large tyinfos to disk.


# 1e0d2028 11-Apr-2018 Michael Norrish <Michael.Norrish@nicta.com.au>

Re-implement Datatype package with TypeBase sexps (not adjoin)


# 0b018443 11-Dec-2017 Michael Norrish <Michael.Norrish@nicta.com.au>

Rename TypeBase entrypoints for caseeqsplit and friends

Now use case_eq everywhere.

Work on github issue #345


# 962f50c1 29-Nov-2017 Michael Norrish <Michael.Norrish@nicta.com.au>

Automatically prove "case-eqsplit" theorems and store in TypeBase

For :num, this theorem looks like

(num_CASE n zc sc = v) <=>
(n = 0) ∧ (zc = v) ∨ ∃x. (n = SUC x) ∧ (sc x = v)

Such theorems can be powerful rewrites when (large) case-expressions
are asserted to be equal to some value or other.

These theorems have to be installed somewhat by hand for early types,
but from list onwards, the Datatype package handles this. This work
leverages earlier work done implementing prove_case_eq_thm (8f16922426).

Take the opportunity to rework TypeBasePure's code to use
FunctionalRecordUpdate.

This is progress with github issue #345.


# 9652789f 29-Mar-2016 Anthony Fox <anthony.fox@cl.cam.ac.uk>

Support for simplifying and evaluating enumerated type representation/abstraction maps.

For example, given

Datatype `enum = one | two`;

the following now works

> EVAL ``num2enum 1``;
val it = |- num2enum 1 = two: thm
> EVAL ``enum2num two``;
val it = |- enum2num two = 1: thm

> SIMP_CONV (srw_ss()) [] ``enum2num two``;
val it = |- enum2num two = 1: thm
> SIMP_CONV (srw_ss()) [] ``num2enum 1``;
val it = |- num2enum 1 = two: thm

This also works when building custom compsets using computeLib. add_datatype_info.

NOTE: This change may break some proofs (some in example/ARM have been fixed).


# ef72cbeb 19-Jan-2015 Michael Norrish <Michael.Norrish@nicta.com.au>

WIP fixing problems with 57d38bd4


# 9fd06068 09-Dec-2012 Michael Norrish <michael.norrish@nicta.com.au>

Clean up code that relies on constant and theorem names for case constants.

Rather than code having to know that the constant is called
“type_CASE” and that its definition is stored in “type_case_def”, use
ML entrypoints in Prim_rec to abstract these details.

This is progress with github issue #97.


# fb504774 06-Dec-2012 Michael Norrish <Michael.Norrish@nicta.com.au>

Enumerated types were getting the wrong names for their case constants.

This is progress with github issue #97.


# ea6b6998 04-Dec-2012 Michael Norrish <Michael.Norrish@nicta.com.au>

Fix generation of case constants for enumerated types.

This is progress with github issue #97.


# 050df6ef 01-Aug-2012 Michael Norrish <michael.norrish@nicta.com.au>

Don't emit definition bindings for enumerated constants.

Fixes #78.

This commit also

* fixes uses of constructor definitions (the equations are still
present under the "number2<ty>_thm" name)
* provides a regression test
* a bug fix claim in the release notes.


# 6cac8296 07-Mar-2011 Konrad Slind <konrad.slind@gmail.com>

Addition of destructors and recognizers for datatypes.
So far, I've just got basic support put in.

Some other trivial mods as well.


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


# a37e5a74 09-Jun-2006 Konrad Slind <konrad.slind@gmail.com>

Fixes to support code generation for records. Incomplete! So
do not update these changes (I'm just using CVS to transfer
files to work machine).


# 014f6140 15-Feb-2006 Konrad Slind <konrad.slind@gmail.com>

Changed the TypeBase to be indexed by types. Originally it was
indexed by a single string (representing the type operator), then
Michael changed it to a pair of strings (precise representation
of the type operator). The latest change allows non-datatypes to
be added to the TypeBase. This will allow case analysis and
termination proofs to be supported for non-datatypes.

I reckon there are still a few bugs left after the massive
revision, so you might want to wait a while before upgrading.


# 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


# bbea9bc2 27-Sep-2004 Konrad Slind <konrad.slind@gmail.com>

A load of changes aimed at supporting records better. And some other
odds and ends.


# 71a6ff8b 26-Jun-2003 Konrad Slind <konrad.slind@gmail.com>

Adding in support for encoding in the TypeBase.


# 596a0c7b 18-Feb-2003 Michael Norrish <Michael.Norrish@nicta.com.au>

An efficiency improvement for enumerated types. Here's a little table
giving times taken (in seconds) to define an enumerated type of 50
elements:

dB indices Name-carrying terms
old code 5.5 15.1
new code 4.0 3.9

I don't know why the old code and name-carrying terms interacted so badly,
but will look into this as it may point to a problem in the experimental
kernel.

For what it's worth, the performance graphs for the three good performances
are all linear-looking (for sz = 1..50), but the gradient on the line
for old code is slightly worse than that for the new code.


# 4cd281d5 03-Sep-2002 Michael Norrish <Michael.Norrish@nicta.com.au>

Modify TypeBases so that they can store conversions as well as theorems
in a tyinfo's "simpls_of" slot. This is then used to implement a conversion
for enumerated type equalities. Previously, we just used a rewrite
directly, which meant that something of the form (x = C10) might turn
into the rather ugly (foo_to_num x = 11). Now, the rewrite is only
applied to equalities between constants.
Some comments in the .sig files in Datatype, RecordType and EnumType
hopefully also make it clearer what the weird string results are
doing, and how they get added into theory files.


# 4ccd1ec6 28-Aug-2002 Michael Norrish <Michael.Norrish@nicta.com.au>

At Anthony's suggestion, altered treatment of enumerated type package to
emit one theorem (called <rep>_thm) of form
(rep C1 = 0) /\ (rep C2 = 1) /\ ... (rep Cn = n - 1)
rather than n individual theorems (with names <rep>_Ci) of form
rep Ci = i - 1
Also add <abs>_thm of form
(abs 0 = C1) /\ (abs 1 = C2) /\ ... (abs (n - 1) = Cn)


# d6b08f6b 16-Aug-2002 Konrad Slind <konrad.slind@gmail.com>

Change to type of new_specification, and made it tell that parser about
the introduced constants. Lots of knock-on (trivial) mods.


# c3393882 03-Jul-2002 Joe Hurd <joe@gilith.com>

Moved the code to automatically generate "boolify" functions for datatypes
from src/datatype/Datatype.sml to src/Boolify/src/Boolify.sml.

It uses the register_update_function hook to add the boolification
info (more on that later).

Also added a test suite for boolification.


# e28431af 21-Jun-2002 Joe Hurd <joe@gilith.com>

Added boolification functions for enumerated types, and added a
datatype with a single nullary constructor to the test suite to
stop a recent bug from reappearing.


# 92994079 21-Jun-2002 Konrad Slind <konrad.slind@gmail.com>

Fixed problem with single-constructor datatypes.


# 1784283d 20-Feb-2002 Konrad Slind <konrad.slind@gmail.com>

First steps in adding boolification for datatypes. Shouldn't
interfere with others' work.


# 3d2f9ce3 20-Jun-2001 Konrad Slind <konrad.slind@gmail.com>

Change stemming from split of TypeBase into TypeBasePure and TypeBase.


# e207d7c4 12-Jun-2001 Michael Norrish <Michael.Norrish@nicta.com.au>

Slight reworking to make sure that additional simplification theorems
created by the enumerated types package are saved properly (i.e., correctly
adjoined to the current theory file).


# fb91045b 08-Jun-2001 Konrad Slind <konrad.slind@gmail.com>

Code for case_cong_thm moved to Prim_rec.


# d363631c 07-Jun-2001 Michael Norrish <Michael.Norrish@nicta.com.au>

Minor, and hopefully final, corrections to get case_cong_thm to work
now that the form of the case definition theorem has changed.


# 05cef100 07-Jun-2001 Konrad Slind <konrad.slind@gmail.com>

Fixing define_case to have the definition be all -- postprocessing
seemed to confuse TypeBase instructions left in Theory files.


# 129c2579 07-Jun-2001 Konrad Slind <konrad.slind@gmail.com>

More changes, to fix the final shape of the case definition.


# 158ac6b6 07-Jun-2001 Michael Norrish <Michael.Norrish@nicta.com.au>

Minor fix.


# 34b20618 07-Jun-2001 Konrad Slind <konrad.slind@gmail.com>

Improvements in speed for define_case and case_cong_thm.


# 0abefe27 06-Jun-2001 Konrad Slind <konrad.slind@gmail.com>

Changes to make case constant definition faster in EnumType.


# 6f2287e1 05-Jun-2001 Michael Norrish <Michael.Norrish@nicta.com.au>

Now prove case congruence theorem as well as all the rest.


# 725feda8 04-Jun-2001 Michael Norrish <Michael.Norrish@nicta.com.au>

Efficient definition of enumerated types.