1 **ru le** D a t a T y p e {
2 **from**
3 s : C P P i v o t ! D a t a T y p e 4 to 5 t : C P P i v o t ! D a t a T y p e (
6 n a m e <− s . n a m e 7 ) 8 }
A conditional copy happens when a copy rule has a filter or guard (i.e.,
a boolean expression that conditions the execution of the rule). The rule of Listing 1.2 is similar to the rule presented above in Listing **1.1 but has a guard**
specified at line 4. This rule performs a conditional copy.

Listing 1.2. Conditionally copy **rule example**
1 **ru le** S e t D o m a i n {
2 **from**
3 s : C P P i v o t ! S e t D o m a i n ( 4 n o t s . p a r e n t . o c l I s T y p e O f ( C P P i v o t ! I n d e x V a r i a b l e )
5 )
6 to 7 t : C P P i v o t ! S e t D o m a i n (
8 v a l u e s <− s . v a l u e s 9 )
10 }
Listing 1.3 contains a lazy copy rule similar to the two previous rules of Listings 1.1 and 1.2 but starting with keyword lazy **at line 1. Additionally, the**
rule presented here extends another rule via rule inheritance. This information is currently ignored during the abstraction process.

1 **lazy ru le** l a z y B o o l V a l **extends** l a z y E x p r e s s i o n {
2 **from**
3 b : C P P i v o t ! B o o l V a l 4 to 5 t : C P P i v o t ! B o o l V a l (
6 v a l u e <− b . v a l u e 7 ) 8 }
An example of conditional mutation is given in Listing 1.4. This rule is a mutation because the target type IntVal **(line 7) is different from the source**
type VariableExpr **(line 3). It is conditional because there is a filter at line 4.**
Listing 1.4. Conditional mutation **rule example**
1 **ru le** V a r i a b l e E x p r 2 I n t V a l {
2 **from**
3 s : C P P i v o t ! V a r i a b l e E x p r ( 4 s . d e c l a r a t i o n . o c l I s T y p e O f ( C P P i v o t ! E n u m L i t e r a l )
5 )
6 to 7 t : C P P i v o t ! I n t V a l (
8 v a l u e <− s . d e c l a r a t i o n . g e t E n u m P o s 9 )
10 }
Listing 1.3. Lazily copy **rule example**