WIP: parameterise operators with boolean result by the result integer type
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 thei32
used before. - adapt the existing notations for these operators to reflect this.
- add new derived notations in
lang/c_notations.v
that instantiate the operators withi32
so that the codegen for RefinedC does not need to be changed much, and change the Coq codegen to also import this new file. - 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.
Merge request reports
Activity
I had a quick look, and that seems pretty good to me so far.
Note however that we only have CI on branches with names starting with
ci/
(just CI) ortime/
(CI + data on https://coq-speed.mpi-sws.org). It would probably make sense to rename your branch into something likeci/lang-bool-param
so that we get CI.mentioned in merge request !99 (merged)
Closed in favour of !99 (merged)