\usepackage{hyperref}
\usepackage{listings}
\usepackage{xcolor}
\usepackage{xspace}
\usepackage{amssymb}
\usepackage{bussproofs}
\usepackage{stackengine}
\usepackage{cite}
\usepackage[square,numbers]{natbib}

\definecolor{codegray}{rgb}{0.5,0.5,0.5}

\lstdefinestyle{mystyle}{
    numberstyle=\tiny\color{codegray},
    basicstyle=\ttfamily\footnotesize,
    breakatwhitespace=false,         
    breaklines=true,                 
    captionpos=b,                    
    keepspaces=true,                 
    numbers=left,                    
    numbersep=5pt,                  
    showspaces=false,                
    showstringspaces=false,
    showtabs=false,                  
    tabsize=2
}

\lstset{style=mystyle}
\lstset{language=C}

\AtBeginDocument{
  \providecommand\BibTeX{{
    Bib\TeX}}}

\newenvironment{bprooftree}
  {\leavevmode\hbox\bgroup}
  {\DisplayProof\egroup}