Whiley / WhileyCompiler

The Whiley Compiler (WyC)
http://whiley.org
Apache License 2.0
217 stars 36 forks source link

Support Specification Elements #1110

Closed DavePearce closed 2 years ago

DavePearce commented 2 years ago

Currently, specification elements are represented in the WyIL file format as Tuple<Expr>. This is actually quite limited for several reasons:

  1. Modifiers. We cannot have public / private specification elements, etc. Similarly, synthetic elements which have been inferred.
  2. Queries. For a given expression, we cannot ask a question like: is this expression within a specification element?

Therefore, it makes sense to me to have a specific type such that Tuple<Expr> becomes Tuple<Element> (or similar) where Element wraps the Expr. Perhaps it makes sense even to distinguish Where, Requires, Ensures.