This file contains useful definitions and lemmas about the Typechecker functions.
The type soundness property says that if the typechecker assigns a type to an
expression, then it must be the case that the expression EvaluatesTo a value
of that type. The EvaluatesTo predicate covers the (obvious) case where
evaluation has no errors, but it also allows for errors of type
entityDoesNotExist, extensionError, and arithBoundsError.
The typechecker cannot protect against these errors because they depend on
runtime information (i.e., the entities passed into the authorization request,
extension function applications on authorization-time data, and arithmetic
overflow errors). All other errors (attrDoesNotExist and typeError) can be
prevented statically.
Note: Currently, extensionErrors can also be ruled out at validation time
because the only extension functions that can error are constructors, and all
constructors are required to be applied to string literals, meaning that they
can be fully evaluated during validation. This is not guaranteed to be the case
in the future.
Note: We plan to implement a range analysis that will be able to rule out
arithBoundsErrors.
Equations
- One or more equations did not get rendered due to their size.
Instances For
On input to the typechecking function, for any (e, .attr k) in the Capabilities, e is a record- or entity-typed expression that has attribute k. Similarly, for any (e, .tag k) in the Capabilities, e is an entity-typed expression that has tag k.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The Capabilities output by the typechecking function will satisfy
CapabilitiesInvariant provided that the input expression evaluates to true.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
A variant of type_is_inhabited assuming instead
that the type is the result of typeOf.