how do I write
foreach triple ti in Q do
Q <- M
in latex I have tried
\foreach \triple ti in {Q} {Q \gets M}
but it doesnt work
I want the result to be displayed as follow it is a sort of an algorithm whriten in the report
"…..
Foreach Triple pattern ti ∈ Q Do
Q<- M "
…
\documentclass{article}
\usepackage{amsmath}
\usepackage[linesnumbered,ruled]{algorithm2e}
\begin{document}
\begin{algorithm}
\SetKwInOut{Input}{Input}
\SetKwInOut{Output}{Output}
{MFS} $(Q,D)$\;
\Input{ A failing Query Q = t1$\wedge$t2$\wedge$...$\wedge$tn and RDF Database D ;}
\Output{An MFS denoted by Q* ;}
Q $\gets$ Q* ; \\
Q' $\gets$ Q* ; \\
\caption{Find An MFS in a failing SPARQL Query}
\end{algorithm}
\end{document}
I want this result
Best Answer
You need to use
\ForEach{<condition>}{<stuff>}
I've also defined a program called
\FindAnMFS
to obtain the outer block.