A couple of basic applications of dynamic rewrite rules in Stratego: constant propagation, variable renaming, function inlining, common-subexpression elimination
These are the slides from Helen Bevanās talk ā Itās time to rewrite the rules of change in health and careā to be given on 3rd September 2014 at the APAC Forum, Melbourne Australia.
The APAC Forum (1st to 3rd September 2014) is the premier healthcare conference in the Asia Pacific region. It offers innovative ideas and leading-edge solutions for clinicians, managers, policy-makers and academics seeking to deliver the highest quality healthcare with finite resources and seemingly infinite demand. More details at http://apacforum.com/
The document appears to be a series of dilemmas exploring ethical gray areas without clear right or wrong answers. Each dilemma is presented with two options like "Yes" or "No" but the document suggests the issues are complex with multiple factors to consider. Overall, the document advocates carefully considering context and intentions rather than assuming simple binary choices. It stresses consulting authorities like instructors for guidance on collaborative work. The dilemmas focus on topics like turning in lost items, correcting mistakes, sharing test information, plagiarism, citing sources, and reporting suspicions of cheating.
The document discusses factors that contribute to failures in the United States education system and who should be blamed. It argues that a student's background, including poverty, lack of healthcare, and low birth weight due to issues like smoking during pregnancy, are major causes of educational deficits. Standardized testing does not take these varying backgrounds into account. While educators aim to enable students to direct their own education and careers, external factors like poverty are out of teachers' control and impact student performance more than the efforts of teachers. The document concludes that broader changes are needed to address poverty and inequality, rather than blaming educators, in order to improve school performance.
This document provides an introduction to mod_rewrite, which allows URL matching and transformation in Apache. It outlines key concepts like RewriteRule, RewriteCond, and RewriteFlags. Regular expressions basics are covered, like wildcards and character classes. Examples show URL beautification and conditional rewrites. RewriteMap is described for more complex rewrites using external programs or files. Caveats of mod_rewrite in .htaccess files are noted, such as relative paths and inability to enable RewriteLog.
Publishing involves rewriting your paper with your best handwriting, displaying it for others to see in your most visibly pleasing way. Illustrations can be added and blue or black ink should be used, as this is the last step in the process to finalize your work.
Co-author of a world-class paper written as a PhD-candidate
Dr. Rick Pleijhuis (MD, PhD)
AIOS Internal Medicine, Medical Spectrum Twente
See also: http://youtu.be/yd4RKNYSsYw
A couple of basic applications of dynamic rewrite rules in Stratego: constant propagation, variable renaming, function inlining, common-subexpression elimination
These are the slides from Helen Bevanās talk ā Itās time to rewrite the rules of change in health and careā to be given on 3rd September 2014 at the APAC Forum, Melbourne Australia.
The APAC Forum (1st to 3rd September 2014) is the premier healthcare conference in the Asia Pacific region. It offers innovative ideas and leading-edge solutions for clinicians, managers, policy-makers and academics seeking to deliver the highest quality healthcare with finite resources and seemingly infinite demand. More details at http://apacforum.com/
The document appears to be a series of dilemmas exploring ethical gray areas without clear right or wrong answers. Each dilemma is presented with two options like "Yes" or "No" but the document suggests the issues are complex with multiple factors to consider. Overall, the document advocates carefully considering context and intentions rather than assuming simple binary choices. It stresses consulting authorities like instructors for guidance on collaborative work. The dilemmas focus on topics like turning in lost items, correcting mistakes, sharing test information, plagiarism, citing sources, and reporting suspicions of cheating.
The document discusses factors that contribute to failures in the United States education system and who should be blamed. It argues that a student's background, including poverty, lack of healthcare, and low birth weight due to issues like smoking during pregnancy, are major causes of educational deficits. Standardized testing does not take these varying backgrounds into account. While educators aim to enable students to direct their own education and careers, external factors like poverty are out of teachers' control and impact student performance more than the efforts of teachers. The document concludes that broader changes are needed to address poverty and inequality, rather than blaming educators, in order to improve school performance.
This document provides an introduction to mod_rewrite, which allows URL matching and transformation in Apache. It outlines key concepts like RewriteRule, RewriteCond, and RewriteFlags. Regular expressions basics are covered, like wildcards and character classes. Examples show URL beautification and conditional rewrites. RewriteMap is described for more complex rewrites using external programs or files. Caveats of mod_rewrite in .htaccess files are noted, such as relative paths and inability to enable RewriteLog.
Publishing involves rewriting your paper with your best handwriting, displaying it for others to see in your most visibly pleasing way. Illustrations can be added and blue or black ink should be used, as this is the last step in the process to finalize your work.
Co-author of a world-class paper written as a PhD-candidate
Dr. Rick Pleijhuis (MD, PhD)
AIOS Internal Medicine, Medical Spectrum Twente
See also: http://youtu.be/yd4RKNYSsYw
Clear legal content for business benefitSimplified UK
Ā
With increased consumer protection and activism, legal and marketing stakeholders must work together to help businesses to achieve clarity and customer focus in their communications.
This paper discusses the challenges of climate change and potential solutions. The main challenges are population growth, which increases environmental impacts; the slow response of ecosystems to changes; and international stalemates in climate agreements. Potential solutions include using public transportation to reduce emissions, consuming fewer and more sustainable products, and holding companies responsible for environmental impacts to induce cleaner practices. Small individual efforts can help address climate change issues.
The document summarizes the debate between Alexander Hamilton and Thomas Jefferson over the interpretation of the Necessary and Proper Clause regarding the constitutionality of establishing a national bank. The author argues that Jefferson's strict interpretation is more persuasive. Jefferson believed that powers must be expressly enumerated in the Constitution, otherwise it allows for overreach. A loose interpretation could lead to abuse of implied powers and loss of faith in government. The author concludes that Jefferson's limited view of federal power better protects individual liberties and the original intent of the framers.
This document provides an overview of the typical sections in a research paper or thesis and guidance on how to write each section effectively. It discusses the purpose and content for sections like the title, abstract, introduction, methods, results, discussion, and conclusion. The document also reviews tips for strong writing like rewriting and getting feedback from others. Overall, it aims to help readers understand what should be included in a research paper and how to structure and tell a compelling story through their writing.
Presentation given at the International Conference on
Application and Theory of Petri Nets and Concurrency 2014, in Tunis, Tunisia. You can find the paper manuscript at http://edmundo.lopezbobeda.net/publications .
This document summarizes a presentation on using indexes in Hive to accelerate query performance. It describes how indexes provide an alternative view of data to enable faster lookups compared to full data scans. Example queries demonstrating group by and aggregation are rewritten to use an index on the shipdate column. Performance tests on TPC-H data show the indexed queries outperforming the non-indexed versions by an order of magnitude. Future work is needed to expand rewrite rules and integrate indexing fully into Hive's optimizer.
The document outlines the typical structure and components of a research paper, including an introduction with background and statement of the problem, literature review, methodology, results and data analysis, conclusions and recommendations. It describes the purpose and content that should be included in each chapter and section, such as defining terms, describing the research method and subjects, presenting and interpreting findings, and summarizing conclusions. Proper formatting of references, tables, figures and appendices is also addressed. The overall structure and guidelines provided are meant to help write and organize a research paper in a clear, systematic manner.
This document discusses composing source-to-source data-flow transformations with dependent dynamic rewrite rules. It outlines strategies for basic constant propagation, dead code elimination, and copy propagation. It also discusses issues that can arise with dynamic rewrite rules, such as insufficient dependencies, free variable capture, and escaping variables, and proposes solutions like undefining rules when variables are modified or go out of scope.
This document discusses software design principles and patterns, including:
1) Generic programming allows code to work with different data types through interfaces and abstract base classes. Reflection allows examining and manipulating objects at runtime.
2) The document discusses separation of concerns, loose coupling, and high cohesion as important design principles. It gives an example of dividing an application by feature and concern.
3) The document uses a duck simulation example to illustrate issues that can arise from rigid class hierarchies and inheritance. It proposes using the strategy pattern by defining behavior interfaces and swapping concrete strategy classes to vary behavior while keeping classes loosely coupled and extensible.
Mining Source Code Improvement Patterns from Similar Code Review WorksYuki Ueda
Ā
Yuki Ueda, Takashi Ishio, Akinori Ihara, and Kenichi Matsumoto, "Mining Source Code Improvement Patterns from Similar Code Review Works", In Proc. 13th International Workshop on Software Clones (IWSCā19), 2019
Technical operations is plagued with an unhealthy infatuation of typically untested, imperative code with a high reliance on shared mutable state using dynamically typed languages such as Ruby, Python, Bash, and - ugh - remember Perl? :) In an age where building reliable infrastructure to elastically scale applications and services are paramount to business success, we need to start rethinking the infrastructure engineerās toolkit and guiding principles. This talk will take a look at applying various functional techniques to building and automating infrastructure. From functional package management and congruent configuration to declarative cloud provisioning weāll see just how practical these techniques typically used in functional programming for applications can be used to help build more robust and predictable infrastructures. While specific code examples will be given, the emphasis of the talk will be on guiding principles and functional design.
Slides from my presentation to the Auckland Web Meetup on 15 September 2011. The interactive demos havenāt translated well to PDF. (Downloading disabled to comply with typeface EULA, but I can email you a copy if you drop me a line.)
The document describes strategies for online partial evaluation of programs. It begins by explaining the goal of online partial evaluation and outlining several strategies: constant propagation (Specialize 0), function unfolding (Specialize 1), unfolding only static calls (Specialize 2), memoizing unfoldings (Specialize 3), and specializing function definitions (Specialize 4). Each strategy is then explained in detail with examples showing how it transforms programs during partial evaluation. The strategies aim to optimize programs based on known inputs while avoiding recomputing the same values multiple times.
The document provides an overview of Smarty, a widely used PHP templating system. It discusses that Smarty was created by Andrei Zmievski and separates display logic from controller logic for improved security and ease of use. Key features covered include literal tags, modifiers, and capture/cycle functions that allow for powerful templating capabilities. Examples demonstrate how to output variables, format dates, and alternate content display. Resources listed provide more documentation on Smarty syntax and usage.
The document discusses templates in C++. It explains that templates allow functions and classes to work with different data types using a single code definition. Template functions are called function templates, and template classes are called class templates. The document provides examples of defining class and function templates, and overloading template functions. It demonstrates how templates can be used to create generic functions that operate on multiple types of data.
This document discusses the challenges of evolving mature programming languages like Java. It outlines design principles like encouraging desirable practices, isolating the language from specific APIs, and preferring readability over conciseness. Short-term goals include regularizing the existing language through improvements to generics, type inference, string switches, and catch clauses. Long-term goals include further language features like reification, control abstraction, and concurrency support.
Functional programming languages promise to be easier to test and easier to debug. However, when learning the functional way we often try to translate our current techniques to another language. This is usually not easy and the end result is far from those promises we've heard. Early frustrations might even discourage from further learning.
In this talk I will show you two very simple patterns:
- Designing code around single data structure
- Dealing with impure parts of program like DBs, external services or IO
This should give beginners jump start for their first toy projects and further exploration.
This document provides an agenda and overview for a PowerShell tips and tricks session focused on using PowerShell with Exchange. The session will cover Exchange and PowerShell basics, tips for efficient PowerShell scripting including filtering, objects and properties, and regular expressions. It will also demonstrate message tracking examples and cover using cmdlet extension agents to extend Exchange cmdlets.
Sixteen (16) simple rules for building robust machine learning models. Invited talk for the AMA call of the Research Data Alliance (RDA) Early Career and Engagement Interest Group (ECEIG).
Clear legal content for business benefitSimplified UK
Ā
With increased consumer protection and activism, legal and marketing stakeholders must work together to help businesses to achieve clarity and customer focus in their communications.
This paper discusses the challenges of climate change and potential solutions. The main challenges are population growth, which increases environmental impacts; the slow response of ecosystems to changes; and international stalemates in climate agreements. Potential solutions include using public transportation to reduce emissions, consuming fewer and more sustainable products, and holding companies responsible for environmental impacts to induce cleaner practices. Small individual efforts can help address climate change issues.
The document summarizes the debate between Alexander Hamilton and Thomas Jefferson over the interpretation of the Necessary and Proper Clause regarding the constitutionality of establishing a national bank. The author argues that Jefferson's strict interpretation is more persuasive. Jefferson believed that powers must be expressly enumerated in the Constitution, otherwise it allows for overreach. A loose interpretation could lead to abuse of implied powers and loss of faith in government. The author concludes that Jefferson's limited view of federal power better protects individual liberties and the original intent of the framers.
This document provides an overview of the typical sections in a research paper or thesis and guidance on how to write each section effectively. It discusses the purpose and content for sections like the title, abstract, introduction, methods, results, discussion, and conclusion. The document also reviews tips for strong writing like rewriting and getting feedback from others. Overall, it aims to help readers understand what should be included in a research paper and how to structure and tell a compelling story through their writing.
Presentation given at the International Conference on
Application and Theory of Petri Nets and Concurrency 2014, in Tunis, Tunisia. You can find the paper manuscript at http://edmundo.lopezbobeda.net/publications .
This document summarizes a presentation on using indexes in Hive to accelerate query performance. It describes how indexes provide an alternative view of data to enable faster lookups compared to full data scans. Example queries demonstrating group by and aggregation are rewritten to use an index on the shipdate column. Performance tests on TPC-H data show the indexed queries outperforming the non-indexed versions by an order of magnitude. Future work is needed to expand rewrite rules and integrate indexing fully into Hive's optimizer.
The document outlines the typical structure and components of a research paper, including an introduction with background and statement of the problem, literature review, methodology, results and data analysis, conclusions and recommendations. It describes the purpose and content that should be included in each chapter and section, such as defining terms, describing the research method and subjects, presenting and interpreting findings, and summarizing conclusions. Proper formatting of references, tables, figures and appendices is also addressed. The overall structure and guidelines provided are meant to help write and organize a research paper in a clear, systematic manner.
This document discusses composing source-to-source data-flow transformations with dependent dynamic rewrite rules. It outlines strategies for basic constant propagation, dead code elimination, and copy propagation. It also discusses issues that can arise with dynamic rewrite rules, such as insufficient dependencies, free variable capture, and escaping variables, and proposes solutions like undefining rules when variables are modified or go out of scope.
This document discusses software design principles and patterns, including:
1) Generic programming allows code to work with different data types through interfaces and abstract base classes. Reflection allows examining and manipulating objects at runtime.
2) The document discusses separation of concerns, loose coupling, and high cohesion as important design principles. It gives an example of dividing an application by feature and concern.
3) The document uses a duck simulation example to illustrate issues that can arise from rigid class hierarchies and inheritance. It proposes using the strategy pattern by defining behavior interfaces and swapping concrete strategy classes to vary behavior while keeping classes loosely coupled and extensible.
Mining Source Code Improvement Patterns from Similar Code Review WorksYuki Ueda
Ā
Yuki Ueda, Takashi Ishio, Akinori Ihara, and Kenichi Matsumoto, "Mining Source Code Improvement Patterns from Similar Code Review Works", In Proc. 13th International Workshop on Software Clones (IWSCā19), 2019
Technical operations is plagued with an unhealthy infatuation of typically untested, imperative code with a high reliance on shared mutable state using dynamically typed languages such as Ruby, Python, Bash, and - ugh - remember Perl? :) In an age where building reliable infrastructure to elastically scale applications and services are paramount to business success, we need to start rethinking the infrastructure engineerās toolkit and guiding principles. This talk will take a look at applying various functional techniques to building and automating infrastructure. From functional package management and congruent configuration to declarative cloud provisioning weāll see just how practical these techniques typically used in functional programming for applications can be used to help build more robust and predictable infrastructures. While specific code examples will be given, the emphasis of the talk will be on guiding principles and functional design.
Slides from my presentation to the Auckland Web Meetup on 15 September 2011. The interactive demos havenāt translated well to PDF. (Downloading disabled to comply with typeface EULA, but I can email you a copy if you drop me a line.)
The document describes strategies for online partial evaluation of programs. It begins by explaining the goal of online partial evaluation and outlining several strategies: constant propagation (Specialize 0), function unfolding (Specialize 1), unfolding only static calls (Specialize 2), memoizing unfoldings (Specialize 3), and specializing function definitions (Specialize 4). Each strategy is then explained in detail with examples showing how it transforms programs during partial evaluation. The strategies aim to optimize programs based on known inputs while avoiding recomputing the same values multiple times.
The document provides an overview of Smarty, a widely used PHP templating system. It discusses that Smarty was created by Andrei Zmievski and separates display logic from controller logic for improved security and ease of use. Key features covered include literal tags, modifiers, and capture/cycle functions that allow for powerful templating capabilities. Examples demonstrate how to output variables, format dates, and alternate content display. Resources listed provide more documentation on Smarty syntax and usage.
The document discusses templates in C++. It explains that templates allow functions and classes to work with different data types using a single code definition. Template functions are called function templates, and template classes are called class templates. The document provides examples of defining class and function templates, and overloading template functions. It demonstrates how templates can be used to create generic functions that operate on multiple types of data.
This document discusses the challenges of evolving mature programming languages like Java. It outlines design principles like encouraging desirable practices, isolating the language from specific APIs, and preferring readability over conciseness. Short-term goals include regularizing the existing language through improvements to generics, type inference, string switches, and catch clauses. Long-term goals include further language features like reification, control abstraction, and concurrency support.
Functional programming languages promise to be easier to test and easier to debug. However, when learning the functional way we often try to translate our current techniques to another language. This is usually not easy and the end result is far from those promises we've heard. Early frustrations might even discourage from further learning.
In this talk I will show you two very simple patterns:
- Designing code around single data structure
- Dealing with impure parts of program like DBs, external services or IO
This should give beginners jump start for their first toy projects and further exploration.
This document provides an agenda and overview for a PowerShell tips and tricks session focused on using PowerShell with Exchange. The session will cover Exchange and PowerShell basics, tips for efficient PowerShell scripting including filtering, objects and properties, and regular expressions. It will also demonstrate message tracking examples and cover using cmdlet extension agents to extend Exchange cmdlets.
Sixteen (16) simple rules for building robust machine learning models. Invited talk for the AMA call of the Research Data Alliance (RDA) Early Career and Engagement Interest Group (ECEIG).
Video and slides synchronized, mp3 and slide download available at URL http://bit.ly/1eZv11J.
Simon Ritter discusses the syntax and use of Lambda expressions, focusing on using Streams to greatly simplify the way bulk and aggregate operations are handled in Java. Filmed at qconlondon.com.
Simon Ritter is a Java Technology Evangelist at Oracle Corporation. Simon has been in the IT business since 1984 and holds a Bachelor of Science degree in Physics from Brunel University in the U.K.
Elixir is a functional programming language that is well-suited for building scalable and fault-tolerant applications. The document provides an introduction to Elixir by discussing its roots in Erlang and how it builds upon Erlang's strengths like concurrency, distribution, and fault tolerance. It also demonstrates some basic Elixir concepts like functions, pattern matching, recursion, and the BEAM virtual machine. Finally, it provides examples of real-world applications of Elixir like building Phoenix web applications and developing embedded hardware projects with Nerves.
The document discusses priority queues and their implementations using different data structures. It describes priority queues as structures that allow insertion of comparable keys and removal of the highest priority key. Priority queues can be implemented lazily by inserting keys at the back of a list and finding the maximum key during removal, or eagerly by inserting keys in order and removing from the back. The document also describes binary heaps as a balanced tree structure for implementing priority queues, where each node's key is higher than its children's. Operations like addition and removal on heaps can be done in O(log n) time by swimming or sinking a key through the tree.
Human: Thank you for the summary. Can you provide a more detailed summary in 3
Tony Scalese, Edgewater Ranzal Oracle Financial Data Management (FDM) practice director, presented "Jython Scripting in FDMEE - It's Not That Scary" at KScope14.
Structured grammatical evolution (SGE) is a new genotypic representation for grammatical evolution (GE). It comprises a hierarchical organization of the genes, where each locus is explicitly linked to a non-terminal of the grammar being used. This one-to-one correspondence ensures that the modification of a gene does not affect the derivation options of other non-terminals. We present a comprehensive set of optimization results obtained with problems from three different categories: symbolic regression, path finding, and predictive modeling. In most of the situations SGE outperforms standard GE, confirming the effectiveness of the new representation. To understand the reasons for SGE enhanced performance, we scrutinize its main features. We rely on a set of static measures to model the interactions between the representation and variation operators and assess how they influence the interplay between the genotype-phenotype spaces. The study reveals that the structured organization of SGE promotes an increased locality and is less redundant than standard GE, thus fostering an effective exploration of the search space
The document discusses GS Collections, a Java collections framework developed by Goldman Sachs as an alternative to the standard Java collections. It covers key features of GS Collections such as iteration patterns inspired by Smalltalk, lazy evaluation, memory efficiency through primitive collections, and fluent APIs. It compares performance of GS Collections to standard Java collections and other third-party collections libraries, showing significant memory savings. The document also discusses how method references improve code readability over anonymous classes in the GS Collections Kata training materials.
Similar to Composing Source-to-Source Data-Flow Transformations with Rewriting Strategies and Dependent Dynamic Rewrite Rules (20)
This document discusses syntactic editor services including formatting, syntax coloring, and syntactic completion. It describes how syntactic completion can be provided generically based on a syntax definition. The document also discusses how context-free grammars can be extended with templates to specify formatting layout when pretty-printing abstract syntax trees to text. Templates are used to insert whitespace, line breaks, and indentation to produce readable output.
This document provides an overview of parsing in compiler construction. It discusses context-free grammars and how they are used to generate sentences and parse trees through derivations. It also covers ambiguity that can arise from grammars and various grammar transformations used to eliminate ambiguity, including defining associativity and priority. The dangling else problem is presented as an example of an ambiguous grammar.
This document provides an overview of the Lecture 2 on Declarative Syntax Definition for the CS4200 Compiler Construction course. The lecture covers the specification of syntax definition from which parsers can be derived, the perspective on declarative syntax definition using SDF, and reading material on the SDF3 syntax definition formalism and papers on testing syntax definitions and declarative syntax. It also discusses what syntax is, both in linguistics and programming languages, and how programs can be described in terms of syntactic categories and language constructs. An example Tiger program for solving the n-queens problem is presented to illustrate syntactic categories in Tiger.
This document provides an overview of the CS4200 Compiler Construction course at TU Delft. It discusses the course organization, structure, and assessment. The course is split into two parts - CS4200-A which covers concepts and techniques through lectures, papers, and homework assignments, and CS4200-B which involves building a compiler for a subset of Java as a semester-long project. Students will use the Spoofax language workbench to implement their compiler and will submit assignments through a private GitLab repository.
A Direct Semantics of Declarative Disambiguation RulesEelco Visser
Ā
This document discusses research into providing a direct semantics for declarative disambiguation of expression grammars. It aims to define what disambiguation rules mean, ensure they are safe and complete, and provide an effective implementation strategy. The document outlines key research questions around the meaning, safety, completeness and coverage of disambiguation rules. It also presents contributions around using subtree exclusion patterns to define safe and complete disambiguation for classes of expression grammars, and implementing this in SDF3.
Declarative Type System Specification with StatixEelco Visser
Ā
In this talk I present the design of Statix, a new constraint-based language for the executable specification of type systems. Statix specifications consist of predicates that define the well-formedness of language constructs in terms of built-in and user-defined constraints. Statix has a declarative semantics that defines whether a model satisfies a constraint. The operational semantics of Statix is defined as a sound constraint solving algorithm that searches for a solution for a constraint. The aim of the design is that Statix users can ignore the execution order of constraint solving and think in terms of the declarative semantics.
A distinctive feature of Statix is its use of scope graphs, a language parametric framework for the representation and querying of the name binding facts in programs. Since types depend on name resolution and name resolution may depend on types, it is typically not possible to construct the entire scope graph of a program before type constraint resolution. In (algorithmic) type system specifications this leads to explicit staging of the construction and querying of the type environment (class table, symbol table). Statix automatically stages the construction of the scope graph of a program such that queries are never executed when their answers may be affected by future scope graph extension. In the talk, I will explain the design of Statix by means of examples.
https://eelcovisser.org/post/309/declarative-type-system-specification-with-statix
Compiler Construction | Lecture 17 | Beyond Compiler ConstructionEelco Visser
Ā
Compiler construction techniques are applied beyond general-purpose languages through domain-specific languages (DSLs). The document discusses several DSLs developed using Spoofax including:
- WebDSL for web programming with sub-languages for entities, queries, templates, and access control.
- IceDust for modeling information systems with derived values computed on-demand, incrementally, or eventually consistently.
- PixieDust for client-side web programming with views as derived values updated incrementally.
- PIE for defining software build pipelines as tasks with dynamic dependencies computed incrementally.
The document also outlines several research challenges in compiler construction like high-level declarative language definition, verification of
Domain Specific Languages for Parallel Graph AnalytiX (PGX)Eelco Visser
Ā
This document discusses domain-specific languages (DSLs) for parallel graph analytics using PGX. It describes how DSLs allow users to implement graph algorithms and queries using high-level languages that are then compiled and optimized to run efficiently on PGX. Examples of DSL optimizations like multi-source breadth-first search are provided. The document also outlines the extensible compiler architecture used for DSLs, which can generate code for different backends like shared memory or distributed memory.
Compiler Construction | Lecture 15 | Memory ManagementEelco Visser
Ā
The document discusses different memory management techniques:
1. Reference counting counts the number of pointers to each record and deallocates records with a count of 0.
2. Mark and sweep marks all reachable records from program roots and sweeps unmarked records, adding them to a free list.
3. Copying collection copies reachable records to a "to" space, allowing the original "from" space to be freed without fragmentation.
4. Generational collection focuses collection on younger object generations more frequently to improve efficiency.
Compiler Construction | Lecture 14 | InterpretersEelco Visser
Ā
This document summarizes a lecture on interpreters for programming languages. It discusses how operational semantics can be used to define the meaning of a program through state transitions in an interpreter. It provides examples of defining the semantics of a simple language using DynSem, a domain-specific language for specifying operational semantics. DynSem specifications can be compiled to interpreters that execute programs in the defined language.
Compiler Construction | Lecture 13 | Code GenerationEelco Visser
Ā
The document discusses code generation and optimization techniques, describing compilation schemas that define how language constructs are translated to target code patterns, and covers topics like ensuring correctness of generated code through type checking and verification of static constraints on the target format. It also provides examples of compilation schemas for Tiger language constructs like arithmetic expressions and control flow and discusses generating nested functions.
Compiler Construction | Lecture 12 | Virtual MachinesEelco Visser
Ā
The document discusses the architecture of the Java Virtual Machine (JVM). It describes how the JVM uses threads, a stack, heap, and method area. It explains JVM control flow through bytecode instructions like goto, and how the operand stack is used to perform operations and hold method arguments and return values.
Compiler Construction | Lecture 9 | Constraint ResolutionEelco Visser
Ā
This document provides an overview of constraint resolution in the context of a compiler construction lecture. It discusses unification, which is the basis for many type inference and constraint solving approaches. It also describes separating type checking into constraint generation and constraint solving, and introduces a constraint language that integrates name resolution into constraint resolution through scope graph constraints. Finally, it discusses papers on further developments with this approach, including addressing expressiveness and staging issues in type systems through the Statix DSL for defining type systems.
Compiler Construction | Lecture 8 | Type ConstraintsEelco Visser
Ā
This lecture covers type checking with constraints. It introduces the NaBL2 meta-language for writing type specifications as constraint generators that map a program to constraints. The constraints are then solved to determine if a program is well-typed. NaBL2 supports defining name binding and type structures through scope graphs and constraints over names, types, and scopes. Examples show type checking patterns in NaBL2 including variables, functions, records, and name spaces.
Compiler Construction | Lecture 7 | Type CheckingEelco Visser
Ā
This document summarizes a lecture on type checking. It discusses using constraints to separate the language-specific type checking rules from the language-independent solving algorithm. Constraint-based type checking collects constraints as it traverses the AST, then solves the constraints in any order. This allows type information to be learned gradually and avoids issues with computation order.
Compiler Construction | Lecture 6 | Introduction to Static AnalysisEelco Visser
Ā
Lecture introducing the need for static analysis in addition to parsing, the complications caused by names, and an introduction to name resolution with scope graphs
Best 20 SEO Techniques To Improve Website Visibility In SERPPixlogix Infotech
Ā
Boost your website's visibility with proven SEO techniques! Our latest blog dives into essential strategies to enhance your online presence, increase traffic, and rank higher on search engines. From keyword optimization to quality content creation, learn how to make your site stand out in the crowded digital landscape. Discover actionable tips and expert insights to elevate your SEO game.
Webinar: Designing a schema for a Data WarehouseFederico Razzoli
Ā
Are you new to data warehouses (DWH)? Do you need to check whether your data warehouse follows the best practices for a good design? In both cases, this webinar is for you.
A data warehouse is a central relational database that contains all measurements about a business or an organisation. This data comes from a variety of heterogeneous data sources, which includes databases of any type that back the applications used by the company, data files exported by some applications, or APIs provided by internal or external services.
But designing a data warehouse correctly is a hard task, which requires gathering information about the business processes that need to be analysed in the first place. These processes must be translated into so-called star schemas, which means, denormalised databases where each table represents a dimension or facts.
We will discuss these topics:
- How to gather information about a business;
- Understanding dictionaries and how to identify business entities;
- Dimensions and facts;
- Setting a table granularity;
- Types of facts;
- Types of dimensions;
- Snowflakes and how to avoid them;
- Expanding existing dimensions and facts.
Building Production Ready Search Pipelines with Spark and MilvusZilliz
Ā
Spark is the widely used ETL tool for processing, indexing and ingesting data to serving stack for search. Milvus is the production-ready open-source vector database. In this talk we will show how to use Spark to process unstructured data to extract vector representations, and push the vectors to Milvus vector database for search serving.
Threats to mobile devices are more prevalent and increasing in scope and complexity. Users of mobile devices desire to take full advantage of the features
available on those devices, but many of the features provide convenience and capability but sacrifice security. This best practices guide outlines steps the users can take to better protect personal devices and information.
Ivantiās Patch Tuesday breakdown goes beyond patching your applications and brings you the intelligence and guidance needed to prioritize where to focus your attention first. Catch early analysis on our Ivanti blog, then join industry expert Chris Goettl for the Patch Tuesday Webinar Event. There weāll do a deep dive into each of the bulletins and give guidance on the risks associated with the newly-identified vulnerabilities.
Digital Marketing Trends in 2024 | Guide for Staying AheadWask
Ā
https://www.wask.co/ebooks/digital-marketing-trends-in-2024
Feeling lost in the digital marketing whirlwind of 2024? Technology is changing, consumer habits are evolving, and staying ahead of the curve feels like a never-ending pursuit. This e-book is your compass. Dive into actionable insights to handle the complexities of modern marketing. From hyper-personalization to the power of user-generated content, learn how to build long-term relationships with your audience and unlock the secrets to success in the ever-shifting digital landscape.
OpenID AuthZEN Interop Read Out - AuthorizationDavid Brossard
Ā
During Identiverse 2024 and EIC 2024, members of the OpenID AuthZEN WG got together and demoed their authorization endpoints conforming to the AuthZEN API
Fueling AI with Great Data with Airbyte WebinarZilliz
Ā
This talk will focus on how to collect data from a variety of sources, leveraging this data for RAG and other GenAI use cases, and finally charting your course to productionalization.
Main news related to the CCS TSI 2023 (2023/1695)Jakub Marek
Ā
An English š¬š§ translation of a presentation to the speech I gave about the main changes brought by CCS TSI 2023 at the biggest Czech conference on Communications and signalling systems on Railways, which was held in Clarion Hotel Olomouc from 7th to 9th November 2023 (konferenceszt.cz). Attended by around 500 participants and 200 on-line followers.
The original Czech šØšæ version of the presentation can be found here: https://www.slideshare.net/slideshow/hlavni-novinky-souvisejici-s-ccs-tsi-2023-2023-1695/269688092 .
The videorecording (in Czech) from the presentation is available here: https://youtu.be/WzjJWm4IyPk?si=SImb06tuXGb30BEH .
How to Get CNIC Information System with Paksim Ga.pptxdanishmna97
Ā
Pakdata Cf is a groundbreaking system designed to streamline and facilitate access to CNIC information. This innovative platform leverages advanced technology to provide users with efficient and secure access to their CNIC details.
5th LF Energy Power Grid Model Meet-up SlidesDanBrown980551
Ā
5th Power Grid Model Meet-up
It is with great pleasure that we extend to you an invitation to the 5th Power Grid Model Meet-up, scheduled for 6th June 2024. This event will adopt a hybrid format, allowing participants to join us either through an online Mircosoft Teams session or in person at TU/e located at Den Dolech 2, Eindhoven, Netherlands. The meet-up will be hosted by Eindhoven University of Technology (TU/e), a research university specializing in engineering science & technology.
Power Grid Model
The global energy transition is placing new and unprecedented demands on Distribution System Operators (DSOs). Alongside upgrades to grid capacity, processes such as digitization, capacity optimization, and congestion management are becoming vital for delivering reliable services.
Power Grid Model is an open source project from Linux Foundation Energy and provides a calculation engine that is increasingly essential for DSOs. It offers a standards-based foundation enabling real-time power systems analysis, simulations of electrical power grids, and sophisticated what-if analysis. In addition, it enables in-depth studies and analysis of the electrical power gridās behavior and performance. This comprehensive model incorporates essential factors such as power generation capacity, electrical losses, voltage levels, power flows, and system stability.
Power Grid Model is currently being applied in a wide variety of use cases, including grid planning, expansion, reliability, and congestion studies. It can also help in analyzing the impact of renewable energy integration, assessing the effects of disturbances or faults, and developing strategies for grid control and optimization.
What to expect
For the upcoming meetup we are organizing, we have an exciting lineup of activities planned:
-Insightful presentations covering two practical applications of the Power Grid Model.
-An update on the latest advancements in Power Grid -Model technology during the first and second quarters of 2024.
-An interactive brainstorming session to discuss and propose new feature requests.
-An opportunity to connect with fellow Power Grid Model enthusiasts and users.
āBuilding and Scaling AI Applications with the Nx AI Manager,ā a Presentation...Edge AI and Vision Alliance
Ā
For the full video of this presentation, please visit: https://www.edge-ai-vision.com/2024/06/building-and-scaling-ai-applications-with-the-nx-ai-manager-a-presentation-from-network-optix/
Robin van Emden, Senior Director of Data Science at Network Optix, presents the āBuilding and Scaling AI Applications with the Nx AI Manager,ā tutorial at the May 2024 Embedded Vision Summit.
In this presentation, van Emden covers the basics of scaling edge AI solutions using the Nx tool kit. He emphasizes the process of developing AI models and deploying them globally. He also showcases the conversion of AI models and the creation of effective edge AI pipelines, with a focus on pre-processing, model conversion, selecting the appropriate inference engine for the target hardware and post-processing.
van Emden shows how Nx can simplify the developerās life and facilitate a rapid transition from concept to production-ready applications.He provides valuable insights into developing scalable and efficient edge AI solutions, with a strong focus on practical implementation.
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slackshyamraj55
Ā
Discover the seamless integration of RPA (Robotic Process Automation), COMPOSER, and APM with AWS IDP enhanced with Slack notifications. Explore how these technologies converge to streamline workflows, optimize performance, and ensure secure access, all while leveraging the power of AWS IDP and real-time communication via Slack notifications.
Taking AI to the Next Level in Manufacturing.pdfssuserfac0301
Ā
Read Taking AI to the Next Level in Manufacturing to gain insights on AI adoption in the manufacturing industry, such as:
1. How quickly AI is being implemented in manufacturing.
2. Which barriers stand in the way of AI adoption.
3. How data quality and governance form the backbone of AI.
4. Organizational processes and structures that may inhibit effective AI adoption.
6. Ideas and approaches to help build your organization's AI strategy.
UiPath Test Automation using UiPath Test Suite series, part 6DianaGray10
Ā
Welcome to UiPath Test Automation using UiPath Test Suite series part 6. In this session, we will cover Test Automation with generative AI and Open AI.
UiPath Test Automation with generative AI and Open AI webinar offers an in-depth exploration of leveraging cutting-edge technologies for test automation within the UiPath platform. Attendees will delve into the integration of generative AI, a test automation solution, with Open AI advanced natural language processing capabilities.
Throughout the session, participants will discover how this synergy empowers testers to automate repetitive tasks, enhance testing accuracy, and expedite the software testing life cycle. Topics covered include the seamless integration process, practical use cases, and the benefits of harnessing AI-driven automation for UiPath testing initiatives. By attending this webinar, testers, and automation professionals can gain valuable insights into harnessing the power of AI to optimize their test automation workflows within the UiPath ecosystem, ultimately driving efficiency and quality in software development processes.
What will you get from this session?
1. Insights into integrating generative AI.
2. Understanding how this integration enhances test automation within the UiPath platform
3. Practical demonstrations
4. Exploration of real-world use cases illustrating the benefits of AI-driven test automation for UiPath
Topics covered:
What is generative AI
Test Automation with generative AI and Open AI.
UiPath integration with generative AI
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
UiPath Test Automation using UiPath Test Suite series, part 6
Ā
Composing Source-to-Source Data-Flow Transformations with Rewriting Strategies and Dependent Dynamic Rewrite Rules
1. Composing Source-to-Source Data-Flow
Transformations with Rewriting Strategies and
Dependent Dynamic Rewrite Rules
Karina Olmos & Eelco Visser
Institute of Information & Computing Sciences
Utrecht University
The Netherlands
April 5, 2005
CCā05 Edinburgh
2. Source-to-Source
Transformations
Goal: transformation tools for the working programmer
Transformations on various programming languages
General-purpose languages
(Embedded) domain-speciļ¬c languages
Combine diļ¬erent types of transformations
Program generation and meta-programming
Simpliļ¬cation
(Domain-speciļ¬c) optimization
Data-ļ¬ow transformations
Source-to-source
Transformations on abstract syntax trees
Concise and reusable
http://www.strategoxt.org
Dependent Dynamic Rewrite Rules
3. Source-to-Source Data-Flow Transformations
Goal: transformation tools for the working programmer
Transformations on various programming languages
General-purpose languages
(Embedded) domain-speciļ¬c languages
Combine diļ¬erent types of transformations
Program generation and meta-programming
Simpliļ¬cation
(Domain-speciļ¬c) optimization
Data-ļ¬ow transformations
Source-to-source
Transformations on abstract syntax trees
Concise and reusable
http://www.strategoxt.org
Dependent Dynamic Rewrite Rules
4. Rewriting Strategies and Dynamic Rewrite Rules
Stratego/XT: language + tools for program transformation
XT: infrastructure for transformation systems
Stratego: high-level language for program transformation
Not tied to one type of transformation or language
http://www.strategoxt.org
Dependent Dynamic Rewrite Rules
5. Rewriting Strategies and Dynamic Rewrite Rules
Stratego/XT: language + tools for program transformation
XT: infrastructure for transformation systems
Stratego: high-level language for program transformation
Not tied to one type of transformation or language
Stratego paradigm
Rewrite rules for basic transformation steps
Programmable rewriting strategies for controlling rules
Dynamic rules for context-sensitive transformation
Concrete syntax for patterns
http://www.strategoxt.org
Dependent Dynamic Rewrite Rules
6. Rewriting Strategies and Dynamic Rewrite Rules
Stratego/XT: language + tools for program transformation
XT: infrastructure for transformation systems
Stratego: high-level language for program transformation
Not tied to one type of transformation or language
Stratego paradigm
Rewrite rules for basic transformation steps
Programmable rewriting strategies for controlling rules
Dynamic rules for context-sensitive transformation
Concrete syntax for patterns
Contributions
Dependent dynamic rules
Generic data-ļ¬ow strategies
Combination of transformations
http://www.strategoxt.org
Dependent Dynamic Rewrite Rules
7. Rewrite Rules and Strategies
Constant folding
y := x * (3 + 4) ā y := x * 7
Constant folding rules
EvalAdd : | i + j ] -> | k ] where <add>(i, j) => k
[
|
[
|
EvalMul : | i * j ] -> | k ] where <mul>(i, j) => k
[
|
[
|
AddZero : | 0 + e ] -> | e ]
[
|
[
|
http://www.strategoxt.org
Dependent Dynamic Rewrite Rules
8. Rewrite Rules and Strategies
Constant folding
y := x * (3 + 4) ā y := x * 7
Constant folding rules
EvalAdd : | i + j ] -> | k ] where <add>(i, j) => k
[
|
[
|
EvalMul : | i * j ] -> | k ] where <mul>(i, j) => k
[
|
[
|
AddZero : | 0 + e ] -> | e ]
[
|
[
|
Constant folding strategy (bottom-up)
EvalBinOp = EvalAdd < AddZero < EvalMul < EvalOther
+
+
+
try(s)
= s < id
+
constfold = all(constfold); try(EvalBinOp)
http://www.strategoxt.org
Dependent Dynamic Rewrite Rules
9. Rewrite Rules and Strategies
Constant folding
y := x * (3 + 4)
Constant folding rules
EvalAdd : | i + j ] -> | k ] where <add>(i, j) => k
[
|
[
|
EvalMul : | i * j ] -> | k ] where <mul>(i, j) => k
[
|
[
|
AddZero : | 0 + e ] -> | e ]
[
|
[
|
Constant folding strategy (bottom-up)
EvalBinOp = EvalAdd < AddZero < EvalMul < EvalOther
+
+
+
try(s)
= s < id
+
constfold = all(constfold); try(EvalBinOp)
http://www.strategoxt.org
Dependent Dynamic Rewrite Rules
10. Rewrite Rules and Strategies
Constant folding
y := x * (3 + 4)
Constant folding rules
EvalAdd : | i + j ] -> | k ] where <add>(i, j) => k
[
|
[
|
EvalMul : | i * j ] -> | k ] where <mul>(i, j) => k
[
|
[
|
AddZero : | 0 + e ] -> | e ]
[
|
[
|
Constant folding strategy (bottom-up)
EvalBinOp = EvalAdd < AddZero < EvalMul < EvalOther
+
+
+
try(s)
= s < id
+
constfold = all(constfold); try(EvalBinOp)
http://www.strategoxt.org
Dependent Dynamic Rewrite Rules
11. Rewrite Rules and Strategies
Constant folding
y := x * (3 + 4)
Constant folding rules
EvalAdd : | i + j ] -> | k ] where <add>(i, j) => k
[
|
[
|
EvalMul : | i * j ] -> | k ] where <mul>(i, j) => k
[
|
[
|
AddZero : | 0 + e ] -> | e ]
[
|
[
|
Constant folding strategy (bottom-up)
EvalBinOp = EvalAdd < AddZero < EvalMul < EvalOther
+
+
+
try(s)
= s < id
+
constfold = all(constfold); try(EvalBinOp)
http://www.strategoxt.org
Dependent Dynamic Rewrite Rules
12. Rewrite Rules and Strategies
Constant folding
y := x * (3 + 4)
Constant folding rules
EvalAdd : | i + j ] -> | k ] where <add>(i, j) => k
[
|
[
|
EvalMul : | i * j ] -> | k ] where <mul>(i, j) => k
[
|
[
|
AddZero : | 0 + e ] -> | e ]
[
|
[
|
Constant folding strategy (bottom-up)
EvalBinOp = EvalAdd < AddZero < EvalMul < EvalOther
+
+
+
try(s)
= s < id
+
constfold = all(constfold); try(EvalBinOp)
http://www.strategoxt.org
Dependent Dynamic Rewrite Rules
13. Rewrite Rules and Strategies
Constant folding
y := x * (3 + 4)
Constant folding rules
EvalAdd : | i + j ] -> | k ] where <add>(i, j) => k
[
|
[
|
EvalMul : | i * j ] -> | k ] where <mul>(i, j) => k
[
|
[
|
AddZero : | 0 + e ] -> | e ]
[
|
[
|
Constant folding strategy (bottom-up)
EvalBinOp = EvalAdd < AddZero < EvalMul < EvalOther
+
+
+
try(s)
= s < id
+
constfold = all(constfold); try(EvalBinOp)
http://www.strategoxt.org
Dependent Dynamic Rewrite Rules
14. Rewrite Rules and Strategies
Constant folding
y := x * (3 + 4)
Constant folding rules
EvalAdd : | i + j ] -> | k ] where <add>(i, j) => k
[
|
[
|
EvalMul : | i * j ] -> | k ] where <mul>(i, j) => k
[
|
[
|
AddZero : | 0 + e ] -> | e ]
[
|
[
|
Constant folding strategy (bottom-up)
EvalBinOp = EvalAdd < AddZero < EvalMul < EvalOther
+
+
+
try(s)
= s < id
+
constfold = all(constfold); try(EvalBinOp)
http://www.strategoxt.org
Dependent Dynamic Rewrite Rules
15. Rewrite Rules and Strategies
Constant folding
y := x * 7
Constant folding rules
EvalAdd : | i + j ] -> | k ] where <add>(i, j) => k
[
|
[
|
EvalMul : | i * j ] -> | k ] where <mul>(i, j) => k
[
|
[
|
AddZero : | 0 + e ] -> | e ]
[
|
[
|
Constant folding strategy (bottom-up)
EvalBinOp = EvalAdd < AddZero < EvalMul < EvalOther
+
+
+
try(s)
= s < id
+
constfold = all(constfold); try(EvalBinOp)
http://www.strategoxt.org
Dependent Dynamic Rewrite Rules
16. Rewrite Rules and Strategies
Constant folding
y := x * 7
Constant folding rules
EvalAdd : | i + j ] -> | k ] where <add>(i, j) => k
[
|
[
|
EvalMul : | i * j ] -> | k ] where <mul>(i, j) => k
[
|
[
|
AddZero : | 0 + e ] -> | e ]
[
|
[
|
Constant folding strategy (bottom-up)
EvalBinOp = EvalAdd < AddZero < EvalMul < EvalOther
+
+
+
try(s)
= s < id
+
constfold = all(constfold); try(EvalBinOp)
http://www.strategoxt.org
Dependent Dynamic Rewrite Rules
17. Rewrite Rules and Strategies
Constant folding
y := x * 7
Constant folding rules
EvalAdd : | i + j ] -> | k ] where <add>(i, j) => k
[
|
[
|
EvalMul : | i * j ] -> | k ] where <mul>(i, j) => k
[
|
[
|
AddZero : | 0 + e ] -> | e ]
[
|
[
|
Constant folding strategy (bottom-up)
EvalBinOp = EvalAdd < AddZero < EvalMul < EvalOther
+
+
+
try(s)
= s < id
+
constfold = all(constfold); try(EvalBinOp)
http://www.strategoxt.org
Dependent Dynamic Rewrite Rules
19. Context-Sensitive Transformations
Problem: Rewrite Rules are Context-free
Rewrite rules can only access information in term that is matched
Many Transformations are Context-Sensitive
Constant propagation
Copy propagation
Common-subexpression elimination
Partial evaluation
Function inlining
Dead code elimination
http://www.strategoxt.org
Dependent Dynamic Rewrite Rules
20. Context-Sensitive Transformations
Problem: Rewrite Rules are Context-free
Rewrite rules can only access information in term that is matched
Many Transformations are Context-Sensitive
Constant propagation
Copy propagation
Common-subexpression elimination
Partial evaluation
Function inlining
Dead code elimination
Solution: Dynamic Rewrite Rules
Deļ¬ne rewrite rules during transformation
http://www.strategoxt.org
Dependent Dynamic Rewrite Rules
21. Deļ¬ning and Undeļ¬ning Rules Dynamically
Constant Propagation and Folding in Straight-Line Code
b
c
b
a
:=
:=
:=
:=
1;
b + 3;
foo();
b + c
prop-const =
PropConst < prop-const-assign
+
< (all(prop-const); try(EvalBinOp))
+
prop-const-assign =
| x := <prop-const => e> ]
[
|
; if <is-value> e then
rules( PropConst : | x ] -> | e ] )
[
|
[
|
else
rules( PropConst :- | x ] )
[
|
end
http://www.strategoxt.org
Dependent Dynamic Rewrite Rules
22. Deļ¬ning and Undeļ¬ning Rules Dynamically
Constant Propagation and Folding in Straight-Line Code
b
c
b
a
:=
:=
:=
:=
1;
b + 3;
foo();
b + c
prop-const =
PropConst < prop-const-assign
+
< (all(prop-const); try(EvalBinOp))
+
prop-const-assign =
| x := <prop-const => e> ]
[
|
; if <is-value> e then
rules( PropConst : | x ] -> | e ] )
[
|
[
|
else
rules( PropConst :- | x ] )
[
|
end
http://www.strategoxt.org
Dependent Dynamic Rewrite Rules
23. Deļ¬ning and Undeļ¬ning Rules Dynamically
Constant Propagation and Folding in Straight-Line Code
b
c
b
a
:=
:=
:=
:=
1;
b + 3;
foo();
b + c
prop-const =
PropConst < prop-const-assign
+
< (all(prop-const); try(EvalBinOp))
+
prop-const-assign =
| x := <prop-const => e> ]
[
|
; if <is-value> e then
rules( PropConst : | x ] -> | e ] )
[
|
[
|
else
rules( PropConst :- | x ] )
[
|
end
http://www.strategoxt.org
Dependent Dynamic Rewrite Rules
24. Deļ¬ning and Undeļ¬ning Rules Dynamically
Constant Propagation and Folding in Straight-Line Code
b
c
b
a
:=
:=
:=
:=
1;
b + 3;
foo();
b + c
b -> 1
prop-const =
PropConst < prop-const-assign
+
< (all(prop-const); try(EvalBinOp))
+
prop-const-assign =
| x := <prop-const => e> ]
[
|
; if <is-value> e then
rules( PropConst : | x ] -> | e ] )
[
|
[
|
else
rules( PropConst :- | x ] )
[
|
end
http://www.strategoxt.org
Dependent Dynamic Rewrite Rules
25. Deļ¬ning and Undeļ¬ning Rules Dynamically
Constant Propagation and Folding in Straight-Line Code
b
c
b
a
:=
:=
:=
:=
1;
b + 3;
foo();
b + c
b -> 1
prop-const =
PropConst < prop-const-assign
+
< (all(prop-const); try(EvalBinOp))
+
prop-const-assign =
| x := <prop-const => e> ]
[
|
; if <is-value> e then
rules( PropConst : | x ] -> | e ] )
[
|
[
|
else
rules( PropConst :- | x ] )
[
|
end
http://www.strategoxt.org
Dependent Dynamic Rewrite Rules
26. Deļ¬ning and Undeļ¬ning Rules Dynamically
Constant Propagation and Folding in Straight-Line Code
b
c
b
a
:=
:=
:=
:=
1;
b + 3;
foo();
b + c
b -> 1
prop-const =
PropConst < prop-const-assign
+
< (all(prop-const); try(EvalBinOp))
+
prop-const-assign =
| x := <prop-const => e> ]
[
|
; if <is-value> e then
rules( PropConst : | x ] -> | e ] )
[
|
[
|
else
rules( PropConst :- | x ] )
[
|
end
http://www.strategoxt.org
Dependent Dynamic Rewrite Rules
27. Deļ¬ning and Undeļ¬ning Rules Dynamically
Constant Propagation and Folding in Straight-Line Code
b
c
b
a
:=
:=
:=
:=
1;
1 + 3;
foo();
b + c
b -> 1
prop-const =
PropConst < prop-const-assign
+
< (all(prop-const); try(EvalBinOp))
+
prop-const-assign =
| x := <prop-const => e> ]
[
|
; if <is-value> e then
rules( PropConst : | x ] -> | e ] )
[
|
[
|
else
rules( PropConst :- | x ] )
[
|
end
http://www.strategoxt.org
Dependent Dynamic Rewrite Rules
28. Deļ¬ning and Undeļ¬ning Rules Dynamically
Constant Propagation and Folding in Straight-Line Code
b
c
b
a
:=
:=
:=
:=
1;
1 + 3;
foo();
b + c
b -> 1
prop-const =
PropConst < prop-const-assign
+
< (all(prop-const); try(EvalBinOp))
+
prop-const-assign =
| x := <prop-const => e> ]
[
|
; if <is-value> e then
rules( PropConst : | x ] -> | e ] )
[
|
[
|
else
rules( PropConst :- | x ] )
[
|
end
http://www.strategoxt.org
Dependent Dynamic Rewrite Rules
29. Deļ¬ning and Undeļ¬ning Rules Dynamically
Constant Propagation and Folding in Straight-Line Code
b
c
b
a
:=
:=
:=
:=
1;
4;
foo();
b + c
b -> 1
prop-const =
PropConst < prop-const-assign
+
< (all(prop-const); try(EvalBinOp))
+
prop-const-assign =
| x := <prop-const => e> ]
[
|
; if <is-value> e then
rules( PropConst : | x ] -> | e ] )
[
|
[
|
else
rules( PropConst :- | x ] )
[
|
end
http://www.strategoxt.org
Dependent Dynamic Rewrite Rules
30. Deļ¬ning and Undeļ¬ning Rules Dynamically
Constant Propagation and Folding in Straight-Line Code
b
c
b
a
:=
:=
:=
:=
1;
4;
foo();
b + c
b -> 1
prop-const =
PropConst < prop-const-assign
+
< (all(prop-const); try(EvalBinOp))
+
prop-const-assign =
| x := <prop-const => e> ]
[
|
; if <is-value> e then
rules( PropConst : | x ] -> | e ] )
[
|
[
|
else
rules( PropConst :- | x ] )
[
|
end
http://www.strategoxt.org
Dependent Dynamic Rewrite Rules
31. Deļ¬ning and Undeļ¬ning Rules Dynamically
Constant Propagation and Folding in Straight-Line Code
b
c
b
a
:=
:=
:=
:=
1;
4;
foo();
b + c
b -> 1 & c -> 4
prop-const =
PropConst < prop-const-assign
+
< (all(prop-const); try(EvalBinOp))
+
prop-const-assign =
| x := <prop-const => e> ]
[
|
; if <is-value> e then
rules( PropConst : | x ] -> | e ] )
[
|
[
|
else
rules( PropConst :- | x ] )
[
|
end
http://www.strategoxt.org
Dependent Dynamic Rewrite Rules
32. Deļ¬ning and Undeļ¬ning Rules Dynamically
Constant Propagation and Folding in Straight-Line Code
b
c
b
a
:=
:=
:=
:=
1;
4;
foo();
b + c
b -> 1 & c -> 4
prop-const =
PropConst < prop-const-assign
+
< (all(prop-const); try(EvalBinOp))
+
prop-const-assign =
| x := <prop-const => e> ]
[
|
; if <is-value> e then
rules( PropConst : | x ] -> | e ] )
[
|
[
|
else
rules( PropConst :- | x ] )
[
|
end
http://www.strategoxt.org
Dependent Dynamic Rewrite Rules
33. Deļ¬ning and Undeļ¬ning Rules Dynamically
Constant Propagation and Folding in Straight-Line Code
b
c
b
a
:=
:=
:=
:=
1;
4;
foo();
b + c
b -
& c -> 4
prop-const =
PropConst < prop-const-assign
+
< (all(prop-const); try(EvalBinOp))
+
prop-const-assign =
| x := <prop-const => e> ]
[
|
; if <is-value> e then
rules( PropConst : | x ] -> | e ] )
[
|
[
|
else
rules( PropConst :- | x ] )
[
|
end
http://www.strategoxt.org
Dependent Dynamic Rewrite Rules
34. Deļ¬ning and Undeļ¬ning Rules Dynamically
Constant Propagation and Folding in Straight-Line Code
b
c
b
a
:=
:=
:=
:=
1;
4;
foo();
b + c
b -
& c -> 4
prop-const =
PropConst < prop-const-assign
+
< (all(prop-const); try(EvalBinOp))
+
prop-const-assign =
| x := <prop-const => e> ]
[
|
; if <is-value> e then
rules( PropConst : | x ] -> | e ] )
[
|
[
|
else
rules( PropConst :- | x ] )
[
|
end
http://www.strategoxt.org
Dependent Dynamic Rewrite Rules
35. Deļ¬ning and Undeļ¬ning Rules Dynamically
Constant Propagation and Folding in Straight-Line Code
b
c
b
a
:=
:=
:=
:=
1;
4;
foo();
b + 4
b -
& c -> 4
prop-const =
PropConst < prop-const-assign
+
< (all(prop-const); try(EvalBinOp))
+
prop-const-assign =
| x := <prop-const => e> ]
[
|
; if <is-value> e then
rules( PropConst : | x ] -> | e ] )
[
|
[
|
else
rules( PropConst :- | x ] )
[
|
end
http://www.strategoxt.org
Dependent Dynamic Rewrite Rules
36. Deļ¬ning and Undeļ¬ning Rules Dynamically
Constant Propagation and Folding in Straight-Line Code
b
c
b
a
:=
:=
:=
:=
1;
4;
foo();
b + 4
b -
& c -> 4 & a -
prop-const =
PropConst < prop-const-assign
+
< (all(prop-const); try(EvalBinOp))
+
prop-const-assign =
| x := <prop-const => e> ]
[
|
; if <is-value> e then
rules( PropConst : | x ] -> | e ] )
[
|
[
|
else
rules( PropConst :- | x ] )
[
|
end
http://www.strategoxt.org
Dependent Dynamic Rewrite Rules
37. Properties of Dynamic Rules
Rules are deļ¬ned dynamically
Carry context information
Multiple rules with same name can be deļ¬ned
Rules can be undeļ¬ned
Rules with same left-hand side override old rules
http://www.strategoxt.org
Dependent Dynamic Rewrite Rules
38. Properties of Dynamic Rules
Rules are deļ¬ned dynamically
Carry context information
Multiple rules with same name can be deļ¬ned
Rules can be undeļ¬ned
Rules with same left-hand side override old rules
b := 3;
...
b := 4;
http://www.strategoxt.org
b -> 3
b -> 3
b -> 4
Dependent Dynamic Rewrite Rules
39. Flow-Sensitive Transformations
Flow-Sensitive Constant Propagation
(x := 3;
y := x + 1;
if foo(x) then
(y := 2 * x;
x := y - 2)
else
(x := y;
y := 23);
z := x + y)
(x := 3;
y := 4;
if foo(3) then
(y := 6;
x := 4)
else
(x := 4;
y := 23);
z := 4 + y)
40. Flow-Sensitive Transformations
x := 3
x := 3
x -> 3
Flow-Sensitive Constant Propagation
(x := 3;
y := x + 1;
if foo(x) then
(y := 2 * x;
x := y - 2)
else
(x := y;
y := 23);
z := x + y)
(x := 3;
y := 4;
if foo(3) then
(y := 6;
x := 4)
else
(x := 4;
y := 23);
z := 4 + y)
y := x + 1
y := 4
x -> 3
y -> 4
if foo(x)
if foo(3)
x -> 3
y -> 4
x -> 3
y -> 4
y := 2 * x
y := 6
x := y
x := 4
x -> 3
y -> 6
x := y - 2
x := 4
x -> 4
y -> 4
y := 23
y := 23
x -> 4
y -> 6
x -> 4
y -> 23
fork rule sets and combine at merge point
x -> 4
y z := x + y
z := 4 + y
41. Constant propagation in abstract syntax tree
;
x -> 3
x := 3
;
x := 3
x -> 3
y := x + 1
x -> 3
y -> 4
;
y := 4
x -> 3
y -> 4
if foo(x)
z := x + y
if foo(3)
x -> 3
y -> 4
;
x -> 3 x -> 3
y -> 4 y -> 6
y := 2 * x
y := 6
x := y - 2
x := 4
http://www.strategoxt.org
x -> 4
y -
z := 4 + y
x -> 3
y -> 4
;
x -> 3
y -> 4
x -> 4
y -> 4
x := y
y := 23
x := 4
y := 23
Dependent Dynamic Rewrite Rules
42. Forking and Intersecting Dynamic Rulesets
Flow-sensitive Constant Propagation
prop-const-if =
| if <prop-const> then <id> else <id> ]
[
|
; (|
[if <id> then <prop-const> else <id>]
|
/PropConst |
[if <id> then <id> else <prop-const>]
|)
s1 /R s2 : fork and intersect
http://www.strategoxt.org
Dependent Dynamic Rewrite Rules
43. Propagation through Loops
(a := 1;
i := 0;
while i < m do (
j := a;
a := f();
a := j;
i := i + 1
);
print(a, i, j))
http://www.strategoxt.org
ā
(a := 1;
i := 0;
while i < m do (
j := 1;
a := f();
a := 1;
i := i + 1
);
print(1, i, j))
Dependent Dynamic Rewrite Rules
44. Fixpoint Iteration
Flow-sensitive Constant Propagation
prop-const-while =
?| while e1 do e2 ]
[
|
; (/PropConst* |
[while <prop-const> do <prop-const>]
|)
/R* s ā” ((id /R s) /R s) /R ...)
until ļ¬xedpoint of ruleset is reached
http://www.strategoxt.org
Dependent Dynamic Rewrite Rules
45. Fixpoint Iteration
Flow-sensitive Constant Propagation
prop-const-while =
?| while e1 do e2 ]
[
|
; (/PropConst* |
[while <prop-const> do <prop-const>]
|)
/R* s ā” ((id /R s) /R s) /R ...)
until ļ¬xedpoint of ruleset is reached
prop-const-while terminates:
fewer rules deļ¬ned each iteration
http://www.strategoxt.org
Dependent Dynamic Rewrite Rules
46. Combining Analysis and Transformation
Unreachable code elimination
i := 1;
j := 2;
if j = 2
then i := 3;
else z := foo()
print(i)
http://www.strategoxt.org
ā
i := 1;
j := 2;
i := 3;
print(3)
Dependent Dynamic Rewrite Rules
47. Combining Analysis and Transformation
Unreachable code elimination
i := 1;
j := 2;
if j = 2
then i := 3;
else z := foo()
print(i)
ā
i := 1;
j := 2;
i := 3;
print(3)
EvalIf : | if 0 then e1 else e2 ] -> | e2 ]
[
|
[
|
EvalIf : | if i then e1 else e2 ] -> | e1 ]
[
|
[
|
where <not(eq)>(i,| |)
[0]
http://www.strategoxt.org
Dependent Dynamic Rewrite Rules
48. Combining Analysis and Transformation
Unreachable code elimination
i := 1;
j := 2;
if j = 2
then i := 3;
else z := foo()
print(i)
ā
i := 1;
j := 2;
i := 3;
print(3)
EvalIf : | if 0 then e1 else e2 ] -> | e2 ]
[
|
[
|
EvalIf : | if i then e1 else e2 ] -> | e1 ]
[
|
[
|
where <not(eq)>(i,| |)
[0]
prop-const-if =
| if <prop-const> then <id> else <id> ]
[
|;
(EvalIf; prop-const
< (|
+ [if <id> then <prop-const> else <id>] /PropConst
|
|
[if <id> then <id> else <prop-const>]
|))
http://www.strategoxt.org
Dependent Dynamic Rewrite Rules
49. Combining Analysis and Transformation
Unreachable code elimination
(x := 10;
while A do
if x = 10
then dosomething()
else (dosomethingelse();
x := x + 1);
y := x)
ā
(x := 10;
while A do
dosomething();
y := 10)
Conditional Constant Propagation [Wegman & Zadeck 1991]
Graph analysis + transformation in Vortex [Lerner et al. 2002]
http://www.strategoxt.org
Dependent Dynamic Rewrite Rules
50. Dynamic Rule Scope
let var x := 17
in let var y := x + 1
in let var x := y+1
in () end
end; print(x)
end
ā
let var x := 17
in let var y := 18
in let var x := 19
in () end
end; print(17)
end
Transformation in presence of local variables
Dynamic rule scope restricts lifetime of dynamic rule
See paper
http://www.strategoxt.org
Dependent Dynamic Rewrite Rules
51. Other Issues
Interprocedural transformation
[Olmos & Visser 2003]
Type specialization for Octave
[Bravenboer, Van Dam, Olmos & Visser 2005]
Poly-variant online specialization and unfolding
[Olmos 2005 forthcoming]
Global variables
Mono-variant specialization (summaries)
Aliasing
[Olmos 2005 forthcoming]
Propagation with records and arrays
http://www.strategoxt.org
Dependent Dynamic Rewrite Rules
52. Putting it all together
Conditional Constant Propagation
prop-const =
PropConst < prop-const-assign < prop-const-declare
+
+
< prop-const-let < prop-const-if < prop-const-while
+
+
+
< (all(prop-const); try(EvalBinOp))
+
prop-const-assign =
| x := <prop-const => e> ]
[
|
; if <is-value> e then rules( PropConst.x : | x ] -> | e ] )
[
|
[
|
else rules( PropConst.x :- | x ] ) end
[
|
prop-const-declare =
| var x := <prop-const => e> ]
[
|
; if <is-value> e then rules( PropConst+x : | x ] -> | e ] )
[
|
[
|
else rules( PropConst+x :- | x ] ) end
[
|
prop-const-let =
?| let d* in e* end ] {| PropConst : all(prop-const) |}
[
|;
prop-const-if =
| if <prop-const> then <id> else <id> ]
[
|
; (EvalIf; prop-const
< (| if <id> then <prop-const> else <id> ]
+ [
|
/PropConst | if <id> then <id> else <prop-const> ]
[
|))
prop-const-while =
?| while e1 do e2 ]
[
|
; (| while <prop-const> do <id> ] EvalWhile
[
|;
< (/PropConst* | while <prop-const> do <prop-const> ]
+
[
|))
http://www.strategoxt.org
Dependent Dynamic Rewrite Rules
53. Recapitulation
Rewrite rules for constant folding
Strategies for (generic) traversal
Dynamic rule propagates values
Fork and intersection (union) for ļ¬ow-sensitive transformation
Dynamic rule scopes controls lifetime of rules
http://www.strategoxt.org
Dependent Dynamic Rewrite Rules
54. Recapitulation
Rewrite rules for constant folding
Strategies for (generic) traversal
Dynamic rule propagates values
Fork and intersection (union) for ļ¬ow-sensitive transformation
Dynamic rule scopes controls lifetime of rules
can this be applied to other data-ļ¬ow transformations?
http://www.strategoxt.org
Dependent Dynamic Rewrite Rules
55. Common-Subexpression Elimination
x := a + b;
y := a * b;
while y > a + b do (
a := a + 1;
x := a + b
)
http://www.strategoxt.org
ā
x := a + b;
y := a * b;
while y > x do (
a := a + 1;
x := a + b
)
Dependent Dynamic Rewrite Rules
56. Common-Subexpression Elimination
x := a + b;
y := a * b;
while y > a + b do (
a := a + 1;
x := a + b
)
ā
x := a + b;
y := a * b;
while y > x do (
a := a + 1;
x := a + b
)
CSE with dynamic rule
cse-assign =
| x := <cse => e> ]
[
|
; if <pure-and-not-trivial(|x)> | e ] then
[
|
rules( CSE : | e ] -> | x ] )
[
|
[
|
end
http://www.strategoxt.org
Dependent Dynamic Rewrite Rules
57. Common-Subexpression Elimination
x := a + b;
y := a * b;
while y > a + b do (
a := a + 1;
x := a + b
)
ā
x := a + b;
y := a * b;
while y > x do (
a := a + 1;
x := a + b
)
CSE with dynamic rule
cse-assign =
| x := <cse => e> ]
[
|
; if <pure-and-not-trivial(|x)> | e ] then
[
|
rules( CSE : | e ] -> | x ] )
[
|
[
|
end
This works
http://www.strategoxt.org
Dependent Dynamic Rewrite Rules
58. Common-Subexpression Elimination
x := a + b;
y := a * b;
while y > a + b do (
a := a + 1;
x := a + b
)
ā
x := a + b;
y := a * b;
while y > x do (
a := a + 1;
x := a + b
)
CSE with dynamic rule
cse-assign =
| x := <cse => e> ]
[
|
; if <pure-and-not-trivial(|x)> | e ] then
[
|
rules( CSE : | e ] -> | x ] )
[
|
[
|
end
This works, kind of
http://www.strategoxt.org
Dependent Dynamic Rewrite Rules
59. Problem: Insuļ¬cient Dependency Information
x := a + b;
a := foo();
y := a + b
a + b -> x
http://www.strategoxt.org
x := a + b;
a := foo();
y := x // wrong!
Dependent Dynamic Rewrite Rules
60. Problem: Insuļ¬cient Dependency Information
x := a + b;
a := foo();
y := a + b
a + b -> x
x := a + b;
a := foo();
y := x // wrong!
Analysis
Rule should be undeļ¬ned when any variable changes value
http://www.strategoxt.org
Dependent Dynamic Rewrite Rules
61. Problem: Insuļ¬cient Dependency Information
x := a + b;
a := foo();
y := a + b
a + b -> x
x := a + b;
a := foo();
y := x // wrong!
Analysis
Rule should be undeļ¬ned when any variable changes value
Solution: Dependent Dynamic Rules
Record all dependencies of dynamic rules
rules( R : p1 -> p2 depends on [x1,...,xn] )
Undeļ¬ne all rules depending on dep
undefine-R(|dep)
http://www.strategoxt.org
Dependent Dynamic Rewrite Rules
62. CSE with Dependent Dynamic Rules
cse-assign =
| x := <cse => e> ]
[
|
; where( undefine-CSE(|x) )
; where( <pure-and-not-trivial(|x)> e )
; where( get-var-dependencies => xs )
; rules( CSE : | e ] -> | x ] depends on xs )
[
|
[
|
cse-if =
| if <cse> then <id> else <id> ]
[
|
; ( | if <id> then <cse> else <id> ]
[
|
/CSE | if <id> then <id> else <cse> ]
[
|)
cse-while =
| while <id> do <id> ]
[
|
; (/CSE* | while <cse> do <cse> ]
[
|)
http://www.strategoxt.org
Dependent Dynamic Rewrite Rules
63. Hygienic Program Transformation
Respect variable bindings
Dependent rules avoid
free variable capture
escaping variables
See paper
http://www.strategoxt.org
Dependent Dynamic Rewrite Rules
64. Recapitulation
Rewrite rules for basic transformations
Strategies for control and (generic) traversal
Dynamic rule propagates context information
Fork and intersection (union) for ļ¬ow-sensitive transformation
Dynamic rule scopes and dependent rules for control over
lifetime of rules
Examples
Constant propagation |[ x ]| -> |[ i ]|
Copy propagation |[ x ]| -> |[ y ]|
Common-subexpression elimination |[ e ]| -> |[ x ]|
Forward substitution |[ x ]| -> |[ e ]|
Partial redundancy elimination (down-safe, earliest)
http://www.strategoxt.org
Dependent Dynamic Rewrite Rules
65. Generic Data-Flow Strategies
Observation: most of data-ļ¬ow strategy is boilerplate
Solution: generic data-ļ¬ow strategy
Generalized operators
Intersection and union: /Rs1 Rs2 / and /Rs1 Rs2 /*
Undeļ¬nition of multiple dynamic rules
Instantiation for common-subexpression elimination
cse = forward-prop(fail, id, cse-after | ["CSE"], [], [])
cse-assign =
?| x := e ]
[
|
; where( <pure-and-not-trivial(|x)> | e ] )
[
|
; where( get-var-dependencies => xs )
; rules( CSE : | e ] -> | x ] depends on xs )
[
|
[
|
cse-after = try(cse-assign < CSE)
+
http://www.strategoxt.org
Dependent Dynamic Rewrite Rules
67. Experience with Dynamic Rules
Tiger compiler: sandbox for transformation techniques
bound variable renaming, inlining, constant propagation, copy
propagation, common-subexpression elimination, dead assignment
elimination, partial redundancy elimination, online and oļ¬ine partial
evaluation, loop normalization, loop vectorization, ...
Octave compiler
type specialization, partial evaluation, other data-ļ¬ow
transformations, combined transformations, loop vectorization
Stratego compiler
inlining, specialization, bound-unbound variables analysis, ...
LVM optimizer (functional)
substitutions, inlining, (deforestation, warm fusion)
Java Compiler
name disambiguation, type propagation, assimilation of embedded
domain-speciļ¬c languages
http://www.strategoxt.org
Dependent Dynamic Rewrite Rules
68. Related Work
[Wegman & Zadeck 1991]
SCC: special algorithm for conditional constant propagation
propagation through SSA edges
[Lerner et al. 2002]
integration of analysis and transformation for CFGs
combination of multiple analyses/transformations
[Lacey & de Moor 2001]
temporal logic : ļ¬nd context from occurrence
[Sittampalam, de Moor & Larsen 2004]
regular path queries
incremental analysis after applying transformation
http://www.strategoxt.org
Dependent Dynamic Rewrite Rules
69. Conclusion
Abstract interpretation style of data-ļ¬ow transformation
combination of data-ļ¬ow analysis and transformation
Hygienic: correct treatment of variable binding constructs
avoid free variable capture and escaping variables
scoped transformation rules
Generic data-ļ¬ow strategies
concise speciļ¬cation speciļ¬cation of data-ļ¬ow transformation
combination of multiple transformations
Combination of data-ļ¬ow transformations with other
transformations
reuse of (elements of) transformations
alternative transformation strategies
Stratego/XT 0.14 (pre-release) from www.stratego-language.org
http://www.strategoxt.org
Dependent Dynamic Rewrite Rules
71. Correctness of Transformations
Invariant: rule set valid at current program point
Check: each rule maintains invariant
http://www.strategoxt.org
Dependent Dynamic Rewrite Rules
72. Break and Continue
Only structured control-ļ¬ow supported
Exit from loop: break-R
http://www.strategoxt.org
Dependent Dynamic Rewrite Rules