SlideShare une entreprise Scribd logo
1  sur  16
Coen De Roover                           Andy Kellens
                                       Carlos Noguera
Software Languages Lab, Brussels




  Logic-based program transformation
  in symbiosis with Eclipse
Menu

      logic program queries ...
   ... in symbiosis with Eclipse.
     (Smalltalk intermezzo)
logic-based program transformation.
Logic program queries
... over an Eclipse project

                              logic evaluator
                              finds solutions




                              program query
                              quantifies over reified ASTs
Solutions to the logic program query
... over a dummy Eclipse project



                                             single solution
                                             consists of variable bindings




                                   variable binding
                                   reified AST node
Why aren’t all tool builders using this?
... prevalent reification encumbers exploiting query solutions



 node(a,[node(b,[]),node(c,[node(d,[])])).


                                         variable
                                         binding
         a

     b       c

                 d        to be found in IDE
Facilitating adoption by tool builders
... reify(ASTNode) = ASTNode

                               example application:
                               exploiting solutions to a query
                               in Eclipse plugins
Facilitating adoption by tool builders
... reify(ASTNode) = ASTNode

                               example application:
                               querying reified nodes for their context
}
      }                                          public class SuperLogLeaf extends OnlyLoggingLeaf {

Facilitating
  },
  jtExpression(?instance){
                                                   public void acceptVisitor(ComponentVisitor v) {
                                                     super.acceptVisitor(v);
                                 new ?singleton(?argList) },
                                                     v.visitSuperLogLeaf(this);


adoption by
   absolutelyNot(?instance
                                                   }
                                 equals: ?uniqueInstance)
                                                 }

                                                      public class MustAliasLeaf extends Component {

developers
if jtStatement(?s){
     for(?initList; ?iterator.hasNext();
       ?iterator.next();
                                                        public void acceptVisitor(ComponentVisitor v) {
                                                    ?updList) temp = this; alias.");
                                                          System.out.println("Must
                                                          Component
                                                          v.visitMustAliasLeaf(temp);
... example-driven queries
   }                                                  }
                                                        }


                                                      public class MayAliasLeaf extends Component {
if jtMethodDeclaration(?m){                   public Object m(Object o) {
     public static void main(String[] args) { if(getInput() % 2 == 0)
               solutions java.util.Scanner(?argList); o;
       ?scanner := new
                         include                  return
                                                else
               implementation variants
       ?scanner.close();                          return new MayAliasLeaf();
               found by consulting
       ?scanner.next();
                                                }
                                              public void acceptVisitor(ComponentVisitor v)           {
     }         program analyses                 System.out.println("May alias.");
                                                v.visitMayAliasLeaf((MayAliasLeaf)m(this));
   }                                          }
                                                      }

if jtClassDeclaration(?class){
   class !Composite extends* Component {
     ?modList ?type acceptVisitor(?t ?v) {
        System.out.println(?string);
        ?v.?visitMethod(this);
     }
   }                                                  exemplify through
}                                                     familiar code templates
One more thing
... for those who develop Java tools in Smalltalk
                 all three of you ;)




         inspector on
         Smalltalk proxy
         for Java object
One more
thing               Smalltalk FFI              C call                 Java JNI


... demystified
                      S proxy
                                                                         J
                        for J               delegates to
                                                                       object
                       object




                                                           program
                                Smalltalk
                                program
                                                                       sends




                                                            Java
                  receives                                            message
                  message
                                                                      J proxy
                         S
                                            delegates to                for S
                       object
                                                                       object




                      Smalltalk                                      Java native
                                             C callback
                  callback handler                                     method




                   Smalltalk VM                                       Java VM
One more thing
... programming in a Smalltalk-Java hybrid
showProgress: label complete: work while: block            closure as an argument
	    | job listener result promise |
	    promise := Smalltalk.Promise new.
	    job := self new_String: label asJavaValue
                                                           creating a promise
	    	      	     	     IBaristaRunnableWithProgressAndStatus:
	    	      	     	     	      [:m |
	    	      	     	     	      m beginTask_String: label asJavaValue int: work asJavaValue.
	    	      	     	     	      result := [block value] on: Smalltalk.IncrementNotification
	    	      	     	     	      	      	     	     do:
	    	      	     	     	      	      	     	     	     [:ex |
	    	      	     	     	      	      	     	     	     m worked_int: 1.   resuming a Smalltalk exception
	    	      	     	     	      	      	     	     	     ex resume].
	    	      	     	     	      m done.
	    	      	     	     	      JavaWorld.org.eclipse.core.runtime.Status get_OK_STATUS].
	    listener := Smalltalk.BaristaJobListener new.
	    listener doneBlock:
	    	      	     [:event |
	    	      	     promise value: result].
	    job addJobChangeListener_IJobChangeListener: listener.
	    job setUser_boolean: true.
	    job schedule.                                                              resolving the Smalltalk promise
	    ^promise value
                                                                                when the Eclipse job finishes
                      waiting for the value of the promise
Towards program transformation
... by means of pattern-action rules
                                         a la CTs [Kniesel et al.]
definition
      introduceExplicitThis(?e):
         jtExpression(?e){?message(?argList)}),
         [?e parentMethodDeclaration isStatic not],
         => ?e becomes: {this.?message(?argList)})

execution
      if <introduceExplicitThis(?e)> execute


         for each transformation rule:
            actions are executed for each matching ast node
            variable bindings can be passed between rules
         changes are committed to the workspace after all rules have been executed
         Smalltalk side is notified of changes through a listener
Towards program transformation
... by means of pattern-action rules
                                in symbiosis with Eclipse




                                             rewriter of Eclispe
                                               records modifications
                                               when committed to workspace
                                               produces an undo action
                                               retains formatting
Towards program transformation
... code manipulation actions

                         in symbiosis with Eclipse
template
  ?e becomes: {this.?message(?argList)}

new node
  ?this equals: [?e getAST newThisExpression],
  ?e equals: methodInvocation(?this, ?ta, ?name, ?args),
  ?e becomes: methodInvocation(?this, ?ta, ?name, ?args)

compound term
  ?e equals: methodInvocation(?this, ?ta, ?name, ?args),
  ?e becomes: methodInvocation(thisExpression([nil]), ?ta, ?name, ?args)

compound term with templates
  ?e equals: methodInvocation(?this, ?ta, ?name, ?args),
  ?e becomes:methodInvocation({this}, ?typeArguments, ?name, ?arguments)

                                          add:/2, insertBefore:/2, insertAfter:/2
Conclusions
... and future work

enabled by reification through symbiosis
  unique in logic program querying, but trivializes implementation

for now, just a proof of concept
  explore design space of transformation language
program transformation by example
  generalize from the identity transformation on a code snippet

exploit analyses in transformations
  towards “refactoring” for parallelization
Freely available
... website will be launched soon




                                    tabled logic evaluator
                                    regular path queries
                                    example-driven queries
                                    access to Soot analyses
                                    Eclipse extension points

Contenu connexe

Tendances

A recommender system for generalizing and refining code templates
A recommender system for generalizing and refining code templatesA recommender system for generalizing and refining code templates
A recommender system for generalizing and refining code templatesCoen De Roover
 
Virtual Separation of Concerns
Virtual Separation of ConcernsVirtual Separation of Concerns
Virtual Separation of Concernschk49
 
Формальная верификация как средство тестирования (в Java)
Формальная верификация как средство тестирования (в Java)Формальная верификация как средство тестирования (в Java)
Формальная верификация как средство тестирования (в Java)SQALab
 
NDC 2011, C++ 프로그래머를 위한 C#
NDC 2011, C++ 프로그래머를 위한 C#NDC 2011, C++ 프로그래머를 위한 C#
NDC 2011, C++ 프로그래머를 위한 C#tcaesvk
 
Java Tutorial | My Heart
Java Tutorial | My HeartJava Tutorial | My Heart
Java Tutorial | My HeartBui Kiet
 
Java - Generic programming
Java - Generic programmingJava - Generic programming
Java - Generic programmingRiccardo Cardin
 
Java Course 5: Enums, Generics, Assertions
Java Course 5: Enums, Generics, AssertionsJava Course 5: Enums, Generics, Assertions
Java Course 5: Enums, Generics, AssertionsAnton Keks
 
Shiksharth com java_topics
Shiksharth com java_topicsShiksharth com java_topics
Shiksharth com java_topicsRajesh Verma
 
Why Spring <3 Kotlin
Why Spring <3 KotlinWhy Spring <3 Kotlin
Why Spring <3 KotlinVMware Tanzu
 
Java basic tutorial by sanjeevini india
Java basic tutorial by sanjeevini indiaJava basic tutorial by sanjeevini india
Java basic tutorial by sanjeevini indiaSanjeev Tripathi
 
Container Classes
Container ClassesContainer Classes
Container Classesadil raja
 
Java Course 6: Introduction to Agile
Java Course 6: Introduction to AgileJava Course 6: Introduction to Agile
Java Course 6: Introduction to AgileAnton Keks
 
Let's go Developer 2011 sendai Let's go Java Developer (Programming Language ...
Let's go Developer 2011 sendai Let's go Java Developer (Programming Language ...Let's go Developer 2011 sendai Let's go Java Developer (Programming Language ...
Let's go Developer 2011 sendai Let's go Java Developer (Programming Language ...Uehara Junji
 
Managing Binary Compatibility in Scala (Scala Lift Off 2011)
Managing Binary Compatibility in Scala (Scala Lift Off 2011)Managing Binary Compatibility in Scala (Scala Lift Off 2011)
Managing Binary Compatibility in Scala (Scala Lift Off 2011)mircodotta
 
Easy Going Groovy 2nd season on DevLOVE
Easy Going Groovy 2nd season on DevLOVEEasy Going Groovy 2nd season on DevLOVE
Easy Going Groovy 2nd season on DevLOVEUehara Junji
 
Dynamic Analysis - SCOTCH: Improving Test-to-Code Traceability using Slicing ...
Dynamic Analysis - SCOTCH: Improving Test-to-Code Traceability using Slicing ...Dynamic Analysis - SCOTCH: Improving Test-to-Code Traceability using Slicing ...
Dynamic Analysis - SCOTCH: Improving Test-to-Code Traceability using Slicing ...ICSM 2011
 
Modern Java Workshop
Modern Java WorkshopModern Java Workshop
Modern Java WorkshopSimon Ritter
 

Tendances (20)

A recommender system for generalizing and refining code templates
A recommender system for generalizing and refining code templatesA recommender system for generalizing and refining code templates
A recommender system for generalizing and refining code templates
 
Virtual Separation of Concerns
Virtual Separation of ConcernsVirtual Separation of Concerns
Virtual Separation of Concerns
 
Формальная верификация как средство тестирования (в Java)
Формальная верификация как средство тестирования (в Java)Формальная верификация как средство тестирования (в Java)
Формальная верификация как средство тестирования (в Java)
 
NDC 2011, C++ 프로그래머를 위한 C#
NDC 2011, C++ 프로그래머를 위한 C#NDC 2011, C++ 프로그래머를 위한 C#
NDC 2011, C++ 프로그래머를 위한 C#
 
Java Tutorial | My Heart
Java Tutorial | My HeartJava Tutorial | My Heart
Java Tutorial | My Heart
 
Java - Generic programming
Java - Generic programmingJava - Generic programming
Java - Generic programming
 
Java Course 5: Enums, Generics, Assertions
Java Course 5: Enums, Generics, AssertionsJava Course 5: Enums, Generics, Assertions
Java Course 5: Enums, Generics, Assertions
 
Java mcq
Java mcqJava mcq
Java mcq
 
Shiksharth com java_topics
Shiksharth com java_topicsShiksharth com java_topics
Shiksharth com java_topics
 
Why Spring <3 Kotlin
Why Spring <3 KotlinWhy Spring <3 Kotlin
Why Spring <3 Kotlin
 
Java basic tutorial by sanjeevini india
Java basic tutorial by sanjeevini indiaJava basic tutorial by sanjeevini india
Java basic tutorial by sanjeevini india
 
Container Classes
Container ClassesContainer Classes
Container Classes
 
Java Course 6: Introduction to Agile
Java Course 6: Introduction to AgileJava Course 6: Introduction to Agile
Java Course 6: Introduction to Agile
 
Let's go Developer 2011 sendai Let's go Java Developer (Programming Language ...
Let's go Developer 2011 sendai Let's go Java Developer (Programming Language ...Let's go Developer 2011 sendai Let's go Java Developer (Programming Language ...
Let's go Developer 2011 sendai Let's go Java Developer (Programming Language ...
 
Java Tutorial
Java Tutorial Java Tutorial
Java Tutorial
 
Managing Binary Compatibility in Scala (Scala Lift Off 2011)
Managing Binary Compatibility in Scala (Scala Lift Off 2011)Managing Binary Compatibility in Scala (Scala Lift Off 2011)
Managing Binary Compatibility in Scala (Scala Lift Off 2011)
 
Easy Going Groovy 2nd season on DevLOVE
Easy Going Groovy 2nd season on DevLOVEEasy Going Groovy 2nd season on DevLOVE
Easy Going Groovy 2nd season on DevLOVE
 
Java Basics
Java BasicsJava Basics
Java Basics
 
Dynamic Analysis - SCOTCH: Improving Test-to-Code Traceability using Slicing ...
Dynamic Analysis - SCOTCH: Improving Test-to-Code Traceability using Slicing ...Dynamic Analysis - SCOTCH: Improving Test-to-Code Traceability using Slicing ...
Dynamic Analysis - SCOTCH: Improving Test-to-Code Traceability using Slicing ...
 
Modern Java Workshop
Modern Java WorkshopModern Java Workshop
Modern Java Workshop
 

Similaire à Logic-based program transformation in symbiosis with Eclipse

Java Performance Tuning
Java Performance TuningJava Performance Tuning
Java Performance TuningMinh Hoang
 
FP in Java - Project Lambda and beyond
FP in Java - Project Lambda and beyondFP in Java - Project Lambda and beyond
FP in Java - Project Lambda and beyondMario Fusco
 
Владимир Иванов. Java 8 и JVM: что нового в HotSpot
Владимир Иванов. Java 8 и JVM: что нового в HotSpotВладимир Иванов. Java 8 и JVM: что нового в HotSpot
Владимир Иванов. Java 8 и JVM: что нового в HotSpotVolha Banadyseva
 
Scala clojure techday_2011
Scala clojure techday_2011Scala clojure techday_2011
Scala clojure techday_2011Thadeu Russo
 
Clojure - A new Lisp
Clojure - A new LispClojure - A new Lisp
Clojure - A new Lispelliando dias
 
Virtualizing Java in Java (jug.ru)
Virtualizing Java in Java (jug.ru)Virtualizing Java in Java (jug.ru)
Virtualizing Java in Java (jug.ru)aragozin
 
RxJava и Android. Плюсы, минусы, подводные камни
RxJava и Android. Плюсы, минусы, подводные камниRxJava и Android. Плюсы, минусы, подводные камни
RxJava и Android. Плюсы, минусы, подводные камниStfalcon Meetups
 
Framework engineering JCO 2011
Framework engineering JCO 2011Framework engineering JCO 2011
Framework engineering JCO 2011YoungSu Son
 
CogLab Information.htmlCogLab InformationCogLabs for this
CogLab Information.htmlCogLab InformationCogLabs for this CogLab Information.htmlCogLab InformationCogLabs for this
CogLab Information.htmlCogLab InformationCogLabs for this WilheminaRossi174
 
4Developers 2015: Programowanie synchroniczne i asynchroniczne - dwa światy k...
4Developers 2015: Programowanie synchroniczne i asynchroniczne - dwa światy k...4Developers 2015: Programowanie synchroniczne i asynchroniczne - dwa światy k...
4Developers 2015: Programowanie synchroniczne i asynchroniczne - dwa światy k...PROIDEA
 
Industrial Strength Groovy - Tools for the Professional Groovy Developer: Pau...
Industrial Strength Groovy - Tools for the Professional Groovy Developer: Pau...Industrial Strength Groovy - Tools for the Professional Groovy Developer: Pau...
Industrial Strength Groovy - Tools for the Professional Groovy Developer: Pau...Paul King
 
比XML更好用的Java Annotation
比XML更好用的Java Annotation比XML更好用的Java Annotation
比XML更好用的Java Annotationjavatwo2011
 
The Mayans Lost Guide to RxJava on Android
The Mayans Lost Guide to RxJava on AndroidThe Mayans Lost Guide to RxJava on Android
The Mayans Lost Guide to RxJava on AndroidFernando Cejas
 
Have Your Cake and Eat It Too: Meta-Programming Techniques for Java
Have Your Cake and Eat It Too: Meta-Programming Techniques for JavaHave Your Cake and Eat It Too: Meta-Programming Techniques for Java
Have Your Cake and Eat It Too: Meta-Programming Techniques for JavaHoward Lewis Ship
 
Postdoc symposium - A Logic Meta-Programming Foundation for Example-Driven Pa...
Postdoc symposium - A Logic Meta-Programming Foundation for Example-Driven Pa...Postdoc symposium - A Logic Meta-Programming Foundation for Example-Driven Pa...
Postdoc symposium - A Logic Meta-Programming Foundation for Example-Driven Pa...ICSM 2011
 
A Logic Meta-Programming Foundation for Example-Driven Pattern Detection in O...
A Logic Meta-Programming Foundation for Example-Driven Pattern Detection in O...A Logic Meta-Programming Foundation for Example-Driven Pattern Detection in O...
A Logic Meta-Programming Foundation for Example-Driven Pattern Detection in O...Coen De Roover
 

Similaire à Logic-based program transformation in symbiosis with Eclipse (20)

Java Performance Tuning
Java Performance TuningJava Performance Tuning
Java Performance Tuning
 
FP in Java - Project Lambda and beyond
FP in Java - Project Lambda and beyondFP in Java - Project Lambda and beyond
FP in Java - Project Lambda and beyond
 
Владимир Иванов. Java 8 и JVM: что нового в HotSpot
Владимир Иванов. Java 8 и JVM: что нового в HotSpotВладимир Иванов. Java 8 и JVM: что нового в HotSpot
Владимир Иванов. Java 8 и JVM: что нового в HotSpot
 
Scala clojure techday_2011
Scala clojure techday_2011Scala clojure techday_2011
Scala clojure techday_2011
 
Clojure - A new Lisp
Clojure - A new LispClojure - A new Lisp
Clojure - A new Lisp
 
Virtualizing Java in Java (jug.ru)
Virtualizing Java in Java (jug.ru)Virtualizing Java in Java (jug.ru)
Virtualizing Java in Java (jug.ru)
 
RxJava и Android. Плюсы, минусы, подводные камни
RxJava и Android. Плюсы, минусы, подводные камниRxJava и Android. Плюсы, минусы, подводные камни
RxJava и Android. Плюсы, минусы, подводные камни
 
Framework engineering JCO 2011
Framework engineering JCO 2011Framework engineering JCO 2011
Framework engineering JCO 2011
 
Android and cpp
Android and cppAndroid and cpp
Android and cpp
 
CogLab Information.htmlCogLab InformationCogLabs for this
CogLab Information.htmlCogLab InformationCogLabs for this CogLab Information.htmlCogLab InformationCogLabs for this
CogLab Information.htmlCogLab InformationCogLabs for this
 
4Developers 2015: Programowanie synchroniczne i asynchroniczne - dwa światy k...
4Developers 2015: Programowanie synchroniczne i asynchroniczne - dwa światy k...4Developers 2015: Programowanie synchroniczne i asynchroniczne - dwa światy k...
4Developers 2015: Programowanie synchroniczne i asynchroniczne - dwa światy k...
 
Developing android apps with java 8
Developing android apps with java 8Developing android apps with java 8
Developing android apps with java 8
 
Industrial Strength Groovy - Tools for the Professional Groovy Developer: Pau...
Industrial Strength Groovy - Tools for the Professional Groovy Developer: Pau...Industrial Strength Groovy - Tools for the Professional Groovy Developer: Pau...
Industrial Strength Groovy - Tools for the Professional Groovy Developer: Pau...
 
比XML更好用的Java Annotation
比XML更好用的Java Annotation比XML更好用的Java Annotation
比XML更好用的Java Annotation
 
The Mayans Lost Guide to RxJava on Android
The Mayans Lost Guide to RxJava on AndroidThe Mayans Lost Guide to RxJava on Android
The Mayans Lost Guide to RxJava on Android
 
Scala vs java 8
Scala vs java 8Scala vs java 8
Scala vs java 8
 
testing ppt
testing ppttesting ppt
testing ppt
 
Have Your Cake and Eat It Too: Meta-Programming Techniques for Java
Have Your Cake and Eat It Too: Meta-Programming Techniques for JavaHave Your Cake and Eat It Too: Meta-Programming Techniques for Java
Have Your Cake and Eat It Too: Meta-Programming Techniques for Java
 
Postdoc symposium - A Logic Meta-Programming Foundation for Example-Driven Pa...
Postdoc symposium - A Logic Meta-Programming Foundation for Example-Driven Pa...Postdoc symposium - A Logic Meta-Programming Foundation for Example-Driven Pa...
Postdoc symposium - A Logic Meta-Programming Foundation for Example-Driven Pa...
 
A Logic Meta-Programming Foundation for Example-Driven Pattern Detection in O...
A Logic Meta-Programming Foundation for Example-Driven Pattern Detection in O...A Logic Meta-Programming Foundation for Example-Driven Pattern Detection in O...
A Logic Meta-Programming Foundation for Example-Driven Pattern Detection in O...
 

Plus de Coen De Roover

A Recommender System for Refining Ekeko/X Transformation
A Recommender System for Refining Ekeko/X TransformationA Recommender System for Refining Ekeko/X Transformation
A Recommender System for Refining Ekeko/X TransformationCoen De Roover
 
A logic foundation for template-based program transformation in Eclipse
A logic foundation for template-based program transformation in EclipseA logic foundation for template-based program transformation in Eclipse
A logic foundation for template-based program transformation in EclipseCoen De Roover
 
The Cha-Q Meta-Model: A Comprehensive, Change-Centric Software Representation
The Cha-Q Meta-Model: A Comprehensive, Change-Centric Software RepresentationThe Cha-Q Meta-Model: A Comprehensive, Change-Centric Software Representation
The Cha-Q Meta-Model: A Comprehensive, Change-Centric Software RepresentationCoen De Roover
 
Multi-dimensional exploration of API usage - ICPC13 - 21-05-13
Multi-dimensional exploration of API usage - ICPC13 - 21-05-13Multi-dimensional exploration of API usage - ICPC13 - 21-05-13
Multi-dimensional exploration of API usage - ICPC13 - 21-05-13Coen De Roover
 
CrimeSPOT: Language Support for Programming Interactions among Wireless Senso...
CrimeSPOT: Language Support for Programming Interactions among Wireless Senso...CrimeSPOT: Language Support for Programming Interactions among Wireless Senso...
CrimeSPOT: Language Support for Programming Interactions among Wireless Senso...Coen De Roover
 
The STADiUM language framework for capturing domain-specific interaction patt...
The STADiUM language framework for capturing domain-specific interaction patt...The STADiUM language framework for capturing domain-specific interaction patt...
The STADiUM language framework for capturing domain-specific interaction patt...Coen De Roover
 
UbiLab@SOFT: A tale of ubiquitous bears, flyswatters 
and punching bags in ed...
UbiLab@SOFT: A tale of ubiquitous bears, flyswatters 
and punching bags in ed...UbiLab@SOFT: A tale of ubiquitous bears, flyswatters 
and punching bags in ed...
UbiLab@SOFT: A tale of ubiquitous bears, flyswatters 
and punching bags in ed...Coen De Roover
 

Plus de Coen De Roover (7)

A Recommender System for Refining Ekeko/X Transformation
A Recommender System for Refining Ekeko/X TransformationA Recommender System for Refining Ekeko/X Transformation
A Recommender System for Refining Ekeko/X Transformation
 
A logic foundation for template-based program transformation in Eclipse
A logic foundation for template-based program transformation in EclipseA logic foundation for template-based program transformation in Eclipse
A logic foundation for template-based program transformation in Eclipse
 
The Cha-Q Meta-Model: A Comprehensive, Change-Centric Software Representation
The Cha-Q Meta-Model: A Comprehensive, Change-Centric Software RepresentationThe Cha-Q Meta-Model: A Comprehensive, Change-Centric Software Representation
The Cha-Q Meta-Model: A Comprehensive, Change-Centric Software Representation
 
Multi-dimensional exploration of API usage - ICPC13 - 21-05-13
Multi-dimensional exploration of API usage - ICPC13 - 21-05-13Multi-dimensional exploration of API usage - ICPC13 - 21-05-13
Multi-dimensional exploration of API usage - ICPC13 - 21-05-13
 
CrimeSPOT: Language Support for Programming Interactions among Wireless Senso...
CrimeSPOT: Language Support for Programming Interactions among Wireless Senso...CrimeSPOT: Language Support for Programming Interactions among Wireless Senso...
CrimeSPOT: Language Support for Programming Interactions among Wireless Senso...
 
The STADiUM language framework for capturing domain-specific interaction patt...
The STADiUM language framework for capturing domain-specific interaction patt...The STADiUM language framework for capturing domain-specific interaction patt...
The STADiUM language framework for capturing domain-specific interaction patt...
 
UbiLab@SOFT: A tale of ubiquitous bears, flyswatters 
and punching bags in ed...
UbiLab@SOFT: A tale of ubiquitous bears, flyswatters 
and punching bags in ed...UbiLab@SOFT: A tale of ubiquitous bears, flyswatters 
and punching bags in ed...
UbiLab@SOFT: A tale of ubiquitous bears, flyswatters 
and punching bags in ed...
 

Dernier

JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...amber724300
 
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Mark Simos
 
Accelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with PlatformlessAccelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with PlatformlessWSO2
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024TopCSSGallery
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditSkynet Technologies
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integrationmarketing932765
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxfnnc6jmgwh
 
Kuma Meshes Part I - The basics - A tutorial
Kuma Meshes Part I - The basics - A tutorialKuma Meshes Part I - The basics - A tutorial
Kuma Meshes Part I - The basics - A tutorialJoão Esperancinha
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...BookNet Canada
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
All These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDFAll These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDFMichael Gough
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 

Dernier (20)

JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
 
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
 
Accelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with PlatformlessAccelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with Platformless
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance Audit
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
 
Kuma Meshes Part I - The basics - A tutorial
Kuma Meshes Part I - The basics - A tutorialKuma Meshes Part I - The basics - A tutorial
Kuma Meshes Part I - The basics - A tutorial
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
All These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDFAll These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDF
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
How Tech Giants Cut Corners to Harvest Data for A.I.
How Tech Giants Cut Corners to Harvest Data for A.I.How Tech Giants Cut Corners to Harvest Data for A.I.
How Tech Giants Cut Corners to Harvest Data for A.I.
 

Logic-based program transformation in symbiosis with Eclipse

  • 1. Coen De Roover Andy Kellens Carlos Noguera Software Languages Lab, Brussels Logic-based program transformation in symbiosis with Eclipse
  • 2. Menu logic program queries ... ... in symbiosis with Eclipse. (Smalltalk intermezzo) logic-based program transformation.
  • 3. Logic program queries ... over an Eclipse project logic evaluator finds solutions program query quantifies over reified ASTs
  • 4. Solutions to the logic program query ... over a dummy Eclipse project single solution consists of variable bindings variable binding reified AST node
  • 5. Why aren’t all tool builders using this? ... prevalent reification encumbers exploiting query solutions node(a,[node(b,[]),node(c,[node(d,[])])). variable binding a b c d to be found in IDE
  • 6. Facilitating adoption by tool builders ... reify(ASTNode) = ASTNode example application: exploiting solutions to a query in Eclipse plugins
  • 7. Facilitating adoption by tool builders ... reify(ASTNode) = ASTNode example application: querying reified nodes for their context
  • 8. } } public class SuperLogLeaf extends OnlyLoggingLeaf { Facilitating }, jtExpression(?instance){ public void acceptVisitor(ComponentVisitor v) { super.acceptVisitor(v); new ?singleton(?argList) }, v.visitSuperLogLeaf(this); adoption by absolutelyNot(?instance } equals: ?uniqueInstance) } public class MustAliasLeaf extends Component { developers if jtStatement(?s){ for(?initList; ?iterator.hasNext(); ?iterator.next(); public void acceptVisitor(ComponentVisitor v) { ?updList) temp = this; alias."); System.out.println("Must Component v.visitMustAliasLeaf(temp); ... example-driven queries } } } public class MayAliasLeaf extends Component { if jtMethodDeclaration(?m){ public Object m(Object o) { public static void main(String[] args) { if(getInput() % 2 == 0) solutions java.util.Scanner(?argList); o; ?scanner := new include return else implementation variants ?scanner.close(); return new MayAliasLeaf(); found by consulting ?scanner.next(); } public void acceptVisitor(ComponentVisitor v) { } program analyses System.out.println("May alias."); v.visitMayAliasLeaf((MayAliasLeaf)m(this)); } } } if jtClassDeclaration(?class){ class !Composite extends* Component { ?modList ?type acceptVisitor(?t ?v) { System.out.println(?string); ?v.?visitMethod(this); } } exemplify through } familiar code templates
  • 9. One more thing ... for those who develop Java tools in Smalltalk all three of you ;) inspector on Smalltalk proxy for Java object
  • 10. One more thing Smalltalk FFI C call Java JNI ... demystified S proxy J for J delegates to object object program Smalltalk program sends Java receives message message J proxy S delegates to for S object object Smalltalk Java native C callback callback handler method Smalltalk VM Java VM
  • 11. One more thing ... programming in a Smalltalk-Java hybrid showProgress: label complete: work while: block closure as an argument | job listener result promise | promise := Smalltalk.Promise new. job := self new_String: label asJavaValue creating a promise IBaristaRunnableWithProgressAndStatus: [:m | m beginTask_String: label asJavaValue int: work asJavaValue. result := [block value] on: Smalltalk.IncrementNotification do: [:ex | m worked_int: 1. resuming a Smalltalk exception ex resume]. m done. JavaWorld.org.eclipse.core.runtime.Status get_OK_STATUS]. listener := Smalltalk.BaristaJobListener new. listener doneBlock: [:event | promise value: result]. job addJobChangeListener_IJobChangeListener: listener. job setUser_boolean: true. job schedule. resolving the Smalltalk promise ^promise value when the Eclipse job finishes waiting for the value of the promise
  • 12. Towards program transformation ... by means of pattern-action rules a la CTs [Kniesel et al.] definition introduceExplicitThis(?e): jtExpression(?e){?message(?argList)}), [?e parentMethodDeclaration isStatic not], => ?e becomes: {this.?message(?argList)}) execution if <introduceExplicitThis(?e)> execute for each transformation rule: actions are executed for each matching ast node variable bindings can be passed between rules changes are committed to the workspace after all rules have been executed Smalltalk side is notified of changes through a listener
  • 13. Towards program transformation ... by means of pattern-action rules in symbiosis with Eclipse rewriter of Eclispe records modifications when committed to workspace produces an undo action retains formatting
  • 14. Towards program transformation ... code manipulation actions in symbiosis with Eclipse template ?e becomes: {this.?message(?argList)} new node ?this equals: [?e getAST newThisExpression], ?e equals: methodInvocation(?this, ?ta, ?name, ?args), ?e becomes: methodInvocation(?this, ?ta, ?name, ?args) compound term ?e equals: methodInvocation(?this, ?ta, ?name, ?args), ?e becomes: methodInvocation(thisExpression([nil]), ?ta, ?name, ?args) compound term with templates ?e equals: methodInvocation(?this, ?ta, ?name, ?args), ?e becomes:methodInvocation({this}, ?typeArguments, ?name, ?arguments) add:/2, insertBefore:/2, insertAfter:/2
  • 15. Conclusions ... and future work enabled by reification through symbiosis unique in logic program querying, but trivializes implementation for now, just a proof of concept explore design space of transformation language program transformation by example generalize from the identity transformation on a code snippet exploit analyses in transformations towards “refactoring” for parallelization
  • 16. Freely available ... website will be launched soon tabled logic evaluator regular path queries example-driven queries access to Soot analyses Eclipse extension points