A tool for building a knowledge system and running a consultation on a computer is easily mastered by people with little computer experience yet also provides advanced capabilities for the experienced knowledge engineer. The knowledge system includes a knowledge base in an easily understood English-like language expressing facts, rules, and meta-facts for specifying how the rules are to be applied to solve a specific problem. The tool includes interactive knowledge base debugging, question generation, legal response checking, explanation, certainty factors, and the use of variables. The knowledge base language permits recursion and is extensible. Preferably, control during a consultation is goal directed in depth-first fashion as specified by rule order. The tool is easily embodied in assembly language, or in PROLOG to allow user-defined PROLOG functions.