%%%%% paper-specific deets %%%%%%


%%%%%%%%%%%%%% Notation
\newcommand{\schemaof}[1]{\textbf{sch}(#1)}
\newcommand{\groundtruth}{\mathcal G}
\newcommand{\recordset}{\mathcal R}

\newcommand{\JValue}{v}
\newcommand{\JType}{\tau}
\newcommand{\JObject}{\mathcal O}
\newcommand{\JArray}{\mathcal A}
\newcommand{\TNull}{\textbf{null}}
\newcommand{\TBool}{\mathbb B}
\newcommand{\TNum}{\mathbb R}
\newcommand{\TString}{\mathbb S}
\newcommand{\JNull}{\texttt{null}}
\newcommand{\JKey}{k}
\newcommand{\JPath}{\vec p}
\newcommand{\JSch}{\mathcal S}
\newcommand{\JSchDefn}{\mathcal J}
\newcommand{\JEmptyObject}{\setof{\cdot}}
\newcommand{\JEmptyArray}{\arrayof{\cdot}}
\newcommand{\keysof}[1]{\texttt{keys}(#1)}
\newcommand{\keysofall}[1]{\texttt{keys}_{\forall}(#1)}
\newcommand{\keysofany}[1]{\texttt{keys}_{\exists}(#1)}
\newcommand{\setof}[1]{\left\{\;#1\;\right\}}
\newcommand{\arrayof}[1]{\left[\;#1\;\right]}
\newcommand{\sizeof}[1]{\left|#1\right|}
\newcommand{\booltype}{\textbf{bool}}
\newcommand{\numtype}{\textbf{num}}
\newcommand{\strtype}{\textbf{str}}
\newcommand{\CASESEP}{\;|\;}
\newcommand{\JEval}[1]{\left\llbracket \; #1 \; \right\rrbracket}
\newcommand{\kindof}[1]{\texttt{kind}(#1)}
\newcommand{\extract}[2]{\texttt{merge}_{#1}\left(#2\right)}
\newcommand{\extractNaive}[1]{\extract{\text{naive}}{#1}}
\newcommand{\Entropy}{\mathcal E}
\newcommand{\KeySpaceEntropy}{\Entropy_{\mathcal K}}
\newcommand{\TypeEntropy}{\Entropy_{\mathcal T}}
\newcommand{\isDefinedAs}{\overset{\triangle}{=}}


% \renewcommand{\theenumi}{(\roman{enumi})}
\newcommand{\bfcaption}[1]{\caption{\textbf{#1}}}


%%%%%% Standard Packages %%%%%%
\usepackage{graphicx}
% \usepackage{amssymb}
%\usepackage[noend]{algorithmic}
\usepackage{algorithm}
\usepackage{stackrel}
\usepackage{algpseudocode}
\usepackage{textcomp}
\PassOptionsToPackage{table}{xcolor}
\usepackage[table]{xcolor}
\usepackage{listings}
\usepackage{subcaption}
% \usepackage{caption}
\usepackage{amsmath}
\usepackage{mathtools,xparse}
\usepackage{dsfont}
\usepackage{stmaryrd}
% \usepackage[inline]{enumitem}

%\usepackage{cite}
\usepackage{paralist}
% \usepackage[colorlinks=false,citecolor=white]{hyperref}
\usepackage{cleveref}
\usepackage{lipsum}
\usepackage[normalem]{ulem}
\usepackage{array}
\usepackage{multicol}
\usepackage{enumitem}
% \usepackage[shortlabels]{enumitem}
\usepackage{etoolbox}
\usepackage{varwidth}
\usepackage{xspace}
\usepackage{url}

\usepackage{multirow}

%%%%%% Package Configuration %%%%%%
%%% Listings
\lstset{language=sql,morekeywords={LENS,SCHEMA_MATCHING,string},basicstyle=\small\upshape\ttfamily,keywordstyle=\color{blue}}

%%% Listings - JSON language definition
\colorlet{jsonpunct}{red!60!black}
\definecolor{jsonbackground}{HTML}{EEEEEE}
\definecolor{jsondelim}{RGB}{20,105,176}
\colorlet{jsonnumb}{magenta!60!black}
\definecolor{jsonkey}{RGB}{10,70,50}
% \colorlet{jsonkey}{magenta!60!black}

\lstdefinelanguage{json}{
    basicstyle=\normalfont\ttfamily\small,
%    numbers=left,
    numberstyle=\scriptsize,
    stepnumber=1,
    numbersep=8pt,
    showstringspaces=false,
    breaklines=true,
    frame=lines,
    backgroundcolor=\color{jsonbackground},
    morestring=[b]",
    literate=
     *{0}{{{\color{jsonnumb}0}}}{1}
      {1}{{{\color{jsonnumb}1}}}{1}
      {2}{{{\color{jsonnumb}2}}}{1}
      {3}{{{\color{jsonnumb}3}}}{1}
      {4}{{{\color{jsonnumb}4}}}{1}
      {5}{{{\color{jsonnumb}5}}}{1}
      {6}{{{\color{jsonnumb}6}}}{1}
      {7}{{{\color{jsonnumb}7}}}{1}
      {8}{{{\color{jsonnumb}8}}}{1}
      {9}{{{\color{jsonnumb}9}}}{1}
      {:}{{{\color{jsonpunct}{:}}}}{1}
      {,}{{{\color{jsonpunct}{,}}}}{1}
      {\{}{{{\color{jsondelim}{\{}}}}{1}
      {\}}{{{\color{jsondelim}{\}}}}}{1}
      {[}{{{\color{jsondelim}{[}}}}{1}
      {]}{{{\color{jsondelim}{]}}}}{1}
      {…}{{\normalfont \ldots}}{1},
    morestring=[d]',
    stringstyle=\color{jsonkey}
}
\newcommand{\inlinejson}[1]{\lstinline{#1}}
\newcommand{\mathjson}[1]{\text{\lstinline{#1}}}

%%% verbatim
\makeatletter
\preto{\@verbatim}{\topsep=5pt \parsep=0pt }
\makeatother
%%% Algorithmic
\renewcommand{\algorithmicrequire}{\textbf{In:}}
\renewcommand{\algorithmicensure}{\textbf{Out:}}
%% Multicol
\setlength\multicolsep{\topsep}

%%%%%% Standard Theorem Environments %%%%%%
%\newtheorem{example}{Example}
\newtheorem{scenario}{Scenario}
%\newtheorem{definition}{Definition}
\newtheorem{property}{Property}
\newtheorem{transformation}{Transformation}

%%%%%%% Table styling %%%%%%
\newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{R}[1]{>{\raggedleft\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}


%%%%%% Common Math-Mode Aliases %%%%%%
\newcommand{\comprehension}[2]{\left\{\left.\;{#1}\;\right|\;{#2}\;\right\}}
%\newcommand{\bagcomprehension}[2]{\llbrace\left.\;{#1}\;\right|\;{#2}\;\rrbrace}
\newcommand{\bagcomprehension}[2]{\left\{\!\left|\left.\;{#1}\;\right|\;{#2}\;\right|\!\right\}}
\newcommand{\setsize}[1]{\left|#1\right|}
\newcommand{\tuple}[1]{\left<\;{#1}\;\right>}
\newcommand{\ordefn}{\;|\;}
\newcommand{\sch}[1]{\texttt{schema}({#1})}
\newcommand{\projection}{\pi}
\newcommand{\selection}{\sigma}
\newcommand{\logicalAnd}{\wedge}
\newcommand{\logicalOr}{\vee}
\newcommand{\Union}{\bigcup}
\newcommand*{\Unionl}{\Union\limits}
\newcommand{\Intersection}{\bigcap}
\newcommand{\E}{\mathrm{E}}
\newcommand{\expect}{\mathbb{E}}
\newcommand{\defineeq}{\overset{def}{=}}

\newcommand{\entropy}{\mathcal{H}}

\newcommand{\distinct}[1]{\lfloor{#1}\rfloor}

\DeclareMathOperator*{\argmin}{arg\,min}
\newcommand*{\argminl}{\argmin\limits}

\DeclareMathOperator*{\argmax}{arg\,max}
\newcommand*{\argmaxl}{\argmax\limits}

\DeclareMathOperator*{\mysum}{\sum}
\newcommand*{\mysuml}{\mysum\limits}

\DeclareMathOperator*{\myPi}{\Pi}
\newcommand*{\myPil}{\myPi\limits}

\DeclareMathOperator*{\mymin}{\min}
\newcommand*{\myminl}{\mymin\limits}

\DeclareMathOperator*{\mymax}{\max}
\newcommand*{\mymaxl}{\mymax\limits}

\DeclareMathOperator*{\myunion}{\bigcup}
\newcommand*{\myunionl}{\myunion\limits}

\renewcommand{\vec}[1]{\mathbf{#1}}

\DeclarePairedDelimiter{\norm}{\lVert}{\rVert}

%%%%%% Other Aliases %%%%%%
\newcommand{\ccomment}[1]{{\small\texttt{/*} #1 \texttt{*/}}}
\newcommand{\tinysection}[1]{\smallskip \noindent \textbf{#1.}~}
%\newcommand{\keyword}[1]{\textcolor{blue}{\texttt{#1}}}
