public class ReadableArrayExtractor extends AbstractTypeExtractor<WyalFile.Type.Array>
Responsible for extracting a "readable array" from a given type. A readable
array is a conservative approximation of the arrays described in a given
type. Furthermore, it is safe used when reading elements from that type. For
example, the type (int[])|(bool[]) has a readable array type of
(int|bool)[]. This is the readable type as, if we were to read
an element from either bound, the return type would be in
int|bool. However, we cannot use type for writing as this could
be unsafe. For example, if we actually had an array of type
int[], then writing a boolean value is not permitted.
Not all types have readable array type and, furthermore, care must be
exercised for those that do. For example, (int[])|int does not
have a readable array type. Finally, negations play an important role in
determining the readable array type. For example,
(int|null)[] & !(int[]) generates the readable array type
null[].
AbstractTypeExtractor.Conjunct, AbstractTypeExtractor.Disjunct, AbstractTypeExtractor.Signedresolver, typeSystem| Constructor and Description |
|---|
ReadableArrayExtractor(wybs.lang.NameResolver resolver,
TypeSystem typeSystem) |
| Modifier and Type | Method and Description |
|---|---|
protected WyalFile.Type.Array |
construct(WyalFile.Type.Atom type) |
protected WyalFile.Type.Array |
intersect(WyalFile.Type.Array lhs,
WyalFile.Type.Array rhs) |
protected WyalFile.Type.Array |
subtract(WyalFile.Type.Array lhs,
WyalFile.Type.Array rhs) |
protected WyalFile.Type.Array |
union(WyalFile.Type.Array lhs,
WyalFile.Type.Array rhs) |
construct, construct, extract, intersectionHelper, isVoid, toDisjunctiveNormalForm, toDisjunctiveNormalForm, toDisjunctiveNormalForm, toDisjunctiveNormalForm, toDisjunctiveNormalForm, toDisjunctiveNormalForm, toDisjunctiveNormalForm, toDisjunctiveNormalForm, toDisjunctiveNormalForm, toDisjunctiveNormalForm, unionHelperpublic ReadableArrayExtractor(wybs.lang.NameResolver resolver,
TypeSystem typeSystem)
protected WyalFile.Type.Array construct(WyalFile.Type.Atom type)
construct in class AbstractTypeExtractor<WyalFile.Type.Array>protected WyalFile.Type.Array union(WyalFile.Type.Array lhs, WyalFile.Type.Array rhs)
union in class AbstractTypeExtractor<WyalFile.Type.Array>protected WyalFile.Type.Array subtract(WyalFile.Type.Array lhs, WyalFile.Type.Array rhs)
subtract in class AbstractTypeExtractor<WyalFile.Type.Array>protected WyalFile.Type.Array intersect(WyalFile.Type.Array lhs, WyalFile.Type.Array rhs)
intersect in class AbstractTypeExtractor<WyalFile.Type.Array>Copyright © 2017. All rights reserved.