author | Christian Urban <christian dot urban at kcl dot ac dot uk> |
Tue, 15 Mar 2016 12:47:34 +0000 | |
changeset 397 | ca75a0cd27a4 |
parent 396 | 8d4f3b55ead8 |
child 398 | c6612bffb0c1 |
permissions | -rw-r--r-- |
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 |
397
ca75a0cd27a4
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
396
diff
changeset
|
36 |
''rigorous proof'' of the correctness of their algorithm w.r.t. their |
392
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> |
396
8d4f3b55ead8
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
395
diff
changeset
|
54 |
<li> <A HREF="http://talisker.inf.kcl.ac.uk/%7Eurbanc/cgi-bin/repos.cgi/lexing/raw-file/tip/thys/Simplifying.thy">Simplifying.thy</A> |
395
c7f232bf2d83
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
394
diff
changeset
|
55 |
<li> <A HREF="http://talisker.inf.kcl.ac.uk/%7Eurbanc/cgi-bin/repos.cgi/lexing/raw-file/tip/thys/Sulzmann.thy">Sulzmann.thy</A> |
393
c08b9d616f9d
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
392
diff
changeset
|
56 |
</ul> |
392
880e62843614
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
57 |
|
880e62843614
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
58 |
|
394
d7ecd834b2a5
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
393
diff
changeset
|
59 |
<H3>Links</H3> |
392
880e62843614
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
60 |
|
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 |
<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
|
63 |
</ul> |
880e62843614
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
64 |
|
880e62843614
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
65 |
</TABLE> |
880e62843614
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
66 |
<P> |
397
ca75a0cd27a4
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
396
diff
changeset
|
67 |
<!-- hhmts start --> Last modified: Tue Mar 15 12:47:17 GMT 2016 <!-- hhmts end --> |
392
880e62843614
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
68 |
<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
|
69 |
</BODY> |
880e62843614
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
70 |
</HTML> |