20,964 research outputs found
Generation of abstract programming interfaces from syntax definitions
Tree Manipulation; Using the ATerm-Library to represent tree-like data structures has become a popular activity, especially amongst developers of e.g. lexical scanners, parsers, rewrite engines and model checkers. Practical experience with the ATerm-Library in the ASF+SDF Meta-Environment has shown that the development and maintenance of tools that access ATerms using handcrafted code is involved and very error prone. Both the make and match paradigm and the direct manipulation of ATerms suffer from the fact that the programmer uses knowledge about the underlying structure (a.k.a. the signature) of the ATerm that represents the data type being accessed. Hard-wiring this knowledge in various tools makes it difficult to maintain the tools with respect to changes in the data structure. By lifting the data definition and its mapping to an ATerm representation away from the level of tool implementation, it becomes possible to generate a library of access functions on the data type, which can be used by all the tools that need access to it. The tools no longer directly manipulate the ATerm representation, but rather invoke methods described by the API of the library, thus abstracting from the fact that ATerms are used for the implementation of the data type. This paper describes how an API and its implementation can be generated from a syntax definition of the data type. In particular we describe how a grammar (in SDF) can be used to generate a library of access functions that manipulate the parse trees of terms over this syntax. Application of this technique in the ASF+SDF Meta-Environment has resulted in a spectacular elimination of 47 of the handwritten code, thus greatly improving both maintainability of the tools and their flexibility with respect to changes in the parse tree format
Recommended from our members
XML-based genetic rules for scene boundary detection in a parallel processing environment
Genetic programming is based on Darwinian evolutionary theory that suggests that the best solution for a problem can be evolved by methods of natural selection of the fittest organisms in a population. These principles are translated into genetic programming by populating the solution space with an initial number of computer programs that can possibly solve the problem and then evolving the programs by means of mutation, reproduction and crossover until a candidate solution can be found that is close to or is the optimal solution for the problem. The computer programs are not fully formed source code but rather a derivative that is represented as a parse tree. The initial solutions are randomly generated and set to a certain population size that the system can compute efficiently. Research has shown that better solutions can be obtained if 1) the population size is increased and 2) if multiple runs are performed of each experiment. If multiple runs are initiated on many machines the probability of finding an optimal solution are increased exponentially and computed more efficiently. With the proliferation of the web and high speed bandwidth connections genetic programming can take advantage of grid computing to both increase population size and increasing the number of runs by utilising machines connected to the web. Using XML-Schema as a global referencing mechanism for defining the parameters and syntax of the evolvable computer programs all machines can synchronise ad-hoc to the ever changing environment of the solution space. Another advantage of using XML is that rules are constructed that can be transformed by XSLT or DOM tree viewers so they can be understood by the GP programmer. This allows the programmer to experiment by manipulating rules to increase the fitness of a rule and evaluate the selection of parameters used to define a solution
- …