author | Christian Urban <christian.urban@kcl.ac.uk> |
Sat, 29 Jan 2022 23:53:21 +0000 | |
changeset 400 | 46e5566ad4ba |
parent 398 | dac6d27c99c6 |
child 402 | 1612f2a77bf6 |
permissions | -rw-r--r-- |
396 | 1 |
(*<*) |
2 |
theory Paper |
|
3 |
imports |
|
4 |
"../Lexer" |
|
5 |
"../Simplifying" |
|
6 |
"../Positions" |
|
7 |
"../SizeBound4" |
|
8 |
"HOL-Library.LaTeXsugar" |
|
9 |
begin |
|
397
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
10 |
|
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
11 |
declare [[show_question_marks = false]] |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
12 |
|
398 | 13 |
notation (latex output) |
14 |
If ("(\<^latex>\<open>\\textrm{\<close>if\<^latex>\<open>}\<close> (_)/ \<^latex>\<open>\\textrm{\<close>then\<^latex>\<open>}\<close> (_)/ \<^latex>\<open>\\textrm{\<close>else\<^latex>\<open>}\<close> (_))" 10) and |
|
15 |
Cons ("_\<^latex>\<open>\\mbox{$\\,$}\<close>::\<^latex>\<open>\\mbox{$\\,$}\<close>_" [75,73] 73) |
|
16 |
||
17 |
||
397
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
18 |
abbreviation |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
19 |
"der_syn r c \<equiv> der c r" |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
20 |
|
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
21 |
notation (latex output) |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
22 |
der_syn ("_\\_" [79, 1000] 76) and |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
23 |
|
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
24 |
ZERO ("\<^bold>0" 81) and |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
25 |
ONE ("\<^bold>1" 81) and |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
26 |
CH ("_" [1000] 80) and |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
27 |
ALT ("_ + _" [77,77] 78) and |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
28 |
SEQ ("_ \<cdot> _" [77,77] 78) and |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
29 |
STAR ("_\<^sup>\<star>" [79] 78) |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
30 |
|
396 | 31 |
(*>*) |
397
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
32 |
|
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
33 |
section {* Introduction *} |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
34 |
|
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
35 |
text {* |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
36 |
|
400 | 37 |
In the last fifteen or so years, Brzozowski's derivatives of regular |
38 |
expressions have sparked quite a bit of interest in the functional |
|
39 |
programming and theorem prover communities. The beauty of |
|
40 |
Brzozowski's derivatives \cite{Brzozowski1964} is that they are neatly |
|
41 |
expressible in any functional language, and easily definable and |
|
42 |
reasoned about in theorem provers---the definitions just consist of |
|
43 |
inductive datatypes and simple recursive functions. A mechanised |
|
44 |
correctness proof of Brzozowski's matcher in for example HOL4 has been |
|
45 |
mentioned by Owens and Slind~\cite{Owens2008}. Another one in |
|
46 |
Isabelle/HOL is part of the work by Krauss and Nipkow |
|
47 |
\cite{Krauss2011}. And another one in Coq is given by Coquand and |
|
48 |
Siles \cite{Coquand2012}. |
|
49 |
||
50 |
||
51 |
The notion of derivatives |
|
52 |
\cite{Brzozowski1964}, written @{term "der c r"}, of a regular |
|
53 |
expression give a simple solution to the problem of matching a string |
|
54 |
@{term s} with a regular expression @{term r}: if the derivative of |
|
55 |
@{term r} w.r.t.\ (in succession) all the characters of the string |
|
56 |
matches the empty string, then @{term r} matches @{term s} (and {\em |
|
57 |
vice versa}). The derivative has the property (which may almost be |
|
58 |
regarded as its specification) that, for every string @{term s} and |
|
59 |
regular expression @{term r} and character @{term c}, one has @{term |
|
60 |
"cs \<in> L(r)"} if and only if \mbox{@{term "s \<in> L(der c r)"}}. |
|
61 |
||
397
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
62 |
|
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
63 |
If a regular expression matches a string, then in general there is more |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
64 |
than one way of how the string is matched. There are two commonly used |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
65 |
disambiguation strategies to generate a unique answer: one is called |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
66 |
GREEDY matching \cite{Frisch2004} and the other is POSIX |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
67 |
matching~\cite{POSIX,Kuklewicz,OkuiSuzuki2010,Sulzmann2014,Vansummeren2006}. |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
68 |
For example consider the string @{term xy} and the regular expression |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
69 |
\mbox{@{term "STAR (ALT (ALT x y) xy)"}}. Either the string can be |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
70 |
matched in two `iterations' by the single letter-regular expressions |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
71 |
@{term x} and @{term y}, or directly in one iteration by @{term xy}. The |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
72 |
first case corresponds to GREEDY matching, which first matches with the |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
73 |
left-most symbol and only matches the next symbol in case of a mismatch |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
74 |
(this is greedy in the sense of preferring instant gratification to |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
75 |
delayed repletion). The second case is POSIX matching, which prefers the |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
76 |
longest match. |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
77 |
|
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
78 |
|
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
79 |
|
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
80 |
\begin{figure}[t] |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
81 |
\begin{center} |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
82 |
\begin{tikzpicture}[scale=2,node distance=1.3cm, |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
83 |
every node/.style={minimum size=6mm}] |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
84 |
\node (r1) {@{term "r\<^sub>1"}}; |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
85 |
\node (r2) [right=of r1]{@{term "r\<^sub>2"}}; |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
86 |
\draw[->,line width=1mm](r1)--(r2) node[above,midway] {@{term "der a DUMMY"}}; |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
87 |
\node (r3) [right=of r2]{@{term "r\<^sub>3"}}; |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
88 |
\draw[->,line width=1mm](r2)--(r3) node[above,midway] {@{term "der b DUMMY"}}; |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
89 |
\node (r4) [right=of r3]{@{term "r\<^sub>4"}}; |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
90 |
\draw[->,line width=1mm](r3)--(r4) node[above,midway] {@{term "der c DUMMY"}}; |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
91 |
\draw (r4) node[anchor=west] {\;\raisebox{3mm}{@{term nullable}}}; |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
92 |
\node (v4) [below=of r4]{@{term "v\<^sub>4"}}; |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
93 |
\draw[->,line width=1mm](r4) -- (v4); |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
94 |
\node (v3) [left=of v4] {@{term "v\<^sub>3"}}; |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
95 |
\draw[->,line width=1mm](v4)--(v3) node[below,midway] {\<open>inj r\<^sub>3 c\<close>}; |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
96 |
\node (v2) [left=of v3]{@{term "v\<^sub>2"}}; |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
97 |
\draw[->,line width=1mm](v3)--(v2) node[below,midway] {\<open>inj r\<^sub>2 b\<close>}; |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
98 |
\node (v1) [left=of v2] {@{term "v\<^sub>1"}}; |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
99 |
\draw[->,line width=1mm](v2)--(v1) node[below,midway] {\<open>inj r\<^sub>1 a\<close>}; |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
100 |
\draw (r4) node[anchor=north west] {\;\raisebox{-8mm}{@{term "mkeps"}}}; |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
101 |
\end{tikzpicture} |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
102 |
\end{center} |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
103 |
\mbox{}\\[-13mm] |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
104 |
|
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
105 |
\caption{The two phases of the algorithm by Sulzmann \& Lu \cite{Sulzmann2014}, |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
106 |
matching the string @{term "[a,b,c]"}. The first phase (the arrows from |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
107 |
left to right) is \Brz's matcher building successive derivatives. If the |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
108 |
last regular expression is @{term nullable}, then the functions of the |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
109 |
second phase are called (the top-down and right-to-left arrows): first |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
110 |
@{term mkeps} calculates a value @{term "v\<^sub>4"} witnessing |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
111 |
how the empty string has been recognised by @{term "r\<^sub>4"}. After |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
112 |
that the function @{term inj} ``injects back'' the characters of the string into |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
113 |
the values. |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
114 |
\label{Sulz}} |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
115 |
\end{figure} |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
116 |
|
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
117 |
|
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
118 |
*} |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
119 |
|
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
120 |
section {* Background *} |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
121 |
|
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
122 |
text {* |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
123 |
Sulzmann-Lu algorithm with inj. State that POSIX rules. |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
124 |
metion slg is correct. |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
125 |
|
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
126 |
|
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
127 |
\begin{figure}[t] |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
128 |
\begin{center} |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
129 |
\begin{tabular}{c} |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
130 |
@{thm[mode=Axiom] Posix.intros(1)}\<open>P\<close>@{term "ONE"} \qquad |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
131 |
@{thm[mode=Axiom] Posix.intros(2)}\<open>P\<close>@{term "c"}\medskip\\ |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
132 |
@{thm[mode=Rule] Posix.intros(3)[of "s" "r\<^sub>1" "v" "r\<^sub>2"]}\<open>P+L\<close>\qquad |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
133 |
@{thm[mode=Rule] Posix.intros(4)[of "s" "r\<^sub>2" "v" "r\<^sub>1"]}\<open>P+R\<close>\medskip\\ |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
134 |
$\mprset{flushleft} |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
135 |
\inferrule |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
136 |
{@{thm (prem 1) Posix.intros(5)[of "s\<^sub>1" "r\<^sub>1" "v\<^sub>1" "s\<^sub>2" "r\<^sub>2" "v\<^sub>2"]} \qquad |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
137 |
@{thm (prem 2) Posix.intros(5)[of "s\<^sub>1" "r\<^sub>1" "v\<^sub>1" "s\<^sub>2" "r\<^sub>2" "v\<^sub>2"]} \\\\ |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
138 |
@{thm (prem 3) Posix.intros(5)[of "s\<^sub>1" "r\<^sub>1" "v\<^sub>1" "s\<^sub>2" "r\<^sub>2" "v\<^sub>2"]}} |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
139 |
{@{thm (concl) Posix.intros(5)[of "s\<^sub>1" "r\<^sub>1" "v\<^sub>1" "s\<^sub>2" "r\<^sub>2" "v\<^sub>2"]}}$\<open>PS\<close>\\ |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
140 |
@{thm[mode=Axiom] Posix.intros(7)}\<open>P[]\<close>\medskip\\ |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
141 |
$\mprset{flushleft} |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
142 |
\inferrule |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
143 |
{@{thm (prem 1) Posix.intros(6)[of "s\<^sub>1" "r" "v" "s\<^sub>2" "vs"]} \qquad |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
144 |
@{thm (prem 2) Posix.intros(6)[of "s\<^sub>1" "r" "v" "s\<^sub>2" "vs"]} \qquad |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
145 |
@{thm (prem 3) Posix.intros(6)[of "s\<^sub>1" "r" "v" "s\<^sub>2" "vs"]} \\\\ |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
146 |
@{thm (prem 4) Posix.intros(6)[of "s\<^sub>1" "r" "v" "s\<^sub>2" "vs"]}} |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
147 |
{@{thm (concl) Posix.intros(6)[of "s\<^sub>1" "r" "v" "s\<^sub>2" "vs"]}}$\<open>P\<star>\<close> |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
148 |
\end{tabular} |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
149 |
\end{center} |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
150 |
\caption{Our inductive definition of POSIX values.}\label{POSIXrules} |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
151 |
\end{figure} |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
152 |
|
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
153 |
|
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
154 |
*} |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
155 |
|
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
156 |
section {* Bitcoded Derivatives *} |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
157 |
|
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
158 |
text {* |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
159 |
bitcoded regexes / decoding / bmkeps |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
160 |
gets rid of the second phase (only single phase) |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
161 |
correctness |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
162 |
*} |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
163 |
|
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
164 |
|
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
165 |
section {* Simplification *} |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
166 |
|
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
167 |
text {* |
400 | 168 |
Sulzmann \& Lu apply simplification via a fixpoint operation; also does not use erase to filter out duplicates. |
169 |
||
397
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
170 |
not direct correspondence with PDERs, because of example |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
171 |
problem with retrieve |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
172 |
|
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
173 |
correctness |
398 | 174 |
|
175 |
||
176 |
||
177 |
\begin{figure}[t] |
|
178 |
\begin{center} |
|
179 |
\begin{tabular}{c} |
|
180 |
@{thm[mode=Axiom] bs1}\qquad |
|
181 |
@{thm[mode=Axiom] bs2}\qquad |
|
182 |
@{thm[mode=Axiom] bs3}\\ |
|
183 |
@{thm[mode=Rule] bs4}\qquad |
|
184 |
@{thm[mode=Rule] bs5}\\ |
|
185 |
@{thm[mode=Rule] bs6}\qquad |
|
186 |
@{thm[mode=Rule] bs7}\\ |
|
187 |
@{thm[mode=Rule] bs8}\\ |
|
188 |
@{thm[mode=Axiom] ss1}\qquad |
|
189 |
@{thm[mode=Rule] ss2}\qquad |
|
190 |
@{thm[mode=Rule] ss3}\\ |
|
191 |
@{thm[mode=Axiom] ss4}\qquad |
|
192 |
@{thm[mode=Axiom] ss5}\qquad |
|
193 |
@{thm[mode=Rule] ss6}\\ |
|
194 |
\end{tabular} |
|
195 |
\end{center} |
|
196 |
\caption{???}\label{SimpRewrites} |
|
197 |
\end{figure} |
|
397
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
198 |
*} |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
199 |
|
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
200 |
section {* Bound - NO *} |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
201 |
|
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
202 |
section {* Bounded Regex / Not *} |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
203 |
|
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
204 |
section {* Conclusion *} |
e1b74d618f1b
updated Sizebound4
Christian Urban <christian.urban@kcl.ac.uk>
parents:
396
diff
changeset
|
205 |
|
396 | 206 |
text {* |
207 |
||
208 |
\cite{AusafDyckhoffUrban2016} |
|
209 |
||
210 |
%%\bibliographystyle{plain} |
|
211 |
\bibliography{root} |
|
212 |
*} |
|
213 |
||
214 |
(*<*) |
|
215 |
end |
|
216 |
(*>*) |