Capabilities
Capabilities are members of capture sets. They partially overlap with types as shown in the trait hierarchy below.
Capability --+-- RootCapabilty -----+-- GlobalCap --------+-- GlobalAny | | +-- GlobalFresh | +-- LocalCap | +-- ResultCap | +-- CoreCapability ----+-- ObjectCapability --+-- TermRef | | +-- ThisType | | +-- TermParamRef | | | +-- SetCapability -----+-- TypeRef | +-- TypeParamRef | +-- DerivedCapability -+-- Reach +-- Only +-- ReadOnly +-- Maybe
All CoreCapabilities are Types, or, more specifically instances of TypeProxy.
Attributes
- Graph
-
- Supertypes
- Self type
-
Capabilities.type
Members list
Type members
Classlikes
A trait for references in CaptureSets. These can be NamedTypes, ThisTypes or ParamRefs, as well as three kinds of AnnotatedTypes representing readOnly, reach, and maybe capabilities. If there are several annotations they come with an order: * first, .only next, .rd next, ? last.
A trait for references in CaptureSets. These can be NamedTypes, ThisTypes or ParamRefs, as well as three kinds of AnnotatedTypes representing readOnly, reach, and maybe capabilities. If there are several annotations they come with an order: * first, .only next, .rd next, ? last.
Attributes
- Supertypes
- Known subtypes
-
trait CoreCapabilitytrait ObjectCapabilityclass TermParamRefclass TermRefclass CachedTermRefclass ThisTypeclass CachedThisTypetrait SetCapabilityclass TypeParamRefclass TypeRefclass CachedTypeRefclass ParamReftrait DerivedCapabilityclass Maybeclass Reachclass ReadOnlyclass Restrictedtrait RootCapabilityclass GlobalCapobject GlobalAnyobject GlobalFreshclass LocalCapclass ResultCapShow all
Result type of transClassifiers. Interprete as follows: UnknownClassifier: No list could be computed since some capture sets are still unsolved variables Unclassified : No set exists since some parts of tcs are not classified ClassifiedAs(clss: All parts of tcss are classified with classes in clss
Result type of transClassifiers. Interprete as follows: UnknownClassifier: No list could be computed since some capture sets are still unsolved variables Unclassified : No set exists since some parts of tcs are not classified ClassifiedAs(clss: All parts of tcss are classified with classes in clss
Attributes
- Supertypes
-
trait Enumtrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
The base trait of all capabilities represented as types
The base trait of all capabilities represented as types
Attributes
- Supertypes
- Known subtypes
-
trait ObjectCapabilityclass TermParamRefclass TermRefclass CachedTermRefclass ThisTypeclass CachedThisTypetrait SetCapabilityclass TypeParamRefclass TypeRefclass CachedTypeRefclass ParamRefShow all
Attributes
- Supertypes
- Known subtypes
Map GlobalFresh capabilities in results of methods to ResultCaps This map is peculiar since it has to run very early in Setup where some capture sets are not yet known and consequently map in CaptureSet might give wrong results. A test case where this would happen is neg-custom-args/captures/i13816.scala This motivates the various tricks explained below.
Map GlobalFresh capabilities in results of methods to ResultCaps This map is peculiar since it has to run very early in Setup where some capture sets are not yet known and consequently map in CaptureSet might give wrong results. A test case where this would happen is neg-custom-args/captures/i13816.scala This motivates the various tricks explained below.
Attributes
- Supertypes
The global root capability referenced as caps.any
The global root capability referenced as caps.any
Attributes
- Supertypes
-
class GlobalCaptrait RootCapabilitytrait Capabilitytrait Showableclass Objecttrait Matchableclass AnyShow all
- Self type
-
GlobalAny.type
A class for the global root capabilities referenced as caps.any and caps.fresh. They do not subsume other capabilities, except in arguments of withCapAsRoot calls.
A class for the global root capabilities referenced as caps.any and caps.fresh. They do not subsume other capabilities, except in arguments of withCapAsRoot calls.
Attributes
- Supertypes
-
trait RootCapabilitytrait Capabilitytrait Showableclass Objecttrait Matchableclass AnyShow all
- Known subtypes
-
object GlobalAnyobject GlobalFresh
Map each occurrence of caps.any to a different LocalCap instance Exception: CapSet^ stays as it is.
Map each occurrence of caps.any to a different LocalCap instance Exception: CapSet^ stays as it is.
Attributes
- Supertypes
-
trait FollowAliasesMaptrait BiTypeMapclass TypeMapclass VariantTraversalclass Objecttrait Matchableclass AnyShow all
- Self type
The global root capability referenced as caps.fresh
The global root capability referenced as caps.fresh
Attributes
- Supertypes
-
class GlobalCaptrait RootCapabilitytrait Capabilitytrait Showableclass Objecttrait Matchableclass AnyShow all
- Self type
-
GlobalFresh.type
The local dual of a result type of a closure type.
The local dual of a result type of a closure type.
Value parameters
- binder
-
the method type of the anonymous function whose result is mapped
Attributes
- Supertypes
- Self type
The class of local roots named "any". These do subsume other capabilties in scope. They track with hidden sets which other capabilities were subsumed. Hidden sets are inspected by separation checking.
The class of local roots named "any". These do subsume other capabilties in scope. They track with hidden sets which other capabilities were subsumed. Hidden sets are inspected by separation checking.
Value parameters
- origin
-
an indication where and why the LocalCap was created, used for diagnostics
- owner
-
the owner of the context in which the LocalCap was created
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait RootCapabilitytrait Capabilitytrait Showableclass Objecttrait Matchableclass AnyShow all
If x is a capability, its maybe capability x?. x? stands for a capability x that might or might not be part of a capture set. We have `{} : C^{} <: C^{x}]
If x is a capability, its maybe capability x?. x? stands for a capability x that might or might not be part of a capture set. We have `{} : C^{} <: C^{x}]
but it has fewer issues with type inference.
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait DerivedCapabilitytrait Capabilitytrait Showableclass Objecttrait Matchableclass AnyShow all
Attributes
- Supertypes
-
trait CoreCapabilitytrait Capabilityclass TypeProxyclass Typetrait Showabletrait Hashableclass Objecttrait Matchableclass AnyShow all
- Known subtypes
The place of - and cause for - creating a LocalCap capability. Used for error diagnostics
The place of - and cause for - creating a LocalCap capability. Used for error diagnostics
Attributes
- Supertypes
-
trait Enumtrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
If x is a capability, its reach capability x*. x* stands for all capabilities reachable through x. We have {x} <: {x*} <: dcs(x)} where the deep capture set dcs(x) of x is the union of all capture sets that appear in covariant position in the type of x. If x and y are different variables then {x*} and {y*} are unrelated.
If x is a capability, its reach capability x*. x* stands for all capabilities reachable through x. We have {x} <: {x*} <: dcs(x)} where the deep capture set dcs(x) of x is the union of all capture sets that appear in covariant position in the type of x. If x and y are different variables then {x*} and {y*} are unrelated.
Reach capabilities cannot wrap read-only capabilities or maybe capabilities. We have (x?).reach = (x.reach)? (x.rd).reach = (x.reach).rd (x.only[T]).reach = (x*).only[T]
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait DerivedCapabilitytrait Capabilitytrait Showableclass Objecttrait Matchableclass AnyShow all
The readonly capability x.rd. We have {x.rd} <: {x}.
The readonly capability x.rd. We have {x.rd} <: {x}.
Read-only capabilities cannot wrap maybe capabilities but they can wrap reach capabilities. We have (x?).readOnly = (x.rd)?
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait DerivedCapabilitytrait Capabilitytrait Showableclass Objecttrait Matchableclass AnyShow all
The restricted capability x.only[C]. We have {x.only[C]} <: {x}.
The restricted capability x.only[C]. We have {x.only[C]} <: {x}.
Restricted capabilities cannot wrap maybe capabilities or read-only capabilities but they can wrap reach capabilities. We have (x?).restrict[T] = (x.restrict[T])? (x.rd).restrict[T] = (x.restrict[T]).rd
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait DerivedCapabilitytrait Capabilitytrait Showableclass Objecttrait Matchableclass AnyShow all
A root capability associated with a function type. These are conceptually existentially quantified over the function's result type.
A root capability associated with a function type. These are conceptually existentially quantified over the function's result type.
Value parameters
- binder
-
The function type with which the capability is associated. It is a MethodicType since we also have ResultCaps that are associated with the ExprTypes of parameterless functions. Currently we never create results over PolyTypes since a PolyType used as a type (not a method info) is always followed by a MethodType. Setup: In the setup phase,
freshinstances in the result of a dependent function type or method type such as(x: T): C^{fresh}are converted toResultCap(binder)instances, wherebinderrefers to the immediately enclosing method type. If one needs to refer to an outer method type as the binder instead, one can achieve that by using a type alias. For instance: type F[X^] = (x: A) => C^{X} () => F[{fresh}] With explicit quantification, this would be equivalent to () => \exists fresh. (x: A) => C^{fresh} The trick is that the argumentfreshis bound before theFalias is expanded.
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait RootCapabilitytrait Capabilitytrait Showableclass Objecttrait Matchableclass AnyShow all
The base trait of all root capabilities
The base trait of all root capabilities
Attributes
- Supertypes
- Known subtypes
Attributes
- Supertypes
-
trait CoreCapabilitytrait Capabilityclass TypeProxyclass Typetrait Showabletrait Hashableclass Objecttrait Matchableclass AnyShow all
- Known subtypes
Types
Value members
Concrete methods
The smallest list D of class symbols in cs1 and cs2 such that every class symbol in cs1 and cs2 is a subclass of a class symbol in D
The smallest list D of class symbols in cs1 and cs2 such that every class symbol in cs1 and cs2 is a subclass of a class symbol in D
Attributes
Maps caps.any to LocalCap instances. GlobalCapToLocal is a BiTypeMap since we don't want to freeze a set when it is mapped. On the other hand, we do not want LocalCap values to flow back to caps.any since that would fail disallowRootCapability tests elsewhere. We therefore use withNoVarsMapped to prevent the map being installed for future use.
Maps caps.any to LocalCap instances. GlobalCapToLocal is a BiTypeMap since we don't want to freeze a set when it is mapped. On the other hand, we do not want LocalCap values to flow back to caps.any since that would fail disallowRootCapability tests elsewhere. We therefore use withNoVarsMapped to prevent the map being installed for future use.
Attributes
The least classifier between cls1 and cls2, which are either AnyClass, NothingClass, or a class directly extending caps.Classifier.
The least classifier between cls1 and cls2, which are either AnyClass, NothingClass, or a class directly extending caps.Classifier.
Attributes
- Returns
-
if one of cls1, cls2 is a subclass of the other, the subclass otherwise NothingClass (which is a subclass of all classes)
Maps all LocalCap instances to caps.any
Maps all LocalCap instances to caps.any
Attributes
Map top-level free ResultCaps one-to-one to LocalCap instances
Map top-level free ResultCaps one-to-one to LocalCap instances
Attributes
Replace all occurrences of caps.any or LocalCap in parts of this type by an existentially bound variable bound by mt. Stop at function or method types since these have been mapped before.
Replace all occurrences of caps.any or LocalCap in parts of this type by an existentially bound variable bound by mt. Stop at function or method types since these have been mapped before.