\code{
\func{FOL-FC-Ask}{\v{KB}{\ac}$\alpha$}{a substitution or \v{false}}
\bodysep
    \key{repeat until} \v{new} is empty
          \setq{\v{new}}{$\emptyset$}
          \key{for each} sentence \v{r} \key{in} \v{KB} \key{do} 
                \setq{$({\ts}\v{p}_1\land\ldots\land \v{p}_n\implies \v{q})$}{\noprog{Standardize-Apart}(\v{r})} 
                \key{for each} $\theta$ such that $(\v{p}_1 \land \ldots \land \v{p}_n)\theta = (\v{p}'_1 \land \ldots \land \v{p}'_n)\theta$
                                  for some $\v{p}'_1,\ldots,\v{p}'_n$ in \v{KB}
                      \setq{$\v{q}'$}{\noprog{Subst}($\theta${\ac}$\v{q}$)}
                      \key{if} $\v{q}'$ is not a renaming of a sentence already in \v{KB} or \v{new} \key{then do}
                            add $\v{q}'$ to \v{new}
                            \setq{$\phi$}{\prog{Unify}($\v{q}'${\ac}$\alpha$)}
                            \k{if} $\phi$ is not \v{fail} \key{then return} $\phi$
          add \v{new} to \v{KB}
    \key{return} \v{false}
}




