Search code examples
coq

Iris/Coq replacing literal


I am using Iris for Coq, but I am stuck on something. Place I am stuck on

Here, I want to get the snd value, l', from hd'. Then I can use IH with Hl and Hphi to finish the goal. Does anyone know how to replace hd' in the goal?


Solution

  • Your program (as in, the heap_lang code you are trying to verify) seems wrong. You are trying to get the second component of a location, which does not make sense, since locations are not pairs.

    What your program should probably do here is load from the location, to get the pair that is stored in memory at location #hd'. In other words, instead of Snd #hd', it should be Snd (! #hd').

    Once you fix your program, you can simply load from memory using wp_load. But this needs the load instruction (!) you are currently missing.