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
Joshua Yanovski
iris-coq
Commits
f00f21a8
Commit
f00f21a8
authored
Mar 07, 2016
by
Ralf Jung
Browse files
add some notation for writing cFunctors
parent
0a279595
Changes
5
Hide whitespace changes
Inline
Side-by-side
algebra/cofe.v
View file @
f00f21a8
...
...
@@ -347,6 +347,9 @@ Structure cFunctor := CFunctor {
Existing
Instance
cFunctor_ne
.
Instance:
Params
(
@
cFunctor_map
)
5.
Delimit
Scope
cFunctor_scope
with
CF
.
Bind
Scope
cFunctor_scope
with
cFunctor
.
Class
cFunctorContractive
(
F
:
cFunctor
)
:=
cFunctor_contractive
A1
A2
B1
B2
:>
Contractive
(
@
cFunctor_map
F
A1
A2
B1
B2
).
...
...
@@ -412,6 +415,7 @@ Proof.
apply
cofe_morC_map_ne
;
apply
cFunctor_contractive
=>
i
?
;
split
;
by
apply
Hfg
.
Qed
.
(
**
Discrete
cofe
*
)
Section
discrete_cofe
.
Context
`
{
Equiv
A
,
@
Equivalence
A
(
≡
)
}
.
...
...
@@ -518,3 +522,10 @@ Proof.
intros
A1
A2
B1
B2
n
fg
fg
'
Hfg
.
apply
laterC_map_contractive
=>
i
?
.
by
apply
cFunctor_ne
,
Hfg
.
Qed
.
(
**
Notation
for
writing
functors
*
)
Notation
"∙"
:=
idCF
:
cFunctor_scope
.
Notation
"F1 -n> F2"
:=
(
cofe_morCF
F1
%
CF
F2
%
CF
)
:
cFunctor_scope
.
Notation
"( F1 , F2 , .. , Fn )"
:=
(
prodCF
..
(
prodCF
F1
%
CF
F2
%
CF
)
..
Fn
%
CF
)
:
cFunctor_scope
.
Notation
"▶ F"
:=
(
laterCF
F
%
CF
)
(
at
level
20
,
right
associativity
)
:
cFunctor_scope
.
Coercion
constCF
:
cofeT
>->
cFunctor
.
heap_lang/lang.v
View file @
f00f21a8
...
...
@@ -20,7 +20,7 @@ Inductive binder := BAnon | BNamed : string → binder.
Definition
cons_binder
(
mx
:
binder
)
(
X
:
list
string
)
:
list
string
:=
match
mx
with
BAnon
=>
X
|
BNamed
x
=>
x
::
X
end
.
Infix
":b:"
:=
cons_binder
(
at
level
60
,
right
associativity
).
Delimit
Scope
binder_scope
with
bind
er
.
Delimit
Scope
binder_scope
with
bind
.
Bind
Scope
binder_scope
with
binder
.
Instance
binder_dec_eq
(
x1
x2
:
binder
)
:
Decision
(
x1
=
x2
).
Proof
.
solve_decision
.
Defined
.
...
...
program_logic/model.v
View file @
f00f21a8
...
...
@@ -34,7 +34,7 @@ End iProp_solution_sig.
Module
Export
iProp_solution
:
iProp_solution_sig
.
Definition
iProp_result
(
Λ
:
language
)
(
Σ
:
iFunctor
)
:
solution
(
uPredCF
(
resRF
Λ
(
laterCF
idCF
)
Σ
))
:=
solver
.
result
_.
solution
(
uPredCF
(
resRF
Λ
(
▶
∙
)
Σ
))
:=
solver
.
result
_.
Definition
iPreProp
(
Λ
:
language
)
(
Σ
:
iFunctor
)
:
cofeT
:=
iProp_result
Λ
Σ
.
Definition
iGst
(
Λ
:
language
)
(
Σ
:
iFunctor
)
:
cmraT
:=
Σ
(
iPreProp
Λ
Σ
).
...
...
program_logic/saved_prop.v
View file @
f00f21a8
...
...
@@ -5,7 +5,7 @@ Import uPred.
Class
savedPropG
(
Λ
:
language
)
(
Σ
:
gFunctors
)
(
F
:
cFunctor
)
:=
saved_prop_inG
:>
inG
Λ
Σ
(
agreeR
(
laterC
(
F
(
iPreProp
Λ
(
globalF
Σ
))))).
Definition
savedPropGF
(
F
:
cFunctor
)
:
gFunctor
:=
GFunctor
(
agreeRF
(
laterCF
F
)).
GFunctor
(
agreeRF
(
▶
F
)).
Instance
inGF_savedPropG
`
{
inGF
Λ
Σ
(
savedPropGF
F
)
}
:
savedPropG
Λ
Σ
F
.
Proof
.
apply
:
inGF_inG
.
Qed
.
...
...
program_logic/tests.v
View file @
f00f21a8
...
...
@@ -9,7 +9,7 @@ End ModelTest.
Module
SavedPropTest
.
(
*
Test
if
we
can
really
go
"crazy higher order"
*
)
Section
sec
.
Definition
F
:
=
(
cofe_morCF
idCF
idCF
).
Definition
F
:
cFunctor
:=
(
∙
-
n
>
∙
).
Definition
Σ
:
gFunctors
:=
#[
savedPropGF
F
].
Context
{
Λ
:
language
}
.
Notation
iProp
:=
(
iPropG
Λ
Σ
).
...
...
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