History log of /seL4-l4v-master/HOL4/src/parse/GrammarDeltas.sml
Revision Date Author Comments
# 978013e4 20-Oct-2020 Michael Norrish <michael.norrish@data61.csiro.au>

Change AncestryData API a little

- In particular, make it clear that we expect lists of deltas that are
then applied to values to update them (with a foldl)
- Also hint at next step with (commented out) fullmake entry-point.


# e11c53c1 20-Oct-2020 Michael Norrish <michael.norrish@data61.csiro.au>

Make more visible in the GrammarDeltas signature


# d3dc93f8 20-Oct-2020 Michael Norrish <michael.norrish@data61.csiro.au>

Make grammar-deltas s-expressions when stored in theory .dat files

This makes them more legible, and is also a prelude to being more
uniform in the treatment of theory data that merges deltas across
ancestors.


# 7ac36a38 04-Feb-2020 Michael Norrish <michael.norrish@data61.csiro.au>

Allow users' theory data to share/hash embedded strings


# c4643f5f 02-Feb-2020 Michael Norrish <michael.norrish@data61.csiro.au>

Make stored theory data HOLsexp's rather than strings

It's easy enough to cope with old code because strings can be injected
into sexps trivially. The richer ThyDataSexp type has been updated to
use a nicer encoder though, and clients that use that API are unchanged.


# b98f5ead 10-Apr-2019 Michael Norrish <Michael.Norrish@nicta.com.au>

Be more careful over handling of ThmSetData and rebinding of thm names

In particular, it was previously possible to do

val thm = store_thm("thm[some_attribute]", tm1, tac2);
val thm = store_thm("thm", tm2, tac2);

and have the second thm be exported but to pick up the attribute from
the first call. This is clearly outrageous, so now the attribute is
lost when the second theorem is slotted into the theory.

Working through all this found three places where this
double-definition pattern was happening (there may yet be more). In
src/finite_map and src/list the second theorem was clearly just
redundant and could be deleted.

The example in fun-op-sem is slightly more interesting: there it
defines a function (which definition gives that function a "compute"
attribute), and then restates the definition, saving it under the same
name ("foo_def"). Though arguably bad style, it's important that the
second theorem replace the first, and that it should have the
"compute" attribute. Here the change is to explicitly add that
attribute to the second theorem.

Finally, all this work revealed that Theory.sml's handling of the
NewBinding theory-delta hook was wrong and caused changes to be
dropped after the hook function was called. Debugging *that* led me to
add a pp field to the LoadableThyData registration process so that
theory-data values could be inspected more easily. There is also a
trace variable to turn on some debugging output in Theory.


# 66465004 27-Feb-2019 Michael Norrish <Michael.Norrish@nicta.com.au>

Clean up handling of type_grammar deltas and interaction with Thyops

Need a slightly better interface for querying the kernel name
signature information for types, and also alter term functions to not
return constants that don't have up-to-date types.

Now deleting a type doesn't result in broken theories.

With a regression test.

Closes #179


# 17990a1d 08-Nov-2018 Michael Norrish <Michael.Norrish@nicta.com.au>

Implement "input only type abbreviations"

Closes #599


# 5d5a8494 09-Mar-2017 Michael Norrish <Michael.Norrish@nicta.com.au>

Preserve add_user_printer properly in grammar data

This requires a slightly involved process for storing references to
code in theory files.

Update the .doc file on add_user_printer (which was already incredibly
long), and add a test.

Closes #367


# 7a08fce1 04-Oct-2016 Michael Norrish <Michael.Norrish@nicta.com.au>

Handle clear_overloads_on with user-deltas


# af6c06dc 03-Oct-2016 Michael Norrish <Michael.Norrish@nicta.com.au>

Convert type-grammars to use deltas for updates

This is very much analogous to what has been done for term grammars.


# 717781e5 22-Sep-2016 Michael Norrish <Michael.Norrish@nicta.com.au>

Add deltas for moving overload operations

Sadly, making an inferior overload is not *quite* the same as making a
normal one, then then moving it "to the back", so I've left both
operations in the user_delta type for the moment.


# cd932cf1 22-Sep-2016 Michael Norrish <Michael.Norrish@nicta.com.au>

Handle gen_remove_ovl_mapping

This gets tests as far as string_numTheory


# 4b008b2b 20-Sep-2016 Michael Norrish <Michael.Norrish@nicta.com.au>

Begin process to use GrammarDeltas inside theories

This doesn't work yet (just attempting to load boolTheory leads to an
exception), but it's close to working, at least for some situations. I'm
generating new constructors for the user_delta type more or less as the
errors prompt me to.

The new constructors in this commit are IOVERLOAD_ON for "add inferior
overload on" (it's not really clear that this is used enough to warrant
inclusion, but hey); ASSOC_RESTR for "associate restriction", which is
used in boolTheory and probably nowhere else ever, and RMOVMAP for
"remove overload mapping", which is used to remove overloadings to
constants.

General pattern in Parse is to generate the user_delta values, and to
then feed these to the term_grammar.add_delta function to make the
grammar updates. This makes Parse simpler on the whole, which is
definitely an improvement.


# 7e8d786d 19-Sep-2016 Michael Norrish <Michael.Norrish@nicta.com.au>

Record overload_on calls in GrammarDeltas


# 145b3a03 18-Sep-2016 Michael Norrish <Michael.Norrish@nicta.com.au>

Record grammar deltas in Parse

These are not used for any other purpose just yet, and the set of
possible grammar deltas is not yet big enough. (Next addition:
overload_on).