I'm writing an algorithm with lstlisting
This is the output
And this is the code:
\begin{figure}
\begin{lstlisting}[mathescape=true]
INPUT: Insieme $C$ di cubi che coprono una funzione $f$
OUTPUT: Insieme $D$ di cubi disgiunti che coprono $f$
$D = \emptyset$
while($C \neq \emptyset$):
BUILD-SOP($C$, $P$) # crea SOP e la inserisce in $P$
$A\ = \{d\in P\ |\ \forall c \in P \backslash \{d\} : d \cap c = \emptyset \}$
$D = D \cup A$
$P = P \backslash A$
WEIGHT($P$)
SORP($P$)
$B = \emptyset$
while($P\neq \emptyset$):
$p = P[0]$
$P = P \backslash \{p\}$
$D = D \cup \{p\}$
forall $q \in P\ :\ p \cap q = \emptyset$:
$P = P \backslash \{q\}$
BREAK($q$,$p$,$Q$)
OPT($q$,$Q$,$P$,$B$)
forall $r \in B\ :\ p \cap r \neq \emptyset$:
$B = B \backslash \{r\}$
BREAK($r$,$p$,$Q$)
$B = B \cup Q$
$C = B$
\end{lstlisting}
\caption{Algoritmo DSOP}
\end{figure}
How can I make the commands like "while","if" and "forall" in bold and the functions that are written in capital letters in a way that distinguishes them from the rest of the code?
algorithm2e
oralgorithmicx
.