Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
I
Iris
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 116
    • Issues 116
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 22
    • Merge Requests 22
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Iris
  • Iris
  • Issues
  • #184

Closed
Open
Opened Apr 22, 2018 by Dan Frumin@dfruminContributor

`wp_binop` is not very useful for comparing arbitrary values

Consider the following piece of code:

From iris.heap_lang Require Export proofmode notation.

Lemma wut `{heapG Σ} (v1 v2 : val) :
  (WP if: (v1 = v2) then #0 else #0 {{ _, True }})%I.
Proof.
  wp_binop.
Abort.

The goal that I expected after executing wp_binop:

WP if: #(bool_decide (v1 = v2)) then #0 else #0 {{ _, True }}

Instead I got two goals:

  • bin_op_eval EqOp v1 v2 = Some ?Goal0
  • WP if: ?Goal0 then #0 else #0 {{ _, True }}

This is not very helpful, as it is pretty annoying to get a boolean value for ?Goal0.

I believe this is due to the way that bin_op_eval is defined: it first matches v1 and v2 for specific types of values (integers or booleans), and only then considers the case of generalized equality checks.

Since we have generalized/dynamic equality checks in heap_lang, why not first match on the type of the operation, and only then match on the values in bin_op_eval?

Best -Dan

Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: iris/iris#184