Experiments with Pro-Active
         Declarative Meta-Programming
                            Verónica Uquillas Gómez
    ...
Problem




              Developer-driven ( pro-active)
              Snapshot-based reasoning ( time)
SOUL: Smalltalk Open Unification
Language

  Query language
  Prolog-like
  Smalltalk, Java,
  C(++), Cobol



        ...
PARACHUT: Programming And Reasoning
About CHanges Using Time




          if subclassOf(?subclass, ?superclass),
        ...
Backward Chaining vs. Forward Chaining




          Goal-driven                           Data-driven



  More possible...
Example: hash – equal rule
“re-implementing the = method implies re-implementing the
                      hash method”


...
PARACHUT: defining the declarative queries
PARACHUT: outputs to developers (I)
PARACHUT: outputs to developers (II)
Other Examples
      Pulsar class pattern
      Possible refactoring opportunities
Pulsar Class Pattern
   Pulsar class



                              TIME



pulsar(?class) if
  pulsar(?class, ?len3, ?l...
Detecting possible refactoring opportunities



   duplicateSelector(?classA, ?classB, ?method) if
     addedMethodInClass...
Conclusions




if subclassOf(?subclass,
  ?superclass), ….



                                        Verónica Uquillas G...
Upcoming SlideShare
Loading in …5
×

Experiments with Pro-Active Declarative Meta-Programming

542 views
396 views

Published on

Experiments with Pro-Active Declarative Meta-Programming by Verónica Uquillas Gómez. ESUG09, Brest, France

Published in: Technology, Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
542
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
3
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Experiments with Pro-Active Declarative Meta-Programming

  1. 1. Experiments with Pro-Active Declarative Meta-Programming Verónica Uquillas Gómez Andy Kellens Kris Gybels Theo D’Hondt International Workshop on Smalltalk Technologies Software Languages Lab 31st of August 2009, Brest - France Vrije Universiteit Brussel ESUG 2009 Belgium
  2. 2. Problem   Developer-driven ( pro-active)   Snapshot-based reasoning ( time)
  3. 3. SOUL: Smalltalk Open Unification Language   Query language   Prolog-like   Smalltalk, Java, C(++), Cobol class(?class) if member(?class, [Smalltalk allClasses])
  4. 4. PARACHUT: Programming And Reasoning About CHanges Using Time if subclassOf(?subclass, ?superclass), …. Ch1 Ch2 Ch3 Chn TIME …
  5. 5. Backward Chaining vs. Forward Chaining Goal-driven Data-driven   More possible start states or goal states?   What kind of events triggers problem-solving?
  6. 6. Example: hash – equal rule “re-implementing the = method implies re-implementing the hash method” classNeedsHash(?class) if   class methodInClass(?class, =),   instanceVariableInClass not(methodInClass(?class, hash))   methodInClass   methodCallsMethod classNeedsEqual(?class) if   classInPackage methodInClass(?class, hash),   subclassOf not(methodInClass(?class, =))   classInHierarchyOf
  7. 7. PARACHUT: defining the declarative queries
  8. 8. PARACHUT: outputs to developers (I)
  9. 9. PARACHUT: outputs to developers (II)
  10. 10. Other Examples   Pulsar class pattern   Possible refactoring opportunities
  11. 11. Pulsar Class Pattern Pulsar class TIME pulsar(?class) if pulsar(?class, ?len3, ?len2, ?len1) pulsar(?class, ?len3, ?len2, ?len1) if allConsecutiveSizes(?class, ?len3, ?len2, ?len1), escape(?val, [(?len1 * 2) = ?len2 and:[ ?len1 = ?len3]])
  12. 12. Detecting possible refactoring opportunities duplicateSelector(?classA, ?classB, ?method) if addedMethodInClass(?classB, ?method), mostrecent(addedMethodInClass(?classA, ?method)) refactoringOpportunity(?superclass, ?method) if duplicatedSelector(?classA, ?classB, ?method), subclassOf(?classA, ?superclass), subclassOf(?classB, ?superclass), not(addedMethodInClass(?superclass, ?method))
  13. 13. Conclusions if subclassOf(?subclass, ?superclass), …. Verónica Uquillas Gómez vuquilla@vub.ac.be … Ch1 Ch2 Ch3 Chn TIME

×