public class TypeInvariantExtractor extends Object implements TypeExtractor<Formula,WyalFile.Expr>
type nat is (int x) where x >= 0Then, extracting the invariant from type
nat gives
x >= 0. Likewise, extracting the invariant from the type
bool|int gives the invariant
(x is int) ==> (x >= 0). Finally, extracting the invariant from
the type nat[] gives the invariant forall(int i).(0 <= i
&& i < |xs| ==> xs[i] >= 0).| Constructor and Description |
|---|
TypeInvariantExtractor(wybs.lang.NameResolver resolver) |
| Modifier and Type | Method and Description |
|---|---|
Formula |
extract(WyalFile.Type type,
WyalFile.Expr root)
Attempt to extract a certain kind of type from an arbitrary type.
|
Formula |
extractTypeInvariantInner(WyalFile.Type type,
WyalFile.Expr root,
HashSet<WyalFile.Type> visited) |
public TypeInvariantExtractor(wybs.lang.NameResolver resolver)
public Formula extract(WyalFile.Type type, WyalFile.Expr root) throws wybs.lang.NameResolver.ResolutionError
TypeExtractor{int x}|{int x} we can extract the type
{int x}.extract in interface TypeExtractor<Formula,WyalFile.Expr>type - The type for which information is to be extractedroot - Supplementary information which may be used by the extractor.wybs.lang.NameResolver.ResolutionErrorpublic Formula extractTypeInvariantInner(WyalFile.Type type, WyalFile.Expr root, HashSet<WyalFile.Type> visited) throws wybs.lang.NameResolver.ResolutionError
wybs.lang.NameResolver.ResolutionErrorCopyright © 2017. All rights reserved.