Index of /mct/2011-08-18

[ICO]NameLast modifiedSizeDescription

[PARENTDIR]Parent Directory   -  
[DIR]bin.Linux_x86_64/ 2012-03-20 19:24 -  
[DIR]result/ 2012-03-20 19:24 -  
[DIR]scripts/ 2012-03-20 19:24 -  
[DIR]source/ 2012-03-20 19:24 -  
[TXT]eval.c.id.type 2012-03-20 19:24 30K 
[TXT]eval.c.id 2012-03-20 19:24 42K 
[   ]mct-Linux.tar.gz 2012-03-20 19:24 4.1M 

Frequently asked questions


Q. What are in the folder?

bin.* -- binaries

source -- source examples
  source/norm -- user-defined normalisations
  source/Java/java -- Java program examples
  source/Verilog/v -- Verilog examples

result -- result of normalisations
  result/norm -- normalisations transformed 
  result/Java/java -- normalised Java program examples
  result/Verilog/verilog2 -- normalised Verilog examples
  result/Verilog/v -- unparsed Verilog examples
  grammar.txt -- the size related to the grammar transformations
  jhotdraw.txt -- the size related to the jhotdraw experiments
  gmf.txt -- the size related to the gmf experiments

cvs -- experiments on analysing the CVS of java projects
  cvs/uart16650 -- UArt 16650 (Verilog)
  cvs/jhotdraw -- JHotDraw (Java)
  cvs/gmf -- GMF (Java)

scripts -- the high-level driving scripts of MCT
  scripts/mct -- meaningful change detection
  scripts/mct-mdsd -- meaningful change detection: comparing @generated NOT with @generated tags
  scripts/mct-model -- meaningful change detection: extracting the @model members
  scripts/mct-id -- meaningful change detection: extracting the identifiers

Q. How to define annotations?

Given a TXL grammar, enter the following annotations in the end of any
non-terminal rule [...]:

  ... [kept] [ordered by X] [ignored when Y] [preferred with Z]

where X is an optional user-defined ordering rule, Y is an optional
user-defined selection rule, and Z is one to many literal constants or a user-defined
function to be used to replace the term.

Q. How to generate normalisation transformations from the annotations? 

First apply the `normc' to create the normalisation tools, e.g.,

> bin.*/normc source/norm/Java/simple.norm -o result/norm/Java/simple.norm
> bin.*/normc source/norm/Verilog/verilog2.norm -o result/norm/Verilog/verilog2.norm
> bin.*/norm-id-c source/norm/C/cid.norm -o result/norm/C/cid.norm

Then apply the following commands to generate the binary tools:

> bin.*/txlc result/norm/Java/simple.norm -o bin.*/Java/simple
> bin.*/txlc result/norm/Verilog/verilog2.norm -o bin.*/Verilog/verilog2c
> bin.*/txlc result/norm/C/cid.norm -o bin.*/C/cidc

Q. How to normalise the examples?

E.g.,

> bin.*/Java/simplec source/Java/java/HelloWorld.java -o result/Java/java/HelloWorld.java
> bin.*/Java/simplec source/Java/java/HelloWorld-2.java -o result/Java/java/HelloWorld-2.java

Q. How to remove clones in the normalised examples?

Either use the original sources, e.g.,
> bin.*/Java/simplec source/Java/java/HelloWorld.java -diff source/Java/java/HelloWorld-2.java 

or use the normalised source:
> bin.*/Java/simplec result/Java/java/HelloWorld.java -diff result/Java/java/HelloWorld-2.java 

Q. How to count the number of clones removed ?

Turn on the -attr option, e.g.,
> bin.*/Java/simplec -attr source/Java/java/HelloWorld.java -diff source/Java/java/HelloWorld-2.java 

Q. How to compare the code with comments?

We use the "cc" tool to delegate the check differences with comments
> bin.*/Java/simplecc -attr source/Java/java/HelloWorld-2.java -diff source/Java/java/HelloWorld-3.java 

Q. How to extract identifiers from any programs?

We use the "id" tool to extract the identifiers of any programs, e.g.,
> bin.*/C/cidc source/C/vim73/eval.c