paper-BagRelationalPDBsAreHard/poly-form.tex

82 lines
4.4 KiB
TeX
Raw Normal View History

%root: main.tex
2020-06-26 17:27:52 -04:00
%!TEX root = ./main.tex
2020-07-14 11:45:57 -04:00
%\onecolumn
2020-12-14 23:34:12 -05:00
\subsection{Reduced Polynomials and Equivalences}
We now introduce some terminology
2021-09-07 11:32:06 -04:00
and develop a reduced form of lineage polynomials for a \abbrBIDB or \abbrTIDB.
Note that a polynomial over $\vct{X}=(X_1,\dots,X_n)$ with individual degree $B <\infty$
2021-09-18 00:55:37 -04:00
is formally defined as (where $c_{\vct{d}}\in \semN$):
2021-04-08 22:30:03 -04:00
\begin{equation}
\label{eq:sop-form}
2021-09-20 18:04:04 -04:00
\poly\inparen{X_1,\dots,X_n}=\sum_{\vct{d}\in\{0,\ldots,B\}^n} c_{\vct{d}}\cdot \prod_{i=1}^n X_i^{d_i}.
2021-04-08 22:30:03 -04:00
\end{equation}
2021-09-18 00:55:37 -04:00
%where $c_{\vct{d}}\in \semN$.
2021-04-08 22:30:03 -04:00
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{Definition}[Standard Monomial Basis]\label{def:smb}
2021-09-18 00:55:37 -04:00
The term $\prod_{i=1}^n X_i^{d_i}$ in \Cref{eq:sop-form} is a {\em monomial}. A polynomial $\poly\inparen{\vct{X}}$ is in standard monomial basis (\abbrSMB) when we keep only the terms with $c_{\vct{d}}\ne 0$ from \Cref{eq:sop-form}.
\end{Definition}
2020-12-14 13:58:56 -05:00
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2021-06-11 11:22:58 -04:00
Unless othewise noted, we consider all polynomials to be in \abbrSMB representation.
When it is unclear, we use $\smbOf{\poly}$ to denote the \abbrSMB form of a polynomial $\poly$.
2021-04-07 23:27:51 -04:00
2020-12-14 13:58:56 -05:00
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2020-12-14 23:34:12 -05:00
\begin{Definition}[Degree]\label{def:degree}
The degree of polynomial $\poly(\vct{X})$ is the largest $\sum_{i=1}^n d_i$ such that $c_{(d_1,\dots,d_n)}\ne 0$. % maximum sum of exponents, over all monomials in $\smbOf{\poly(\vct{X})}$.
2020-12-14 23:34:12 -05:00
\end{Definition}
2020-12-14 13:58:56 -05:00
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2021-09-07 11:32:06 -04:00
As an example, the degree of the polynomial $X^2+2XY^2+Y^2$ is $3$.
2021-09-18 00:55:37 -04:00
Product terms in lineage arise only from join operations (\Cref{fig:nxDBSemantics}), so intuitively, the degree of a lineage polynomial is analogous to the largest number of joins needed to produce a result tuple.
2021-09-07 11:32:06 -04:00
%in any clause of the $\raPlus$ query that created it.
2021-09-18 00:55:37 -04:00
We call a polynomial $\poly\inparen{\vct{X}}$ a \emph{\bi-lineage polynomial} (resp., \emph{\ti-lineage polynomial}, or simply lineage polynomial), if there exists a $\raPlus$ query $\query$, \bi (\ti) $\pdb$, and result tuple $\tup$ such that $\poly\inparen{\vct{X}} = \apolyqdt\inparen{\vct{X}}.$
2020-12-14 13:58:56 -05:00
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2020-12-14 23:34:12 -05:00
\begin{Definition}[Reduced \bi Polynomials]\label{def:reduced-bi-poly}
Let $\poly(\vct{X})$ be a \bi-lineage polynomial.
2021-09-07 11:32:06 -04:00
The reduced form $\rpoly(\vct{X})$ of $\poly(\vct{X})$ is the same as \Cref{def:reduced-poly} with the added constraint that all monomials with variables $X_{\block, i}, X_{\block, j}, i\neq j$ from the same block $\block$ are omitted.
\end{Definition}
2020-12-14 13:58:56 -05:00
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
2020-12-20 18:29:52 -05:00
2021-09-07 11:32:06 -04:00
Consider a $\abbrBIDB$ polynomial $\poly\inparen{\vct{X}} = X_{1, 1}X_{1, 2} + X_{1, 2}X_{2, 1}^2$. Then by \Cref{def:reduced-bi-poly}, we have that $\rpoly\inparen{\vct{X}} = X_{1, 2}X_{2, 1}$. Next, we show why the reduced form is useful for our purposes.
2021-04-07 23:27:51 -04:00
%%Removing this example to save space
\iffalse
\begin{Example}\label{example:qtilde}
Consider $\poly(X, Y) = (X + Y)(X + Y)$ where $X$ and $Y$ are from different blocks. The expanded derivation for $\rpoly(X, Y)$ is
\begin{align*}
2020-12-16 12:38:21 -05:00
(&X^2 + 2XY + Y^2 \mod X^2 - X) \mod Y^2 - Y\\
= ~&X + 2XY + Y^2 \mod Y^2 - Y\\
= ~& X + 2XY + Y
\end{align*}
\end{Example}
2021-04-07 23:27:51 -04:00
\fi
2020-12-14 13:58:56 -05:00
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2021-09-02 12:06:47 -04:00
2020-12-14 13:58:56 -05:00
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{Lemma}\label{lem:exp-poly-rpoly}
2021-09-18 00:55:37 -04:00
Let $\pdb$ be a \abbrBIDB over $\numvar$ input tuples such that the probability distribution $\pdassign$ over $\{0,1\}^\numvar$ (the all worlds set) is induced by the probability vector $\probAllTup = (\prob_1, \ldots, \prob_\numvar)$. As in \Cref{lem:tidb-reduce-poly} for \abbrTIDB, any \abbrBIDB-lineage polynomial $\poly(\vct{X})$ based on $\pdb$ and query $\query$ we have:
2020-12-14 23:34:12 -05:00
% The expectation over possible worlds in $\poly(\vct{X})$ is equal to $\rpoly(\prob_1,\ldots, \prob_\numvar)$.
\begin{equation*}
2022-01-11 11:35:45 -05:00
\expct_{\vct{W}\sim \pdassign}\pbox{\poly(\vct{W})} = \rpoly(\probAllTup).
\end{equation*}
\end{Lemma}
2020-12-14 13:58:56 -05:00
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2022-01-11 11:35:45 -05:00
Let $\abs{\poly}$ be the number of operators in $\poly$.
2020-06-15 18:38:10 -04:00
2020-12-14 13:58:56 -05:00
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{Corollary}\label{cor:expct-sop}
2021-09-18 13:48:00 -04:00
If $\poly$ is a \bi-lineage polynomial already in \abbrSMB, then the expectation of $\poly$, i.e., $\expct\pbox{\poly} = \rpoly\left(\prob_1,\ldots, \prob_\numvar\right)$ can be computed in $\bigO{\abs{\poly}}$ time.
2020-06-17 10:58:02 -04:00
\end{Corollary}
2020-12-17 17:08:48 -05:00
2020-12-14 13:58:56 -05:00
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2020-12-17 17:08:48 -05:00
2020-12-14 13:58:56 -05:00
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Local Variables:
%%% mode: latex
%%% TeX-master: "main"
%%% End: