Answer set programming (ASP) is a method for solving hard problems using computational logic. We describe a problem as a set of formulas of a declarative logical language in such way that the solutions correspond to the models (answer sets) of the set and then use a general-purpose inference engine to find the answer sets. In this work we define an ASP language, cardinality constraint programs (CCP). The language extends normal logic programs by adding cardinality and conditional literals as well as choice rules. These extensions allow us to represent many if not most NP-complete problems in a concise and intuitive way. The language is defined in two phases where we first introduce a simple basic language and then define the constructs o...