Skip to content
Snippets Groups Projects
Commit 1a544253 authored by Robbert Krebbers's avatar Robbert Krebbers
Browse files

Fix a broken notation.

parent 51564167
Branches
Tags
No related merge requests found
...@@ -20,6 +20,7 @@ Inductive binder := BAnon | BNamed : string → binder. ...@@ -20,6 +20,7 @@ Inductive binder := BAnon | BNamed : string → binder.
Delimit Scope lrust_binder_scope with RustB. Delimit Scope lrust_binder_scope with RustB.
Bind Scope lrust_binder_scope with binder. Bind Scope lrust_binder_scope with binder.
Notation "[ ]" := (@nil binder) : lrust_binder_scope.
Notation "a :: b" := (@cons binder a%RustB b%RustB) Notation "a :: b" := (@cons binder a%RustB b%RustB)
(at level 60, right associativity) : lrust_binder_scope. (at level 60, right associativity) : lrust_binder_scope.
Notation "[ x1 ; x2 ; .. ; xn ]" := Notation "[ x1 ; x2 ; .. ; xn ]" :=
......
...@@ -2,8 +2,7 @@ From iris.program_logic Require Import weakestpre. ...@@ -2,8 +2,7 @@ From iris.program_logic Require Import weakestpre.
From iris.base_logic.lib Require Import invariants. From iris.base_logic.lib Require Import invariants.
From iris.proofmode Require Import tactics. From iris.proofmode Require Import tactics.
From iris.algebra Require Import excl. From iris.algebra Require Import excl.
From lrust.lang Require Import proofmode notation. From lrust.lang Require Import lang proofmode notation.
From lrust.lang Require Export lang.
Set Default Proof Using "Type". Set Default Proof Using "Type".
Definition newlock : val := λ: [], let: "l" := Alloc #1 in "l" <- #false ;; "l". Definition newlock : val := λ: [], let: "l" := Alloc #1 in "l" <- #false ;; "l".
...@@ -54,14 +53,12 @@ Section proof. ...@@ -54,14 +53,12 @@ Section proof.
{ iNext. iExists false. by iFrame. } { iNext. iExists false. by iFrame. }
eauto. eauto.
Qed. Qed.
Lemma newlock_spec (R : iProp Σ) : Lemma newlock_spec (R : iProp Σ) :
{{{ R }}} newlock [] {{{ l γ, RET #l; is_lock γ l R }}}. {{{ R }}} newlock [] {{{ l γ, RET #l; is_lock γ l R }}}.
Proof. Proof.
iIntros (Φ) "HR HΦ". rewrite -wp_fupd /newlock /=. iIntros (Φ) "HR HΦ". iApply wp_fupd.
wp_seq. wp_alloc l vl as "Hl" "H†". inv_vec vl=>x. wp_seq. wp_alloc l vl as "Hl" "H†". inv_vec vl=>x.
(* FIXME: Something is wrong with the printing of the expression here *)
rewrite heap_mapsto_vec_singleton. (* FIXME shouldn't this also compute now, like bigops do? *) rewrite heap_mapsto_vec_singleton. (* FIXME shouldn't this also compute now, like bigops do? *)
wp_let. wp_write. wp_let. wp_write.
iMod (newlock_inplace with "[HR] Hl") as (γ) "?". iMod (newlock_inplace with "[HR] Hl") as (γ) "?".
......
...@@ -12,6 +12,7 @@ Coercion Var : string >-> expr. ...@@ -12,6 +12,7 @@ Coercion Var : string >-> expr.
Coercion BNamed : string >-> binder. Coercion BNamed : string >-> binder.
Notation "<>" := BAnon : lrust_binder_scope. Notation "<>" := BAnon : lrust_binder_scope.
Notation "[ ]" := (@nil expr) : expr_scope.
Notation "[ x ]" := (@cons expr x%E (@nil expr)) : expr_scope. Notation "[ x ]" := (@cons expr x%E (@nil expr)) : expr_scope.
Notation "[ x1 ; x2 ; .. ; xn ]" := Notation "[ x1 ; x2 ; .. ; xn ]" :=
(@cons expr x1%E (@cons expr x2%E (@cons expr x1%E (@cons expr x2%E
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment