FermaT Transformation System
From Wikipedia, the free encyclopedia
| This article or section is written like an advertisement. Please help rewrite this article from a neutral point of view. Mark blatant advertising which would require a fundamental rewrite in order to become encyclopedic for speedy deletion, using {{db-spam}}. (December 2007) |
The FermaT Transformation System is a powerful industrial-strength program transformation system based on the WSL language.
FermaT has been used successfully in several major assembler to C migration projects: each project involved converting over half a million lines of hand-written assembler code to efficient and maintainable C code.
FermaT is available as free software under the GNU General Public License (GPL).
An example of a program transformation is Semantic Slicing. Consider the following WSL program:
total:= 0;
i := 0;
evens := 0;
noevens := 0;
odds := 0;
noodds := 0;
n := n0;
WHILE i <= n DO
evenflag := A[i] MOD 2;
evenflag := 0;
IF FALSE
THEN evens := evens + A[i];
noevens := noevens + 1
ELSE odds := odds + A[i];
noodds := noodds + 1 FI;
total := total + A[i];
i := i + 1 OD;
IF noevens <> 0
THEN meaneven := evens/noevens
ELSE meaneven := 0 FI;
IF noodds <> 0
THEN meanodd := odds/noodds
ELSE meanodd := 0 FI;
mean := total/(n+1);
evendifference := ABS(meaneven - mean);
odddifference := ABS(meanodd-mean)
Suppose we are interested in the final value of the variable evendifference. Save the program as a text file test-1.wsl and run the transformation:
dotrans test-1.wsl test-2.wsl Semantic_Slice data=evendifference
This generates the output file test-2.wsl:
evendifference
:= ABS(REDUCE("+", A[0..n0]) / (n0 + 1))
See this paper for more information about semantic slicing.

