Skip to content

parameterise operators with boolean result by the result integer type

Lennard Gäher requested to merge ci/lang-bool-param into master

This is a follow-up to !98 (closed).

This PR parameterises Caesium's operators with a "boolean" result (i.e. the comparison operators as well as the derived && and || operators) by a result integer type (which was hard-coded before to i32) as a step to use Caesium for modelling other C-like languages with different modelling of boolean results (e.g. Rust, which uses single-byte booleans).

Concretely, the changes can be summarised as:

  • add a parameter rit to the affected operators and use that for the operational semantics of these operators, replacing the i32 used before.
  • adapt the existing notations for these operators to reflect this.
  • change the Coq codegen to emit the additional parameter as i32,
  • adapt the typing proofs to work for the changed operators instantiated to i32. Possibly, it might be desirable to support other result types even for C and to generalize the proofs accordingly, but I'm not sure.

The existing examples in the repo compile with these changes, but I haven't tested more exhaustively yet.

Edited by Lennard Gäher

Merge request reports