Friday, June 20, 2014

Call for papers: Modularity 2015



 Call for Papers: Modularity '15 Research Results
         March 16-19, 2015, Ft. Collins, Colorado, USA

First round due date: August 4, 2014. Second round due date: October 10, 2014.

Modularity is a key property for scalability of software processes, including debugging, maintenance, reasoning, and testing. Modularity influences system diversity, dependability, performance, evolution, the structure and the dynamics of the organizations that produce systems, human understanding and management of systems, and ultimately system value. Yet the nature of and possibilities for modularity, limits to modularity, the mechanisms needed to achieve it in given forms, and its costs, benefits, and tradeoffs remain poorly understood. Significant advances in modularity thus are possible and promise to yield breakthroughs in our ability to conceive, design, develop, validate, integrate, and evolve modern information systems and their underlying software artifacts.

Modularity at the semantic as well as the syntactic level is a key enabler for the expression of high quality software systems. One of the most important techniques for complexity reduction is abstraction. Novel concepts and abstraction mechanisms, including but not limited to aspect-oriented techniques, are a focus point for improvements in the support for modularity. The scope of this effort covers all perspectives on software systems in all their life-cycle phases, for instance application domain analysis, programming language constructs, formal proofs of system properties, program state visualization in debuggers, performance improvements in compiler algorithms, etc. As the premier international conference on modularity, Modularity'15 continues to advance our understanding of these issues and the expressive power of known techniques.

The Modularity'15 conference invites full, scholarly papers of the highest quality on new ideas and results. Papers are expected to contribute significant new research results with rigorous and substantial validation of specific technical claims, based on scientifically sound reflections on experience, analysis, experimentation, or formal models. Compelling new ideas are especially welcome, which means that the requirements in the areas of validation and maturity are higher for papers that contribute more incremental results.

Modularity'15 is deeply committed to publishing works of the highest caliber. To this aim, two separate paper submission deadlines and review stages are offered. A paper accepted in any round will be published in the proceedings and presented at the conference. Promising papers submitted in the first round that are not accepted may be invited to be revised and resubmitted for review by the same reviewers in the second round. Authors of such invited resubmissions are asked to also submit a letter explaining the revisions made to the paper to address the reviewers' concerns. While there is no guarantee that an invited resubmission will be accepted, this procedure (similar to major revisions requested by journals) is designed to help authors of promising work get their papers into the conference. Submission to both rounds is open for all, and authors who submit to the first round may of course choose to resubmit a revised version in the second round without such an invitation, in which case new reviewers may be appointed. Finally, the same paper cannot be simultaneously submitted to other conferences or journals. In case of doubt, please contact the Program Chair.

Research Topics

Modularity'15 is looking for papers in all areas of software modularity. Topics of interest include, but are not limited to, the following:

* Varieties of modularity: Context orientation; feature orientation; generative programming; aspect orientation; software product lines; traits; families of classes; meta-programming and reflection; components; view-based development.

* Programming languages: Support for modular abstraction in: language design; verification, specification, and static program analysis; compilation, interpretation, and runtime support; formal languages and calculi; execution environments and dynamic weaving; dynamic languages; domain-specific languages.

* Software design and engineering: Requirements and domain engineering; architecture; synthesis; evolution; metrics and evaluation; empirical studies of existing software; economics; testing and verification; semantics; composition and interference; traceability; methodologies; patterns.

* Tools: Crosscutting views; refactoring; evolution and reverse engineering; aspect mining; support for new language constructs.

* Applications: Data-intensive computing; distributed and concurrent systems; middleware; service- oriented computing systems; cyber-physical systems; networking; cloud computing; pervasive computing; runtime verification; computer systems performance; system health monitoring; enforcement of non-functional properties.

* Complex systems: Works that explore and establish connections across disciplinary boundaries, bridging to such areas as biology, economics, education, infrastructure such as buildings or transport systems, and more.

* Composition. Component-based software engineering; Composition and adaptation techniques; Composition algebras, calculi, and type systems; Model-driven composition; Dynamic composition and reconfiguration; Large-scale component-based systems; Cloud, service-oriented architectures; Business process orchestration; Visual composition environments; Performance optimization of composite systems.


Important Dates

* First round:
Submission: August 4, 2014 (23:59 Baker Island / UTC-12)
Notification: September 14, 2014

* Second round:
Submission: October 10, 2014 (23:59 Baker Island / UTC-12)
Notification: December 7, 2014

* Camera ready: February 15, 2015

Submission Guidelines

Modularity'15 is deeply committed to eliciting works of the highest caliber. To this aim, two separate paper submission deadlines and review stages are offered. A paper accepted in any round will be published in the proceedings and presented at the conference. Promising papers submitted in the first round that are not accepted may be invited to be revised and resubmitted for review by the same reviewers in the second round. Authors of such invited resubmissions are asked to also submit a letter explaining the revisions made to the paper to address the reviewers' concerns. While there is no guarantee that an invited resubmission will be accepted, this procedure (similar to major revisions requested by journals) is designed to help authors of promising work get their papers into the conference. Submission to both rounds is open for all, and authors who submit to the first round may of course choose to resubmit a revised version in the second round without such an invitation, in which case new reviewers may be appointed. Finally, the same paper cannot be simultaneously submitted to other conferences or journals. In case of doubt, please get in touch with the Program Chair.
All submissions must conform to both the ACM Policy on Prior Publication and Simultaneous Submissions and the SIGPLAN Republication Policy.

Papers are to be submitted electronically to CyberChair.

Please use http://cyberchairpro.borbala.net/modularitypapers/submit/ to submit your paper. Submissions should use the SIGPLAN Proceedings Format using 9 point font. Please include page numbers in your submission as this will be helpful for the reviewers and also for you when reading their reviews. (If your submission is written using LaTeX, please set the preprint option in the LaTeX \documentclass command to generate page numbers.) Please also ensure that your submission is legible when printed on a black and white printer. In particular, please check that colors remain distinct and font sizes are legible.

To ensure that papers stay focused on their core contributions, the main part of the paper should be no longer than 12 pages. There is a 4 page limit for appendices, and, therefore, for the overall submission must be less than 16 pages. If the paper is accepted, the final submission will be limited to 16 pages, including appendices.

However, it is the responsibility of the authors to keep the reviewers interested and motivated to read their submission. Reviewers are under no obligation to read all or even a substantial portion of a paper if they do not find the initial part of the paper compelling. The committee will not accept a paper if it is unclear that the paper will fit in the Modularity'15 Proceedings.

All submitted papers are peer-reviewed. Accepted papers from all tracks will appear in the Modularity'15 Proceedings in the ACM Digital Library. Submissions will be judged on the potential impact of the ideas and the quality of the presentation.

Program Committee Chair
Gary T. Leavens, University of Central Florida, USA (leavens@cs.ucf.edu)

Program Committee

Don Batory, University of Texas at Austin
Eric Bodden, Fraunhofer SIT and TU Darmstadt
Paulo Borba, Federal University of Pernambuco
Walter Cazzola, Università degli Studi di Milano
Cynthia Disenfeld, Technion -- Israel Institute of Technology
Robert Dyer, Bowling Green State University
Erik Ernst, Aarhus University
Matthew Flatt, University of Utah
Michael Haupt, Oracle Labs
Marieke Huisman, University of Twente
Cristina Lopes, University of California Irvine
Tiziana Margaria, University of Potsdam
Linda Northrop, Software Engineering Institute
Nate Nystrom, University of Lugano
Bruno C. d. S. Oliveira, The University of Hong Kong
Awais Rashid, Lancaster University
Henrique Rebêlo, Federal University of Pernambuco
Martin Rinard, Massachusetts Institute of Technology
Norbert Siegmund, University of Passau
Murali Sitaraman, Clemson University
Kevin Sullivan, University of Virginia

External Review Committee

Marsha Chechik, University of Toronto
Steven Edwards, Virginia Tech.
Dan Grossman, University of Washington
Görel Hedin, Lund University
Mira Mezini, TU Darmstadt
Peter Müller, ETH Zurich
Hridesh Rajan, Iowa State University
Clemens Szyperski, Microsoft Research
Éric Tanter, University of Chile
Eelco Visser, Delft University of Technology

For additional information, clarification, or answers to questions please contact the Program Committee Chair.

Sunday, June 15, 2014

Locks

Locks allow restricting access to different areas of the code. A part of the code that we want only one thread to have access at a given time is called a critical section. This critical section can represent access to some resource (like a printer; we don't want another process to start printing in the middle), execution of a particular function or part within the program (like an ATM transaction, there should be no interference while it occurs), or a method of a distributed data type (avoid erasing while inserting an element to a list).

Let's see the following code (without locks)

public class Printer implements Runnable {

private String document;

public Printer(String document){
this.document = document;
}

@Override
public void run() {
Random r = new Random();
//represents some preprocessing of the document
try {
Thread.sleep(1000*(r.nextInt(2)+1));
} catch (InterruptedException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
for (int i=0; i < document.length(); i++){
System.out.println("printing \"" + document.charAt(i) + "\"");
try {
Thread.sleep(1000*(r.nextInt(2)+1));
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}

public static void main(String[] args) {
Thread t1 = new Thread(new Printer("hello"));
Thread t2 = new Thread(new Printer("world"));
t1.start();
t2.start();
}

}

The main method starts two thread printing "hello" and "world" respectively. The run method of the Printer class (invoked when the threads are started), prints each letter and has some delay (imagine the physical time to actually print the letter. Then, when running this program the printing of both documents gets winded and the output letters do not form "hello" "world", but some mix of their letters.

One way to deal with this is by using locks within the for loop so that from the moment the printer starts it cannot get interrupted: (changes to the run method)

@Override
public void run() {
Random r = new Random();
//represents some preprocessing of the document
try {
Thread.sleep(1000*(r.nextInt(2)+1));
} catch (InterruptedException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
while (true){
boolean success = lock.tryLock();
if (success) break;
try {
Thread.sleep(1000*(r.nextInt(2)+1));
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
for (int i=0; i < document.length(); i++){
System.out.println("printing \"" + document.charAt(i) + "\"");
try {
Thread.sleep(1000*(r.nextInt(2)+1));
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
lock.unlock();
}

Now, only one thread can access the for loop at a time. 


Question to think: what would have happened had we forgotten the unlock after the loop?



PS: The goal of this post was to give a first explanation of locks (without entering into language details) Java allows using synchronized for avoiding multiple threads from entering the same method. For a discussion on the difference between locks and synchronize, there's a nice explanation here: locks vs synchronized

Thursday, June 12, 2014

LOTOS

LOTOS (Language of Temporal Ordering Specifications) is a formal specification language that allows expressing processes and process compositions.

There is a wide set of operators with which very interesting behaviors and process interactions can be obtained. But first, we'll start from the basics.

The basic process is an event, and an event is a communication through a gate, for instance, receiving through a gate g an integer value x

g?x:int

or providing as output "hello" through the gate h

h!"hello"

Notice that we represent input with a question mark and output with an exclamation mark. In addition, when g receives the value within x, the variable x is locally accessible to the following events.. but now we ask ourselves, how to add events?

The simplest case is the sequential composition, obtained with the semicolon (;)

for instance

g?x:int; g!x

this process receives an int value, and then outputs it through the same gate

Different gates and variables could be involved. For instance

g?x:int; g?y: string; h!concat(y, " world"); f!x+2

In the next LOTOS post I will discuss choice (choosing between enabled behaviors)

A Lotus flower

Aspect-oriented Programming (AOP) - around advice

We have discussed before and after advice (AfterAOP - 2), it remains to talk about around advice. This kind of advice is very interesting because not only allows adding behavior before and/or after the original joinpoint, but also allows overriding the original behavior, or applying the original behavior multiple times.

For example,

public class C{

  public static void main(){
1    int y = addOne(0);
2    System.out.println(y);
  }

  public static int addOne(int x){
3    return x+1;
  }
}

public aspect A{
4  pointcut callAddOne(int x): call(* *.addOne(int)) && args(x)

5  int around(int x): callAddOne(x){
6    System.out.println("before calling");
7    int tmpValue = proceed(x);
8    tmpValue = proceed(tmpValue);
9    System.out.println("after calling");
10    return tmpValue;
  }
}

In the example, the around advice (line 5) is activated when the pointcut (line 4) matches a joinpoint. The only location in C where this occurs is in line 1, when addOne is called.
Then, the following things happen
i) when matching the joinpoint, the pointcut caputres x as the argument to the call (notices args(x) within the pointcut definition)
ii) the message "before calling" is printed
iii) proceed indicates to apply the original behavior. That is, we are actually calling to addOne with the value x (in the original call was 0, so this is the value within the advice).
iv) tmpValue obtains the return value of the call, in this case 1
v) we call again to the original method! but this time with the argument tmpValue
vi) tmpValue is updated to 2 (it was incremented by the second proceed)
vii) the second message within the advice is printed
viii) the value 2 is returned
ix) y (in line 1) receives 2 and gets printed.


Around-like advice are a very strong mechanism not only to add behavior before or after the original, but also to change the control flow, for instance by making the original joinpoint to be executed multiple times, or none at all! If within the around advice there is no proceed, then the original behavior gets overriden.

The Earth moves around the Sun (but doesn't override it :) )




Thursday, June 5, 2014

Pre and Post Conditions: Hoare Logic - 2

Continuing the post Hoare Logic - 1, we will now present to which kind of statements these triples (pre, program, post) can be applied
0. Nop (doesn't do anything)
1. Assignments
x := e // x gets the value of some expression e, that may or may not contain x
2. Consequence; that is, S1;S2 (first execute S1, then S2)
3. if B then S1 else S2 fi (typical if, with B a boolean condition)
4. while B do S od (at each iteration, B is checked. If satisfied by the current state, S is executed)

All these statements can then be combined to make more complex programs, and provide the formalization to prove program correctness

For example, given P:

y := 2*x;
if (y < 0) z := - y/2
else z := y/2
fi

we can prove that the value of z is the absolute value of x (the division is the real division, not the integer one).

To do so we can instrument the program above as follows:

1. {\(x=X_0\)}
y := 2*x;
2. {\(x=X_0 \land y = 2\cdot x\)}
if (y < 0)
  z := - y/2
3.  {\(x=X_0 \land y = 2\cdot x \land z = - y/2\)}
else
   z := y/2
4.  {\(x=X_0 \land y = 2\cdot x \land z = y/2\)}
fi
5. {\(x=X_0 \land y = 2\cdot x \land (y<0 \rightarrow z = - y/2)  \land (y\ge 0 \rightarrow z = y/2)\)}

Line 1 adds an auxiliary variable (X0) - which doesn't appear in the program - to indicate that the contents of x do not change. Auxiliary variables can be added at any stage of the proof, but their value does not change; that is, from the moment we have indicated x = X0 in 1, we have indicated that X0 will always contain x's initial value

Line 2 adds the assignment to y, and that x has not changed

Line 3 considers the first branch of the if, and Line 4 the second branch, updating z as necessary

Line 5 joins both branches, according to the condition. That is, if y <0 then the first branch is applied, otherwise the second one.

5. {\(x=X_0 \land y = 2\cdot x \land (y<0 \rightarrow z = - y/2)  \land (y\ge 0 \rightarrow z = y/2)\)}
Now given this last expression, we'll try to conclude that indeed z contains the absolute value of x

From
\(x=X_0 \land y = 2\cdot x \land (y<0 \rightarrow z = - y/2)\)
It can be inferred that when y<0 the value of z is -X0
Similarly, from the second implication it can be inferred that when y is greater or equal than 0, the value of z is X0.

Now, y is lower than 0 iff x is lower than 0, therefore,
the value of z is -X0 if x is lower than 0, and X0 otherwise, which is the definition of the absolute value, as expected.



Wednesday, June 4, 2014

Aspect-oriented Programming (AOP) - AJDT - First project

To actually define pointcuts (Pointcuts - 1Pointcuts - 2), advice (Introduction - 2after advice), and aspects in general, AJDT is a useful tool. According to your eclipse version, download instructions are available in AJDT - download.

That is, you open eclipse, go to Help -> Install new Software ; enter the appropriate update site, and install AJDT.

Once installed, you can define an AspectJ project, with classes and aspects.

Creating an AspectJ project:


In the next window, set the project name.

A project that has not initially been set as an AspectJ project, can later be changed (and an AspectJ project can be changed to a normal java project - but if it has aspects, it will fail to compile)

Add a new class HelloWorldAspectsMain

with the following methods:

public static void main(String[] args) {
foo();
}

private static void foo() {
           System.out.println("in foo"); 
}


Then, create the aspect HelloWorldAspect (new -> Other.. -> Aspect) 

The contents of the created file are:

public aspect HelloWorldAspect {

}

Within the brackets add the following code:


pointcut callFoo(): call(* *.foo());
before(): callFoo(){
System.out.println("Hello");
}
after(): callFoo(){
System.out.println("World!");
}

so that the resulting aspect file is:

public aspect HelloWorldAspect {
pointcut callFoo(): call(* *.foo());
before(): callFoo(){
System.out.println("Hello");
}
after(): callFoo(){
System.out.println("World!");
}
}


Run the code as an AspectJ program (when pressing run, this option should appear), and check what happens!

The expected output is:

Hello
in foo
World!

Tuesday, June 3, 2014

Pre and Post Conditions: Hoare Logic

One way to specify and verify programs is by means of pre and post conditions. The main idea is that given a program or a function P, we write {pre} P {post}, where pre represents the precondition and post the postcondition.

This triple expresses the following: for any input, such that pre is satisfied (before executing P), when P is run, if it finishes its execution then post must hold.

Note that if the input does not satisfy pre, or if P does not end, then the triple is trivially satisfied

These are usually called Hoare triples, because of the article "An Axiomatic Basis for Computer Programming" [1].

For example,
{x \(\ge\) 0}
y := sqrt(x);
{y = \(\sqrt(x)\)}

This code only makes sense for non-negative x's, and after executing the statement y contains the square root of x.

These ideas are the basis of design by contract, where for each method there is a contract of what is expected about the input, and in case that holds, what is guaranteed about the output.



[1] Hoare, Charles Antony Richard. "An axiomatic basis for computer programming." Communications of the ACM 12, no. 10 (1969): 576-580.

Shavuot inspired post: 5 formal methods related areas

Today in the evening starts Shavuot (feast of the weeks), the Jewish holiday that occurs 7 weeks after Passover and commemorates receiving the Torah (at Mount Sinai). The typical movie image includes Moses going down the mountain with the 10 commandments written in stone, 5 commandments on each.

Inspired by this, I will post here 5 (one tablet of stone) formal methods related areas I intend to write about in this blog:

1. Pre and post conditions: hoare logic, design by contract, software implementing these ideas, extensions
2. Model checking: temporal logic, algorithms, bdds, compositional verification, abstraction-refinement
3. Static analysis: overapproximation, abstract interpretation
4. Sat-based verification: algorithms, smt, bounded model checking
5. Parallel programming formal models: consistency models, synchronization primitives, languages (csp, ccs, lotos)

I will probably continue writing about other topics as well, such as AOP in the context of Software Engineering, Modularity..
However I hope to cover most of the topics mentioned above (given enough time)

Hag Sameach!



Monday, June 2, 2014

Aspect-oriented Programming (AOP) - after advice

As we have mentioned in AOP - 2, there are three kinds of advice: before, after, and around.

The before advice is very simple, it allows adding the concern code before the joinpoints matching the pointcut.

I will now focus on the after advice which has some more options.
It can be used as:

  1. after( exposed information ) returning [(exposed information)]: pointcut
  2. after( exposed information ) throwing [(exposed information)]: pointcut
  3. after( exposed information ): pointcut
Notation: the text between brackets means that it is optional

The first one captures when the execution flow returns from the joinpoint (possible exposing information about the returned value).

For example, given the classes:

class C{
  public static void main(){
    D d = new D();
    int x = d.foo();
  }
}

class D {
  public int foo(){
    return 8;
  }
}

and the advice

after() returning: call(* *.foo()){
  System.out.println("after foo");
}

prints the advice message once foo has returned successfully

On the other hand, the advice

after() returning(int x): call(* *.foo()){
  System.out.println("after foo");
  System.out.println(x);
}

also prints the returned value by foo methods of type int

The second option above (2.) captures the exception thrown, so that if we want to add some behavior only when an exception occurred within the joinpoint this kind of advice is very useful.

For example, given the following classes

class C{
  public static void main(){
    D d = new D();
    int x = d.foo(-1);
  }
}

class D {
  public int foo(int i){
    if (i < 0) throw new Exception("did not expect negative value");
    return Math.sqrt(i);
  }
}

The advice
after() throwing: call(* *.foo()){
  System.out.println("exception thrown within foo");
}

captures the problematic situation and prints the message (and the exception is still thrown to the other classes.

The third option captures returning from the joinpoint either correctly or because of an exception.

To think about: How would you write an advice that when returning from foo with an exception, also prints the exception message? (before forwarding the exception to the calling methods?)

The boy throws a rock to the sea, as sometimes methods throw exceptions...

Sunday, June 1, 2014

Aspect-oriented Programming (AOP) - Static Pointcuts - Exercises



Try writing the following pointcuts statically capturing some joinpoints:

(According to the posts AOP - Pointcuts 1AOP - Pointcuts 2)
  1. The pointcut that captures any call to any int method containing the word "Method" in its name. For example:
class C{
  public static void main(){
      D d = new D();
1.    d.thisMethodIsCool();
  }
}

class D{
  public int thisMethodIsCool(){
2.    System.out.println("within the cool method");
  }
}

The pointcut should match the call in line 1 of class C.



pointcut callMethod(): call(int *.*Method*(..))


  1. The same as before but now capture the execution of the method, i.e., when the eecution flow is within line 2 of class D.

pointcut executeMethod(): execution(int *.*Method*(..))



  1. This pointcut should match whenever a String field named "name" is set

pointcut setName(): set(String *.name)