Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Iris
Iris
Commits
9c0037c6
Unverified
Commit
9c0037c6
authored
Mar 02, 2022
by
Paolo G. Giarrusso
Browse files
Make `inG` instances local
parent
96883dbd
Changes
22
Hide whitespace changes
Inline
Side-by-side
iris/base_logic/lib/boxes.v
View file @
9c0037c6
...
...
@@ -6,9 +6,10 @@ Import uPred.
(** The CMRAs we need. *)
Class
boxG
Σ
:
=
boxG_inG
:
>
inG
Σ
(
prodR
boxG_inG
:
inG
Σ
(
prodR
(
excl_authR
boolO
)
(
optionR
(
agreeR
(
laterO
(
iPropO
Σ
))))).
Local
Existing
Instance
boxG_inG
.
Definition
box
Σ
:
gFunctors
:
=
#[
GFunctor
(
excl_authR
boolO
*
optionRF
(
agreeRF
(
▶
∙
))
)
].
...
...
iris/base_logic/lib/cancelable_invariants.v
View file @
9c0037c6
...
...
@@ -5,8 +5,9 @@ From iris.base_logic.lib Require Export invariants.
From
iris
.
prelude
Require
Import
options
.
Import
uPred
.
Class
cinvG
Σ
:
=
cinv_inG
:
>
inG
Σ
fracR
.
Class
cinvG
Σ
:
=
cinv_inG
:
inG
Σ
fracR
.
Definition
cinv
Σ
:
gFunctors
:
=
#[
GFunctor
fracR
].
Local
Existing
Instance
cinv_inG
.
Global
Instance
subG_cinv
Σ
{
Σ
}
:
subG
cinv
Σ
Σ
→
cinvG
Σ
.
Proof
.
solve_inG
.
Qed
.
...
...
iris/base_logic/lib/gen_heap.v
View file @
9c0037c6
...
...
@@ -68,8 +68,9 @@ these can be matched up with the invariant namespaces. *)
Class
gen_heapGpreS
(
L
V
:
Type
)
(
Σ
:
gFunctors
)
`
{
Countable
L
}
:
=
{
gen_heapGpreS_heap
:
>
ghost_mapG
Σ
L
V
;
gen_heapGpreS_meta
:
>
ghost_mapG
Σ
L
gname
;
gen_heapGpreS_meta_data
:
>
inG
Σ
(
reservation_mapR
(
agreeR
positiveO
))
;
gen_heapGpreS_meta_data
:
inG
Σ
(
reservation_mapR
(
agreeR
positiveO
))
;
}.
Local
Existing
Instance
gen_heapGpreS_meta_data
.
Class
gen_heapGS
(
L
V
:
Type
)
(
Σ
:
gFunctors
)
`
{
Countable
L
}
:
=
GenHeapGS
{
gen_heap_inG
:
>
gen_heapGpreS
L
V
Σ
;
...
...
iris/base_logic/lib/gen_inv_heap.v
View file @
9c0037c6
...
...
@@ -31,8 +31,9 @@ Definition to_inv_heap {L V : Type} `{Countable L}
prod_map
(
λ
x
,
Excl'
x
)
to_agree
<$>
h
.
Class
inv_heapGpreS
(
L
V
:
Type
)
(
Σ
:
gFunctors
)
`
{
Countable
L
}
:
=
{
inv_heapGpreS_inG
:
>
inG
Σ
(
authR
(
inv_heap_mapUR
L
V
))
inv_heapGpreS_inG
:
inG
Σ
(
authR
(
inv_heap_mapUR
L
V
))
}.
Local
Existing
Instance
inv_heapGpreS_inG
.
Class
inv_heapGS
(
L
V
:
Type
)
(
Σ
:
gFunctors
)
`
{
Countable
L
}
:
=
Inv_HeapG
{
inv_heap_inG
:
>
inv_heapGpreS
L
V
Σ
;
...
...
iris/base_logic/lib/ghost_map.v
View file @
9c0037c6
...
...
@@ -12,8 +12,9 @@ From iris.prelude Require Import options.
FIXME: This is intentionally discrete-only, but
should we support setoids via [Equiv]? *)
Class
ghost_mapG
Σ
(
K
V
:
Type
)
`
{
Countable
K
}
:
=
GhostMapG
{
ghost_map_inG
:
>
inG
Σ
(
gmap_viewR
K
(
leibnizO
V
))
;
ghost_map_inG
:
inG
Σ
(
gmap_viewR
K
(
leibnizO
V
))
;
}.
Local
Existing
Instance
ghost_map_inG
.
Definition
ghost_map
Σ
(
K
V
:
Type
)
`
{
Countable
K
}
:
gFunctors
:
=
#[
GFunctor
(
gmap_viewR
K
(
leibnizO
V
))
].
...
...
iris/base_logic/lib/ghost_var.v
View file @
9c0037c6
...
...
@@ -8,8 +8,9 @@ From iris.prelude Require Import options.
(** The CMRA we need. *)
Class
ghost_varG
Σ
(
A
:
Type
)
:
=
GhostVarG
{
ghost_var_inG
:
>
inG
Σ
(
dfrac_agreeR
$
leibnizO
A
)
;
ghost_var_inG
:
inG
Σ
(
dfrac_agreeR
$
leibnizO
A
)
;
}.
Local
Existing
Instance
ghost_var_inG
.
Global
Hint
Mode
ghost_varG
-
!
:
typeclass_instances
.
Definition
ghost_var
Σ
(
A
:
Type
)
:
gFunctors
:
=
...
...
iris/base_logic/lib/gset_bij.v
View file @
9c0037c6
...
...
@@ -28,8 +28,9 @@ From iris.prelude Require Import options.
(* The uCMRA we need. *)
Class
gset_bijG
Σ
A
B
`
{
Countable
A
,
Countable
B
}
:
=
GsetBijG
{
gset_bijG_inG
:
>
inG
Σ
(
gset_bijR
A
B
)
;
}.
GsetBijG
{
gset_bijG_inG
:
inG
Σ
(
gset_bijR
A
B
)
;
}.
Global
Hint
Mode
gset_bijG
-
!
!
-
-
-
-
:
typeclass_instances
.
Local
Existing
Instance
gset_bijG_inG
.
Definition
gset_bij
Σ
A
B
`
{
Countable
A
,
Countable
B
}
:
gFunctors
:
=
#[
GFunctor
(
gset_bijR
A
B
)
].
...
...
iris/base_logic/lib/mono_nat.v
View file @
9c0037c6
...
...
@@ -14,7 +14,8 @@ From iris.base_logic.lib Require Export own.
From
iris
.
prelude
Require
Import
options
.
Class
mono_natG
Σ
:
=
MonoNatG
{
mono_natG_inG
:
>
inG
Σ
mono_natR
;
}.
MonoNatG
{
mono_natG_inG
:
inG
Σ
mono_natR
;
}.
Local
Existing
Instance
mono_natG_inG
.
Definition
mono_nat
Σ
:
gFunctors
:
=
#[
GFunctor
mono_natR
].
Global
Instance
subG_mono_nat
Σ
Σ
:
subG
mono_nat
Σ
Σ
→
mono_natG
Σ
.
Proof
.
solve_inG
.
Qed
.
...
...
iris/base_logic/lib/na_invariants.v
View file @
9c0037c6
...
...
@@ -9,7 +9,8 @@ Import uPred.
Definition
na_inv_pool_name
:
=
gname
.
Class
na_invG
Σ
:
=
na_inv_inG
:
>
inG
Σ
(
prodR
coPset_disjR
(
gset_disjR
positive
)).
na_inv_inG
:
inG
Σ
(
prodR
coPset_disjR
(
gset_disjR
positive
)).
Local
Existing
Instance
na_inv_inG
.
Definition
na_inv
Σ
:
gFunctors
:
=
#[
GFunctor
(
constRF
(
prodR
coPset_disjR
(
gset_disjR
positive
)))
].
Global
Instance
subG_na_invG
{
Σ
}
:
subG
na_inv
Σ
Σ
→
na_invG
Σ
.
...
...
iris/base_logic/lib/saved_prop.v
View file @
9c0037c6
...
...
@@ -9,9 +9,10 @@ Import uPred.
saved whatever-you-like. *)
Class
savedAnythingG
(
Σ
:
gFunctors
)
(
F
:
oFunctor
)
:
=
SavedAnythingG
{
saved_anything_inG
:
>
inG
Σ
(
agreeR
(
oFunctor_apply
F
(
iPropO
Σ
)))
;
saved_anything_inG
:
inG
Σ
(
agreeR
(
oFunctor_apply
F
(
iPropO
Σ
)))
;
saved_anything_contractive
:
oFunctorContractive
F
(* NOT an instance to avoid cycles with [subG_savedAnythingΣ]. *)
}.
Local
Existing
Instance
saved_anything_inG
.
Definition
savedAnything
Σ
(
F
:
oFunctor
)
`
{!
oFunctorContractive
F
}
:
gFunctors
:
=
#[
GFunctor
(
agreeRF
F
)
].
...
...
iris/base_logic/lib/wsat.v
View file @
9c0037c6
...
...
@@ -9,9 +9,9 @@ exception of what's in the [invGS] module. The module [invGS] is thus exported i
[fancy_updates], where [wsat] is only imported. *)
Module
invGS
.
Class
invGpreS
(
Σ
:
gFunctors
)
:
Set
:
=
InvGpreS
{
invGpreS_inv
:
>
inG
Σ
(
gmap_viewR
positive
(
laterO
(
iPropO
Σ
)))
;
invGpreS_enabled
:
>
inG
Σ
coPset_disjR
;
invGpreS_disabled
:
>
inG
Σ
(
gset_disjR
positive
)
;
invGpreS_inv
:
inG
Σ
(
gmap_viewR
positive
(
laterO
(
iPropO
Σ
)))
;
invGpreS_enabled
:
inG
Σ
coPset_disjR
;
invGpreS_disabled
:
inG
Σ
(
gset_disjR
positive
)
;
}.
Class
invGS
(
Σ
:
gFunctors
)
:
Set
:
=
InvG
{
...
...
iris/program_logic/ownp.v
View file @
9c0037c6
...
...
@@ -16,9 +16,10 @@ union.
Class
ownPGS
(
Λ
:
language
)
(
Σ
:
gFunctors
)
:
=
OwnPGS
{
ownP_invG
:
invGS
Σ
;
ownP_inG
:
>
inG
Σ
(
excl_authR
(
stateO
Λ
))
;
ownP_inG
:
inG
Σ
(
excl_authR
(
stateO
Λ
))
;
ownP_name
:
gname
;
}.
Local
Existing
Instance
ownP_inG
.
Global
Instance
ownPG_irisGS
`
{!
ownPGS
Λ
Σ
}
:
irisGS
Λ
Σ
:
=
{
iris_invGS
:
=
ownP_invG
;
...
...
@@ -35,8 +36,9 @@ Definition ownPΣ (Λ : language) : gFunctors :=
Class
ownPGpreS
(
Λ
:
language
)
(
Σ
:
gFunctors
)
:
Set
:
=
{
ownPPre_invG
:
>
invGpreS
Σ
;
ownPPre_state_inG
:
>
inG
Σ
(
excl_authR
(
stateO
Λ
))
ownPPre_state_inG
:
inG
Σ
(
excl_authR
(
stateO
Λ
))
}.
Local
Existing
Instance
ownPPre_state_inG
.
Global
Instance
subG_ownP
Σ
{
Λ
Σ
}
:
subG
(
ownP
Σ
Λ
)
Σ
→
ownPGpreS
Λ
Σ
.
Proof
.
solve_inG
.
Qed
.
...
...
iris_deprecated/base_logic/auth.v
View file @
9c0037c6
...
...
@@ -11,9 +11,10 @@ Import uPred.
(* The CMRA we need. *)
Class
authG
Σ
(
A
:
ucmra
)
:
=
AuthG
{
auth_inG
:
>
inG
Σ
(
authR
A
)
;
auth_inG
:
inG
Σ
(
authR
A
)
;
auth_cmra_discrete
:
>
CmraDiscrete
A
;
}.
Local
Existing
Instance
auth_inG
.
Definition
auth
Σ
(
A
:
ucmra
)
:
gFunctors
:
=
#[
GFunctor
(
authR
A
)
].
Global
Instance
subG_auth
Σ
Σ
A
:
subG
(
auth
Σ
A
)
Σ
→
CmraDiscrete
A
→
authG
Σ
A
.
...
...
iris_deprecated/base_logic/sts.v
View file @
9c0037c6
...
...
@@ -10,9 +10,10 @@ Import uPred.
(** The CMRA we need. *)
Class
stsG
Σ
(
sts
:
stsT
)
:
=
StsG
{
sts_inG
:
>
inG
Σ
(
sts_resR
sts
)
;
sts_inG
:
inG
Σ
(
sts_resR
sts
)
;
sts_inhabited
:
>
Inhabited
(
sts
.
state
sts
)
;
}.
Local
Existing
Instance
sts_inG
.
Definition
sts
Σ
(
sts
:
stsT
)
:
gFunctors
:
=
#[
GFunctor
(
sts_resR
sts
)
].
Global
Instance
subG_sts
Σ
Σ
sts
:
...
...
iris_heap_lang/lib/counter.v
View file @
9c0037c6
...
...
@@ -13,7 +13,8 @@ Definition incr : val := rec: "incr" "l" :=
Definition
read
:
val
:
=
λ
:
"l"
,
!
"l"
.
(** Monotone counter *)
Class
mcounterG
Σ
:
=
MCounterG
{
mcounter_inG
:
>
inG
Σ
(
authR
max_natUR
)
}.
Class
mcounterG
Σ
:
=
MCounterG
{
mcounter_inG
:
inG
Σ
(
authR
max_natUR
)
}.
Local
Existing
Instance
mcounter_inG
.
Definition
mcounter
Σ
:
gFunctors
:
=
#[
GFunctor
(
authR
max_natUR
)].
Global
Instance
subG_mcounter
Σ
{
Σ
}
:
subG
mcounter
Σ
Σ
→
mcounterG
Σ
.
...
...
@@ -86,7 +87,8 @@ End mono_proof.
(** Counter with contributions *)
Class
ccounterG
Σ
:
=
CCounterG
{
ccounter_inG
:
>
inG
Σ
(
frac_authR
natR
)
}.
CCounterG
{
ccounter_inG
:
inG
Σ
(
frac_authR
natR
)
}.
Local
Existing
Instance
ccounter_inG
.
Definition
ccounter
Σ
:
gFunctors
:
=
#[
GFunctor
(
frac_authR
natR
)].
...
...
iris_heap_lang/lib/spawn.v
View file @
9c0037c6
...
...
@@ -19,7 +19,8 @@ Definition join : val :=
(** The CMRA & functor we need. *)
(* Not bundling heapGS, as it may be shared with other users. *)
Class
spawnG
Σ
:
=
SpawnG
{
spawn_tokG
:
>
inG
Σ
(
exclR
unitO
)
}.
Class
spawnG
Σ
:
=
SpawnG
{
spawn_tokG
:
inG
Σ
(
exclR
unitO
)
}.
Local
Existing
Instance
spawn_tokG
.
Definition
spawn
Σ
:
gFunctors
:
=
#[
GFunctor
(
exclR
unitO
)].
Global
Instance
subG_spawn
Σ
{
Σ
}
:
subG
spawn
Σ
Σ
→
spawnG
Σ
.
...
...
iris_heap_lang/lib/spin_lock.v
View file @
9c0037c6
...
...
@@ -14,7 +14,8 @@ Definition release : val := λ: "l", "l" <- #false.
(** The CMRA we need. *)
(* Not bundling heapGS, as it may be shared with other users. *)
Class
lockG
Σ
:
=
LockG
{
lock_tokG
:
>
inG
Σ
(
exclR
unitO
)
}.
Class
lockG
Σ
:
=
LockG
{
lock_tokG
:
inG
Σ
(
exclR
unitO
)
}.
Local
Existing
Instance
lock_tokG
.
Definition
lock
Σ
:
gFunctors
:
=
#[
GFunctor
(
exclR
unitO
)].
Global
Instance
subG_lock
Σ
{
Σ
}
:
subG
lock
Σ
Σ
→
lockG
Σ
.
...
...
iris_heap_lang/lib/ticket_lock.v
View file @
9c0037c6
...
...
@@ -28,7 +28,8 @@ Definition release : val :=
(** The CMRAs we need. *)
Class
tlockG
Σ
:
=
tlock_G
:
>
inG
Σ
(
authR
(
prodUR
(
optionUR
(
exclR
natO
))
(
gset_disjUR
nat
))).
tlock_G
:
inG
Σ
(
authR
(
prodUR
(
optionUR
(
exclR
natO
))
(
gset_disjUR
nat
))).
Local
Existing
Instance
tlock_G
.
Definition
tlock
Σ
:
gFunctors
:
=
#[
GFunctor
(
authR
(
prodUR
(
optionUR
(
exclR
natO
))
(
gset_disjUR
nat
)))
].
...
...
iris_staging/base_logic/mono_list.v
View file @
9c0037c6
...
...
@@ -22,7 +22,8 @@ From iris.base_logic.lib Require Export own.
From
iris
.
prelude
Require
Import
options
.
Class
mono_listG
(
A
:
Type
)
Σ
:
=
MonoListG
{
mono_list_inG
:
>
inG
Σ
(
mono_listR
(
leibnizO
A
))
}.
MonoListG
{
mono_list_inG
:
inG
Σ
(
mono_listR
(
leibnizO
A
))
}.
Local
Existing
Instance
mono_list_inG
.
Definition
mono_list
Σ
(
A
:
Type
)
:
gFunctors
:
=
#[
GFunctor
(
mono_listR
(
leibnizO
A
))].
...
...
tests/ipm_paper.v
View file @
9c0037c6
...
...
@@ -188,7 +188,8 @@ Section M.
Qed
.
End
M
.
Class
counterG
Σ
:
=
CounterG
{
counter_tokG
:
>
inG
Σ
M_UR
}.
Class
counterG
Σ
:
=
CounterG
{
counter_tokG
:
inG
Σ
M_UR
}.
Local
Existing
Instance
counter_tokG
.
Definition
counter
Σ
:
gFunctors
:
=
#[
GFunctor
(
constRF
M_UR
)].
Global
Instance
subG_counter
Σ
{
Σ
}
:
subG
counter
Σ
Σ
→
counterG
Σ
.
Proof
.
intros
[?%
subG_inG
_
]%
subG_inv
.
split
;
apply
_
.
Qed
.
...
...
Prev
1
2
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment