Skip to content

Boogie Backend Redesign #153

@DavePearce

Description

@DavePearce

(see also #72, #120 and #142)

This is an attempt to log the various problems with the current approach.

  • Functions. Translating a Whiley function as a boogie function is fraught with difficulties (why?). A better solution would be to translate them as procedures. This has a bunch of knock-on effects. In particular, we cannot use preconditions / postconditions in procedures. Instead, we must use assume and assert statements. Also, it means function calls have to be pulled out of expressions. In effect, we end up with something much closer to bytecode.
  • Properties. These are translated into boogie functions. But, how do we enforce their preconditions / postconditions (e.g. parameter / return types). Likewise, internal consistency requirements, such as indices within bounds? Potentially, a separate property check procedure is required for this.
  • Control Flow. Current challenges with extracting method calls from conditions mean that we often fall back to unstructured control-flow (e.g. for loops). Overall, I thing its simply better to do this all the time.
  • Boxing / Unboxing. It should be possible to eliminate the need for boxing / unboxing. This can done using algebraic datatypes, and types like Vec. See also Boogie Sequences #109. Questions remain around the heap and template.
  • Types. Dafny uses something like <A>[ref, Field A]A for representing parts of the heap (see Memory T below). Boogie also has built-in support for "sequences" (see here), and supports tuple assignments.
  • Casts. These appear to be a problem in my current design.
  • Error Reporting. You can supply messages in assertions which can help with error reporting (see here). Syntax is {:msg "your text goes here"}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions