An Introduction to Graph Rewriting Thomas Huining Feng CHESS, UC Berkeley May.

Slides:



Advertisements
Similar presentations
CPSC 388 – Compiler Design and Construction
Advertisements

Problems and Their Classes
NP-Hard Nattee Niparnan.
Variational Methods for Graphical Models Micheal I. Jordan Zoubin Ghahramani Tommi S. Jaakkola Lawrence K. Saul Presented by: Afsaneh Shirazi.
CS412/413 Introduction to Compilers Radu Rugina Lecture 37: DU Chains and SSA Form 29 Apr 02.
Introduction Complex Engineered Systems
1 CS 201 Compiler Construction Lecture 7 Code Optimizations: Partial Redundancy Elimination.
Generated Waypoint Efficiency: The efficiency considered here is defined as follows: As can be seen from the graph, for the obstruction radius values (200,
© 2007 Pearson Education Chapter 14: Solving and Analyzing Optimization Models.
1 Don´t Care Minimization of *BMDs: Complexity and Algorithms Christoph Scholl Marc Herbstritt Bernd Becker Institute of Computer Science Albert-Ludwigs-University.
TEMPLATE DESIGN © Genetic Algorithm and Poker Rule Induction Wendy Wenjie Xu Supervised by Professor David Aldous, UC.
Model checking dynamic states in GROOVE Arend Rensink Formal Methods and Tools University of Twente.
Maintenance Routing Gábor Maróti CWI, Amsterdam and NS Reizigers, Utrecht Models for Maintenance Routing 2nd AMORE Seminar, Partas, 30.
Decision Tree Algorithm
DAST, Spring © L. Joskowicz 1 Data Structures – LECTURE 1 Introduction Motivation: algorithms and abstract data types Easy problems, hard problems.
In Search of a Phase Transition in the AC-Matching Problem Phokion G. Kolaitis Thomas Raffill Computer Science Department UC Santa Cruz.
Process Scheduling for Performance Estimation and Synthesis of Hardware/Software Systems Slide 1 Process Scheduling for Performance Estimation and Synthesis.
Analysis of Algorithms CS 477/677
Computational Complexity, Physical Mapping III + Perl CIS 667 March 4, 2004.
Planning operation start times for the manufacture of capital products with uncertain processing times and resource constraints D.P. Song, Dr. C.Hicks.
CS 188: Artificial Intelligence Spring 2006 Lecture 2: Queue-Based Search 8/31/2006 Dan Klein – UC Berkeley Many slides over the course adapted from either.
MA/CSSE 474 Theory of Computation
DAST, Spring © L. Joskowicz 1 Data Structures – LECTURE 1 Introduction Motivation: algorithms and abstract data types Easy problems, hard problems.
State-Space Searches. 2 State spaces A state space consists of –A (possibly infinite) set of states The start state represents the initial problem Each.
Page 1 ISMT E-120 Introduction to Microsoft Access & Relational Databases The Influence of Software and Hardware Technologies on Business Productivity.
1 Lab Session-III CSIT-120 Fall 2000 Revising Previous session Data input and output While loop Exercise Limits and Bounds Session III-B (starts on slide.
Game Playing.
Nattee Niparnan. Easy & Hard Problem What is “difficulty” of problem? Difficult for computer scientist to derive algorithm for the problem? Difficult.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 1 Defect testing l Testing programs to establish the presence of system defects.
CSC3315 (Spring 2009)1 CSC 3315 Programming Languages Hamid Harroud School of Science and Engineering, Akhawayn University
A NEW ECO TECHNOLOGY FOR FUNCTIONAL CHANGES AND REMOVING TIMING VIOLATIONS Jui-Hung Hung, Yao-Kai Yeh,Yung-Sheng Tseng and Tsai-Ming Hsieh Dept. of Information.
Z-Town Technical Details Ben Trivett, Drew Switzer, Cameron Jett, Ryan Southard Department of Computer Science and Engineering The Ohio State University.
Exact methods for ALB ALB problem can be considered as a shortest path problem The complete graph need not be developed since one can stop as soon as in.
Chapter 5B: Hardware/Software Codesign / Partitioning EECE **** Embedded System Design.
1 Graph-Based State Spaces Arend Rensink, University of Twente CamPaM 2012 April 2012Graph-Based State Spaces.
Dynamic Program Analysis with Partial Execution and Summary Thomas Huining Feng CHESS, UC Berkeley May 8, 2007 CS.
XP New Perspectives on Microsoft Access 2002 Tutorial 1 1 Microsoft Access 2002 Tutorial 1 – Introduction To Microsoft Access 2002.
Give these a try…. Answers Self Quiz Self Quiz Answers.
COMP261 Lecture 6 Dijkstra’s Algorithm. Connectedness Is this graph connected or not? A Z FF C M N B Y BB S P DDGG AA R F G J L EE CC Q O V D T H W E.
The 14 th IEEE Real-Time and Embedded Technology and Applications Symposium, April 2008 Real-Time Distributed Discrete-Event Execution with Fault Tolerance.
Automated Patch Generation Adapted from Tevfik Bultan’s Lecture.
Chapter 10 Graph Theory Eulerian Cycle and the property of graph theory 10.3 The important property of graph theory and its representation 10.4.
Introduction to Computer Programming CS 126 Lecture 1 Zeke Maier.
ICS 252 Introduction to Computer Design Lecture 12 Winter 2004 Eli Bozorgzadeh Computer Science Department-UCI.
CSCI 4310 Lecture 2: Search. Search Techniques Search is Fundamental to Many AI Techniques.
Bernd Fischer RW713: Compiler and Software Language Engineering.
AS91587 Simultaneous Equations. In mathematics, a system of linear equations (or linear system) is a collection of linear equations involving the same.
Arc Consistency CPSC 322 – CSP 3 Textbook § 4.5 February 2, 2011.
Dr Nick Mitchell (Room CM 224)
Fall 2008Programming Development Techniques 1 Topic 17 Assignment, Local State, and the Environment Model of Evaluation Section 3.1 & 3.2.
C H A P T E R T W O Linking Syntax And Semantics Programming Languages – Principles and Paradigms by Allen Tucker, Robert Noonan.
Ence 627 Decision Analysis for Engineering Project Portfolio Selection: “Optimal Budgeting of Projects Under Uncertainty” Javier Ordóñez.
1 Test Coverage Coverage can be based on: –source code –object code –model –control flow graph –(extended) finite state machines –data flow graph –requirements.
Constructs for Data Organization and Program Control, Scope, Binding, and Parameter Passing. Expression Evaluation.
A Scalable Machine Learning Approach to Go Pierre Baldi and Lin Wu UC Irvine.
Product A Product B Product C A1A1 A2A2 A3A3 B1B1 B2B2 B3B3 B4B4 C1C1 C3C3 C4C4 Turret lathes Vertical mills Center lathes Drills From “Fundamentals of.
Binary Decision Diagrams Prof. Shobha Vasudevan ECE, UIUC ECE 462.
Finite State Machines Logical and Artificial Intelligence in Games Lecture 3a.
Chapter 15 Running Time Analysis. Topics Orders of Magnitude and Big-Oh Notation Running Time Analysis of Algorithms –Counting Statements –Evaluating.
Dr. M. Al-Mulhem Introduction 1 Chapter 6 Type Systems.
Grammars, L-Systems Jim Whitehead UC Santa Cruz School of Engineering courses.soe.ucsc.edu/courses/cmps265/Spring14/01 23 Apr 2014.
Decision Support Systems
CSE 476/876 Optional Course Project
Structural testing, Path Testing
Graph transformation in a Nutshell
Safe Path Planning for an Autonomous Agent in a Hostile Environment
GAME TIME: Solving 2-Step Equations
Solving Systems Check Point Quiz Corrections
Model Transformation with the Ptera Controller
NP-Completeness Reference: Computers and Intractability: A Guide to the Theory of NP-Completeness by Garey and Johnson, W.H. Freeman and Company, 1979.
Presentation transcript:

An Introduction to Graph Rewriting Thomas Huining Feng CHESS, UC Berkeley May 1, 2007 Inspired by Tutorial Introduction to Graph Transformation: A Software Engineering Perspective. Luciano Baresi, Reiko Heckel. ICGT 2002

PacMan: a Motivating Example : Field Field Type : Ghost Ghost : PacMan PacMan : Marble Marble

Our 1 st Rule: pmove b : Field a : Field : PacMan b : Field a : Field : PacMan 3 pmove LHS (Left Hand Side) RHS (Right Hand Side) : Field : Ghost : PacMan : Marble Host Graph Redex Redex finding is a sub-graph isomorphism problem). Multiple redexes?

Our 2 nd Rule: gmove b : Field a : Field : Ghost b : Field a : Field : Ghost gmove : Field : Ghost : PacMan : Marble

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. 5 b : Field a : Field : PacMan b : Field a : Field : PacMan pmove b : Field a : Field : Ghost b : Field a : Field : Ghost gmove

catch Rule 6 b : Field a : Field : Ghost b : Field a : Field : Ghost catch : PacMan : Field : Ghost : PacMan : Marble

catch is actually a “sub-case” of gmove, because: LHS(gmove)  LHS(catch) Assign priority (almost always the same for sub-cases): P(catch) > P(gmove) Important Decision: Which Rule to Choose? 7 b : Field a : Field : Ghost b : Field a : Field : Ghost gmove b : Field a : Field : Ghost b : Field a : Field : Ghost catch : PacMan

Attribute Binding: collect Rule 8 : Field : Ghost : PacMan 3 : marble : Marble : PacMan 4 : marble

Here, m on the LHS serves as a bound variable; on the RHS, it refers to the value bound to. Attribute Binding: collect Rule 9 b : Field a : Field : PacMan m : marble b : Field a : Field : PacMan m+1 : marble collect : Marble : Field : Ghost : PacMan 3 : marble : Marble Field Type Ghost Marble PacMan int marble

Completing the PacMan Game 10 b : Field a : Field : PacMan b : Field a : Field : PacMan pmove b : Field a : Field : Ghost b : Field a : Field : Ghost gmove b : Field a : Field : Ghost b : Field a : Field : Ghost catch b : Field a : Field : PacMan m : marble b : Field a : Field : PacMan m+1 : marble collect : Marble : PacMan sub-case interfering sub-case n P Priority:

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 The Graph Rewriting Problem 11 m < BAG_SIZE b : Field a : Field : PacMan m : marble b : Field a : Field : PacMan m+1 : marble : Marble

The Graph Rewriting Problem 12 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 1.In the host graph, find all redexes according to the rules. Match LHS Check application condition 2.Choose a redex and a rule to apply. 3.Apply the rule. Generate a substitution (unique) isomorphic to RHS Compute new attributes Make substitution (“bridge” w.r.t embedding information)

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 13 C? YN e1e2 C1?C2?

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

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) 15 StartEnd Man 00 1* Start Man int time End Field int delay b : Field d : delay a : Field : Man t : time b : Field d : delay a : Field : Man t+d : time

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. 16