In theoretical computer science, correctness of an algorithm is asserte when it is said that the algorithm is correct with respect to a specification. Functional correctness refers to the input-output behaviour of the algorithm (i.e., for each input it produces the correct output). See also program verification.