Interactive Rule-based Specification with an Application to Visual Language Definition