Definition

We say that an algorithm ( is input) decides a predicate/language in O(f(n)) if, for each instance , terminates after basic steps of computation and accepts if and only if .

(We can also speak of solving a problem in time .)
From here, polynomial-time computation is defined as expected:

Definition

is the set of such that there is some olynomial and an algorithm deciding in steps.

Example: Satisfiability Revisited

Eval Problem:
By earlier -time algorithm:

SAT Problem:

Example: Reachability

(meaning: A graph consists of a set of vertices and a set of edges , where each edge is an ordered pair of vertices).
Reach =
Algorithm : Calculate progressively where is the graph of -reachability. Then reaches iff