Skip to main content

Module annotation

Module annotation 

Source
Expand description

Pancake contracts: pancake2viper’s annotation IR, lifted to the contract IR.

The pancake2viper crate parses each /@ … @/ annotation — the same parser the verifier runs, at the revision Cargo.toml and nix/pancake2viper.nix share. This module is foreign::c::acsl’s counterpart for Viper: the ir::Expr of each requires/ensures becomes a Term of crate::foreign::contract.

The subset matches C’s: integer and boolean literals, parameters, retval, old(…), + - * / %, the signed comparisons (<+ and friends are unsigned), ==/!=, ! && || and c ? a : b. Permissions, quantifiers, the heap, implication, calls, bit operators and shifts are rejected by name. Any other annotation (trusted, an invariant) is the verifier’s and is not read.

Functions§

from_foreign
The contract of a Pancake function from its requires/ensures annotations; any other annotation is the verifier’s and is not read. consts are the .fis constants a clause may name besides the parameters.