Management of heart failure is a major health care challenge. Healthcare providers are expected to use best practices described in clinical practice guidelines, which typically consist of a long series of complex rules. For heart failure management, the relevant guidelines are nearly 80 pages long. Due to their complexity, the guidelines are often difficult to fully comply with, which can result in suboptimal medical practices. In this paper, we describe a heart failure treatment adviser system that automates the entire set of rules in the guidelines for heart failure management. The system is based on answer set programming, a form of declarative programming suited for simulating human-style reasoning. Given a patients information, the system is able to generate a set of guideline-compliant recommendations. We conducted a pilot study of the system on 21 real and 10 simulated patients with heart failure. The results show that the system can give treatment recommendations compliant with the guidelines. Out of 187 total recommendations made by the system, 176 were agreed upon by the expert cardiologists. Also, the system missed eight valid recommendations. The reason for the missed and discordant recommendations seems to be insufficient information, differing style, experience, and knowledge of experts in decision-making that were not captured in the system at this time. The system can serve as a point-of-care tool for clinics. Also, it can be used as an educational tool for training physicians and an assessment tool to measure the quality metrics of heart failure care of an institution.