Changes between Initial Version and Version 1 of RefactoringSteps/RenameVariable


Ignore:
Timestamp:
Feb 15, 2012, 1:48:37 PM (12 years ago)
Author:
manualwiki
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • RefactoringSteps/RenameVariable

    v1 v1  
     1= Rename variable = 
     2 
     3The "rename variable" transformation renames a variable and all of its occurrences. The only semantic information it requires is the scope and visibility of the variables. 
     4 
     5Rename X to Y: 
     6 
     7{{{ 
     8max(X,Z) -> 
     9   if 
     10      X=<Z -> Z; 
     11      X>=Z -> X 
     12   end. 
     13}}} 
     14 
     15Result: 
     16 
     17{{{ 
     18max(Y,Z) -> 
     19   if 
     20      Y=<Z -> Z; 
     21      Y>=Z -> Y 
     22   end. 
     23}}} 
     24 
     25== Side conditions == 
     26 
     27 * The new variable name does not exist in the scope of the variable, either as a defined variable or as a visible variable. If it exists then the transformation starts an interaction to ask for a new variable name. 
     28 
     29 * If the user does not specify a variable, the transformation starts an interaction to ask for a variable. It gives a list of variables which can be reached from the selected function clause. 
     30 
     31 
     32== Transformation steps and compensations == 
     33 
     34 1. Replace every occurrence of the variable with the new name. In case of variable shadowing, other variables with the same name are not modified.