1. Apparatus for constructing a new rule for a domain theory having an associated entity relationship (ER) theory represented by data stored in a file which relates to the domain theory and which can be represented diagrammatically, wherein said domain theory includes on or more existing rules, comprising: (a) display means for displaying visual elements for an ER diagram representing the ER theory; (b) constraints storage means for storing constraints; (c) control means for selecting said visual elements of the ER diagram, means for entering constraints relating to said selected visual elements and storing said related constraints involving the said selected visual elements in said constraints storage means; and (d) rule assembly means for automatically generating the new rule from a relevant portion of the ER theory data corresponding to said selected visual elements and said related constraints stored in said constraints storage means.