We describe how model-based reasoning knowledge (represented in the form of Horn clauses) can be transformed into efficient diagnostic procedures. These procedures, in the form of generalized decision trees, are produced by partial evaluation of a declarative system model. These decision trees are constructed incrementally based on diagnostic sessions and the system model. Both optimal measurement point selection and fault localization are included in these diagnostic procedures. Using this approach we produce a diagnosis system which integrates both model-based structural and behavioral knowledge and generates explicit diagnostic knowledge. This structure guarantees both high flexibility and a good runtime behavior. Conventional inductive learning algorithms produce decision trees with constant attribute labels for decision making. In contrast our algorithm generates generalized expression labels leading to much smaller and more understandable decision trees. This is done by exploiting the logic representation of the model and an extension of well-known partial evaluation techniques.