lex/index.html
author Christian Urban <christian dot urban at kcl dot ac dot uk>
Fri, 11 Mar 2016 12:48:03 +0000
changeset 392 880e62843614
child 393 c08b9d616f9d
permissions -rw-r--r--
updated
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
392
880e62843614 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" 
880e62843614 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     2
"http://www.w3.org/TR/REC-html40/loose.dtd"> 
880e62843614 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     3
<HEAD>
880e62843614 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     4
<TITLE>HGMP</TITLE>
880e62843614 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     5
<BASE HREF="http://www.inf.kcl.ac.uk/staff/urbanc/">
880e62843614 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     6
</HEAD>
880e62843614 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     7
880e62843614 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     8
<BODY TEXT="#000000" 
880e62843614 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     9
      BGCOLOR="#4169E1" 
880e62843614 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    10
      LINK="#0000EF" 
880e62843614 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    11
      VLINK="#51188E" 
880e62843614 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    12
      ALINK="#FF0000">
880e62843614 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    13
880e62843614 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    14
<TABLE WIDTH="100%" 
880e62843614 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    15
       BGCOLOR="#4169E1" 
880e62843614 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    16
       BORDER="0"   
880e62843614 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    17
       FRAME="border"  
880e62843614 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    18
       CELLPADDING="10"     
880e62843614 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    19
       CELLSPACING="2"
880e62843614 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    20
       RULES="all">
880e62843614 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    21
880e62843614 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    22
<!-- right column -->
880e62843614 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    23
<TR>
880e62843614 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    24
<TD BGCOLOR="#FFFFFF" WIDTH="75%">
880e62843614 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    25
<H2>POSIX Lexing with Derivatives of Regular Expressions (Proof Pearl)</H2>
880e62843614 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    26
 
880e62843614 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    27
Fahad Ausaf, Roy Dyckhoff, Christian Urban
880e62843614 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    28
<p>
880e62843614 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    29
880e62843614 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    30
Brzozowski introduced the notion of derivatives for regular
880e62843614 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    31
expressions. They can be used for a very simple regular expression
880e62843614 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    32
matching algorithm.  Sulzmann and Lu cleverly extended this algorithm
880e62843614 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    33
in order to deal with POSIX matching, which is the underlying
880e62843614 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    34
disambiguation strategy for regular expressions needed in lexers.
880e62843614 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    35
Sulzmann and Lu have made available on-line what they call a
880e62843614 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    36
``rigorous proof'' of the correctness of their algorithm w.r.t. their
880e62843614 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    37
specification; regrettably, it appears to us to have unfillable gaps.
880e62843614 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    38
In the first part of this paper we give our inductive definition of
880e62843614 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    39
what a POSIX value is and show (i) that such a value is unique (for
880e62843614 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    40
given regular expression and string being matched) and (ii) that
880e62843614 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    41
Sulzmann and Lu's algorithm always generates such a value (provided
880e62843614 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    42
that the regular expression matches the string).  We also prove the
880e62843614 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    43
correctness of an optimised version of the POSIX matching
880e62843614 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    44
algorithm. Our definitions and proof are much simpler than those by
880e62843614 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    45
Sulzmann and Lu and can be easily formalised in Isabelle/HOL. In the
880e62843614 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    46
second part we analyse the correctness argument by Sulzmann and Lu and
880e62843614 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    47
explain why it seems hard to turn it into a proof rigorous enough to
880e62843614 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    48
be accepted by a system such as Isabelle/HOL.
880e62843614 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    49
880e62843614 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    50
<H3>Theory Files for Isabelle 2016</H3>
880e62843614 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    51
  
880e62843614 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    52
<ul>
880e62843614 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    53
<li> <A HREF="http://talisker.inf.kcl.ac.uk/%7Eurbanc/cgi-bin/repos.cgi/lexing/raw-file/tip/thys/ReStar.thy">ReStar.thy</A>
880e62843614 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    54
</u>
880e62843614 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    55
880e62843614 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    56
880e62843614 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    57
<H3>Links</A>
880e62843614 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    58
880e62843614 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    59
<ul>
880e62843614 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    60
<li> <A HREF="http://talisker.inf.kcl.ac.uk/%7Eurbanc/cgi-bin/repos.cgi/lexing/raw-file/tip/Literature/sulzmann14-new.pdf">the paper</A> by Sulzmann and Lu
880e62843614 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    61
</ul>
880e62843614 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    62
  
880e62843614 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    63
</TABLE>
880e62843614 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    64
<P>
880e62843614 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    65
<!-- hhmts start --> Last modified: Fri Mar 11 12:20:03 GMT 2016 <!-- hhmts end -->
880e62843614 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    66
<a href="http://validator.w3.org/check/referer">[Validate this page.]</a>
880e62843614 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    67
</BODY>
880e62843614 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    68
</HTML>