Declarative if–then rules have proven very useful in many applications of expert systems. They can be managed in deductive databases and evaluated using the well-known forward-chaining approach. For domain-experts, however, the syntax of rules becomes complicated quickly, and already many different knowledge representation formalisms exist. Expert knowledge is often acquired in story form using interviews. In this paper, we discuss its representation by defining domain-specific languages (DSLs) for declarative expert rules. They can be embedded in Prolog systems in internal DSLs using term expansion and as external DSLs using definite clause grammars and quasi-quotations – for more sophisticated syntaxes.
Based on the declarative rules and the integration with the Prolog-based deductive database system DDBase, multiple rules acquired in practical case studies can be combined, compared, graphically analysed by domain-experts, and evaluated, resulting in an extensible system for expert knowledge. As a result, the actual modeling DSL becomes executable; the declarative forward-chaining evaluation of deductive databases can be understood by the domain experts. Our DSL for rules can be further improved by integrating ontologies and rule annotations.