An example DFA: reaching definitions
|
|
- Baldwin Sherman
- 5 years ago
- Views:
Transcription
1 Dataflow analysis: what is it? Dataflow analysis A common framework for expressg algorithms that compute formation ab a program Why is such a framework useful? Dataflow analysis: what is it? A common framework for expressg algorithms that compute formation ab a program Why is such a framework useful? Provides a common language, which makes it easier to: communicate your analysis to others compare analyses adapt techniques from one analysis to another reuse implementations (eg: dataflow analysis frameworks) Control Flow Graphs For now, we will use a Control Flow Graph representation of programs each statement becomes a node edges between nodes represent control flow Later we will see other program representations variations on the CFG (eg CFG with basic blocks) other graph based representations Example CFG if (...) { } else { * } if (...) * An example DFA: reachg defitions For each use of a variable, determe what assignments could have set the value beg read from the variable Information useful for: performg constant and copy prop detectg references to undefed variables presentg def/use chas to the programmer buildg other representations, like the DFG Let s try this on an example 1
2 Visual sugar 1: 2: 3: 1: 2: 3: if (...) 5: 6: 5: 6: * 8: 8: 5: 1: 2: 3: 8: 6: Safety When is computed fo safe? Recall tended use of this fo: performg constant and copy prop detectg references to undefed variables presentg def/use chas to the programmer buildg other representations, like the DFG Safety: can have more bdgs than the true answer, but can t miss any Reachg defitions generalized DFA framework geared to computg formation at each program pot (edge) the CFG So generalize problem by statg what should be computed at each program pot For each program pot the CFG, compute the set of defitions (statements) that may reach that pot Notion of safety remas the same Reachg defitions generalized Computed formation at a program pot is a set of var! stmt bdgs eg: { x! s 1, x! s 2, y! s 3 } How do we get the previous fo we wanted? if a var x is used a stmt whose comg fo is, then: 2
3 Reachg defitions generalized Computed formation at a program pot is a set of var! stmt bdgs eg: { x! s 1, x! s 2, y! s 3 } How do we get the previous fo we wanted? if a var x is used a stmt whose comg fo is, then: { s (x! s) 2 } This is a common pattern generalize the problem to defe what formation should be computed at each program pot use the computed formation at the program pots to get the origal fo we wanted 5: 1: 2: 3: 8: 6: 5: 1: 2: 3: 8: 6: Usg constrats to formalize DFA Now that we ve gone through some examples, let s try to precisely express the algorithms for computg dataflow formation We ll model DFA as solvg a system of constrats Each node the CFG will impose constrats relatg formation at predecessor and successor pots Solution to constrats is result of analysis Constrats for reachg defitions Constrats for reachg defitions s: s: = { x! s s 2 stmts } [ { x! s } s: * s: * Usg may-pot-to formation: = [ { x! s x 2 may-pot-to(p) } Usg must-pot-to aswell: = { x! s x 2 must-pot-to(p) Æ s 2 stmts } [ { x! s x 2 may-pot-to(p) } 3
4 Constrats for reachg defitions Constrats for reachg defitions s: if (...) [0] [1] s: if (...) [ 0 ] = Æ [ 1 ] = [0] [1] more generally: 8 i. [ i ] = [0] [1] merge [0] [1] merge = [ 0 ] [ [ 1 ] more generally: = i [ i ] Flow functions The constrat for a statement kd s often have the form: = F s () F s is called a flow function other names for it: dataflow function, transfer function Given formation before statement s, F s () returns formation after statement s Other formulations have the statement s as an explicit parameter to F: given a statement s and some formation, F(s,) returns the gog formation after statement s Flow functions, some issues put edges to a node? gog edges to a node? Flow functions, some issues put edges to a node? the flow functions takes as put a tuple of values, one value for each comg edge gog edges to a node? the flow function returns a tuple of values, one value for each gog edge can also have one flow function per gog edge Flow functions Flow functions are a central component of a dataflow analysis They state constrats on the formation flowg to and of a statement This version of the flow functions is local it applies to a particular statement kd we ll see global flow functions shortly... 4
5 Summary of flow functions Flow functions: Given formation before statement s, F s () returns formation after statement s Flow functions are a central component of a dataflow analysis They state constrats on the formation flowg to and of a statement 5
Programming Languages
CSE 130 : Fall 2008 Programmg Languages Lecture 4: Variables, Environments, Scope News PA 1 due Frida 5pm PA 2 out esterda (due net Fi) Fri) Ranjit Jhala UC San Diego Variables and Bdgs Q: How to use variables
More informationMore Dataflow Analysis
More Dataflow Analysis Steps to building analysis Step 1: Choose lattice Step 2: Choose direction of dataflow (forward or backward) Step 3: Create transfer function Step 4: Choose confluence operator (i.e.,
More informationA Linear Logic Representation for BPEL Process Protocol *
Applied Mathematics & Information Sciences An International Journal 5 (2) (2011), 25S-31S A Lear Logic Representation for BPEL Process Protocol * Jian Wu 1 and Lu J 2 1 Department of Computer Science and
More information7.3.3 A Language With Nested Procedure Declarations
7.3. ACCESS TO NONLOCAL DATA ON THE STACK 443 7.3.3 A Language With Nested Procedure Declarations The C family of languages, and many other familiar languages do not support nested procedures, so we troduce
More informationContextual Analysis (2) Limitations of CFGs (3)
G53CMP: Lecture 5 Contextual Analysis: Scope I Henrik Nilsson University of Nottgham, UK This Lecture Limitations of context-free languages: Why checkg contextual constrats is different from checkg syntactical
More informationComputer Science 312 Fall Prelim 2 SOLUTIONS April 18, 2006
Computer Science 312 Fall 2006 Prelim 2 SOLUTIONS April 18, 2006 1 2 3 4 5 6 7 8 Total Grade /xx /xx /xx /xx /xx /xx /xx /xx /100 Grader 1 1. (xx pots) A. The bary representation of a natural number is
More informationScheduling complex streaming applications on the Cell processor. LIP Research Report RR-LIP
Schedulg complex streamg applications on the Cell processor Matthieu Gallet 1,3,4 Mathias Jacquel 1,3,4 Loris Marchal 2,4 1 ENS Lyon 2 CNRS 3 Université de Lyon 4 LIP laboratory, UMR 5668, ENS Lyon CNRS
More informationImplementing Routing Policy
A routg policy structs the router to spect routes, filter them, and potentially modify their attributes as they are accepted from a peer, advertised to a peer, or redistributed from one routg protocol
More informationCS153: Compilers Lecture 17: Control Flow Graph and Data Flow Analysis
CS153: Compilers Lecture 17: Control Flow Graph and Data Flow Analysis Stephen Chong https://www.seas.harvard.edu/courses/cs153 Announcements Project 5 out Due Tuesday Nov 13 (14 days) Project 6 out Due
More informationThe Phases of a Compiler. Course Overview. In Chapter 4. Syntax Analysis. Syntax Analysis. Multi Pass Compiler. PART I: overview material
Course Overview The Phases of a Compiler PART I: overview material Introduction 2 Language processors (tombstone diagrams, bootstrappg) 3 Architecture of a compiler PART II: side a compiler 4 Sntax analsis
More informationConflicts in LR Parsing and More LR Parsing Types
Conflicts in LR Parsing and More LR Parsing Types Lecture 10 Dr. Sean Peisert ECS 142 Spring 2009 1 Status Project 2 Due Friday, Apr. 24, 11:55pm The usual lecture time is being replaced by a discussion
More informationStatic Analysis for Fast and Accurate Design Space Exploration of Caches
Static Analysis for Fast and Accurate Design Space Exploration of Caches Yun iang, Tulika Mitra Department of Computer Science National University of Sgapore {liangyun,tulika}@comp.nus.edu.sg ABSTRACT
More informationImplementing Routing Policy
Implementg Routg Policy A routg policy structs the router to spect routes, filter them, and potentially modify their attributes as they are accepted from a peer, advertised to a peer, or redistributed
More informationImplementing Routing Policy
A routg policy structs the router to spect routes, filter them, and potentially modify their attributes as they are accepted from a peer, advertised to a peer, or redistributed from one routg protocol
More informationMIT Introduction to Program Analysis and Optimization. Martin Rinard Laboratory for Computer Science Massachusetts Institute of Technology
MIT 6.035 Introduction to Program Analysis and Optimization Martin Rinard Laboratory for Computer Science Massachusetts Institute of Technology Program Analysis Compile-time reasoning about run-time behavior
More informationCS 312, Fall Exam 1
Name: ID number: CS 312, Fall 2003 Exam 1 October 16, 2003 Problem 1 2 3 4 Total Grader Grade 18 24 28 30 There are 4 problems on this exam. Please check now that you have a complete exam booklet with
More informationFuzzy Systems. Fuzzy Systems in Knowledge Engineering. Chapter 4. Christian Jacob. 4. Fuzzy Systems. Fuzzy Systems in Knowledge Engineering
Chapter 4 Fuzzy Systems Knowledge Engeerg Fuzzy Systems Christian Jacob jacob@cpsc.ucalgary.ca Department of Computer Science University of Calgary [Kasabov, 1996] Fuzzy Systems Knowledge Engeerg [Kasabov,
More informationPetri Nets. Petri Nets. Petri Net Example. Systems are specified as a directed bipartite graph. The two kinds of nodes in the graph:
System Design&Methodologies Fö - 1 System Design&Methodologies Fö - 2 Petri Nets 1. Basic Petri Net Model 2. Properties and Analysis of Petri Nets 3. Extended Petri Net Models Petri Nets Systems are specified
More informationCSci 4223 Principles of Programming Languages
Review CSci 4223 Prciples of Programmg Languages Lecture 8 Features learned: functions, tuples, lists, let expressions, options, records, datatypes, case expressions, type synonyms, pattern matchg, exceptions
More informationOn Secure Distributed Data Storage Under Repair Dynamics
On Secure Distributed Data Storage Under Repair Dynamics Sameer Pawar, Salim El Rouayheb, Kannan Ramchandran University of California, Bereley Emails: {spawar,salim,annanr}@eecs.bereley.edu. Abstract We
More informationGlobal Optimization. Lecture Outline. Global flow analysis. Global constant propagation. Liveness analysis. Local Optimization. Global Optimization
Lecture Outline Global Optimization Global flow analysis Global constant propagation Liveness analysis Compiler Design I (2011) 2 Local Optimization Recall the simple basic-block optimizations Constant
More information15-451/651: Design & Analysis of Algorithms November 20, 2018 Lecture #23: Closest Pairs last changed: November 13, 2018
15-451/651: Design & Analysis of Algorithms November 20, 2018 Lecture #23: Closest Pairs last changed: November 13, 2018 1 Prelimaries We ll give two algorithms for the followg closest pair problem: Given
More informationExample. Example. Constant Propagation in SSA
Example x=1 a=x x=2 b=x x=1 x==10 c=x x++ print x Original CFG x 1 =1 a=x 1 x 2 =2 x 3 =φ (x 1,x 2 ) b=x 3 x 4 =1 x 5 = φ(x 4,x 6 ) x 5 ==10 c=x 5 x 6 =x 5 +1 print x 5 CFG in SSA Form In SSA form computing
More informationOn Secure Distributed Data Storage Under Repair Dynamics
On Secure Distributed Data Storage Under Repair Dynamics Sameer Pawar Salim El Rouayheb Kannan Ramchandran Electrical Engeerg and Computer Sciences University of California at Berkeley Technical Report
More informationCSE 501 Midterm Exam: Sketch of Some Plausible Solutions Winter 1997
1) [10 pts] On homework 1, I asked about dead assignment elimination and gave the following sample solution: 8. Give an algorithm for dead assignment elimination that exploits def/use chains to work faster
More informationProgramming Languages Fall 2014
Programming Languages Fall 2014 Lecture 7: Simple Types and Simply-Typed Lambda Calculus Prof. Liang Huang huang@qc.cs.cuny.edu 1 Types stuck terms? how to fix it? 2 Plan First I For today, we ll go back
More informationCompiler Design Spring 2017
Compiler Design Spring 2017 8.6 Live variables Dr. Zoltán Majó Compiler Group Java HotSpot Virtual Machine Oracle Corporation Live variables Foundations for several optimizations If a variable is not live,
More informationIntermediate Representation (IR)
Intermediate Representation (IR) Components and Design Goals for an IR IR encodes all knowledge the compiler has derived about source program. Simple compiler structure source code More typical compiler
More informationPage # 20b -Advanced-DFA. Reading assignment. State Propagation. GEN and KILL sets. Data Flow Analysis
b -Advanced-DFA Reading assignment J. L. Peterson, "Petri Nets," Computing Surveys, 9 (3), September 977, pp. 3-5. Sections -4 State Propagation For reference only M. Pezzè, R. N. Taylor and M. Young,
More information(How Not To Do) Global Optimizations
(How Not To Do) Global Optimizations #1 One-Slide Summary A global optimization changes an entire method (consisting of multiple basic blocks). We must be conservative and only apply global optimizations
More informationLisbon Mobility Simulations for Performance Evaluation of Mobile Networks
Lisbon Mobility Simulations for Performance Evaluation of Mobile Networks Pedro Vieira 1,3, Manuel Vieira 1,2 1 DEETC / Instituto Superior de Engenharia de Lisboa, Tel. +351 21 8317291, FAX +351 21 8317114
More informationWhat If. Static Single Assignment Form. Phi Functions. What does φ(v i,v j ) Mean?
Static Single Assignment Form What If Many of the complexities of optimization and code generation arise from the fact that a given variable may be assigned to in many different places. Thus reaching definition
More informationAn Overview of GCC Architecture (source: wikipedia) Control-Flow Analysis and Loop Detection
An Overview of GCC Architecture (source: wikipedia) CS553 Lecture Control-Flow, Dominators, Loop Detection, and SSA Control-Flow Analysis and Loop Detection Last time Lattice-theoretic framework for data-flow
More informationHomework Assignment #1 Sample Solutions
Homework Assignment # Sample Solutions Due Monday /, at the start of lecture. For the following control flow graph, for the purposes of a forward data flow analysis (such as available expressions), show
More informationCompiler Construction 2009/2010 SSA Static Single Assignment Form
Compiler Construction 2009/2010 SSA Static Single Assignment Form Peter Thiemann March 15, 2010 Outline 1 Static Single-Assignment Form 2 Converting to SSA Form 3 Optimization Algorithms Using SSA 4 Dependencies
More information15-451/651: Design & Analysis of Algorithms April 18, 2016 Lecture #25 Closest Pairs last changed: April 18, 2016
15-451/651: Design & Analysis of Algorithms April 18, 2016 Lecture #25 Closest Pairs last changed: April 18, 2016 1 Prelimaries We ll give two algorithms for the followg closest pair proglem: Given n pots
More informationCS153: Compilers Lecture 23: Static Single Assignment Form
CS153: Compilers Lecture 23: Static Single Assignment Form Stephen Chong https://www.seas.harvard.edu/courses/cs153 Pre-class Puzzle Suppose we want to compute an analysis over CFGs. We have two possible
More informationCS553 Lecture Generalizing Data-flow Analysis 3
Generalizing Data-flow Analysis Announcements Project 2 writeup is available Read Stephenson paper Last Time Control-flow analysis Today C-Breeze Introduction Other types of data-flow analysis Reaching
More information20b -Advanced-DFA. J. L. Peterson, "Petri Nets," Computing Surveys, 9 (3), September 1977, pp
State Propagation Reading assignment J. L. Peterson, "Petri Nets," Computing Surveys, 9 (3), September 1977, pp. 223-252. Sections 1-4 For reference only M. Pezzè, R. N. Taylor and M. Young, Graph Models
More informationCompiler Passes. Optimization. The Role of the Optimizer. Optimizations. The Optimizer (or Middle End) Traditional Three-pass Compiler
Compiler Passes Analysis of input program (front-end) character stream Lexical Analysis Synthesis of output program (back-end) Intermediate Code Generation Optimization Before and after generating machine
More informationCOP-5555 PROGRAMMING LANGUAGEPRINCIPLES NOTES ON RPAL
COP-5555 PROGRAMMING LANGUAGEPRINCIPLES NOTES ON 1. Introduction is a subset of PAL, the Pedagogic Algorithmic Language. There are three versions of PAL:, LPAL, and JPAL. The only one of terest here is.
More informationTransformations on the Complex Γ Plane
2/12/27 Transformations on the Complex 1/7 Transformations on the Complex Γ Plane The usefulness of the complex Γ plane is apparent when we consider aga the termated, lossless transmission le: z = z =
More informationHaving a BLAST with SLAM
Announcements Having a BLAST with SLAM Meetings -, CSCI 7, Fall 00 Moodle problems? Blog problems? Looked at the syllabus on the website? in program analysis Microsoft uses and distributes the Static Driver
More informationOptimization of Test/Diagnosis/Rework Location(s) and Characteristics in Electronic Systems Assembly Using Real-Coded Genetic Algorithms
Proceedgs of the International Test Conference, October 3 Optimization of Test/Diagnosis/Rework Location(s) and Characteristics Electronic Systems Assembly Usg Real-Coded Genetic Algorithms Zhen Shi and
More informationFormal Reasoning about Communication Systems II
Formal Reasong about Communication Systems II Automated Fast-Track Reconfiguration Christoph Kreitz Abstract. We present formal techniques for improvg the performance of group communication systems built
More informationAbout coding style Spring February 9, 2004
About codg style 15-212 Sprg 2004 February 9, 2004 Contents 1 Correctness 2 2 Specification 2 3 Style 2 3.1 if-then- Expressions... 3 3.1.1 Boolean if-then- Expressions... 3 3.1.2 if-then- stead of Pattern
More informationPart 5 Program Analysis Principles and Techniques
1 Part 5 Program Analysis Principles and Techniques Front end 2 source code scanner tokens parser il errors Responsibilities: Recognize legal programs Report errors Produce il Preliminary storage map Shape
More informationOptimizing Finite Automata
Optimizing Finite Automata We can improve the DFA created by MakeDeterministic. Sometimes a DFA will have more states than necessary. For every DFA there is a unique smallest equivalent DFA (fewest states
More informationOn the Improvement of Weighted Page Content Rank
On the Improvement of Weighted Page Content Rank Seifede Kadry and Ali Kalakech Abstract The World Wide Web has become one of the most useful formation resource used for formation retrievals and knowledge
More informationTransformations on the Complex Γ Plane
2/4/2010 Transformations on the Complex G plane present.doc 1/8 Transformations on the Complex Γ Plane The usefulness of the complex Γ plane is apparent when we consider aga the termated, lossless transmission
More informationIntroduction to Machine-Independent Optimizations - 4
Introduction to Machine-Independent Optimizations - 4 Department of Computer Science and Automation Indian Institute of Science Bangalore 560 012 NPTEL Course on Principles of Compiler Design Outline of
More informationIn One Slide. Outline. LR Parsing. Table Construction
LR Parsing Table Construction #1 In One Slide An LR(1) parsing table can be constructed automatically from a CFG. An LR(1) item is a pair made up of a production and a lookahead token; it represents a
More informationFeature-Oriented Modelling in BIP: A Case Study
Feature-Oriented Modellg BIP: A Case Study Cecylia Bocovich Joanne Atlee University of Waterloo Email: {cbocovic, jmatlee}@uwaterloo.ca Abstract In this paper, we vestigate the usage of Behaviour- Interaction-Priority
More informationFinite Automata Theory and Formal Languages TMV027/DIT321 LP4 2016
Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2016 Lecture 15 Ana Bove May 23rd 2016 More on Turing machines; Summary of the course. Overview of today s lecture: Recap: PDA, TM Push-down
More informationData Flow Analysis. CSCE Lecture 9-02/15/2018
Data Flow Analysis CSCE 747 - Lecture 9-02/15/2018 Data Flow Another view - program statements compute and transform data So, look at how that data is passed through the program. Reason about data dependence
More informationECE251 Midterm practice questions, Fall 2010
ECE251 Midterm practice questions, Fall 2010 Patrick Lam October 20, 2010 Bootstrapping In particular, say you have a compiler from C to Pascal which runs on x86, and you want to write a self-hosting Java
More informationFinal Exam CSCI 1101 Computer Science I KEY. Wednesday December 16, 2015 Instructor Muller Boston College. Fall 2015
Fal Exam CSCI 1101 Computer Science I KEY Wednesday December 16, 2015 Instructor Muller Boston College Fall 2015 Please do not write your name on the top of this test. Before readg further, please arrange
More informationLecture Compiler Middle-End
Lecture 16-18 18 Compiler Middle-End Jianwen Zhu Electrical and Computer Engineering University of Toronto Jianwen Zhu 2009 - P. 1 What We Have Done A lot! Compiler Frontend Defining language Generating
More informationExploration of Several Page Rank Algorithms for Link Analysis
Exploration of Several Page Rank Algorithms for Lk Analysis Bip B. Vekariya P.G. Student, Computer Engeerg Department, Dharmsh Desai University, Nadiad, Gujarat, India. Ankit P. Vaishnav Assistant Professor,
More informationArticulating and Enforcing Authorisation Policies with UML and OCL
Articulatg and Enforcg Authorisation Policies with UML and OCL Karsten Sohr Department of Mathematics and Computer Science Universität Bremen Bibliothekstr. 1 28359 Bremen, Germany sohr@tzi.de Gail-Joon
More informationCIS 341 Final Examination 4 May 2018
CIS 341 Final Examination 4 May 2018 1 /21 2 /25 3 /30 4 /16 5 /15 6 /13 Total /120 Do not begin the exam until you are told to do so. You have 120 minutes to complete the exam. There are 16 pages in this
More informationStatic Program Analysis Part 8 control flow analysis
Static Program Analysis Part 8 control flow analysis http://cs.au.dk/~amoeller/spa/ Anders Møller & Michael I. Schwartzbach Computer Science, Aarhus University Agenda Control flow analysis for the -calculus
More informationFormal Languages and Compilers Lecture V: Parse Trees and Ambiguous Gr
Formal Languages and Compilers Lecture V: Parse Trees and Ambiguous Grammars Free University of Bozen-Bolzano Faculty of Computer Science POS Building, Room: 2.03 artale@inf.unibz.it http://www.inf.unibz.it/
More informationThursday, December 23, The attack model: Static Program Analysis
The attack model: Static Program Analysis How making SPA? DFA - Data Flow Analysis CFA - Control Flow Analysis Proving invariance: theorem proving Checking models: model checking Giaco & Ranzato DFA:
More informationCSE Section 10 - Dataflow and Single Static Assignment - Solutions
CSE 401 - Section 10 - Dataflow and Single Static Assignment - Solutions 1. Dataflow Review For each of the following optimizations, list the dataflow analysis that would be most directly applicable. You
More informationTyped Lambda Calculus. Chapter 9 Benjamin Pierce Types and Programming Languages
Typed Lambda Calculus Chapter 9 Benjamin Pierce Types and Programming Languages t ::= x x. t t t Call-by-value small step perational Semantics terms variable v ::= values abstraction x. t abstraction values
More informationHaving a BLAST with SLAM
Having a BLAST with SLAM Meeting, CSCI 555, Fall 20 Announcements Homework 0 due Sat Questions? Move Tue office hours to -5pm 2 Software Model Checking via Counterexample Guided Abstraction Refinement
More informationASKNet: Creating and Evaluating Large Scale Integrated Semantic Networks
ASKNet: Creatg and Evaluatg Large Scale Integrated Semantic Networks Brian Harrgton and Stephen Clark Oxford University Computg Laboratory Wolfson Buildg, Parks Road Oxford, United Kgdom {brian.harrgton,stephen.clark}@comlab.ox.ac.uk
More informationNaturalized Communication and Testing
Naturalized Communication Testg Outle PART : communication exposes the fundamental pipele actions underlyg all hshakes to obta a stard protocol terface for translation-free communication to simplify the
More informationAn XML Viewer for Tabular Forms for use with Mechanical Documentation
An XML Viewer for Tabular Forms for use with Mechanical Documentation Osamu Inoue and Kensei Tsuchida Dept. Information & Computer Sciences Toyo University 2100, Kujirai, Kawagoe Saitama, 350-8585, Japan
More informationData-flow Analysis - Part 2
- Part 2 Department of Computer Science Indian Institute of Science Bangalore 560 012 NPTEL Course on Compiler Design Data-flow analysis These are techniques that derive information about the flow of data
More informationSecond Exam CS 1101 Computer Science I Spring Section 03 KEY. Thursday April 14, Instructor Muller Boston College
Second Exam CS 1101 Computer Science I Sprg 2016 Section 03 KEY Thursday April 14, 2016 Instructor Muller Boston College Before readg further, please arrange to have an empty seat on either side of you.
More informationCMSC 330: Organization of Programming Languages
CMSC 330: Organization of Programming Languages Context Free Grammars 1 Architecture of Compilers, Interpreters Source Analyzer Optimizer Code Generator Abstract Syntax Tree Front End Back End Compiler
More informationData Flow Analysis. Agenda CS738: Advanced Compiler Optimizations. 3-address Code Format. Assumptions
Agenda CS738: Advanced Compiler Optimizations Data Flow Analysis Amey Karkare karkare@cse.iitk.ac.in http://www.cse.iitk.ac.in/~karkare/cs738 Department of CSE, IIT Kanpur Static analysis and compile-time
More informationGood Advice for Type-directed Programming
Good Advice for Type-directed Programmg Aspect-oriented Programmg and Extensible Generic Functions Geoffrey Washburn Stephanie Weirich University of Pennsylvania {geoffw,sweirich}@cis.upenn.edu ABSTRACT
More informationInduction and Semantics in Dafny
15-414 Lecture 11 1 Instructor: Matt Fredrikson Induction and Semantics in Dafny TA: Ryan Wagner Encoding the syntax of Imp Recall the abstract syntax of Imp: a AExp ::= n Z x Var a 1 + a 2 b BExp ::=
More information10/30/18. Dynamic Semantics DYNAMIC SEMANTICS. Operational Semantics. An Example. Operational Semantics Definition Process
Dynamic Semantics DYNAMIC SEMANTICS Describe the meaning of expressions, statements, and program units No single widely acceptable notation or formalism for describing semantics Two common approaches:
More informationCSE P 501 Compilers. SSA Hal Perkins Spring UW CSE P 501 Spring 2018 V-1
CSE P 0 Compilers SSA Hal Perkins Spring 0 UW CSE P 0 Spring 0 V- Agenda Overview of SSA IR Constructing SSA graphs Sample of SSA-based optimizations Converting back from SSA form Sources: Appel ch., also
More informationRepair Systems. Automatic correction of type errors in functional programs. Arjen Langebaerd. Master s thesis Thesis number: INF/SCR-05-79
Repair Systems Automatic correction of type errors functional programs Arjen Langebaerd Master s thesis Thesis number: INF/SCR-05-79 Supervisors: Jurriaan Hage Bastiaan Heeren July 2006 2 Abstract Type
More informationProgramming Language Features. CMSC 330: Organization of Programming Languages. Turing Completeness. Turing Machine.
CMSC 330: Organization of Programming Languages Lambda Calculus Programming Language Features Many features exist simply for convenience Multi-argument functions foo ( a, b, c ) Ø Use currying or tuples
More informationCMSC 330: Organization of Programming Languages
CMSC 330: Organization of Programming Languages Lambda Calculus CMSC 330 1 Programming Language Features Many features exist simply for convenience Multi-argument functions foo ( a, b, c ) Ø Use currying
More informationBottom-Up Parsing. Lecture 11-12
Bottom-Up Parsing Lecture 11-12 (From slides by G. Necula & R. Bodik) 9/22/06 Prof. Hilfinger CS164 Lecture 11 1 Bottom-Up Parsing Bottom-up parsing is more general than topdown parsing And just as efficient
More informationCOP4020 Programming Language Concepts Spring 2017 Sample Final Exam Questions SOLUTIONS
COP4020 Programmg Language Concepts Sprg 2017 Sample Fal Exam Questions SOLUTIONS Disclaimer: This is a collection of sample exam questions, not a sample exam. 1. Add the unary postfix auto-crement operator
More informationLecture Notes: Control Flow Analysis for Functional Languages
Lecture Notes: Control Flow Analysis for Functional Languages 17-355/17-665: Program Analysis (Spring 2017) Jonathan Aldrich aldrich@cs.cmu.edu 1 Analysis of Functional Programs Analyzing functional programs
More information2. The Architectures of Networked Applications. Application Architectures Agenda. Architecture
COMP 2410 Networked Information Systems Networked Information Systems This Series of Six Lectures 2. The Architectures of Networked Applications Network Infrastructure and Architecture 1. Network Infrastructure
More informationContext Free Grammars. CS154 Chris Pollett Mar 1, 2006.
Context Free Grammars CS154 Chris Pollett Mar 1, 2006. Outline Formal Definition Ambiguity Chomsky Normal Form Formal Definitions A context free grammar is a 4-tuple (V, Σ, R, S) where 1. V is a finite
More informationCompiler Optimizations. Chapter 8, Section 8.5 Chapter 9, Section 9.1.7
Compiler Optimizations Chapter 8, Section 8.5 Chapter 9, Section 9.1.7 2 Local vs. Global Optimizations Local: inside a single basic block Simple forms of common subexpression elimination, dead code elimination,
More informationCMSC 330: Organization of Programming Languages
CMSC 330: Organization of Programming Languages Context Free Grammars 1 Architecture of Compilers, Interpreters Source Analyzer Optimizer Code Generator Abstract Syntax Tree Front End Back End Compiler
More informationVector Spatial Big Data Storage and Optimized Query Based on the Multi-Level Hilbert Grid Index in HBase
formation Article Vecr Spatial Big Data Srage Optimized Query Based on Multi-Level Grid Index HBase Hua Jiang 1 ID, Junfeng Kang 2, Zhenhong Du 1,3, *, Feng Zhang 1,3 ID, Xiangzhi Huang 4, Renyi Liu 1,3
More informationLR Parsing LALR Parser Generators
LR Parsing LALR Parser Generators Outline Review of bottom-up parsing Computing the parsing DFA Using parser generators 2 Bottom-up Parsing (Review) A bottom-up parser rewrites the input string to the
More informationEnhancement in Weighted PageRank Algorithm Using VOL
IOSR Journal of Computer Engeerg (IOSR-JCE) e-issn: 2278-0661, p- ISSN: 2278-8727Volume 14, Issue 5 (Sep. - Oct. 2013), PP 135-141 Enhancement Weighted PageRank Algorithm Usg VOL Sonal Tuteja 1 1 (Software
More informationtype environment updated subtype sound
#1 Type Checkg #2 One-Slide Summary A type environment gives types for free variables. You typecheck a let-body with an environment that has been updated to conta the new let-variable. If an object of
More informationData Flow Analysis. Program Analysis
Program Analysis https://www.cse.iitb.ac.in/~karkare/cs618/ Data Flow Analysis Amey Karkare Dept of Computer Science and Engg IIT Kanpur Visiting IIT Bombay karkare@cse.iitk.ac.in karkare@cse.iitb.ac.in
More informationMethod of Semantic Web Service Discovery and Automatic Composition
298 JOURNAL OF EMERGING TECHNOLOGIES IN WEB INTELLIGENCE, VOL. 6, NO. 3, AUGUST 2014 Method of Semantic Web Service Discovery and Automatic Composition Yuem Wang Suqian College, 3 rd Department, Suqian,
More informationCompiler Structure. Data Flow Analysis. Control-Flow Graph. Available Expressions. Data Flow Facts
Compiler Structure Source Code Abstract Syntax Tree Control Flow Graph Object Code CMSC 631 Program Analysis and Understanding Fall 2003 Data Flow Analysis Source code parsed to produce AST AST transformed
More informationDefining syntax using CFGs
Defining syntax using CFGs Roadmap Last time Defined context-free grammar This time CFGs for specifying a language s syntax Language membership List grammars Resolving ambiguity CFG Review G = (N,Σ,P,S)
More informationAdvanced Compiler Design. CSE 231 Instructor: Sorin Lerner
Advanced Compiler Design CSE 231 Instructor: Sorin Lerner Let s look at a compiler if ( ) { x := ; } else { y := ; } ; Parser Compiler Compiler Optimizer Code Gen Exec Let s look at a compiler Compiler
More informationTree-based abstract syntax
Tree-based abstract syntax Ralf Lämmel Software Language Engineering Team University of Koblenz-Landau http://www.softlang.org/ A conditional expression Concrete syntax Abstract syntax Text Tree Tree as
More informationDeclarative Intraprocedural Flow Analysis of Java Source Code
Declarative Intraprocedural Flow Analysis of Java Source Code Emma Nilsson-Nyman Torbjörn Ekman Görel Hedin Eva Magnusson Dept of Computer Science Lund University Programming Tools Group University of
More informationType Checking and Type Equality
Type Checking and Type Equality Type systems are the biggest point of variation across programming languages. Even languages that look similar are often greatly different when it comes to their type systems.
More information