An Introduction to Graph Rewriting - PowerPoint PPT Presentation

1 / 16
About This Presentation
Title:

An Introduction to Graph Rewriting

Description:

PacMan : Marble. Combining pmove and gmove. pmove and gmove do not 'interfere' with each other. ... Man. t d : time. Conclusion. Key idea is simple. User ... – PowerPoint PPT presentation

Number of Views:57
Avg rating:3.0/5.0
Slides: 17
Provided by: thoma99
Category:

less

Transcript and Presenter's Notes

Title: An Introduction to Graph Rewriting


1
An Introduction to Graph Rewriting
  • Thomas Huining Fenghttp//www.eecs.berkeley.edu/
    tfeng/CHESS, UC Berkeley
  • May 1, 2007
  • Inspired by Tutorial Introduction to Graph
    Transformation A Software Engineering
    Perspective. Luciano Baresi, Reiko Heckel. ICGT
    2002

2
PacMan a Motivating Example
PacMan
Field
Field
Field
Ghost
Marble
Field
Field
Field
Field
Field
Field
Type
1
1..4
1
0..1
1
0..1
Field
Ghost
PacMan
1
0..1
Marble
3
Our 1st Rule pmove
PacMan
PacMan
LHS (Left Hand Side)
RHS (Right Hand Side)
b Field
a Field
a Field
b Field
Redex finding is a sub-graph isomorphism problem).
Multiple redexes?
Redex
PacMan
Field
Field
Field
Ghost
Marble
Field
Field
Field
Field
Host Graph
Field
Field
4
Our 2nd Rule gmove
Ghost
Ghost
b Field
a Field
a Field
b Field
PacMan
Field
Field
Field
Ghost
Marble
Field
Field
Field
Field
Field
Field
5
Combining pmove and gmove
  • pmove and gmove do not interfere with each
    other.
  • I.e., applying any one does not affect
    applicability of the other.

6
catch Rule
PacMan
Field
Field
Field
Ghost
Marble
Field
Field
Field
Field
Field
Field
7
Important Decision Which Rule to Choose?
  • catch is actually a sub-case of gmove, because
  • LHS(gmove) ? LHS(catch)
  • Assign priority (almost always the same for
    sub-cases)
  • P(catch) gt P(gmove)

8
Attribute Binding collect Rule
PacMan 3 marble
PacMan 4 marble
Field
Field
Field
Ghost
Marble
Field
Field
Field
Field
Field
Field
9
Attribute Binding collect Rule
  • Here, m on the LHS serves as a bound variable on
    the RHS, it refers to the value bound to.

PacMan 3 marble
Field
Field
Field
Ghost
Marble
Field
Field
Field
Field
Field
Field
10
Completing the PacMan Game
Priority
3
interfering
3
sub-case
1
Ghost
Ghost
PacMan
b Field
a Field
a Field
b Field
sub-case
2
11
The Graph Rewriting Problem
  • Common components in the problem
  • Host graph
  • A set of rewriting rules
  • LHS and RHS
  • Attribute binding and transfer
  • Application condition
  • Embedding information

Host Graph Redex
PacMan m marble
PacMan m1 marble
Marble
b Field
a Field
b Field
a Field
m lt BAG_SIZE
12
The Graph Rewriting Problem
  • Common components in the problem
  • Host graph
  • A set of rewriting rules
  • LHS and RHS
  • Attribute binding and transfer
  • Application condition
  • Embedding information
  • Rule application
  • In the host graph, find all redexes according to
    the rules.
  • Match LHS
  • Check application condition
  • Choose a redex and a rule to apply.
  • Apply the rule.
  • Generate a substitution (unique) isomorphic to
    RHS
  • Compute new attributes
  • Make substitution (bridge w.r.t embedding
    information)

13
More on Application Decision
  • We have seen priorities (as a partial order of
    rules).
  • Applications may require other approaches.
  • More flexible rule choosing
  • Combine with control structure
  • Event-driven
  • Combine with state machine

14
More on Application Decision
  • We have seen priorities (as a total order of
    rules).
  • Applications may require other approaches.
  • Maze walking (goal-directed searching)

1
1..4
1
0..1
1
0..1
Field
Entrance
Kid
1
0..1
Exit
15
More on Application Decision
  • We have seen priorities (as a total order of
    rules).
  • Applications may require other approaches.
  • Shortest path (optimizing an objective function)

16
Conclusion
  • Key idea is simple.
  • User-friendly.
  • Expressive.
  • Transformation problems
  • Analysis problems
  • Search problems
  • Optimization problems
  • Complexity due to sub-graph isomorphism on the
    LHS.
  • Rules need to be carefully designed and chosen at
    run time.
  • Depending on the problem and the goal.
  • Problem formulation and algorithm are application
    dependent.
Write a Comment
User Comments (0)
About PowerShow.com