Skip to content

Instantly share code, notes, and snippets.

View JoJoDeveloping's full-sized avatar
💭
🦉

Johannes Hostert JoJoDeveloping

💭
🦉
View GitHub Profile
@JoJoDeveloping
JoJoDeveloping / cmra_restrictions.v
Last active November 28, 2024 00:53
Union of non-empty things is non-empty.
From iris.algebra Require Export ofe monoid cmra.
From iris.prelude Require Import options.
Locate pmap_omap.
Section restrict_validity.
Definition restrictV (A : Type) (P : nat → A → Prop) := A.
Local Instance restrictV_validN A P : ValidN (restrictV A P) := P.
Local Instance restrictV_valid A P : Valid (restrictV A P) := λ a, ∀ n, P n a.
Definition restrictV_cmra {A : cmra} PvalidN
(* the new validity restricts the old one *)
From Coq Require Import Nat List Extraction.
Import ListNotations.
Definition EqDec (A:Type) := forall (a b : A), {a = b} + {a <> b}.
Existing Class EqDec.
Definition eq_dec {A : Type} `{EqDec A} : EqDec A := _.
(* Defining these is somewhat annoying since you need to prove their correctness at the same time. *)
Program Instance eq_dec_option {A} {H : EqDec A} : EqDec (option A) := fun a b => match a, b with
None, None => left _