JunGL is a hybrid functional-logic language in the tradition of ML and Datalog. The main data structure manipulated by JunGL is a graph representation of the program. Edges can be added to the graph lazily

The following function in JunGL computes the control flow edges emanating from a conditional statement:

let IfStmtCFSucc(node)=

match (node.thenBranch,node.elseBranch) with

| (null, null) -> [DefaultCFSucc(node)]

| (t, null) -> [t; DefaultCFSucc(node)]

| (null, e) -> [DefaultCFSucc(node); e]

| (t, e) -> [t; e] ;;

In JunGL, one can use predicates in functions via a stream comprehension.

{ ?x | P(?x) }

will return a stream of all *x* that satisfy the predicate *P*.

Path queries are regular expressions that identify paths in the program graph.

[var]

parent+

[?m:Kind(“MethodDecl”)]child

[?dec:Kind(“ParamDecl”)]

&

?dec.name == var.name

In the above path query, components between square brackets are conditions on nodes, whereas *parent* and *child* match edge labels. The above predicate thus describes a path from a variable occurrence *var* to its declaration as a method parameter.

They implement Rename Variable and Extract Method refactorings in JunGL for a subset of C#. Some refactoings are complex and require various analysis. So, I didn’t expect their language for describing refactorings to be simple. However, it seems to me that they’ve made the process of defining refactorings easier by using features of both functional programming and logic programming. Actually, there are several systems for defining refactorings out there and one could evaluate them against real programmers and compare them.