Answer set programming (ASP) evolved from logic programming, deductive databases, knowledge representation, and nonmonotonic reasoning, and it serves as a flexible language for solving problems in a declarative way. The user does not need to provide an algorithm for solving the problem; rather, it is sufficient that (s)he specifies the properties of the desired solution for its computation. ASP is highly expressive and allows us to solve problems even beyond the complexity class NP. The main representation feature of ASP are rules, which are interpreted according to common sense principles. In ASP, one writes a program, that is, a collection of rules, which represent a problem to be solved. This program, together with some input, usually expressed using factual rules, possesses a collection of models (possibly also no model), called answer sets, which correspond to the solutions of the modeled problem. Efficient systems for computing answer sets are available and have stimulated the development of applications relying on ASP, in both academia and, business. The field of ASP is growing, and several extensions of the basic language have been proposed and used in applications.