Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Dan Frumin
ReLoC-v1
Commits
2e80e6f2
Commit
2e80e6f2
authored
Dec 12, 2017
by
Dan Frumin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A fixpoint definition using `rec`
parent
1bed793b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
0 deletions
+55
-0
theories/examples/Y.v
theories/examples/Y.v
+55
-0
No files found.
theories/examples/Y.v
View file @
2e80e6f2
...
...
@@ -10,6 +10,9 @@ Definition Knot : val := λ: "f",
let:
"z"
:=
ref
bot
in
"z"
<-
(
λ
:
"x"
,
"f"
(
!
"z"
#()));;
!
"z"
#().
Definition
F
:
val
:=
rec
:
"f"
"g"
:=
"g"
(
"f"
"g"
).
Section
contents
.
Context
`
{
logrelG
Σ
}
.
Lemma
Y_semtype
Δ
Γ
A
:
...
...
@@ -58,6 +61,58 @@ Section contents.
iApply
(
bin_log_related_app
with
"Hff"
).
by
iApply
"IH"
.
Qed
.
Lemma
FIX_Y
Δ
Γ
A
:
{
⊤
,
⊤
;
Δ
;
Γ
}
⊨
F
≤
log
≤
Y
:
TArrow
(
TArrow
A
A
)
A
.
Proof
.
unlock
Y
F
.
simpl
.
iApply
bin_log_related_arrow
;
eauto
.
iAlways
.
iIntros
(
f1
f2
)
"#Hff"
.
rel_let_r
.
iL
ö
b
as
"IH"
.
rel_let_l
.
rel_let_r
.
iApply
(
bin_log_related_app
with
"Hff"
).
by
iApply
"IH"
.
Qed
.
Lemma
Y_FIX
Δ
Γ
A
:
{
⊤
,
⊤
;
Δ
;
Γ
}
⊨
Y
≤
log
≤
F
:
TArrow
(
TArrow
A
A
)
A
.
Proof
.
unlock
Y
F
.
simpl
.
iApply
bin_log_related_arrow
;
eauto
.
iAlways
.
iIntros
(
f1
f2
)
"#Hff"
.
rel_let_l
.
iL
ö
b
as
"IH"
.
rel_let_l
.
rel_let_r
.
iApply
(
bin_log_related_app
with
"Hff"
).
by
iApply
"IH"
.
Qed
.
Lemma
FIX_prefixpoint
Δ
Γ
α
β
(
v
:
val
)
:
□
(
{
Δ
;
Γ
}
⊨
v
≤
log
≤
v
:
((
α
→
β
)
→
α
→
β
))
-
∗
{
Δ
;
Γ
}
⊨
v
(
F
v
)
≤
log
≤
F
v
:
(
α
→
β
).
Proof
.
iIntros
"#Hv"
.
unlock
F
.
simpl
.
rel_let_r
.
iApply
(
bin_log_related_app
with
"Hv"
).
iApply
(
bin_log_related_app
with
"[] Hv"
).
iApply
binary_fundamental
.
solve_typed
.
Qed
.
Lemma
FIX_postfixpoint
Δ
Γ
α
β
(
v
:
val
)
:
□
(
{
Δ
;
Γ
}
⊨
v
≤
log
≤
v
:
((
α
→
β
)
→
α
→
β
))
-
∗
{
Δ
;
Γ
}
⊨
F
v
≤
log
≤
v
(
F
v
)
:
(
α
→
β
).
Proof
.
iIntros
"#Hv"
.
unlock
F
.
simpl
.
rel_let_l
.
iApply
(
bin_log_related_app
with
"Hv"
).
iApply
(
bin_log_related_app
with
"[] Hv"
).
iApply
binary_fundamental
.
solve_typed
.
Qed
.
End
contents
.
Theorem
Y_typesafety
f
e
'
τ
thp
σ
σ'
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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