X\oset{p,m_L}{\Longrightarrow}) \}.$$ ]{}

Rewriting Materializations {#sec:RewMat}
--------------------------

In the next step we will now rewrite the rewritable materialization $\rmat{\phi}{\phi_L}$ with the match $L\oset{n_L}{\rat}\rmat{\phi}{\phi_L}$, resulting in a co-match $R\rat B$. In particular, we will show that this co-match represents all co-matches that can be obtained by rewriting an object $X$ of $\mathcal{L}(A)$ at a match compatible with $\phi$. We first start with an example.

We can rewrite the materialization $L \rat \rmat{\phi}{\phi_L} \to A$ as follows:

\[prop:rewriting-materializations\] [ Let a match $n_L\colon L\rat \tilde{A}$ and a production $p\colon L\lat I\rat R$ be given. Assume that $\tilde{A}$ is rewritten along the match $n_L$, i.e., $(L \oset{n_L}{\rat} \tilde{A}) \oset{p}{\Rightarrow}
  (R\oset{n_R}{\rat} B)$. Then $$\mathcal{L}(R\oset{n_R}{\rat} B) = \{ R\oset{m_R}{\rat}
    Y\mid \exists (L\oset{m_L}{\rat} X)\in
    \mathcal{L}(L\oset{n_L}{\rat} \tilde{A}).\
    \big((L\oset{m_L}{\rat} X) \oset{p}{\Rightarrow}
    (R\oset{m_R}{\rat} Y)\big)\}$$ ]{}

If we combine Prop. \[prop:language-rewriting-materialization\] and Prop. \[prop:rewriting-materializations\], we obtain the following corollary that characterizes the co-matches obtained from rewriting a match compatible with $\phi\colon L\to A$.

\[cor:rewriting-materializations\] [ Let $\phi\colon L\to A$ and a production $p\colon L\oset{\phi_L}{\lat} I\oset{\phi_R}{\rat} R$ be given. Assume that $\rmat{\phi}{\phi_L}$ is obtained as the rewritable materialization of $\phi$ and $\phi_L$ with match $L\oset{n_L}{\rat} \rmat{\phi}{\phi_L}$ (see Prop. \[prop:mat-rewritable\]). Furthermore let $(L \oset{n_L}{\rat} \rmat{\phi}{\phi_L}) \oset{p}{\Rightarrow}
  (R\oset{n_R}{\rat} B)$. Then $$\begin{aligned}
    \mathcal{L}(R\oset{n_R}{\rat} B) 