Skip to content
Snippets Groups Projects
Commit d30b8add authored by Robbert Krebbers's avatar Robbert Krebbers Committed by Jacques-Henri Jourdan
Browse files

Automate proofs of `Atomic` instances.

parent 9646293e
No related branches found
No related tags found
No related merge requests found
...@@ -7,70 +7,29 @@ Proof. done. Qed. ...@@ -7,70 +7,29 @@ Proof. done. Qed.
Instance as_val_val v : AsVal (Val v). Instance as_val_val v : AsVal (Val v).
Proof. by eexists. Qed. Proof. by eexists. Qed.
Local Ltac solve_atomic :=
apply strongly_atomic_atomic, ectx_language_atomic;
[inversion 1; naive_solver
|apply ectxi_language_sub_redexes_are_values; intros [] **; naive_solver].
Instance alloc_atomic s v : Atomic s (Alloc (Val v)). Instance alloc_atomic s v : Atomic s (Alloc (Val v)).
Proof. Proof. solve_atomic. Qed.
apply strongly_atomic_atomic, ectx_language_atomic.
- intros σ e σ' ef obs Hstep; simpl in *. inversion Hstep; simplify_eq. eauto.
- apply ectxi_language_sub_redexes_are_values=> /= Ki e' Hfill.
destruct Ki; simplify_eq/=. eauto.
Qed.
Instance load_atomic s v : Atomic s (Load (Val v)). Instance load_atomic s v : Atomic s (Load (Val v)).
Proof. Proof. solve_atomic. Qed.
apply strongly_atomic_atomic, ectx_language_atomic.
- intros σ e σ' ef obs Hstep; simpl in *. inversion Hstep; simplify_eq. eauto.
- apply ectxi_language_sub_redexes_are_values=> /= Ki e' Hfill.
destruct Ki; simplify_eq/=. eauto.
Qed.
Instance store_atomic s v1 v2 : Atomic s (Store (Val v1) (Val v2)). Instance store_atomic s v1 v2 : Atomic s (Store (Val v1) (Val v2)).
Proof. Proof. solve_atomic. Qed.
apply strongly_atomic_atomic, ectx_language_atomic.
- intros σ e σ' ef obs Hstep; simpl in *. inversion Hstep; simplify_eq. eauto.
- apply ectxi_language_sub_redexes_are_values=> /= Ki e' Hfill.
destruct Ki; simplify_eq/=; eauto.
Qed.
Instance cas_atomic s v0 v1 v2 : Atomic s (CAS (Val v0) (Val v1) (Val v2)). Instance cas_atomic s v0 v1 v2 : Atomic s (CAS (Val v0) (Val v1) (Val v2)).
Proof. Proof. solve_atomic. Qed.
apply strongly_atomic_atomic, ectx_language_atomic.
- intros σ e σ' ef obs Hstep; simpl in *. inversion Hstep; simplify_eq; eauto.
- apply ectxi_language_sub_redexes_are_values=> /= Ki e' Hfill.
destruct Ki; simplify_eq/=; eauto.
Qed.
Instance faa_atomic s v1 v2 : Atomic s (FAA (Val v1) (Val v2)). Instance faa_atomic s v1 v2 : Atomic s (FAA (Val v1) (Val v2)).
Proof. Proof. solve_atomic. Qed.
apply strongly_atomic_atomic, ectx_language_atomic.
- intros σ e σ' ef obs Hstep; simpl in *. inversion Hstep; simplify_eq; eauto.
- apply ectxi_language_sub_redexes_are_values=> /= Ki e' Hfill.
destruct Ki; simplify_eq/=; eauto.
Qed.
Instance fork_atomic s e : Atomic s (Fork e). Instance fork_atomic s e : Atomic s (Fork e).
Proof. Proof. solve_atomic. Qed.
apply strongly_atomic_atomic, ectx_language_atomic.
- intros σ e' σ' ef obs Hstep; simpl in *. inversion Hstep; simplify_eq; eauto.
- apply ectxi_language_sub_redexes_are_values=> /= Ki e' Hfill.
destruct Ki; simplify_eq/=; eauto.
Qed.
Instance skip_atomic s : Atomic s Skip. Instance skip_atomic s : Atomic s Skip.
Proof. Proof. solve_atomic. Qed.
apply strongly_atomic_atomic, ectx_language_atomic.
- intros σ e' σ' ef obs Hstep; simpl in *. inversion Hstep; simplify_eq; eauto.
- apply ectxi_language_sub_redexes_are_values=> /= Ki e' Hfill.
destruct Ki; simplify_eq/=; eauto.
Qed.
Instance new_proph_atomic s : Atomic s NewProph. Instance new_proph_atomic s : Atomic s NewProph.
Proof. Proof. solve_atomic. Qed.
apply strongly_atomic_atomic, ectx_language_atomic.
- intros σ e' σ' ef obs Hstep; simpl in *. inversion Hstep; simplify_eq; eauto.
- apply ectxi_language_sub_redexes_are_values=> /= Ki e' Hfill.
destruct Ki; simplify_eq/=; eauto.
Qed.
Instance resolve_proph_atomic s v1 v2 : Atomic s (ResolveProph (Val v1) (Val v2)). Instance resolve_proph_atomic s v1 v2 : Atomic s (ResolveProph (Val v1) (Val v2)).
Proof. Proof. solve_atomic. Qed.
apply strongly_atomic_atomic, ectx_language_atomic.
- intros σ e σ' ef obs Hstep; simpl in *. inversion Hstep; simplify_eq. eauto.
- apply ectxi_language_sub_redexes_are_values=> /= Ki e' Hfill.
destruct Ki; simplify_eq/=; eauto.
Qed.
(** The tactic [reshape_expr e tac] decomposes the expression [e] into an (** The tactic [reshape_expr e tac] decomposes the expression [e] into an
evaluation context [K] and a subexpression [e']. It calls the tactic [tac K e'] evaluation context [K] and a subexpression [e']. It calls the tactic [tac K e']
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment