SlideShare a Scribd company logo
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

More Related Content

What's hot

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
Coen De Roover
 
Virtual Separation of Concerns
Virtual Separation of ConcernsVirtual Separation of Concerns
Virtual Separation of Concerns
chk49
 
Формальная верификация как средство тестирования (в 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 Heart
Bui Kiet
 
Java - Generic programming
Java - Generic programmingJava - Generic programming
Java - Generic programming
Riccardo Cardin
 
Java Course 5: Enums, Generics, Assertions
Java Course 5: Enums, Generics, AssertionsJava Course 5: Enums, Generics, Assertions
Java Course 5: Enums, Generics, Assertions
Anton Keks
 
Java mcq
Java mcqJava mcq
Java mcq
avinash9821
 
Shiksharth com java_topics
Shiksharth com java_topicsShiksharth com java_topics
Shiksharth com java_topics
Rajesh Verma
 
Why Spring <3 Kotlin
Why Spring <3 KotlinWhy Spring <3 Kotlin
Why Spring <3 Kotlin
VMware Tanzu
 
Java basic tutorial by sanjeevini india
Java basic tutorial by sanjeevini indiaJava basic tutorial by sanjeevini india
Java basic tutorial by sanjeevini india
Sanjeev Tripathi
 
Container Classes
Container ClassesContainer Classes
Container Classes
adil raja
 
Java Course 6: Introduction to Agile
Java Course 6: Introduction to AgileJava Course 6: Introduction to Agile
Java Course 6: Introduction to Agile
Anton 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
 
Java Tutorial
Java Tutorial Java Tutorial
Java Tutorial
Akash Pandey
 
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 DevLOVE
Uehara Junji
 
Java Basics
Java BasicsJava Basics
Java Basics
Brandon Black
 
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 Workshop
Simon Ritter
 

What's hot (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
 

Similar to Logic-based program transformation in symbiosis with Eclipse

Java Performance Tuning
Java Performance TuningJava Performance Tuning
Java Performance Tuning
Minh 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 beyond
Mario Fusco
 
Владимир Иванов. Java 8 и JVM: что нового в HotSpot
Владимир Иванов. Java 8 и JVM: что нового в HotSpotВладимир Иванов. Java 8 и JVM: что нового в HotSpot
Владимир Иванов. Java 8 и JVM: что нового в HotSpot
Volha Banadyseva
 
Scala clojure techday_2011
Scala clojure techday_2011Scala clojure techday_2011
Scala clojure techday_2011
Thadeu Russo
 
Clojure - A new Lisp
Clojure - A new LispClojure - A new Lisp
Clojure - A new Lisp
elliando 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 2011
YoungSu Son
 
Android and cpp
Android and cppAndroid and cpp
Android and cpp
Joan Puig Sanz
 
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
 
Developing android apps with java 8
Developing android apps with java 8Developing android apps with java 8
Developing android apps with java 8
Jorge Castillo Pérez
 
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 Annotation
javatwo2011
 
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
Fernando Cejas
 
Scala vs java 8
Scala vs java 8Scala vs java 8
Scala vs java 8
François Sarradin
 
testing ppt
testing ppttesting ppt
testing ppt
techweb08
 
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
Howard 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
 

Similar to 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...
 

More from 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 Transformation
Coen 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 Eclipse
Coen 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 Representation
Coen 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-13
Coen 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
 

More from 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...
 

Recently uploaded

June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Alpen-Adria-Universität
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
Zilliz
 
dbms calicut university B. sc Cs 4th sem.pdf
dbms  calicut university B. sc Cs 4th sem.pdfdbms  calicut university B. sc Cs 4th sem.pdf
dbms calicut university B. sc Cs 4th sem.pdf
Shinana2
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
ssuserfac0301
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 
JavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green MasterplanJavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green Masterplan
Miro Wengner
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
Jakub Marek
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)
Javier Junquera
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
MichaelKnudsen27
 
Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |
AstuteBusiness
 
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
Edge AI and Vision Alliance
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
Chart Kalyan
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
Brandon Minnick, MBA
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
Azure API Management to expose backend services securely
Azure API Management to expose backend services securelyAzure API Management to expose backend services securely
Azure API Management to expose backend services securely
Dinusha Kumarasiri
 

Recently uploaded (20)

June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
 
dbms calicut university B. sc Cs 4th sem.pdf
dbms  calicut university B. sc Cs 4th sem.pdfdbms  calicut university B. sc Cs 4th sem.pdf
dbms calicut university B. sc Cs 4th sem.pdf
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 
JavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green MasterplanJavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green Masterplan
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
 
Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |
 
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
Azure API Management to expose backend services securely
Azure API Management to expose backend services securelyAzure API Management to expose backend services securely
Azure API Management to expose backend services securely
 

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