# jeffreykegler/Marpa-theory

Update for changes to Leo logic

 @@ -2147,7 +2147,10 @@ since \EVtable{\Marpa}{i} is consistent by the inner induction, \subsubsection{Earley reduction is consistent} \label{s:reduction-consistent} -We next show consistency for Marpa's reduction operation, +\begin{sloppypar} +Next, +we show that \Marpa{}'s reduction operation +is consistent, in the case where there is no Leo reduction. There will be two cause EIM's, \Veim{predecessor} and \Veim{component}. @@ -2159,6 +2162,7 @@ From \Veim{component}, we will find zero or more transition symbols, \Vsym{lhs}. From this point, the argument is very similar to that for the case of the scanning operation. +\end{sloppypar} Let \begin{equation*} @@ -2186,7 +2190,9 @@ whether or not a \Veim{predicted} is added. \subsubsection{Leo reduction is consistent} \label{s:leo-consistent} -We now show consistency for Marpa's reduction operation, +\begin{sloppypar} +We now show consistency for \Marpa{}'s +reduction operation, in the case where there is a Leo reduction. If there is a Leo reduction, it is signaled by the presence of \Vlim{predecessor}, @@ -2200,6 +2206,8 @@ the logic to create \Vlim{predecessor} as a matter of memoization of the previous Earley sets, and its correctness follows from the outer induction hypothesis. +\end{sloppypar} + As the result of a Leo reduction, \Leo{} will add $[\Vdr{top}, \Vorig{top}]$ @@ -2399,7 +2407,8 @@ and the case of reduction completeness. \subsubsection{Leo reduction is complete} \label{s:leo-complete} -We now show completeness for Marpa's reduction operation, +\begin{sloppypar} +We now show completeness for \Marpa{}'s reduction operation, in the case where there is a Leo reduction. In Section \ref{s:leo-consistent}, we found that where \Leo{} would create @@ -2411,10 +2420,12 @@ Since \Vdr{top} is a completed rule, there are no predictions. This shows the case immediately, by the definition of completeness. +\end{sloppypar} \subsubsection{Prediction is complete} \label{s:prediction-complete} +\begin{sloppypar} Predictions result only from items in the same Earley set. In Sections \ref{s:scan-complete}, \ref{s:reduction-complete} @@ -2424,6 +2435,7 @@ for every prediction that would result from an item added to \EVtable{\Leo}{i}, a corresponding prediction was added to \EVtable{\Marpa}{i}. +\end{sloppypar} \subsubsection{Finishing the proof} Having shown the cases in Sections @@ -3047,7 +3059,7 @@ for unambiguous grammars is \order{\var{n}^2}. \end{proof} \begin{theorem} -For any context-free grammar, +For every context-free grammar, \Marpa{} runs in $\order{\var{n}^3}$ time. \end{theorem} @@ -3057,7 +3069,7 @@ and Theorem \ref{t:ambiguous-tries}. \end{proof} \begin{theorem}\label{t:cfg-space} -For any context-free grammar, +For every context-free grammar, \Marpa{} runs in $\order{\var{n}^2}$ space, if it does not tracks links. \end{theorem} @@ -3079,7 +3091,7 @@ of an evaluation phase, for which links are necessary. \begin{theorem} -For any context-free grammar, +For every context-free grammar, \Marpa{} runs in $\order{\var{n}^3}$ space, including the space for tracking links. \end{theorem}