RELATION GRAMMARS: A FORMALISM FOR SYNTACTIC AND SEMANTIC ANALYSIS OF VISUAL LANGUAGES