History log of /seL4-l4v-master/HOL4/src/1/selftest.sml
Revision Date Author Comments
# 7e6911ab 19-Oct-2020 Michael Norrish <michael.norrish@data61.csiro.au>

Set up bind as an alias for >- in errormonad

This is so interactive uses can be set up to avoid the >- token, which
is handled magically by the quotation filter in "interactive"
settings, and which can thereby cause much annoyance.


# 1f5da33d 19-Oct-2020 Michael Norrish <michael.norrish@data61.csiro.au>

Make a use of raw_backend utility actually do something

It turns out that print_from_grammars sets up the backend that will be
used when printing is being performed. Therefore the
testutils.raw_backend utility needs to be applied like so:

raw_backend print_from_grammars min_grammars

in order for the reference to get changed appropriately.

This selftest worked because it was run in a situation where the
backend was already raw_terminal. After the construction of the
heaps, the backend becomes something "interactive" by default.

Also make other tests use raw_backend so that this selftest file can
be run inside a hol.bare or hol environment.


# a56a59b2 19-Oct-2020 Michael Norrish <michael.norrish@data61.csiro.au>

Fix type-grammar becoming unprintable because of a stale tyop

In particular, if a tyop name is reused but picks up a different
arity, a grammar's type abbreviation information might think that
an abbreviation using that tyop is still valid.


# 98cf870b 10-Aug-2020 Michael Norrish <michael.norrish@data61.csiro.au>

Fix let-p/printing to lose spaces after semicolons in binding lists

These spaces are inconsistent with the way semicolons are "spaced" in
all other contexts (monad syntax, lists, sets, function updates).

Thanks to Andreas Lööw for the bug report.


# 6656e772 27-Feb-2020 Michael Norrish <michael.norrish@data61.csiro.au>

Get irule (and IRULE_CANON) to do right thing with negated conclusions

Closes #775


# f0a59f1d 22-Sep-2019 Michael Norrish <Michael.Norrish@nicta.com.au>

Improve src/1's selftest

1. emit fewer HOL_{MESG,WARNING}s;
2. cleanup generated scratchTheory.{dat,sml,sig} files after test that
generates them is done even under Moscow ML, which doesn't seem to
implement Process.atExit.


# 17578090 23-Jun-2019 Michael Norrish <Michael.Norrish@nicta.com.au>

Change testutils API to allow for counting of failures

Don't want to necessarily just always instantly abort. Changes die's
type from

string -> 'a

to

string -> unit

This causes a number of knock-on effects.


# eee03790 05-Mar-2019 Michael Norrish <Michael.Norrish@nicta.com.au>

Make equality of "tight" precedence by default

Start to work through knock-on effects of this.


# a97a184e 24-Feb-2019 Michael Norrish <Michael.Norrish@nicta.com.au>

Fix typo in test description


# ffcc4e09 01-Jan-2019 Michael Norrish <Michael.Norrish@nicta.com.au>

Make "quoted variables" ($var$(..)) syntax more robust

In particular, they may contain quotation symbols and
backslash-escaped characters that are not necessarily UTF8 safe.

Thus: “$var$(\172)” parses to a variable whose name (as revealed by
dest_var), is the string containing character 172. The pretty-printer
correctly reverses this.

There are yet two infelicities in all this:
- quoted variables with challenging contents (spaces, quotations) need
to be preceded by whitespace to avoid completely confusing the lexer
- the pretty-printer doesn't safely print back quoted variables in
such contexts, so you get something that won't parse

The latter is easy to fix. The first is not.


# e00c7e37 05-Dec-2018 Michael Norrish <Michael.Norrish@nicta.com.au>

Modify testutils.require_msg and derivatives to return values

It can be useful to get back the result of a passing test for use in
further tests that build on that.

Knock-on effects where it is now not possible to simply List.app such
functions; they must now have their results explicitly ignored.


# caa694d6 27-Nov-2018 Michael Norrish <Michael.Norrish@nicta.com.au>

Don't use $var$(..) syntax to print overloaded names

These can manifest as variables in the guts of the pretty-printer so
it has to pay attention to its knowledge that they may be "fake"
variables.


# 9f4b3059 10-Nov-2018 Michael Norrish <Michael.Norrish@nicta.com.au>

Change type_abbrev to not alter printing behaviour

If printing of abbreviations is desired, users must now use
type_abbrev_pp.

Closes #599


# 1c953ffc 28-Oct-2018 Michael Norrish <Michael.Norrish@nicta.com.au>

Have testutils.die automatically print out "FAILED"

Argument to die is then appended to that, but on a new line.

Adjust some selftests to take advantage of this, though of course, we
don't expect to see the FAILED output for any of them because they're
all passing.


# 7fc780b2 24-Oct-2018 Michael Norrish <Michael.Norrish@nicta.com.au>

More tweaks to testutils

- change API of check_HOL_ERR to be tupled rather than curried (makes
it easier to write the (fn _ => true) predicate)
- add check_result entrypoint


# 185614a4 24-Oct-2018 Michael Norrish <Michael.Norrish@nicta.com.au>

Provide more information in exceptions raised by Tactical.VALID


# 793c19de 17-Sep-2018 Michael Norrish <Michael.Norrish@nicta.com.au>

Get chained Unicode negations to print properly

Selftests for both the pretty-printing behaviour and the underlying
token-splitting function that this depends on.


# 803c5249 11-Sep-2018 Michael Norrish <Michael.Norrish@nicta.com.au>

mp_then: Make Pat selector backtrack over possible parses

With regression test.

Closes #567


# 18e5d5cd 12-Jul-2018 Michael Norrish <Michael.Norrish@nicta.com.au>

Fix an mp_then/Pat selector bug

Include some more selftests. Thanks to Ramana for the bug report.


# 3048cfab 12-Jul-2018 Michael Norrish <Michael.Norrish@nicta.com.au>

Add an mp_then + Pat selector selftest


# ff372764 01-Jun-2018 Michael Norrish <Michael.Norrish@nicta.com.au>

Make a couple of selftests clean up a bit better

1. in src/1 it generates a scratchTheory, but did not remove the .dat
file
2. in tools/Holmake/tests/coproduct it does not clean testdir2 before
starting, allowing for stale/unhelpful Moscow ML dependency info to
linger there.


# 1c2f9678 28-May-2018 Michael Norrish <Michael.Norrish@nicta.com.au>

Fix pretty-printing bug for large-if-exprs in rator position

Closes #540


# d2d6d792 21-May-2018 Michael Norrish <Michael.Norrish@nicta.com.au>

Change irule to not include a rpt conj_tac effect

Closes #465


# 6f280bbc 07-Apr-2018 Michael Norrish <Michael.Norrish@nicta.com.au>

Tweak printing of long function applications

This brings the behaviour (on at least the examples I've tested) back
to the way things appeared in Kananaskis-11.

The change in the munger test only consists of some extra space
characters appearing in the output on a line by
themselves. (Previously the line had just consisted of a newline
without the preceding spaces.)


# dd460d4c 04-Apr-2018 Michael Norrish <Michael.Norrish@nicta.com.au>

Another p/printing test-case for if-expressions

Would catch a bug fixed by 709f4dcf04.


# d35b02e2 28-Mar-2018 Michael Norrish <Michael.Norrish@nicta.com.au>

Restore ppstream_funs as nullary type operator in term_pp_types

This name is used in user-written code (users' special purpose
pretty-printers), and there is no reason to rebind this name, forcing
them to change things.


# f52ec0a0 18-Mar-2018 Michael Norrish <Michael.Norrish@nicta.com.au>

Fix p/printers and selftests to agree with one another again


# 69697709 19-Feb-2018 Michael Norrish <Michael.Norrish@nicta.com.au>

Fixes for mp_then/drule bug found in previous commit

Provide more test-cases as well. Extend normalisation done by
goal_assum after a theorem is returned to it after "resolution".


# b3e096de 19-Feb-2018 Michael Norrish <Michael.Norrish@nicta.com.au>

Test-case demonstrating bug in drule (ultimately mp_then)


# 0216a74b 19-Feb-2018 Michael Norrish <Michael.Norrish@nicta.com.au>

Fix mp_then bug: its PART_MATCH variant wasn't instantiating types

(It has a PART_MATCH variant in order to make sure preserve universal
quantification of variables that don't get specialised to make the
match happen.)


# f44b2f43 18-Feb-2018 Michael Norrish <Michael.Norrish@nicta.com.au>

Implement & document controlled resolution tactics (drule & friends)


# 77938cb5 29-Dec-2017 Michael Norrish <Michael.Norrish@nicta.com.au>

Fix p/printing bug where restriction variables were shown as bound

Closes #503


# 25b94cf5 28-Dec-2017 Michael Norrish <Michael.Norrish@nicta.com.au>

Add failing test-cases for github issue #503

This bug has the free-bound status of the restricted variable
contaminate the free/bound status of variables within the restriction.
The printer is also too keen to see restrictions as identical when
they are not because the freeness of variables within the restrictions
are different.


# beec8de4 24-Oct-2017 Michael Norrish <Michael.Norrish@nicta.com.au>

Remove TABs in some source code, replacing them with spaces

Use Emacs's conception of how many spaces the TAB was
representing (and the M-x untabify command).

This may not line up with the author's original conception, but then,
using TABs makes it impossible to tell just what the original
conception was in the first place anyway.

Should probably script this over all of repository (excluding
makefiles of course), and use standard expand or col utilities rather
than emacs.


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

Remove eqtype declaration for term type


# 767b5efa 27-Sep-2017 Michael Norrish <Michael.Norrish@nicta.com.au>

Add selftest for COND_CONV


# 223cc1dd 26-Sep-2017 Michael Norrish <Michael.Norrish@nicta.com.au>

Fix test-case that depended on SML equality between non-atom terms

We have never guaranteed that terms with the same logical structure
should compare equal with SML equality. Variables and constants yes,
but others no. In particular, the explicit substitution machinery can
break this.


# af9d053e 13-Aug-2017 Michael Norrish <Michael.Norrish@nicta.com.au>

Update let pretty-printing to print let-chains in "list style"

The weird "and" syntax is still handled as before so that it is
possible to write

let x = y and y = x and z = y + 2 ; u = x * 10 in [x;y;z;u]

and have the x, y and z bindings refer to free occurrences of x and y.

Closes #154


# a13cd532 10-Aug-2017 Michael Norrish <Michael.Norrish@nicta.com.au>

Fix let-absyn post-processing

Tests and theories work up until pred_setTheory.

General list-form not yet right: parser now barfs on { x | y }.


# b847c215 01-Aug-2017 Michael Norrish <Michael.Norrish@nicta.com.au>

Extract pretty-printing of LET-terms from term_pp.sml

It is now part of user-printer "land" in src/bool/boolpp.sml,
alongside the custom printer for if-then-else (COND).

This refactoring revealed a bug in the way overloaded constants
couldn't be handled by user-printers if they could have extra
arguments hanging off to the right (as in “LET f x y”), *unless* they
were overloaded to "case" (as in COND).

To make sure one's user-printer is going to work, you have to consult
the grammar's overload information to check if your term is one you
want to print according to the grammar_name function. Unfortunately,
looking for particular constants is not guaranteed to work, as the
process of descending terms in the pretty-printer is liable to turn
real constants into special "fake" constants that are actually
variables with special names.

This is progress with Github issue #154, to allow new (Isabelle-style)
syntax for let expressions.


# 7493f6af 25-Jul-2017 Michael Norrish <Michael.Norrish@nicta.com.au>

Fix bug in free-var calculation for preterms (with test)


# 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


# 7f2c629e 08-Jan-2017 Michael Norrish <Michael.Norrish@nicta.com.au>

Reorganise flow of overloading resolution

This should let more specific errors escape the process. Now, the test
case in the selftest lets a (located) error about the impossible
interaction between < and T escape to the user. Previously, 3 + 4 <
T (with < and + overloaded to integer and number possibilities) was
just generating the "no resolution of overloads possible" message
without a helpful location.


# b9a590e8 29-Sep-2016 Michael Norrish <Michael.Norrish@nicta.com.au>

Unify handling of type abbrevs and type operators

This is analogous to what is done with terms, where the handling of
genuine constants passes through the overload map.

The main desirable effect should be that if multiple genuine type
operators with the same name are in the grammar, then only one will
print unqualified; all the others will print with theory-qualification.

Currently fails in src/datatype's selftest as ParseDatatype doesn't see
bare names that are existing types as possible occurrences of recursive
types.


# 5a1eec38 23-Aug-2016 Michael Norrish <Michael.Norrish@nicta.com.au>

Fix 2 more LVTermNet bugs

1. handling of function variables, supposedly improved by 3e5a7a35 was
broken if functions appeared before end of polish notation path
towards leaves
2. local-variable functions were not seen as such

More test cases to catch these bugs added.


# 71d35e0b 18-Aug-2016 Michael Norrish <Michael.Norrish@nicta.com.au>

Get LVTermNet tests to compile under Moscow ML


# 3e5a7a35 18-Aug-2016 Michael Norrish <Michael.Norrish@nicta.com.au>

Fix matching error in LVTermNet code

Problem was that a pattern like ``R x`` (where R is a variable) didn't
match ``f a b``.

Closes #332

Thanks to Joseph Chan for the original bug report.


# 550b68c2 03-Aug-2016 Michael Norrish <Michael.Norrish@nicta.com.au>

Fix over-aggressive normalisation in goal_assum

In particular, it's important that

P1 /\ P2 /\ ... Pn ==> F

stays as an implication and not turned into a negation.

Add test for expected behaviour with some instantiation provided by
mp_then.


# e7b5dbb4 22-Jul-2016 Michael Norrish <Michael.Norrish@nicta.com.au>

Fix basic unification bug (add derived test-case)


# 351ba238 21-Jul-2016 Michael Norrish <Michael.Norrish@nicta.com.au>

Fix a bug in handling of case expressions

Also fix Holmakefile so that selftest gets recompiled properly under
Moscow ML.


# fec42c3e 21-Jul-2016 Michael Norrish <Michael.Norrish@nicta.com.au>

Find and fix a parsing bug in monad implementation


# a8eebd3f 19-Jul-2016 Michael Norrish <Michael.Norrish@nicta.com.au>

Fix EVERY_CONJ_CONV; add tests for EVERY_DISJ_CONV


# 0dfd2c6d 19-Jul-2016 Michael Norrish <Michael.Norrish@nicta.com.au>

Write more tests for EVERY_CONJ_CONV (one fails)


# e2db1817 21-Apr-2016 Michael Norrish <Michael.Norrish@nicta.com.au>

Make selftest output line up with parallel Holmake's

Also make tests use testutils.OK to report OK


# 9bde18de 19-Apr-2016 Ramana Kumar <ramana@member.fsf.org>

Move match_goal selftests to boss

Enables writing tests depending on more stuff (including BasicProvers).


# 705eb764 09-Apr-2016 Ramana Kumar <ramana@member.fsf.org>

Add an initial implementation of match_goal

This is a tactic builder that does automatic logic-programming-style
search over (sub)terms in the assumptions and conclusion of a goal
ensuring certain patterns match and that a given tactic (which can refer
to the terms and assumptions named by the pattern) succeeds.

Work with Jack Gallagher, and inspired by a similar facility in Coq.


# a1203393 11-Nov-2015 Michael Norrish <Michael.Norrish@nicta.com.au>

Fix src/1/selftest to hide temporary constants

Having a "c" around that is now a constant can mess with your parsing of
innocent seeming terms.


# 934bff32 11-Nov-2015 Michael Norrish <Michael.Norrish@nicta.com.au>

Fix bug in irule found by Jeremy.

Wasn't collapsing groups of assumptions together in terms of their
shared free variables correctly.


# ccf910c6 05-Nov-2015 Michael Norrish <Michael.Norrish@nicta.com.au>

Fix irule to handle input thms with hyps better

As per selftests. Other possible differences will be in ordering of new
subgoal, and distribution of existentials over those subgoals.


# 5e334c4a 04-Nov-2015 Michael Norrish <Michael.Norrish@nicta.com.au>

Add two selftests for irule tactic.

Adjust documentation to make example correspond to what tactic actually
does.


# 3df6c6b3 18-Sep-2015 Michael Norrish <Michael.Norrish@nicta.com.au>

Fix thm_to_string to use raw backend properly.

The term_to_string and type_to_string functions do this already.


# 111800f7 10-Sep-2015 Michael Norrish <Michael.Norrish@nicta.com.au>

Implement and document remove_type_abbrev.

Closes #148


# c3e3e54e 25-Mar-2015 Michael Norrish <Michael.Norrish@nicta.com.au>

Delete trailing whitespace in src/


# 05417c48 28-Jan-2015 Jeremy Dawson <jeremy@cecs.anu.edu.au>

test for VALIDATE in src/1/selftest


# 8a464d08 27-Jan-2015 Jeremy Dawson <jeremy@cecs.anu.edu.au>

self-test for some list-tactics, eg ROTATE_LT, REVERSE_LT, SPLIT_LT


# fac53deb 21-Jan-2015 Jeremy Dawson <jeremy@cecs.anu.edu.au>

self-test for USE_SG_TAC and some other list-tactics


# 57d38bd4 18-Jan-2015 Michael Norrish <Michael.Norrish@nicta.com.au>

Make save_thm etc reject names that will cause uncompilable theory files

This causes exceptions/errors earlier rather than later.


# 754a8519 07-Jan-2015 Michael Norrish <michael.norrish@nicta.com.au>

Add regression test for issue #214


# 51b08c16 05-Nov-2014 Michael Norrish <michael.norrish@nicta.com.au>

Make PP.avoid_unicode also work for bare constant names.

Previously, unicode infixes, suffixes were avoided, but if one did an
outright

overload_on("unicode-ish thing", ``constant``)

then PP.avoid_unicode wouldn't help.


# b7d03a24 05-Nov-2014 Michael Norrish <michael.norrish@nicta.com.au>

Handle Unicode on Windows better with new PP.avoid_unicode trace

If the trace variable is true, then the pretty-printer strives to not
print Unicode characters. If it's false, then it obeys the grammar
(which encodes various printing preferences as well). The trace
is initialised to true on Windows systems.


# f2253bcc 22-Jun-2014 Michael Norrish <michael.norrish@nicta.com.au>

Get src/1/selftest.sml to compile under Moscow ML again.

Change in 1ffe317 (new test-case for issue #172) broke compilation
because Moscow ML's handling of record types differs from Poly/ML's.


# 1ffe3171 22-Jun-2014 Michael Norrish <michael.norrish@nicta.com.au>

Test-case for github issue #172

The problem is that the pattern ``x: bool -> bool`` is matching
everything.


# 44946682 22-Apr-2014 Michael Norrish <michael.norrish@nicta.com.au>

Fix minor bug in behaviour of EVERY_CONJ_CONV (with selftest)


# cf273a71 25-Feb-2014 Michael Norrish <michael.norrish@nicta.com.au>

Allow prefix-operators to be printed without parens in rand-position

This is a refinement to the decision in aeb0085a3d11, which insisted
that prefix operators (like if-then-else, binders, case-expressions
and others) should always get parentheses when printed as arguments to
functions.

Now you can tweak this by choosing the NotEvenIfRand parenthesis style
as an argument to add_rule. For particularly tight operators, ones
that may omit spaces before their arguments say, this may look better.
For example, you might define a "#" operator, when it might be nicer
to have

f #2 + g #n

print that way, rather than with extra parentheses. At the moment, our
standard number injection function & does print with parentheses, but
this case does feel like one where dispensing with the parentheses
might be a good idea.


# b9f7878e 19-Feb-2014 Michael Norrish <michael.norrish@nicta.com.au>

Correct bug in type pretty-printer when unary op is "unknown"

The buggy behaviour would cause

minprint ``x: ('a -> 'b) option``

to print

x: ('a -> 'b option$option)


# 97732c28 28-Jan-2013 Michael Norrish <michael.norrish@nicta.com.au>

Improve pretty-printing of if-then-else. Closes #20

Include some regression tests.


# 2e08a09d 26-Jan-2013 Michael Norrish <Michael.Norrish@nicta.com.au>

Add some type pretty-printing selftests.


# 7bce8ba4 05-Dec-2012 Michael Norrish <Michael.Norrish@nicta.com.au>

Change some regression tests to cope with bool_case = COND.

If you write `case x of T => 3 | F => 4`, it doesn’t print like that
any more; instead it will print as `if x then 3 else 4`. So old
test-cases that relied on the old behaviour failed.

So, the test-cases, which were all about pretty-printing of nested
case expressions (correct parenthesisation etc) are now about case
expressions over nums testing the same issue.


# 1be26119 23-Oct-2012 Michael Norrish <Michael.Norrish@nicta.com.au>

Fix a bug where REWRITE_TAC and friends with rewrite |- T could loop.


# 4354d343 13-Aug-2012 Michael Norrish <Michael.Norrish@nicta.com.au>

Fix a couple of selftest bugs arising from issue #13 hacks.


# b7d8138a 03-Oct-2011 Michael Norrish <Michael.Norrish@nicta.com.au>

Allow case expressions to parse with leading bars. Closes #25.


# d68a7e54 26-Sep-2011 Michael Norrish <Michael.Norrish@nicta.com.au>

New tests for regressions in case-expression pretty-printing.


# a2328149 23-Sep-2011 Anthony Fox <anthony.fox@cl.cam.ac.uk>

Adopt ML-style syntax for case expressions and use freed up "||" for bitwise-or. See issue #24.


# 158b25a2 30-Aug-2011 Michael Norrish <Michael.Norrish@nicta.com.au>

Add test for DiskThms functionality.

This test also causes the current bug to do with dependency failures with mlyacc
stuff to exhibit.


# 99851de6 07-Apr-2011 Michael Norrish <Michael.Norrish@nicta.com.au>

Fix a pretty-printing bug to do with polymorphic constants.

Printing of w2w terms with show_types on works correctly. In fact, it
looks as if it was working correctly before, but the algorithm that
was achieving this was still utterly wrong. The accompanying
self-test demonstrates an instance that the old algorithm got wrong.


# 218b94ff 04-Feb-2011 Michael Norrish <Michael.Norrish@nicta.com.au>

Two more printing tests for parens around prefixes.


# ff071659 04-Feb-2011 Michael Norrish <Michael.Norrish@nicta.com.au>

Add (failing) test for insertion of parens to args with prefix-forms.


# 325f792b 02-Feb-2011 Michael Norrish <Michael.Norrish@nicta.com.au>

Failing test; edit grammar to change break behaviour and see no change.


# 8295bb6c 27-Jan-2011 Michael Norrish <Michael.Norrish@nicta.com.au>

Failing tests for base printing of dollared escapes.


# b54de04e 15-Jan-2011 Ramana Kumar <ramana.kumar@gmail.com>

Turns out last checkin was just a documentation bug


# e732bfc7 15-Jan-2011 Ramana Kumar <ramana.kumar@gmail.com>

Add test for a new INST_TYPE bug

This bug is not yet fixed.
Please forgive me if it's not actually a bug... at least the Docfile for
INST_TYPE should change if this is expected behaviour.


# 1bc9f344 13-Jan-2011 Michael Norrish <Michael.Norrish@nicta.com.au>

Change src/bool to src/1 as a prelude to experimentation!