History log of /seL4-l4v-master/HOL4/src/1/Pmatch.sml
Revision Date Author Comments
# 4888f523 15-Oct-2017 Michael Norrish <Michael.Norrish@nicta.com.au>

Remove eqtype declaration for term type


# a8f09a0a 13-Jun-2017 Thomas Tuerk <tuerk@kth.se>

fix issue #416


# dea93fe0 07-Feb-2017 Thomas Tuerk <thomas@tuerk-brechen.de>

fix bug in case expression pretty printer

In case a sub-casesplit is splitting on not a pattern variable then stop
splitting. A comment said this should be the case already, but this did
not work.


# 547e2f93 27-Nov-2016 Thomas Tuerk <thomas@tuerk-brechen.de>

decision-tree case expressions: fail when mixing literals and constructor patterns

Before, it was possible to mix literal and constructor patterns in one
column. The results were not as intended though. For example

``case x of 0 => 0 | 1 => 1 | SUC _ => 2``

is compiled to (with pretty printing turned off)

``literal_case
(λv.
if v = 0 then 0
else if v = 1 then 1
else if v = SUC m then 2
else ARB) x``

The pattern "SUC m" is handled as a value. "m" is a free variable of the
resulting case expression. It is not - as most likely intended by the
user - matched against "x".

The problem is that this case expression mixes literals and constructor
patterns. The documentation states explicitly that this is an
unsupported case expression. I thought the parser would fail on such
case expressions. I suspect (but am uncertain and could not find
anything going through the old versions) that it did at some point.
Anyhow, this commits adds such a check during pattern compilation now
that prevents such patterns from being parsed.


# 6783d71b 23-Mar-2016 Anthony Fox <anthony.fox@cl.cam.ac.uk>

Implement fix for issue #271.


# ca272ab1 23-Sep-2014 Thomas Tuerk <tt291@cl.cam.ac.uk>

fix issue #196


# 961350f9 24-Jul-2013 Michael Norrish <Michael.Norrish@nicta.com.au>

Delete some trailing whitespace


# 725fb350 24-Jul-2013 Michael Norrish <Michael.Norrish@nicta.com.au>

Improve error message when a user provides a bad pattern.

Closes #119


# 1d91518a 15-Apr-2013 Thomas Tuerk <tt291@cl.cam.ac.uk>

cleanup of Pmatch

Following a suggestion of Anthony, I cleaned-up the interface of Pmatch.
To this end, I moved much of the heuristics-code to a new library called
PmatchHeuristics. This new library is used by Pmatch. This allows to
clean-up the code and interface of Pmatch. If less frequently used functions
are needed, the library PmatchHeuristics has to be used now.


# 257798de 19-Feb-2013 Thomas Tuerk <tt291@cl.cam.ac.uk>

minor tweaks for pattern matching


# 4672d2f0 18-Feb-2013 Thomas Tuerk <tt291@cl.cam.ac.uk>

added trace "pp_cases" that allows to turn pretty-printing for case-expressions off


# 0b6e5649 15-Feb-2013 Thomas Tuerk <tt291@cl.cam.ac.uk>

added exhaustive pattern match heuristic (useful only for very small examples)


# be58d73a 15-Feb-2013 Thomas Tuerk <tt291@cl.cam.ac.uk>

execute several heuristics for pattern-matching and choose the best result
interface of pattern matching simplified


# 0f0c61b2 10-Feb-2013 Thomas Tuerk <tt291@cl.cam.ac.uk>

implemented qba heurtic for pattern matching; don't do splits for which
lead to same result for all cases


# 7cc76829 08-Feb-2013 Thomas Tuerk <tt291@cl.cam.ac.uk>

started with writing more complex pattern match heuristics


# fed48c8e 08-Feb-2013 Thomas Tuerk <tt291@cl.cam.ac.uk>

modify pattern matching to use heuristics for picking the column to split on


# dd90e8d8 07-Feb-2013 Michael Norrish <michael.norrish@nicta.com.au>

Report bad-pattern errors more specifically.

Closes #107.


# 2e60f465 13-Dec-2012 Michael Norrish <michael.norrish@nicta.com.au>

Fix bug in parsing of case-expressions involving “literals”.

Issue arises when the parsing code thinks that it’s seeing a literal,
which it does on seeing a “if var = exp then e1 else e2” under a case
expression, even when exp includes free variables. (The same buggy
behaviour was seen before the case-const arg-flipping work began, but
it had to be a bool_case term then.)

The fix is to make the parsing code check that the exp in expressions
such as the above really does have no free variables. Then it can
treat that as a literal case expression.


# 945ba498 13-Dec-2012 Michael Norrish <michael.norrish@nicta.com.au>

Remove duplication of code between Pmatch and TypeBasePure.

The case-syntax code in the latter has moved entirely to Pmatch.


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

Fixed a bug in Pmatch (residual assumptions about argument order).

This is progress with github issue #97.


# 0e622824 21-Nov-2012 Michael Norrish <michael.norrish@nicta.com.au>

Changes bringing Pmatch more into line with revisions to tfl’s Functional.sml.


# f0553c0e 20-Nov-2012 Michael Norrish <michael.norrish@nicta.com.au>

Move mk_pattern_fn from old Functional structure to Pmatch.


# 7fb62e79 14-Nov-2012 Michael Norrish <michael.norrish@nicta.com.au>

Obvious (but insufficient) fixes for Pmatch.


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

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