[Tex/LaTex] How to make while(true) do loop

algorithmsieeetran

Can someone explain to me how to make this? http://prntscr.com/4y0t4x
I've got the two lines done, but I couldn't find anywhere about "while(true) do" loops and also about foreach.

This is what I have so far.

\documentclass[10pt,conference]{IEEEtran}
\usepackage{amsmath}
\usepackage{algorithm}
\usepackage[noend]{algpseudocode}

\title{Example}
\author{John Doe}

\begin{document}
\maketitle

\begin{algorithm}
\caption{Secure introspection}\label{algo}
\begin{algorithmic}[1]

\State $\textit{TrustedCode} \gets \textit{\{hardware\}}$
\State $\textit{TrustedData} \gets \textit{0}
\While {true}


\EndWhile

\end{algorithmic}
\end{algorithm}



\end{document}

PS. I will be grateful if anyone tell me a site where I can find how to create those symbols on line 2 and line 5 of the code.

EDIT: I've tried with while{true} , while{$true} but none of them works.
EDIT: I don't need this to work, I just want this to be an example in the text. I want to reproduce the linked picture only.

Best Answer

Here is a very similar display.

\documentclass[10pt,conference]{IEEEtran}
\usepackage{amsmath}
\usepackage{algorithm}
\usepackage[noend]{algpseudocode}

\newcommand{\sfunction}[1]{\textsf{\textsc{#1}}}
\algrenewcommand\algorithmicforall{\textbf{foreach}}
\algrenewcommand\algorithmicindent{.8em}

\title{Example}
\author{John Doe}

\begin{document}
\maketitle

\begin{algorithm}
\caption{Secure introspection}\label{algo}
\begin{algorithmic}[1]

\State $\mathit{TrustedCode} \gets \{\mathit{hardware}\}$
\State $\mathit{TrustedData} \gets \emptyset$
\While {true}
  \State $d\gets\emptyset$
  \ForAll{$c\in\mathit{TrustedCode}$}
    \State $d\gets d\cup\sfunction{CFDataUsed}(c)$
    \State $d\gets d\setminus \mathit{TrustedCode}$
  \EndFor
  \ForAll{$\mathit{ptr}\in d$}
    \If{$\sfunction{CodeIsValid}(\text{code at }\mathit{ptr})$}
      \State add code at $\mathit{ptr}$ to $\mathit{TrustedCode}$
      \State add $\mathit{ptr}$ to $\mathit{TrustedData}$
    \Else
      \State{raise alarm}
    \EndIf
  \EndFor
  \State $\sfunction{MonitorForWrites}(\mathit{TrustedCode}\cup\mathit{TrustedData})$
\EndWhile
\State \textbf{end}
\end{algorithmic}
\end{algorithm}

\end{document}

enter image description here