This section describes the steps of a simple use of FORESYS/TSF. We do not focus on the use of FORESYS but on that of TSF. The graphical interface is briefly described but more informations are given in section 5.2. The goal of this exemple is to normalize a Fortran loop.
Before starting Foresys, we must create a Forlib that contains all the Fortran files used in your project. The simplest method is to execute a forlib_create command in the directory that contains your fortran codes:
A graphical interface is also provided in Foresys for this task (see the menu Files). Then we can execute the foresys command. We should obtain a window similar to the one given in figure 2.
An exemple of TSF window is given in the Figure 4. More detailled informations are given in section 5.2. The 'Loop Normalization' transformation is selected.
The normalization transformation must be applied to a specific loop so the first step is to define the target. The simplest and most used method is to select a statement by hand in the fortran window. Another way is to use the pattern (see section 11) provided for the normalization ; the Search button in the TSF window allows to select one by one the loops in the fortran window (see the selection in the left window of the figure 5). More complex patterns can be used. For instance to ignore the loops with a step equal to 1. The right part of the figure 5 shows the resulting code after that the Apply button is pressed. The changes can be cancelled by the Undo button and then restored by Redo button.