I have the following code on overleaf:
\begin{lstlisting}[caption={Código inicial para o sistema de arquivos},label={lst:Figura1}]
abstract sig FSObject { }
sig File, Dir extends FSObject { }
sig FileSystem {
root: Dir,
live: set FSObject,
contents: Dir lone-> FSObject,
parent: FSObject ->lone Dir
}{
no root.parent
live in root.*contents
parent = ~contents
}
pred example { }
run example for exactly 1 FileSystem, 4 FSObject
\end{lstlisting}
Ao executar o código da Figura \ref{lst:Figura1} no interpretador Alloy, diversas instâncias são encontradas. A Figura \ref{fig:Figura2} apresenta uma instância selecionada para análise.
\begin{figure}[ht]
\centering
\includegraphics[width=.5\textwidth]{MyFigure2.jpg}
\caption{Contra-exemplo na modelagem}
\label{fig:Figura2}
\end{figure}
which ends up starting a count for Images and listing (code), as seen on the image below, where I highlighted in blue what is wrong for me. I'd like to have a single counter, as if lstlisting had value 1, and the image had value 2.
Is it possible? How do I achieve that?