corr_pr_sketch.tex
author Chengsong
Mon, 22 Jul 2019 23:01:00 +0100
changeset 79 481c8000de6d
parent 73 569280c1f56c
permissions -rw-r--r--
works on the part that christian did not read will continue tomorrow morning
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
8
Chengsong
parents:
diff changeset
     1
\documentclass{article}
Chengsong
parents:
diff changeset
     2
\usepackage[utf8]{inputenc}
Chengsong
parents:
diff changeset
     3
\usepackage[english]{babel}
Chengsong
parents:
diff changeset
     4
\usepackage{listings}
Chengsong
parents:
diff changeset
     5
 \usepackage{amsthm}
9
2c02d27ec0a3 augmented version of proof sketch
Chengsong
parents: 8
diff changeset
     6
 \usepackage{hyperref}
8
Chengsong
parents:
diff changeset
     7
 \usepackage[margin=0.5in]{geometry}
10
2b95bcd2ac73 exp and proof
Chengsong
parents: 9
diff changeset
     8
\usepackage{pmboxdraw}
2b95bcd2ac73 exp and proof
Chengsong
parents: 9
diff changeset
     9
8
Chengsong
parents:
diff changeset
    10
\theoremstyle{theorem}
Chengsong
parents:
diff changeset
    11
\newtheorem{theorem}{Theorem}
Chengsong
parents:
diff changeset
    12
Chengsong
parents:
diff changeset
    13
\theoremstyle{lemma}
Chengsong
parents:
diff changeset
    14
\newtheorem{lemma}{Lemma}
73
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    15
\usepackage{amsmath}
9
2c02d27ec0a3 augmented version of proof sketch
Chengsong
parents: 8
diff changeset
    16
\newcommand{\lemmaautorefname}{Lemma}
2c02d27ec0a3 augmented version of proof sketch
Chengsong
parents: 8
diff changeset
    17
8
Chengsong
parents:
diff changeset
    18
\theoremstyle{definition}
Chengsong
parents:
diff changeset
    19
 \newtheorem{definition}{Definition}
Chengsong
parents:
diff changeset
    20
\begin{document}
Chengsong
parents:
diff changeset
    21
Chengsong
parents:
diff changeset
    22
Chengsong
parents:
diff changeset
    23
\section{Main Result}
9
2c02d27ec0a3 augmented version of proof sketch
Chengsong
parents: 8
diff changeset
    24
73
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    25
Want to prove 
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    26
\begin{equation}\label{cen}
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    27
\textit{bsimp}(\textit{bder}(c,a)) = \textit{bsimp}(\textit{bder}(c,\textit{bsimp}(a))).
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    28
\end{equation}
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    29
For simplicity, we use $s$ to denote $\textit{bsimp}$ and use $a \backslash c$ or $d \; c \; a $ to denote $\textit{bder}(c,a)$, then we can write the equation we want to prove in the following manner:
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    30
\begin{center}
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    31
$s \; d \; c \; a= s \; d \; c \; s \; a$
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    32
\end{center}
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    33
Specifically, we are interested in the case where $a = a_1+a_2$. The inductive hypothesis is that
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    34
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    35
\begin{center}
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    36
$s \; d \; c \; a_1= s \; d \; c \; s \; a_1 \;  \textbf{and}  \; s \; d \; c \; a_2= s \; d \; c \; s \; a_2.$
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    37
\end{center}
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    38
\noindent
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    39
We want to prove that the $\textit{LHS}$ of \eqref{cen} is equal to the $\textit{RHS}$ of \eqref{cen}.
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    40
For better readability the bits are ommitted as they don't inhibit the proof process but just adds to the
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    41
nuisance of writing.
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    42
$\textit{LHS}$ can be manipulated successively as follows:
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    43
\begin{center}
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    44
		\begin{tabular}{@{}rrl@{}}
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    45
			%\multicolumn{3}{@{}l}{}\medskip\\
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    46
			$\textit{LHS}$ & $=$  & $s \; (a_1+a_2) \backslash c$\\
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    47
			& $=$ & $s \; (a_1 \backslash c + a_2 \backslash c)$   \\
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    48
			& $\overset{\autoref{lma1}}{=}$ & $s(s(a_1 \backslash c) + s(a_2 \backslash c))$         \\
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    49
			& $\overset{\autoref{lma2}}{=}$ & $s(s(a_1) \backslash c + s(a_2) \backslash c).$\\
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    50
		\end{tabular}
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    51
\end{center}
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    52
$\textit{RHS}$ can be manipulated this way:
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    53
\begin{center}
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    54
		\begin{tabular}{@{}rrl@{}}
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    55
			%\multicolumn{3}{@{}l}{}\medskip\\
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    56
			$\textit{RHS}$ & $=$  & $s \; [(s(a_1+a_2)] \backslash c$\\
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    57
		\end{tabular}
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    58
\end{center}
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    59
If we refer to $s(a_1+a_2)$ as $core$, then we have
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    60
\begin{center}
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    61
		\begin{tabular}{@{}rrl@{}}
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    62
			%\multicolumn{3}{@{}l}{}\medskip\\
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    63
			$\textit{RHS}$ & $=$  & $s \; (core \backslash c)$\\
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    64
		\end{tabular}
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    65
\end{center}
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    66
and then
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    67
\begin{center}
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    68
		\begin{tabular}{@{}rrl@{}}
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    69
			%\multicolumn{3}{@{}l}{}\medskip\\
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    70
			$\textit{core}$ & $=$  & $s \; \textit{ALTS}(bs, a_1+a_2)$\\
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    71
			& $\overset{\mathit{bsimp \; def}}{=}$ & $Li(ALTS(bs, dB(flats(s(a_1)+s(a_2))))$\\	
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    72
		\end{tabular}
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    73
\end{center}
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    74
Here we use $Li$ to refer to the operation that opens up the $\textit{ALTS}$ when it has 1
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    75
element, returns 0 when it has 0 elements or does nothing when 
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    76
there are 2 or more elements in the list $rs$ in $\textit{ALTS}(bs, rs)$(in scala code corresponds to the case clauses).
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    77
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    78
Now in order to establish that $LHS = RHS$, we need to
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    79
 prove the transformed results we got above
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    80
for $LHS$ and $RHS$ are equal to each other.
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    81
That is,
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    82
\begin{center}
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    83
		\begin{tabular}{@{}rrl@{}}
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    84
			%\multicolumn{3}{@{}l}{}\medskip\\
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    85
			$s(s(a_1) \backslash c + s(a_2) \backslash c)$ & $=$  &  $Li(ALTS(bs, dB(flats(s(a_1)+s(a_2))))$\\	
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    86
		\end{tabular}
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    87
\end{center}
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    88
We shall call the two sides of the above equation $LHS'$ and $RHS'$.
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    89
To prove this equality we just need to consider what $s(a_1)$ and $s(a_2)$ look like.
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    90
There are three interesting possibility for each, namely 
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    91
$s(a_i)$ is an alt, a star or a sequence. Combined that is
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    92
9 possibilities. We just need to investigate each of these 9 possibilities.
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    93
Here we only one of the 9 cases. The others are handled in a similar 
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    94
fashion.
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    95
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    96
When $s(a_1) = ALTS(bs_1, as_1)$ and $s(a_2) = ALTS(bs_2, as_2)$,
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    97
\begin{center}
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    98
			$\textit{LHS'}$ \\
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
    99
			 $=$   \\
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
   100
			  $s(ALTS(bs, ALTS(bs_1, as_1) \backslash c
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
   101
			+ ALTS(bs_2, as_2) \backslash c))$\\
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
   102
			$=$ \\
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
   103
			 $s(ALTS(bs, ALTS(bs_1, as_1.map \backslash c )+ ALTS(bs_2,as_2.map \backslash c) )  )$\\
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
   104
			 			$\overset{\autoref{lma3}}{=}$ \\
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
   105
			 $s(ALTS(bs,  (as_1.map \backslash c ).map(fuse(bs_1))+ (as_2.map \backslash c).map(fuse(bs_2)) )  )$\\
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
   106
\end{center} 
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
   107
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
   108
And then we deal with $RHS'$:
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
   109
$RHS'$\\
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
   110
			 			$\overset{\autoref{lma4}}{=}$ \\
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
   111
			 $s(ALTS(bs,  (as_1.map \backslash c ).map(fuse(bs_1))++ (as_2.map \backslash c).map(fuse(bs_2)) )  )$\\
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
   112
and this completes the proof.
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
   113
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
   114
\begin{lemma}{doing simplification in advance to subparts}\label{lma1}\\
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
   115
We have that for any annotated regular expressions $a_1 \; a_2$ and bitcode $bs$,\\
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
   116
$\textit{bsimp}(\textit{ALTS}(bs, a_1, a_2)) =
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
   117
 \textit{bsimp}(\textit{ALTS}(bs, \textit{bsimp}(a_1), \textit{bsimp}(a_2))) $
8
Chengsong
parents:
diff changeset
   118
\end{lemma}
Chengsong
parents:
diff changeset
   119
73
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
   120
\begin{lemma}{combination of lemma 1 and inductive hypothesis(from now on use simple notation)}\label{lma2}\\
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
   121
We have that for any annotated regular expressions $a_1 \; a_2$ and bitcode $bs$,
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
   122
$s(s(a_1 \backslash c) + s(a_2 \backslash c)) = 
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
   123
s(s(a_1) \backslash c + s(a_2) \backslash c)$
8
Chengsong
parents:
diff changeset
   124
\end{lemma}
Chengsong
parents:
diff changeset
   125
9
2c02d27ec0a3 augmented version of proof sketch
Chengsong
parents: 8
diff changeset
   126
2c02d27ec0a3 augmented version of proof sketch
Chengsong
parents: 8
diff changeset
   127
%\begin{theorem}See~\cref{lma1}.\end{theorem}
2c02d27ec0a3 augmented version of proof sketch
Chengsong
parents: 8
diff changeset
   128
%\begin{lemma}\label{lma1}\lipsum[2]\end{lemma}
2c02d27ec0a3 augmented version of proof sketch
Chengsong
parents: 8
diff changeset
   129
73
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
   130
\begin{lemma}{Spilling out ALTS does not affect simplification result}\label{lma3}\\
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
   131
$s(ALTS(bs, ALTS(bs_1, as_1.map \backslash c )+ ALTS(bs_2,as_2.map \backslash c) )  )$\\
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
   132
			 			$\overset{\autoref{lma3}}{=}$ \\
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
   133
			 $s(ALTS(bs,  (as_1.map \backslash c ).map(fuse(bs_1))+ (as_2.map \backslash c).map(fuse(bs_2)) )  )$\\
8
Chengsong
parents:
diff changeset
   134
\end{lemma}
Chengsong
parents:
diff changeset
   135
73
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
   136
\begin{lemma}{deleting duplicates does not affect simplification result}\label{lma4}\\
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
   137
$s(ALTS(bs,  (as_1.map \backslash c ).map(fuse(bs_1))+ (as_2.map \backslash c).map(fuse(bs_2)) )  )$\\
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
   138
$=$\\
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
   139
$s(ALTS(bs,  dB((as_1.map \backslash c ).map(fuse(bs_1))+ (as_2.map \backslash c).map(fuse(bs_2)) )  ))$
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
   140
\end{lemma}
9
2c02d27ec0a3 augmented version of proof sketch
Chengsong
parents: 8
diff changeset
   141
2c02d27ec0a3 augmented version of proof sketch
Chengsong
parents: 8
diff changeset
   142
\begin{lemma}{mkepsBC invariant manipulation of bits and notation}\label{lma7}\\
2c02d27ec0a3 augmented version of proof sketch
Chengsong
parents: 8
diff changeset
   143
ALTS(bs, ALTS(bs1, rs1), ALTS(bs2, rs2)) $\sim_{m\epsilon}$ ALTS(bs, rs1.map(fuse(bs1, \_)) ++ rs2.map(fuse(bs2, \_)) ). \\
2c02d27ec0a3 augmented version of proof sketch
Chengsong
parents: 8
diff changeset
   144
We also use $bs2>>rs2 $ as a shorthand notation for rs2.map(fuse(bs2,\_)).
2c02d27ec0a3 augmented version of proof sketch
Chengsong
parents: 8
diff changeset
   145
\end{lemma}
2c02d27ec0a3 augmented version of proof sketch
Chengsong
parents: 8
diff changeset
   146
73
569280c1f56c proof details
Chengsong
parents: 17
diff changeset
   147
8
Chengsong
parents:
diff changeset
   148
9
2c02d27ec0a3 augmented version of proof sketch
Chengsong
parents: 8
diff changeset
   149
\begin{lemma}{What does dB do to two already simplified ALTS}\label{lma5}\\
2c02d27ec0a3 augmented version of proof sketch
Chengsong
parents: 8
diff changeset
   150
$d Co(ALTS(bs, dB(bs1>>rs1 ++ bs2>>rs2))) = d Co(ALTS(bs, bs1>>rs1 ++ ((bs2>>rs2)--rs1)        )) $ 
8
Chengsong
parents:
diff changeset
   151
\end{lemma}
Chengsong
parents:
diff changeset
   152
\begin{proof}
9
2c02d27ec0a3 augmented version of proof sketch
Chengsong
parents: 8
diff changeset
   153
We prove that $ dB(bs1>>rs1 ++ bs2>>rs2) = bs1>>rs1 ++ ((bs2>>rs2)--rs1)$.
2c02d27ec0a3 augmented version of proof sketch
Chengsong
parents: 8
diff changeset
   154
2c02d27ec0a3 augmented version of proof sketch
Chengsong
parents: 8
diff changeset
   155
8
Chengsong
parents:
diff changeset
   156
\end{proof}
Chengsong
parents:
diff changeset
   157
9
2c02d27ec0a3 augmented version of proof sketch
Chengsong
parents: 8
diff changeset
   158
\begin{lemma}{after opening two previously simplified alts up into terms, length must exceed 2}\label{lma6}\\
2c02d27ec0a3 augmented version of proof sketch
Chengsong
parents: 8
diff changeset
   159
If sr1, sr2 are of the form ALTS(bs1, rs1), ALTS(bs2, rs2) respectively, then we have that 
2c02d27ec0a3 augmented version of proof sketch
Chengsong
parents: 8
diff changeset
   160
$Co(bs, (bs1>>rs1) ++ (bs2>>rs2)--rs1) = ALTS(bs, bs1>>rs1 ++ (bs2>>rs2)--rs1)$
8
Chengsong
parents:
diff changeset
   161
\end{lemma}
Chengsong
parents:
diff changeset
   162
\begin{proof}
9
2c02d27ec0a3 augmented version of proof sketch
Chengsong
parents: 8
diff changeset
   163
 $Co(bs, rs) \sim_{m\epsilon} ALTS(bs, rs)$ if $rs$ is a list of length greater than or equal to 2.
2c02d27ec0a3 augmented version of proof sketch
Chengsong
parents: 8
diff changeset
   164
 As suggested by the title of this lemma, ALTS(bs1, rs1) is a result of simplification, which means that rs1 must be composed of at least 2 distinct regular terms. This alone says that $bs1>>rs1 ++ (bs2>>rs2)--rs1$ is a list of length greater than or equal to 2, as the second operand of the concatenation operator $(bs2>>rs2) -- rs1$ can only contribute a non-negative value to the overall length of the list 
2c02d27ec0a3 augmented version of proof sketch
Chengsong
parents: 8
diff changeset
   165
 $bs1>>rs1 ++ (bs2>>rs2)--rs1$.
8
Chengsong
parents:
diff changeset
   166
\end{proof}
Chengsong
parents:
diff changeset
   167
Chengsong
parents:
diff changeset
   168
9
2c02d27ec0a3 augmented version of proof sketch
Chengsong
parents: 8
diff changeset
   169
\begin{lemma}{mkepsBC equivalence w.r.t syntactically different regular expressions(2 ALTS+ some deletion after derivatives)}\label{lma8}\\
2c02d27ec0a3 augmented version of proof sketch
Chengsong
parents: 8
diff changeset
   170
$d ALTS(bs, bs1>>rs1 ++ bs2>>rs2) \sim_{m\epsilon} d ALTS(bs, bs1>>rs1 ++ ((bs2>>rs2)--rs1)        ) $ 
2c02d27ec0a3 augmented version of proof sketch
Chengsong
parents: 8
diff changeset
   171
\end{lemma}
2c02d27ec0a3 augmented version of proof sketch
Chengsong
parents: 8
diff changeset
   172
\begin{proof}
2c02d27ec0a3 augmented version of proof sketch
Chengsong
parents: 8
diff changeset
   173
Let's call $bs1>>rs1$ $rs1'$ and  $bs2>>rs2$ $rs2'$. Then we need to prove $d ALTS(bs, rs1' ++rs2') \sim_{m\epsilon} d ALTS(bs, rs1'++(rs2' -- rs1') )   $.\\
2c02d27ec0a3 augmented version of proof sketch
Chengsong
parents: 8
diff changeset
   174
We might as well omit the prime in each rs for simplicty of notation and prove $d ALTS(bs, rs1++rs2) \sim_{m\epsilon} d ALTS(bs, rs1++(rs2 -- rs1) )   $.\\
2c02d27ec0a3 augmented version of proof sketch
Chengsong
parents: 8
diff changeset
   175
We know that the result of derivative is nullable, so there must exist an r in rs1++rs2 s.t. r is nullable.\\
2c02d27ec0a3 augmented version of proof sketch
Chengsong
parents: 8
diff changeset
   176
If $r \in rs1$, then equivalence holds. If $r \in rs2 \wedge  r \notin rs1$, equivalence holds as well. This completes the proof.
2c02d27ec0a3 augmented version of proof sketch
Chengsong
parents: 8
diff changeset
   177
\end{proof}
8
Chengsong
parents:
diff changeset
   178
10
2b95bcd2ac73 exp and proof
Chengsong
parents: 9
diff changeset
   179
\begin{lemma}{nullability relation between a regex and its simplified version}\label{lma9}\\
2b95bcd2ac73 exp and proof
Chengsong
parents: 9
diff changeset
   180
$r\ nullable \iff sr\ nullable $ 
2b95bcd2ac73 exp and proof
Chengsong
parents: 9
diff changeset
   181
\end{lemma}
2b95bcd2ac73 exp and proof
Chengsong
parents: 9
diff changeset
   182
2b95bcd2ac73 exp and proof
Chengsong
parents: 9
diff changeset
   183
\begin{lemma}{concatenation + simp invariance of mkepsBC}\label{lma10}\\
2b95bcd2ac73 exp and proof
Chengsong
parents: 9
diff changeset
   184
$mkepsBC r1 \cdot sr2 = mkepsBC r1 \cdot r2$ if both r1 and r2 are nullable.
2b95bcd2ac73 exp and proof
Chengsong
parents: 9
diff changeset
   185
\end{lemma}
8
Chengsong
parents:
diff changeset
   186
Chengsong
parents:
diff changeset
   187
Chengsong
parents:
diff changeset
   188
\begin{theorem}{Correctness Result}
Chengsong
parents:
diff changeset
   189
Chengsong
parents:
diff changeset
   190
\begin{itemize}
Chengsong
parents:
diff changeset
   191
Chengsong
parents:
diff changeset
   192
\item{}
Chengsong
parents:
diff changeset
   193
When s is a string in the language L(ar), \\
Chengsong
parents:
diff changeset
   194
ders\_simp(ar, s)  $\sim_{m\epsilon}$ ders(ar, s), \\
Chengsong
parents:
diff changeset
   195
\item{}
Chengsong
parents:
diff changeset
   196
when s is not a string of the language L(ar)
Chengsong
parents:
diff changeset
   197
ders\_simp(ar, s) is not nullable
Chengsong
parents:
diff changeset
   198
\end{itemize}
Chengsong
parents:
diff changeset
   199
\end{theorem}
Chengsong
parents:
diff changeset
   200
Chengsong
parents:
diff changeset
   201
\begin{proof}{Split into 2 parts.}
Chengsong
parents:
diff changeset
   202
\begin{itemize}
Chengsong
parents:
diff changeset
   203
\item
Chengsong
parents:
diff changeset
   204
9
2c02d27ec0a3 augmented version of proof sketch
Chengsong
parents: 8
diff changeset
   205
8
Chengsong
parents:
diff changeset
   206
When we have an annotated regular expression ar and a string s that matches ar, by the correctness of the algorithm ders, we have that ders(ar, s) is nullable, and that mkepsBC will extract the desired bits for decoding the correct value v for the matching, and v is a POSIX value. Now we prove that mkepsBC(ders\_simp(ar, s)) yields the same bitsequence.
Chengsong
parents:
diff changeset
   207
\\
Chengsong
parents:
diff changeset
   208
We first open up the ders\_simp function into nested alternating sequences of ders and simp.
Chengsong
parents:
diff changeset
   209
Assume that s = $c_1...c_n$($n \geq 1$ ) where each of the $c_i$ are characters. 
Chengsong
parents:
diff changeset
   210
Then $ders\_simp(ar, s)$ = $s(d_{c_n}(...s(d_{c_1}(r))...))$ = $sdsd......sdr$. If we can prove that
9
2c02d27ec0a3 augmented version of proof sketch
Chengsong
parents: 8
diff changeset
   211
$sdr \sim_{m\epsilon} dsr$ holds for any regular expression and any character, then we are done. This is because then we can push ders operation inside and move simp operation outside and have that $sdsd...sdr \sim_{m\epsilon} ssddsdsd...sdr \sim_{m\epsilon} ... \sim_{m\epsilon} s....sd....dr$.
2c02d27ec0a3 augmented version of proof sketch
Chengsong
parents: 8
diff changeset
   212
 Using \autoref{lma1} we have that $s...sd....dr = sd...dr$. 
2c02d27ec0a3 augmented version of proof sketch
Chengsong
parents: 8
diff changeset
   213
By \autoref{lma2}, we have $RHS \sim_{m\epsilon} d...dr$.\\
2c02d27ec0a3 augmented version of proof sketch
Chengsong
parents: 8
diff changeset
   214
Notice that we don't actually need \autoref{lma1} here. That is because by \autoref{lma2}, we can have that $s...sd....dr \sim_{m\epsilon} sd...dr$. The equality above can be replaced by mkepsBC
2c02d27ec0a3 augmented version of proof sketch
Chengsong
parents: 8
diff changeset
   215
 equivalence without affecting the validity of the whole proof since all we want is mkepsBC equivalence, not equality.
2c02d27ec0a3 augmented version of proof sketch
Chengsong
parents: 8
diff changeset
   216
2c02d27ec0a3 augmented version of proof sketch
Chengsong
parents: 8
diff changeset
   217
Now we proceed to prove that $sdr \sim_{m\epsilon} dsr$. This can be reduced to proving $dr \sim_{m\epsilon} dsr$ as we know that $dr \sim_{m\epsilon} sdr$ by \autoref{lma2}.\\
8
Chengsong
parents:
diff changeset
   218
Chengsong
parents:
diff changeset
   219
we use an induction proof. Base cases are omitted. Here are the 3 inductive cases.
Chengsong
parents:
diff changeset
   220
\begin{itemize}
Chengsong
parents:
diff changeset
   221
10
2b95bcd2ac73 exp and proof
Chengsong
parents: 9
diff changeset
   222
\item{$r_1+r_2$}\\
8
Chengsong
parents:
diff changeset
   223
The most difficult case is when $sr1$ and $sr2$ are both ALTS, so that they will be opened up in the flats function and some terms in sr2 might be deleted. Or otherwise we can use the argument that $d(r_1+r_2) = dr_1 + dr_2  \sim_{m\epsilon} dsr_1 + dsr_2 \sim_{m\epsilon} ds(r_1+r_2)$,
9
2c02d27ec0a3 augmented version of proof sketch
Chengsong
parents: 8
diff changeset
   224
 the last equivalence being established by \autoref{lma3}.
8
Chengsong
parents:
diff changeset
   225
When $s(r_1), s(r_2)$ are both ALTS, we have to be more careful for the last equivalence step, namelly, $dsr_1 + dsr_2 \sim_{m\epsilon} ds(r_1+r_2)$. \\
9
2c02d27ec0a3 augmented version of proof sketch
Chengsong
parents: 8
diff changeset
   226
We have that $LHS = dsr_1 + dsr_2 = d(sr_1 +sr_2)$. Since $sr_1 = ALTS(bs1, rs1)$ and $sr_2 = ALTS(bs2, rs2)$ we have  $  d(sr_1 +sr_2 ) \sim_{m\epsilon} d(ALTS(bs, bs1>>rs1 ++ bs2>>rs2))$ by \autoref{lma4}.
2c02d27ec0a3 augmented version of proof sketch
Chengsong
parents: 8
diff changeset
   227
On the other hand, $RHS = ds(ALTS(bs, r1, r2)) = d Co(bs, dB(flats(s(r1), s(r2)) ) ) = d Co(bs, dB(bs1>>rs1 ++ bs2>>rs2))$ by definition of bsimp and flats.\\  
2c02d27ec0a3 augmented version of proof sketch
Chengsong
parents: 8
diff changeset
   228
$d Co(bs, dB(bs1>>rs1 ++ bs2>>rs2)) = d Co(bs, (bs1>>rs1 ++ ((bs2>>rs2)--rs1))) $ by \autoref{lma5}.\\ $d Co(bs, (bs1>>rs1 ++ ((bs2>>rs2)--rs1)        )) = d(ALTS(bs, bs1>>rs1 ++ (bs2>>rs2)--rs1))$ by \autoref{lma6}. \\
2c02d27ec0a3 augmented version of proof sketch
Chengsong
parents: 8
diff changeset
   229
 Using \autoref{lma8}, we have  $d(ALTS(bs, bs1>>rs1 ++ (bs2>>rs2)--rs1)) \sim_{m\epsilon} d(ALTS(bs, bs1>>rs1 ++ bs2>>rs2)) \sim_{m\epsilon}  RHS$.\\
2c02d27ec0a3 augmented version of proof sketch
Chengsong
parents: 8
diff changeset
   230
 %only the last part we don't have an equality here. We use mkeps equivalence instead because these two regexes are indeed different syntactically. However, they have even more in common than just mkeps equal. We might later augment this proof so that this equivalence relation is changed to something like regular expression equivalence.
8
Chengsong
parents:
diff changeset
   231
 This completes the proof.
Chengsong
parents:
diff changeset
   232
\item{$r*$}\\
10
2b95bcd2ac73 exp and proof
Chengsong
parents: 9
diff changeset
   233
$s(r*) = r*$. Our goal is trivially achieved.
2b95bcd2ac73 exp and proof
Chengsong
parents: 9
diff changeset
   234
\item{$r1 \cdot r2$}\\
2b95bcd2ac73 exp and proof
Chengsong
parents: 9
diff changeset
   235
When r1 is nullable, $ds r1r2 = dsr1 \cdot sr2 + dsr2  \sim_{m\epsilon}  dr1 \cdot sr2 + dr2 = dr1 \cdot r2 + dr2 $. The last step uses \autoref{lma10}. 
2b95bcd2ac73 exp and proof
Chengsong
parents: 9
diff changeset
   236
When r1 is not nullable, $ds r1r2 = dsr1 \cdot sr2  \sim_{m\epsilon}  dr1 \cdot sr2  \sim_{m\epsilon}  dr1 \cdot r2 $
8
Chengsong
parents:
diff changeset
   237
Chengsong
parents:
diff changeset
   238
\end{itemize}
Chengsong
parents:
diff changeset
   239
\item
Chengsong
parents:
diff changeset
   240
Proof of second part of the theorem: use a similar structure of argument as in the first part.
10
2b95bcd2ac73 exp and proof
Chengsong
parents: 9
diff changeset
   241
2b95bcd2ac73 exp and proof
Chengsong
parents: 9
diff changeset
   242
\item
2b95bcd2ac73 exp and proof
Chengsong
parents: 9
diff changeset
   243
This proof has a major flaw: it assumes all dr is nullable along the path of deriving r by s. But it could be the case that $s\in L(r)$ but $ \exists s' \in Pref(s) \ s.t.\ ders(s', r)$ is not nullable (or equivalently, $s'\notin L(r)$). One remedy for this is to replace the mkepsBC equivalence relation into some other transitive relation that entails mkepsBC equivalence.
8
Chengsong
parents:
diff changeset
   244
\end{itemize}
Chengsong
parents:
diff changeset
   245
\end{proof}
Chengsong
parents:
diff changeset
   246
10
2b95bcd2ac73 exp and proof
Chengsong
parents: 9
diff changeset
   247
\begin{theorem}{
2b95bcd2ac73 exp and proof
Chengsong
parents: 9
diff changeset
   248
This is a very strong claim that has yet to be more carefully examined and proved. However, experiments suggest a very good hope for this.}\\
11
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   249
Define pushbits as the following:\\  
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   250
\begin{verbatim}
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   251
def pushbits(r: ARexp): ARexp = r match {
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   252
    case AALTS(bs, rs) => AALTS(Nil, rs.map(r=>fuse(bs, pushbits(r))))
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   253
    case ASEQ(bs, r1, r2) => ASEQ(bs, pushbits(r1), pushbits(r2))
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   254
    case r => r
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   255
  }
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   256
  \end{verbatim}
10
2b95bcd2ac73 exp and proof
Chengsong
parents: 9
diff changeset
   257
Then we have \mbox{\boldmath$pushbits(ders\_simp(ar, s) ) == simp(ders(ar,s)) \ or\ ders\_simp(ar, s) == simp(ders(ar, s))$}.\\
2b95bcd2ac73 exp and proof
Chengsong
parents: 9
diff changeset
   258
Unfortunately this does not hold. A counterexample is\\
2b95bcd2ac73 exp and proof
Chengsong
parents: 9
diff changeset
   259
\begin{verbatim}
11
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   260
baa
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   261
original regex
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   262
STA
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   263
 └-ALT
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   264
    └-STA List(Z)
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   265
    |  └-a
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   266
    └-ALT List(S)
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   267
       └-b List(Z)
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   268
       └-a List(S)
10
2b95bcd2ac73 exp and proof
Chengsong
parents: 9
diff changeset
   269
regex after ders simp
11
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   270
ALT List(S, S, Z, C(b))
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   271
 └-SEQ
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   272
 |  └-STA List(S, Z, S, C(a), S, C(a))
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   273
 |  |  └-a
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   274
 |  └-STA
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   275
 |     └-ALT
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   276
 |        └-STA List(Z)
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   277
 |        |  └-a
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   278
 |        └-ALT List(S)
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   279
 |           └-b List(Z)
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   280
 |           └-a List(S)
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   281
 └-SEQ List(S, Z, S, C(a), Z)
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   282
    └-ALT List(S)
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   283
    |  └-STA List(Z, S, C(a))
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   284
    |  |  └-a
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   285
    |  └-ONE List(S, S, C(a))
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   286
    └-STA
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   287
       └-ALT
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   288
          └-STA List(Z)
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   289
          |  └-a
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   290
          └-ALT List(S)
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   291
             └-b List(Z)
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   292
             └-a List(S)
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   293
regex after ders
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   294
ALT
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   295
 └-SEQ
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   296
 |  └-ALT List(S)
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   297
 |  |  └-SEQ List(Z)
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   298
 |  |  |  └-ZERO
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   299
 |  |  |  └-STA
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   300
 |  |  |     └-a
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   301
 |  |  └-ALT List(S)
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   302
 |  |     └-ZERO
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   303
 |  |     └-ZERO
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   304
 |  └-STA
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   305
 |     └-ALT
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   306
 |        └-STA List(Z)
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   307
 |        |  └-a
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   308
 |        └-ALT List(S)
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   309
 |           └-b List(Z)
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   310
 |           └-a List(S)
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   311
 └-ALT List(S, S, Z, C(b))
10
2b95bcd2ac73 exp and proof
Chengsong
parents: 9
diff changeset
   312
    └-SEQ
11
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   313
    |  └-ALT List(S)
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   314
    |  |  └-ALT List(Z)
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   315
    |  |  |  └-SEQ
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   316
    |  |  |  |  └-ZERO
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   317
    |  |  |  |  └-STA
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   318
    |  |  |  |     └-a
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   319
    |  |  |  └-SEQ List(S, C(a))
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   320
    |  |  |     └-ONE List(S, C(a))
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   321
    |  |  |     └-STA
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   322
    |  |  |        └-a
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   323
    |  |  └-ALT List(S)
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   324
    |  |     └-ZERO
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   325
    |  |     └-ZERO
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   326
    |  └-STA
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   327
    |     └-ALT
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   328
    |        └-STA List(Z)
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   329
    |        |  └-a
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   330
    |        └-ALT List(S)
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   331
    |           └-b List(Z)
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   332
    |           └-a List(S)
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   333
    └-SEQ List(S, Z, S, C(a), Z)
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   334
       └-ALT List(S)
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   335
       |  └-SEQ List(Z)
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   336
       |  |  └-ONE List(S, C(a))
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   337
       |  |  └-STA
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   338
       |  |     └-a
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   339
       |  └-ALT List(S)
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   340
       |     └-ZERO
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   341
       |     └-ONE List(S, C(a))
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   342
       └-STA
10
2b95bcd2ac73 exp and proof
Chengsong
parents: 9
diff changeset
   343
          └-ALT
11
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   344
             └-STA List(Z)
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   345
             |  └-a
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   346
             └-ALT List(S)
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   347
                └-b List(Z)
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   348
                └-a List(S)
10
2b95bcd2ac73 exp and proof
Chengsong
parents: 9
diff changeset
   349
regex after ders and then a single simp
11
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   350
ALT
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   351
 └-SEQ List(S, S, Z, C(b))
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   352
 |  └-STA List(S, Z, S, C(a), S, C(a))
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   353
 |  |  └-a
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   354
 |  └-STA
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   355
 |     └-ALT
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   356
 |        └-STA List(Z)
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   357
 |        |  └-a
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   358
 |        └-ALT List(S)
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   359
 |           └-b List(Z)
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   360
 |           └-a List(S)
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   361
 └-SEQ List(S, S, Z, C(b), S, Z, S, C(a), Z)
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   362
    └-ALT List(S)
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   363
    |  └-STA List(Z, S, C(a))
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   364
    |  |  └-a
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   365
    |  └-ONE List(S, S, C(a))
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   366
    └-STA
10
2b95bcd2ac73 exp and proof
Chengsong
parents: 9
diff changeset
   367
       └-ALT
11
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   368
          └-STA List(Z)
10
2b95bcd2ac73 exp and proof
Chengsong
parents: 9
diff changeset
   369
          |  └-a
11
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   370
          └-ALT List(S)
9c1ca6d6e190 The C(Char) construct is incompatible with the code and retrieve in Fahad's thesis.
Chengsong
parents: 10
diff changeset
   371
             └-b List(Z)
10
2b95bcd2ac73 exp and proof
Chengsong
parents: 9
diff changeset
   372
             └-a List(S)
2b95bcd2ac73 exp and proof
Chengsong
parents: 9
diff changeset
   373
\end{verbatim}
2b95bcd2ac73 exp and proof
Chengsong
parents: 9
diff changeset
   374
\end{theorem}
2b95bcd2ac73 exp and proof
Chengsong
parents: 9
diff changeset
   375
8
Chengsong
parents:
diff changeset
   376
\end{document}
Chengsong
parents:
diff changeset
   377
Chengsong
parents:
diff changeset
   378
%The second part might still need some more development.
Chengsong
parents:
diff changeset
   379
%When s is not in the set L(ar), we have that s = s1@s2 s.t. s1 $\in$ L(ar), and any longer string that is a prefix of s does not belong to L(ar).\\
Chengsong
parents:
diff changeset
   380
%By first part of proof, we have ders(ar, s1) $\sim_{m\epsilon}$ ders\_simp(ar, s1)
Chengsong
parents:
diff changeset
   381
%.....somehow show that by correctness, der(c, ders\_simp(ar, s1)) must be not nullable. But this will need that L(ders(ar, s1)) == L(ders\_simp(ar, s1)). By part 1 of proof we only have that for any string s1c s.t. s1c $\in$ L(ar) (which is equivalent to s $\in$ L(ders(ar, s1))), s is also in L(ders\_simp(ar, s1)). That is an inclusion, not an equality. c not in L(ders(ar, s1)) does not imply c not in L(ders\_simp(ar, s1))
Chengsong
parents:
diff changeset
   382
%So this path stuck here.