The calculus of variations and some semilinear variational inequalities of elliptic and parabolic type.