Skip to content
GitLab
Menu
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
5f393110
Commit
5f393110
authored
Feb 10, 2016
by
Ralf Jung
Browse files
make some nested function calls in heap_lang/ more readable
parent
41a4028c
Changes
2
Hide whitespace changes
Inline
Side-by-side
heap_lang/heap_lang.v
View file @
5f393110
...
...
@@ -165,11 +165,11 @@ Definition un_op_eval (op : un_op) (l : base_lit) : option base_lit :=
Definition
bin_op_eval
(
op
:
bin_op
)
(
l1
l2
:
base_lit
)
:
option
base_lit
:=
match
op
,
l1
,
l2
with
|
PlusOp
,
LitNat
n1
,
LitNat
n2
=>
Some
(
LitNat
(
n1
+
n2
)
)
|
MinusOp
,
LitNat
n1
,
LitNat
n2
=>
Some
(
LitNat
(
n1
-
n2
)
)
|
LeOp
,
LitNat
n1
,
LitNat
n2
=>
Some
(
LitBool
(
bool_decide
(
n1
≤
n2
)
))
|
LtOp
,
LitNat
n1
,
LitNat
n2
=>
Some
(
LitBool
(
bool_decide
(
n1
<
n2
)
))
|
EqOp
,
LitNat
n1
,
LitNat
n2
=>
Some
(
LitBool
(
bool_decide
(
n1
=
n2
)
))
|
PlusOp
,
LitNat
n1
,
LitNat
n2
=>
Some
$
LitNat
(
n1
+
n2
)
|
MinusOp
,
LitNat
n1
,
LitNat
n2
=>
Some
$
LitNat
(
n1
-
n2
)
|
LeOp
,
LitNat
n1
,
LitNat
n2
=>
Some
$
LitBool
$
bool_decide
(
n1
≤
n2
)
|
LtOp
,
LitNat
n1
,
LitNat
n2
=>
Some
$
LitBool
$
bool_decide
(
n1
<
n2
)
|
EqOp
,
LitNat
n1
,
LitNat
n2
=>
Some
$
LitBool
$
bool_decide
(
n1
=
n2
)
|
_
,
_
,
_
=>
None
end
.
...
...
heap_lang/lifting.v
View file @
5f393110
...
...
@@ -130,7 +130,7 @@ Qed.
Lemma
wp_fst
E
e1
v1
e2
v2
Q
:
to_val
e1
=
Some
v1
→
to_val
e2
=
Some
v2
→
▷
Q
v1
⊑
wp
E
(
Fst
(
Pair
e1
e2
)
)
Q
.
▷
Q
v1
⊑
wp
E
(
Fst
$
Pair
e1
e2
)
Q
.
Proof
.
intros
.
rewrite
-
(
wp_lift_pure_det_step
(
Fst
_
)
e1
None
)
?
right_id
//;
last
by
intros
;
inv_step
;
eauto
.
...
...
@@ -139,7 +139,7 @@ Qed.
Lemma
wp_snd
E
e1
v1
e2
v2
Q
:
to_val
e1
=
Some
v1
→
to_val
e2
=
Some
v2
→
▷
Q
v2
⊑
wp
E
(
Snd
(
Pair
e1
e2
)
)
Q
.
▷
Q
v2
⊑
wp
E
(
Snd
$
Pair
e1
e2
)
Q
.
Proof
.
intros
.
rewrite
-
(
wp_lift_pure_det_step
(
Snd
_
)
e2
None
)
?
right_id
//;
last
by
intros
;
inv_step
;
eauto
.
...
...
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