Home Research Teaching Misc

Program Query Languages

ASTLOG Developers: Roger Crew - Microsoft Research
Papers: ASTLOG: A Language for Examining Abstract Syntax Trees
Website: http://research.microsoft.com/research/pubs/view.aspx?tr_id=114
ASTLOG is a Prolog Based language for analysing and identifying constructs in Abstract Syntax Trees. It uses regular expressions to extract program info from a database of facts. (Info consists of AST nodes, symbols, and file names)
JQuery Developers : Doug Janzen and Kris De Volder - University of British Columbia
Papers:Navigating and Querying Code Without getting Lost
Website: http://www.cs.ubc.ca/labs/spl/projects/jquery/
JQuery is a query-based source code browser implemented as an Eclipse plugin. It operates on the intermediate representations provided by the Eclipse Java Development Tools suite. JQuery is Prolog-like, and is based on the Tyruba logic programming language. JQuery is aimed primarly at improving code visualisation and navigation. Queries can reorganize and redisplay code on the fly.
PQL (Program Query Language) Developers: Michael Martin, Benjamin Livshits, and Monica Lam - Stanford University
Papers: Finding Application Errors and Program Flaws Using PQL: a Program Query Language
Website: http://pql.sourceforge.net/
PQL is a query language that allows users express queries in a "code-like" (aka concrete) syntax; i.e. users can specify queries with code fragments demonstrate the essence of a particular pattern.. PQL is a sugar coating for the BDD-Based Deductive DataBase (bddbddb) implementation of Datalog. Queries must first be translated to Datalog before they interrogate a bddbddb database of program facts. This database of facts is a set of program traces with non essential program events abstracted away. PQL queries are answered using both dynamic and static analysis. Static analysis finds all potential matches for a given query (no false negatives). Dynamic analysis and instrumentation can be used to identify run query matches - and optionally specifiy a dynamic recovery mechanism..
PTQL (Program Trace Query Language) Developers: Simon Goldsmith, Robert O'Callahan and Alex Aiken - UC - Berkeley, IBM Research, Stanford University
Papers: Light-weight Instrumentation From Relational Queries over Program Traces
Website: http://sunsite.berkeley.edu/TechRepPages/CSD-04-1315
PTQL is SQL-like, and operates on dynamic program traces. Users specify queries on a Java program, and the Partiqle compiler instruments this program to answer the query while the program runs. The instrumentation is considered light-weight because Partiqle inserts only enough instrumentation to answer a given query. PTQL's design allows it to answer some unusual queries; for example, queries about the amount of time elapsed between program events.
Stratego Developers: Eelco Visser, Martin Bravenboer - University of the Netherlands
Papers: Program Transformation with Stratego/XT: Rules, Strategies, Tools, and Systems
Website: http://www.program-transformation.org/Stratego/StrategoLanguage
Stratego is a program transformation language that manipulate programs' abstract syntax trees. Transformations are implemented using rewrite rules: i.e. users specify a code pattern to replace and the replacement code pattern. Stratego supports various strategies to define how rewrite rules are executed and the areas of a program to be manipulated. To improve code writing/readability, Stratego allows queries to be written in concrete syntax: transformations are specified in code close to the source language, as opposed to being expressed as ast node objects (more cumbersome).
XForm Developers: Robert Grimm, Joe Pamer - New York University, Microsoft Research
Papers: N/A
Website: N/A
XForm provides a querying and transformation facitliy for abstract syntax trees. XForm loosely follows the syntax of XPath, but includes additional support for AST transformations.