15.12.2.7: Reduction of Constraints (the huge itemize in this section)
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.
type
|
Constraint -> List(Constraint)
|
|
|
ATerm
|
reduce-equal-generic-constraint(Strategy rec, ATerm t)
|
If F has the form G< .... U .... >, where U is a type expression
type
|
Constraint -> List(Constraint)
|
|
|
ATerm
|
reduce-left-right-generic-constraint(Strategy rec, ATerm t)
|
If F has the form G< .... U .... >, where U is a type expression
type
|
Constraint -> List(Constraint)
|
|
|
ATerm
|
reduce-left-right-prim-constraint(Strategy rec, ATerm t)
|
If A is primitive type.
todo
|
Recursive invocation of reduction or fixpoint strategy?
|
type
|
Constraint -> List(Constraint)
|
|
|
ATerm
|
reduce-real-constraint(Strategy rec, ATerm t)
|
No information available.
type
|
Constraint -> List(Constraint)
|
|
|
ATerm
|
reduce-real-constraint(Strategy rec, ATerm t)
|
No information available.
type
|
Constraint -> List(Constraint)
|
|
|
Rule details
|
ATerm
|
helper-reduce-generic-constraint(Strategy s, Strategy rec, ATerm a, ATerm t)
|
Helper used for A << F and A = F.
todo
|
Check that u is a type expression.
|
todo
|
Check that v is a type expression.
|
todo
|
Should the fetch-elem be a retain-all?
|
type
|
List(ActualTypeArg) -> List(Constraint)
|
|
|
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.
todo
|
Primitive arrays introduce no constraints. Test this.
|
todo
|
TypeVariable upper bound case.
|
type
|
Constraint -> List(Constraint)
|
|
|
ATerm
|
reduce-equal-simple-constraint(Strategy rec, ATerm t)
|
If F is Tj, then the constraint Tj = A is implied.
type
|
Constraint -> List(Constraint)
|
|
|
ATerm
|
reduce-left-right-array-constraint(Strategy rec, ATerm t)
|
If F = U[]
todo
|
Primitive arrays introduce no constraints. Test this.
|
todo
|
TypeVariable upper bound case.
|
|
|
ATerm
|
reduce-left-right-simple-constraint(Strategy rec, ATerm t)
|
If F is Tj
type
|
Constraint -> List(Constraint)
|
|
|