Subtyping

File Subtyping.str
Author Martin Bravenboer <martin@cs.uu.nl>
Since unknown

4.10: Subtyping




Statistics


General
Lines of code 195
Stratego
Module number 1 (100% documented)
Constructor number 0
Overlay number 0
Strategy number 16 (62% documented)
Rule number 8 (12% documented)
DynamicRule number 0



Strategy summary


direct-supertypes Case: Class, raw or unparameterized Subtyping.str
direct-supertypes Case: Interface, raw or unparameterized Subtyping.str
direct-supertypes Case: Class, parameterized Subtyping.str
direct-supertypes Case: Interface, parameterized Subtyping.str
direct-supertypes n/a Subtyping.str
direct-supertypes n/a Subtyping.str
direct-supertypes n/a Subtyping.str
direct-supertypes-of-class-helper(ATerm type) n/a Subtyping.str
direct-supertypes-of-interface-helper(ATerm type) n/a Subtyping.str
have-subtype-relation(ATerm t1, ATerm t2) Checks if the two type arguments have a subtype relation Subtyping.str
is-proper-subtype(ATerm type) n/a Subtyping.str
is-proper-supertype(ATerm of) Checks if the current term is a proper supertype of the specified type Subtyping.str
is-subtype(ATerm type) Checks if the current term is a subtype of the specified type Subtyping.str
is-subtype(ATerm type) The special Null type is a subtype of every type Subtyping.str
proper-supertypes Returns all (not just the direct) proper supertypes of the given Type Subtyping.str
supertypes Returns all (not just the direct) proper supertypes of the given Type Subtyping.str

Rule summary


direct-supertypes Returns the direct supertypes of a type Subtyping.str
direct-supertypes n/a Subtyping.str
direct-supertypes n/a Subtyping.str
direct-supertypes n/a Subtyping.str
direct-supertypes n/a Subtyping.str
direct-supertypes n/a Subtyping.str
direct-supertypes n/a Subtyping.str
direct-supertypes n/a Subtyping.str



Strategy details


ATerm direct-supertypes
File Subtyping.str
Author unknown
Since unknown
 

Case: Class, raw or unparameterized.



 
ATerm direct-supertypes
File Subtyping.str
Author unknown
Since unknown
 

Case: Interface, raw or unparameterized.



 
ATerm direct-supertypes
File Subtyping.str
Author unknown
Since unknown
 

Case: Class, parameterized.


todo The second 'contains' option.
todo Check the number of arguments (invoke separate strategy)

 
ATerm direct-supertypes
File Subtyping.str
Author unknown
Since unknown
 

Case: Interface, parameterized.



 
ATerm have-subtype-relation(ATerm t1, ATerm t2)
File Subtyping.str
Author unknown
Since unknown
 
Parameters
ATerm t1 Type
ATerm t2 Type

Checks if the two type arguments have a subtype relation.



 
ATerm is-proper-supertype(ATerm of)
File Subtyping.str
Author unknown
Since unknown
 

Checks if the current term is a proper supertype of the specified type



 
ATerm is-subtype(ATerm type)
File Subtyping.str
Author unknown
Since unknown
 
Parameters
ATerm type t Type

Checks if the current term is a subtype of the specified type.


type Type -> Type

 
ATerm is-subtype(ATerm type)
File Subtyping.str
Author unknown
Since unknown
 

The special Null type is a subtype of every type.


todo I think null is only a subtype of reference types. Submitted. (4.10)

 
ATerm proper-supertypes
File Subtyping.str
Author unknown
Since unknown
 

Returns all (not just the direct) proper supertypes of the given Type.


type Type -> List(Type)

 
ATerm supertypes
File Subtyping.str
Author unknown
Since unknown
 

Returns all (not just the direct) proper supertypes of the given Type.


type Type -> List(Type)

 

Rule details


ATerm direct-supertypes
File Subtyping.str
Author unknown
Since unknown
 

Returns the direct supertypes of a type.


type Type -> List(Type)