Compiling Graph Programs to C

Christopher Peter Bak, Detlef Plump

Research output: Chapter in Book/Report/Conference proceedingConference contribution

Abstract

We show how to generate efficient C code for a high-level domain-specific language for graphs. The experimental language GP 2 is based on graph transformation rules and aims to facilitate formal reasoning on programs. Implementing graph programs is challenging because rule matching is expensive in general. GP 2 addresses this problem by providing rooted rules which under mild conditions can be matched in constant time. Using a search plan, our compiler generates C code for matching rooted graph transformation rules. We present run-time experiments with our implementation in a case study on checking graphs for two-colourability: on grid graphs of up to 100,000 nodes, the compiled GP 2 program is as fast as the tailor-made C program given by Sedgewick.

Original languageEnglish
Title of host publicationProceedings 9th International Conference on Graph Transformation (ICGT 2016)
EditorsRachid Echahed, Mark Minas
PublisherSpringer
Pages102-117
Number of pages16
ISBN (Electronic)978-3-319-40530-8
ISBN (Print)978-3-319-40529-2
DOIs
Publication statusPublished - 2016
Event9th International Conference on Graph Transformation (ICGT 2016) - Vienna, Austria
Duration: 5 Jul 20166 Jul 2016

Publication series

NameLecture Notes in Computer Science
PublisherSpringer
Volume9761

Conference

Conference9th International Conference on Graph Transformation (ICGT 2016)
Country/TerritoryAustria
CityVienna
Period5/07/166/07/16

Bibliographical note

© C. Bak, G. Faulkner, D. Plump & C. Runciman. This is an author-produced version of the published article. Uploaded in accordance with the publisher’s self-archiving policy. Further copying may not be permitted; contact the publisher for details.

Cite this