Diagrammatic Representations in Domain-Specific Languages

Konstantinos Tourlas


One emerging approach to reducing the labour and costs of software development favours the specialisation of techniques to particular application domains. The rationale is that programs within a given domain often share enough common features and assumptions to enable the incorporation of substantial support mechanisms into domain-specific programming languages and associated tools.

Instead of being machine-oriented, algorithmic implementations, programs in many domain-specific languages (DSLs) are rather user-level, problem-oriented specifications of solutions. Taken further, this view suggests that the most appropriate representation of programs in many domains is diagrammatic, in a way which derives from existing design notations in the domain.

This thesis conducts an investigation, using mathematical techniques and supported by case studies, of issues arising from the use of diagrammatic representations in DSLs. Its structure is conceptually divided into two parts: the first is concerned with semantic and reasoning issues; the second introduces an approach to describing the syntax and layout of diagrams, in a way which addresses some pragmatic aspects of their use.

The empirical context of our work is that of IEC 1131-3, an industry standard programming language for embedded control systems. The diagrammatic syntax of IEC 1131-3 consists of circuit (i.e. box-and-wire) diagrams, emphasising a data-flow view, and variants of Petri net diagrams, suited to a control-flow view.

The first contribution of the thesis is the formalisation of the diagrammatic syntax and the semantics of IEC 1131-3 languages, as a prerequisite to the application of algebraic techniques. More generally, we outline an approach to the design of diagrammatic DSLs, emphasising compositionality in the semantics of the language so as to allow the development of simple proof systems for inferring properties which are deemed essential in the domain. The control-flow subset of IEC 1131-3 is carefully evaluated, and is subsequently re-designed, to yield a straightforward proof system for a restricted, yet commonly occurring, class of safety properties.

A substantial part of the thesis deals with DSLs in which programs may be represented both textually and diagrammatically, as indeed is the case with IEC 1131-3. We develop a formalisation of the data-flow diagrams in IEC 1131-3 and rigorously demonstrate the match between these diagrams, their internal textual equivalents and their computational interpretation. Using the devices of universal algebra, we formulate a general, rigorous consistency criterion regarding such ``dual'' representations.

Finally, we motivate the need to include pragmatic aspects of diagrams, such as layout, in formalisations. We demonstrate how certain classes of categories can capture both the structure and layout of graph-based notations. Use of this technique is concretely illustrated in terms of control-flow diagrams in IEC 1131-3, yielding a basis on which diagram-driven and layout-sensitive rules of inference can be formulated.

This report is available in the following formats:

Previous | Index | Next