|
Orbital library | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface TypeSystem
Provides type constructors, and factories for types of a type system. Type constructors create new types depending on some existing types. Factories, instead, create completely new types. For example, there are type constructors for map types.
[Atype system is a] tractable syntactic method for proving the absence of certain program behaviors by classifying phrases according to the kinds of values they compute.
(Types and Programming Languages, MIT Press, 2002)
Types.getDefault()
,
Type.typeSystem()
,
Type
,
Meta-Object Facilitygeneralized iteratable
objects, including but not limited to List
, Set
.Method Summary | |
---|---|
Type |
ABSURD()
The absurd type ⊥ = ⋃∅. |
Function |
bag()
bag: * → *; τ ↦ 〔τ〕. |
Type |
bag(Type element)
The bag/multiset type 〔τ〕. |
Function |
collection()
collection: * → *; τ ↦ collection(τ). |
Type |
collection(Type element)
The general collection type collection(τ). |
boolean |
equals(java.lang.Object o)
Checks whether two type systems are equal. |
int |
hashCode()
|
Function |
inf()
inf: {*} → *; (τi) ↦ ⋂iτi = τ1∩…∩τn. |
Type |
inf(Type[] components)
Get the infimum type ⋂iτi = τ1∩…∩τn. |
Function |
list()
list: * → *; τ ↦ 〈τ〉. |
Type |
list(Type element)
The list type 〈τ〉. |
BinaryFunction |
map()
map: *×* → *; (σ,τ) ↦ σ→τ. |
Type |
map(Type domain,
Type codomain)
Get the map type σ→τ. |
Type |
NOTYPE()
Not a type. |
Type |
objectType(java.lang.Class type)
Get the object type described by a class. |
Type |
objectType(java.lang.Class type,
java.lang.String signifier)
Get the object type described by a class. |
Function |
predicate()
predicate: * → *; σ ↦ (σ). |
Type |
predicate(Type domain)
Get the predicate type (σ) = σ→ο. |
Function |
product()
product: 〈*〉 → *; (τi) ↦ ∏iτi = τ1×…×τn. |
Type |
product(Type[] components)
Get the product type ∏iτi = τ1×…×τn. |
Function |
set()
set: * → *; τ ↦ {τ}. |
Type |
set(Type element)
The set type {τ}. |
Function |
sup()
sup: {*} → *; (τi) ↦ ⋃iτi = τ1∪…∪τn. |
Type |
sup(Type[] components)
Get the supremum type ⋃iτi = τ1∪…∪τn. |
Type |
TYPE()
The meta-type (kind) of types *:□. |
Type |
UNIVERSAL()
The universal type ⊤ = ⋂∅. |
Method Detail |
---|
boolean equals(java.lang.Object o)
Type system equality will often only depend on the implementation's classes.
equals
in class java.lang.Object
int hashCode()
hashCode
in class java.lang.Object
Type TYPE()
Type UNIVERSAL()
ABSURD()
Type ABSURD()
UNIVERSAL()
Type NOTYPE()
ABSURD()
Type objectType(java.lang.Class type)
type
- the type τ represented as a class object.
Type objectType(java.lang.Class type, java.lang.String signifier)
objectType(java.lang.Number,"number").equals(objectType(java.lang.Number,"numericQuantity")
type
- the type τ represented as a class object.signifier
- the representing the type.
objectType(Class)
Type map(Type domain, Type codomain)
The subtype relation of types extends to map types as follows
domain
- the domain
σ.codomain
- the co-domain
τ.BinaryFunction map()
The map type constructor.
map(Type,Type)
Type predicate(Type domain)
☡ Note that this type depends on the specific truth values.
domain
- the co-domain
σ.map(Type,Type)
Function predicate()
The predicate type constructor.
predicate(Type)
Type product(Type[] components)
Also called tuple type.
The subtype relation of types extends to product types as follows
components
- the components τi of the product type.list(Type)
Function product()
The product type constructor.
product(Type[])
Type inf(Type[] components)
The subtype relation of types extends to infimum types as follows
Type.compareTo(Object)
≤
⊤
, commutative, distributive sup(Type[])
, idempotent, σ ≤ τ
⇔ σ∩τ = σFunction inf()
The infimum type constructor.
inf(Type[])
,
Type.compareTo(Object)
Type sup(Type[] components)
The subtype relation of types extends to supremum types as follows
Type.compareTo(Object)
≤
⊥
, commutative, distributive inf(Type[])
, idempotent, σ ≤ τ
⇔ σ∪τ = τFunction sup()
The supremum type constructor.
sup(Type[])
,
Type.compareTo(Object)
Type collection(Type element)
list(Type)
,
set(Type)
,
bag(Type)
Function collection()
The collection type constructor.
collection(Type)
Type set(Type element)
Sets and predicates are different, i.e. {τ} ≠ (σ), because even though extensionally predicates correspond bijectively to sets, they may differ intensionally.
δ | predicate | →̃ | set |
ρ | ↦ | {x ¦ ρ(x)} | |
_∈M | ↤ | M |
collection(Type)
,
Set
Function set()
The set type constructor.
set(Type)
Type list(Type element)
collection(Type)
,
List
,
product(Type[])
Function list()
The list type constructor.
list(Type)
Type bag(Type element)
collection(Type)
Function bag()
The bag type constructor.
bag(Type)
|
Orbital library 1.3.0: 11 Apr 2009 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |