Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
smonad
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Benjamin Bonneau
smonad
Commits
8c125bd8
Commit
8c125bd8
authored
3 months ago
by
Benjamin Bonneau
Browse files
Options
Downloads
Patches
Plain Diff
Lemmas for removable
parent
4b8367ce
Loading
Loading
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
coq/Functional.v
+108
-80
108 additions, 80 deletions
coq/Functional.v
with
108 additions
and
80 deletions
coq/Functional.v
+
108
−
80
View file @
8c125bd8
(
**
Additional
properties
satisfied
by
functional
semantics
.
*
)
From
MyRocqLib
Require
Import
OrderedCategory
.
From
MyRocqLib
Require
Import
Util
OrderedCategory
.
From
SMonad
Require
Import
Op
Ref
Property
.
Import
(
hints
)
EventFam
.
Rel
.
Section
F
unctional
.
Section
f
unctional
.
Context
{
S
:
sem_s
}
{
SR
:
Ref
S
}
{
RT
:
Ret
S
}
{
BD
:
Bind
S
}
.
...
...
@@ -26,7 +26,35 @@ Definition dedupable [E A] (u : S E A) : Prop :=
(
bind
u
(
fun
v0
=>
map_res
(
pair
v0
)
u
))
u
.
Section
Derived
.
Section
intro
.
Context
{
ME
:
MapEv
S
}
{
UB
:
UB
S
}
.
Context
{
SRL
:
Ref_Laws
S
}
{
RTR
:
Ret_Ref
S
}
{
BDR
:
Bind_Ref
S
}
{
MON
:
Monad_Laws
S
}
{
MER
:
MapEv_Ref
S
}
{
UBR
:
UB_Ref
S
}
.
Lemma
ret_removable
[
E
A
]
(
x
:
A
)
:
removable
(
ret
(
E
:=
E
)
x
).
Proof
.
red
;
apply
ref_ret
;
triv
.
Qed
.
Lemma
bind_removable
[
E
A
B
]
[
u
:
S
E
A
]
[
k
:
A
->
S
E
B
]
(
REM_u
:
removable
u
)
(
REM_k
:
forall
x
,
removable
(
k
x
))
:
removable
(
bind
u
k
).
Proof
.
red
.
eapply
sem_ref_add_ret_trg
,
ref_bind
.
{
apply
REM_u
.
}
intros
?
[]
_
;
apply
REM_k
.
Qed
.
Lemma
ub_removable
E
A
:
removable
(
ub
(
E
:=
E
)
(
A
:=
A
)).
Proof
.
red
;
apply
ub_ref
.
Qed
.
End
intro
.
Section
derived
.
Context
{
SRL
:
Ref_Laws
S
}
{
BDR
:
Bind_Ref
S
}
{
MON
:
Monad_Laws
S
}
.
Lemma
commutable_k
...
...
@@ -58,7 +86,7 @@ Section Derived.
}
all:
unfold
map_res
;
sem_eq_simpl
;
reflexivity
.
Qed
.
End
D
erived
.
End
d
erived
.
Variables
(
**
Semantics
that
cannot
reach
an
error
*
)
...
...
@@ -91,5 +119,5 @@ Class Functional := {
dedupable
u
;
(
*
The
opposite
direction
is
false
for
non
-
deterministic
operations
*
)
}
.
End
F
unctional
.
G
lobal
Arguments
Functional
S
{
SR
RT
BD
}
.
End
f
unctional
.
#[
g
lobal
]
Arguments
Functional
S
{
SR
RT
BD
}
.
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment