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
FP
Stacked Borrows Coq
Commits
4c9d1971
Commit
4c9d1971
authored
Jul 05, 2019
by
Ralf Jung
Browse files
add simple sim_bind tactic
parent
6c530c68
Changes
3
Hide whitespace changes
Inline
Side-by-side
_CoqProject
View file @
4c9d1971
...
...
@@ -26,6 +26,7 @@ theories/sim/local.v
theories/sim/local_adequacy.v
theories/sim/program.v
theories/sim/sflib.v
theories/sim/tactics.v
theories/sim/instance.v
theories/sim/body.v
theories/sim/refl_step.v
...
...
theories/opt/ex1.v
View file @
4c9d1971
From
stbor
.
sim
Require
Import
local
invariant
refl_step
.
From
stbor
.
sim
Require
Import
local
invariant
refl_step
tactics
body
.
Set
Default
Proof
Using
"Type"
.
...
...
@@ -28,4 +28,14 @@ Definition ex1_opt : function :=
Lemma
ex1_sim_body
fs
ft
:
⊨
{
fs
,
ft
}
ex1
≥ᶠ
ex1_opt
.
Proof
.
intros
r
es
et
els
elt
σ
s
σ
t
FAs
FAt
FREL
SUBSTs
SUBSTt
.
destruct
els
as
[
|
efs
[]];
[
done
|
|
done
].
simpl
in
SUBSTs
.
destruct
elt
as
[
|
eft
[]];
[
done
|
|
done
].
simpl
in
SUBSTt
.
simplify_eq
.
(
*
InitCall
*
)
exists
10
%
nat
.
apply
sim_body_init_call
.
simpl
.
(
*
Alloc
*
)
sim_bind
(
Alloc
_
)
(
Alloc
_
).
Abort
.
theories/sim/tactics.v
0 → 100644
View file @
4c9d1971
From
stbor
.
lang
Require
Export
lang
.
From
stbor
.
sim
Require
Import
body
.
Ltac
reshape_expr
e
tac
:=
(
*
[
vs
]
is
the
accumulator
*
)
let
rec
go_fun
K
f
vs
es
:=
match
es
with
|
(
Val
?
v
)
::
?
es
=>
go_fun
K
f
(
v
::
vs
)
es
|
?
e
::
?
es
=>
go
(
CallRCtx
f
(
reverse
vs
)
es
::
K
)
e
end
(
*
[
K
]
accumulates
the
context
*
)
with
go
K
e
:=
match
e
with
|
_
=>
tac
K
e
|
Let
?
x
?
e1
?
e2
=>
go
(
LetCtx
x
e2
::
K
)
e1
|
Call
(
Val
?
v
)
?
el
=>
go_fun
K
v
(
@
nil
val
)
el
|
Call
?
e
?
el
=>
go
(
CallLCtx
el
::
K
)
e
|
BinOp
?
op
(
Val
?
v1
)
?
e2
=>
go
(
BinOpRCtx
op
v1
::
K
)
e2
|
BinOp
?
op
?
e1
?
e2
=>
go
(
BinOpLCtx
op
e2
::
K
)
e1
(
*
FIXME
:
add
remaining
context
items
*
)
end
in
go
(
@
nil
ectx_item
)
e
.
Tactic
Notation
"sim_bind"
open_constr
(
efocs
)
open_constr
(
efoct
)
:=
match
goal
with
|
|-
_
⊨
{
_
,
_
,
_
}
(
?
es
,
_
)
≥
(
?
et
,
_
)
:
_
=>
reshape_expr
es
ltac
:
(
fun
Ks
es
=>
unify
es
efocs
;
reshape_expr
et
ltac
:
(
fun
Kt
et
=>
unify
et
efoct
;
eapply
(
sim_body_bind
_
_
_
_
Ks
Kt
es
et
)
)
)
end
.
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