Error:
File /home/kali/.opam/default/lib/coq/user-contrib/iris/algebra/auth.vo has
bad version number 81700 (expected 81601). It is corrupted or was compiled
with another version of Coq.
make[1]: *** [Makefile:793: learn2.vo] Error 1
make: *** [Makefile:409: all] Error 2
I have tried these three commands, but no avail
opam update
opam upgrade coq
opam upgrade coq-iris
Here is my coq file
From iris.algebra Require Import auth frac_auth numbers.
From iris.base_logic Require Import invariants.
From iris.heap_lang Require Import lang proofmode notation.
From iris.proofmode Require Import tactics.
From iris Require Import options.
(* Define the counter module *)
Module counter.
Definition newcounter : val := λ: <>, ref #0.
Definition inc : val := λ: "l", let: "n" := !"l" in CmpXchg "l" "n" ("n" + #1).
Definition read : val := λ: "l", !"l".
End counter.
Section proof.
Context `{!heapGS Σ}.
Definition is_counter (l : loc) (n : Z) :=
(l ↦ #n)%I.
Lemma newcounter_spec :
{{{ True }}}
counter.newcounter #()
{{{ l, RET #l; is_counter l 0 }}}.
Proof.
iIntros (Φ) "_ Hpost".
wp_lam. wp_alloc l as "Hl".
iApply "Hpost".
iExact "Hl".
Qed.
Lemma inc_spec (l: loc) (n: Z) :
{{{ is_counter l n }}}
counter.inc #l
{{{ RET #(); is_counter l (n + 1) }}}.
Proof.
iIntros (Φ) "Hl Hpost".
wp_lam. wp_load. wp_pures.
wp_bind (CmpXchg _ _ _).
wp_cmpxchg_suc.
iApply "Hpost". iFrame.
Qed.
Lemma read_spec (l: loc) (n: Z) :
{{{ is_counter l n }}}
counter.read #l
{{{ RET #n; is_counter l n }}}.
Proof.
iIntros (Φ) "Hl Hpost".
wp_lam. wp_load.
iApply "Hpost". iFrame.
Qed.
End proof.
```
opam remove coq-iris && opam install coq-iris
? $\endgroup$