Copyright © (C) 2015 Pablo Lamela, Simon Thompson
Authors: Pablo Lamela Seijas (P.Lamela-Seijas@kent.ac.uk), Simon Thompson (S.J.Thompson@kent.ac.uk).
This package provides a mechanism that automatically creates an Erlang behaviour by merging two modules selected by the user, which are assumed to be structurally similar, and possibly the result of copying and modifying one of them to produce the other.
The algorithm consists of four main stages:
tree_mapping) - Compares the ASTs of the two input modulestree_clustering) - Divides the contiguous mapped subtrees into clusterscluster_linking) - Organises and links the clusters so that the order of execution from the original ASTs is preservedcluster_mapping) - Uses the information about clusters and links to construct the three final ASTsThe process starts with two modules which are assumed to be similar. First we find commonalities between their ASTs, group the contiguous commonalities, move the commonalities to a separate module, and link the pieces together with function calls in order to preserve the original behaviour. This way we are left with three modules: the remains of the original ones and a new module with the common parts. The module with the common code will be configured as a behaviour definition, and modules with the remainings of the original ones will be configured as behaviour instances of the new module.
The top level module for the algorithm is infer_behaviour.
Generated by EDoc, Nov 12 2015, 18:43:11.