File | ConstraintReduction.str |
Author | Martin Bravenboer |
Since | unknown |
15.12.2.7: Reduction of Constraints (the huge itemize in this section)
General | |
Lines of code | 236 |
Stratego | |
Module number | 1 (100% documented) |
Constructor number | 0 |
Overlay number | 0 |
Strategy number | 10 (60% documented) |
Rule number | 5 (100% documented) |
DynamicRule number | 0 |
Strategy summary |
||
reduce-constraint(ATerm typevars) | Inference of type arguments begins with a set of initial constraints of the form A << F, A = F, or A >> F, where A is a type of an actual parameter, and F is a type of a formal parameter | ConstraintReduction.str |
reduce-equal-generic-constraint(Strategy rec, ATerm t) | If F has the form G< | ConstraintReduction.str |
reduce-equal-generic-constraint(Strategy rec, ATerm t) | n/a | ConstraintReduction.str |
reduce-left-right-generic-constraint(Strategy rec, ATerm t) | If F has the form G< | ConstraintReduction.str |
reduce-left-right-generic-constraint(Strategy rec, ATerm t) | n/a | ConstraintReduction.str |
reduce-left-right-prim-constraint(Strategy rec, ATerm t) | If A is primitive type | ConstraintReduction.str |
reduce-real-constraint(Strategy rec, ATerm t) | n/a | ConstraintReduction.str |
reduce-real-constraint(Strategy rec, ATerm t) | n/a | ConstraintReduction.str |
reduce-real-constraint(Strategy rec, ATerm t) | n/a | ConstraintReduction.str |
Rule summary |
||
helper-reduce-generic-constraint(Strategy s, Strategy rec, ATerm a, ATerm t) | Helper used for A << F and A = F | ConstraintReduction.str |
reduce-equal-array-constraint(Strategy rec, ATerm t) | If F = U[] where the type U involves Tj, then if A is an array type V[], or a type variable with an upper bound that is an array type V[], where V is a reference type, this algorithm is applied recursively to the constraint V = U | ConstraintReduction.str |
reduce-equal-simple-constraint(Strategy rec, ATerm t) | If F is Tj, then the constraint Tj = A is implied | ConstraintReduction.str |
reduce-left-right-array-constraint(Strategy rec, ATerm t) | If F = U[] | ConstraintReduction.str |
reduce-left-right-simple-constraint(Strategy rec, ATerm t) | If F is Tj | ConstraintReduction.str |
Strategy details |
|||||||||||||||
ATerm | reduce-constraint(ATerm typevars) | ||||||||||||||
Inference of type arguments begins with a set of initial constraints of the form A << F, A = F, or A >> F, where A is a type of an actual parameter, and Fis a type of a formal parameter. These constraints are reduced to a set of simpler constraints of the forms T :> X, T = X or T <: X, where T is a type parameter of the method. The result of this method is a list of these simpler constraints.
|
|||||||||||||||
ATerm | reduce-equal-generic-constraint(Strategy rec, ATerm t) | ||||||||||||||
If F has the form G< .... U .... >, where U is a type expression
|
|||||||||||||||
ATerm | reduce-left-right-generic-constraint(Strategy rec, ATerm t) | ||||||||||||||
If F has the form G< .... U .... >, where U is a type expression
|
|||||||||||||||
ATerm | reduce-left-right-prim-constraint(Strategy rec, ATerm t) | ||||||||||||||
If A is primitive type.
|
|||||||||||||||
ATerm | reduce-real-constraint(Strategy rec, ATerm t) | ||||||||||||||
No information available.
|
|||||||||||||||
ATerm | reduce-real-constraint(Strategy rec, ATerm t) | ||||||||||||||
No information available.
|
|||||||||||||||
Rule details |
|||||||||||||||||
ATerm | helper-reduce-generic-constraint(Strategy s, Strategy rec, ATerm a, ATerm t) | ||||||||||||||||
Helper used for A << F and A = F.
|
|||||||||||||||||
ATerm | reduce-equal-array-constraint(Strategy rec, ATerm t) | ||||||||||||||||
If F = U[] where the type U involves Tj, then if A is an arraytype V[], or a type variable with an upper bound that is an arraytype V[], where V is a reference type, this algorithm is appliedrecursively to the constraint V = U.
|
|||||||||||||||||
ATerm | reduce-equal-simple-constraint(Strategy rec, ATerm t) | ||||||||||||||||
If F is Tj, then the constraint Tj = A is implied.
|
|||||||||||||||||
ATerm | reduce-left-right-array-constraint(Strategy rec, ATerm t) | ||||||||||||||||
If F = U[]
|
|||||||||||||||||
ATerm | reduce-left-right-simple-constraint(Strategy rec, ATerm t) | ||||||||||||||||
If F is Tj
|
|||||||||||||||||