64 research outputs found
A Reference Interpreter for the Graph Programming Language GP 2
GP 2 is an experimental programming language for computing by graph
transformation. An initial interpreter for GP 2, written in the functional
language Haskell, provides a concise and simply structured reference
implementation. Despite its simplicity, the performance of the interpreter is
sufficient for the comparative investigation of a range of test programs. It
also provides a platform for the development of more sophisticated
implementations.Comment: In Proceedings GaM 2015, arXiv:1504.0244
Towards Critical Pair Analysis for the Graph Programming Language GP 2
Part 4: Regular PapersInternational audienceWe present the foundations of critical pair analysis for the graph programming language GP 2. Our goal is to develop a static checker that can prove or refute confluence (functional behaviour) for a large class of graph programs. In this paper, we introduce symbolic critical pairs of GP 2 rule schemata, which are labelled with expressions, and establish the completeness and finiteness of the set of symbolic critical pairs over a finite set of rule schemata. We give a procedure for their construction
The Design of GP 2
This papers defines the syntax and semantics of GP 2, a revised version of
the graph programming language GP. New concepts are illustrated and explained
with example programs. Changes to the first version of GP include an improved
type system for labels, a built-in marking mechanism for nodes and edges, a
more powerful edge predicate for conditional rule schemata, and functions
returning the indegree and outdegree of matched nodes. Moreover, the semantics
of the branching and loop statement have been simplified to allow their
efficient implementation.Comment: In Proceedings WRS 2011, arXiv:1204.531
A Unification Algorithm for GP 2
The graph programming language GP 2 allows to apply sets of ruleschemata (or “attributed” rules) non-deterministically. To analyse conflicts of pro-grams statically, graphs labelled with expressisons are overlayed to construct criticalpairs of rule applications. Each overlay induces a system of equations whose solu-tions represent different conflicts. We present a rule-based unification algorithm forGP expressions that is terminating, sound and complete. For every input equation,the algorithm generates a finite set of substitutions. Soundness means that each ofthese substitutions solves the input equation. Since GP labels are lists constructed byconcatenation, unification modulo associativity and unit law is required. This prob-lem, which is also known as word unification, is infinitary in general but becomesfinitary due to GP’s rule schema syntax and the assumption that rule schemata areleft-linear. Our unification algorithm is complete in that every solution of an inputequation is an instance of some substitution in the generated set
The Semantics of Graph Programs
GP (for Graph Programs) is a rule-based, nondeterministic programming
language for solving graph problems at a high level of abstraction, freeing
programmers from handling low-level data structures. The core of GP consists of
four constructs: single-step application of a set of conditional
graph-transformation rules, sequential composition, branching and iteration. We
present a formal semantics for GP in the style of structural operational
semantics. A special feature of our semantics is the use of finitely failing
programs to define GP's powerful branching and iteration commands
A Fast Graph Program for Computing Minimum Spanning Trees
When using graph transformation rules to implement graph algorithms, a
challenge is to match the efficiency of programs in conventional languages. To
help overcome that challenge, the graph programming language GP 2 features
rooted rules which, under mild conditions, can match in constant time on
bounded degree graphs. In this paper, we present an efficient GP 2 program for
computing minimum spanning trees. We provide empirical performance results as
evidence for the program's subquadratic complexity on bounded degree graphs.
This is achieved using depth-first search as well as rooted graph
transformation. The program is based on Boruvka's algorithm for minimum
spanning trees. Our performance results show that the program's time complexity
is consistent with that of classical implementations of Boruvka's algorithm,
namely O(m log n), where m is the number of edges and n the number of nodes.Comment: In Proceedings GCM 2020, arXiv:2012.0118
Verifying Graph Programs with First-Order Logic
We consider Hoare-style verification for the graph programming language GP 2.
In previous work, graph properties were specified by so-called E-conditions
which extend nested graph conditions. However, this type of assertions is not
easy to comprehend by programmers that are used to formal specifications in
standard first-order logic. In this paper, we present an approach to verify GP
2 programs with a standard first-order logic. We show how to construct a
strongest liberal postcondition with respect to a rule schema and a
precondition. We then extend this construction to obtain strongest liberal
postconditions for arbitrary loop-free programs. Compared with previous work,
this allows to reason about a vastly generalised class of graph programs. In
particular, many programs with nested loops can be verified with the new
calculus.Comment: In Proceedings GCM 2020, arXiv:2012.01181. arXiv admin note:
substantial text overlap with arXiv:2010.1454
Rooted Graph Programs
We present an approach for programming with graph transformation rules in which programs can be as efficient as programs in imperative languages. The basic idea is to equip rules and host graphs with distinguished nodes, so-called roots, and to match roots in rules with roots in host graphs. This enables graph transformation rules to be matched in constant time, provided that host graphs have a bounded node degree (which in practice is often the case). Hence, for example, programs with a linear bound on the number of rule applications run in truly linear time. We demonstrate the feasibility of this approach with a case study in graph colouring
- …