% Requires: \usepackage{float}  % for [H]
% Optional: \SetAlgoLongEnd, \SetAlgoNoEnd

\begin{algorithm2e}[H]
\DontPrintSemicolon
\SetAlgoVlined
\SetAlgoSkip{0pt}
\caption{Planner Decomposition of ``High-Risk Features'' into Atomic VLM Queries}
\label{alg:decompose_high_risk}
\KwIn{CT scan $\mathcal{I}$, VLM $\mathcal{V}$, threshold $\tau$}
\KwOut{Per-factor evidence $E$, aggregated flag $HR$}

\SetKwFunction{FAsk}{VLMYesNo}
\SetKwFunction{FAgg}{AggregateRisk}
\SetKwFunction{Fn}{Function}
\Fn{\FAsk{$\mathcal{I}, \mathcal{V}, q$}}{
  $p \gets \mathcal{V}.\textsc{ImageTextMatching}(\mathcal{I}, [q])$\;
  \Return{$p$}\;
}

\BlankLine
$\mathcal{F} \gets$ \{%
$q_1$: ``mural nodule present'',\;
$q_2$: ``solid component present'',\;
$q_3$: ``main pancreatic duct dilated ($\geq$ 10mm)'',\;
$q_4$: ``abrupt duct caliber change with distal atrophy''\}\;

\ForEach{$(k,q_k)\in \mathcal{F}$}{
  $p_k \gets$ \FAsk{$\mathcal{I}, \mathcal{V}, q_k$}\;
  $E[k] \gets (p_k,\; p_k>\tau)$ \tcp*{(confidence, boolean)}
}

$HR \gets$ \FAgg{$E$} \tcp*{e.g., OR over booleans, or weighted rule}
\Return{$(E, HR)$}\;
\end{algorithm2e}