Polyglot is an extensible compiler framework for Java developed at Cornell University. In rough outline, it parses a source language and produces an abstract syntax tree (AST) which can then be manipulated. The AST is finally compiled down to bytecode. The framework is primarily used to extend the Java language with new features.
The two major extensions to the Java language needed to support the Galois programming model are Galois iterators and Galois wrappers.
Galois iterators look like Java foreach statements:
foreach (Element e : wl)
but unlike Java foreach statements, new elements can be added to the collection being iterated over during execution. These statements signal to the Galois system that the loop can be profitably parallelized using optimistic parallelization. Note that the Galois iterators appear in sequential code. Your transformation should transform the sequential code using these iterators into parallel code executed using the Galois runtime
Shared objects in the Galois programming model must have access to them controlled by conflict logs which ensure that concurrent method invocations do not violate isolation, and hence preserve sequential semantics. This is achieved in the model by wrapping shared objects (written using normal, thread-safe classes) in Galois wrappers. These wrappers intercept method calls, perform conflict detection, and then delegate the call to the underlying shared object, preserving isolation. Your program transformation should detect shared objects (i.e. objects which persist across iterations in a Galois iterator) and automatically wrap them in Galois wrappers.
For more details of the Galois programming model, see here
A new parser and source-to-source transformation which takes Java code extended with Galois iterators and produces working parallel Java code. This transformation should correctly transform two sequential applications written using Galois iterators. Write a report detailing the transformations and your implementation