Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • RefinedC RefinedC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 21
    • Issues 21
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 3
    • Merge requests 3
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Iris
  • RefinedCRefinedC
  • Merge requests
  • !98

WIP: parameterise operators with boolean result by the result integer type

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Lennard Gäher requested to merge lang-bool-param into master Jul 20, 2021
  • Overview 3
  • Commits 1
  • Pipelines 0
  • Changes 12

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.
  • add new derived notations in lang/c_notations.v that instantiate the operators with i32 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.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: lang-bool-param