Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Joshua Yanovski
iriscoq
Commits
bfbc24d8
Commit
bfbc24d8
authored
Feb 12, 2016
by
Robbert Krebbers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Put Lit notations in global scope.
parent
cee0b0d8
Changes
2
Hide whitespace changes
Inline
Sidebyside
Showing
2 changed files
with
10 additions
and
9 deletions
+10
9
heap_lang/notation.v
heap_lang/notation.v
+7
4
heap_lang/tests.v
heap_lang/tests.v
+3
5
No files found.
heap_lang/notation.v
View file @
bfbc24d8
...
...
@@ 2,6 +2,8 @@ Require Export heap_lang.derived.
Delimit
Scope
lang_scope
with
L
.
Bind
Scope
lang_scope
with
expr
val
.
(
*
What
about
Arguments
for
hoare
triples
?
.
*
)
Arguments
wp
{
_
_
}
_
_
%
L
_.
Coercion
LitInt
:
Z
>>
base_lit
.
...
...
@@ 16,10 +18,11 @@ Coercion of_val : val >> expr.
first
.
*
)
(
*
We
have
overlapping
notation
for
values
and
expressions
,
with
the
expressions
coming
first
.
This
way
,
parsing
as
a
value
will
be
preferred
.
If
an
expression
was
needed
,
the
coercion
of_val
will
be
called
.
*
)
(
*
What
about
Arguments
for
hoare
triples
?
.
*
)
Notation
"' l"
:=
(
Lit
l
)
(
at
level
8
,
format
"' l"
)
:
lang_scope
.
Notation
"' l"
:=
(
LitV
l
)
(
at
level
8
,
format
"' l"
)
:
lang_scope
.
was
needed
,
the
coercion
of_val
will
be
called
.
The
notations
for
literals
are
not
put
in
any
scope
so
as
to
avoid
lots
of
annoying
%
L
scopes
while
pretty
printing
.
*
)
Notation
"' l"
:=
(
Lit
l
%
Z
)
(
at
level
8
,
format
"' l"
).
Notation
"' l"
:=
(
LitV
l
%
Z
)
(
at
level
8
,
format
"' l"
).
Notation
"! e"
:=
(
Load
e
%
L
)
(
at
level
10
,
right
associativity
)
:
lang_scope
.
Notation
"'ref' e"
:=
(
Alloc
e
%
L
)
(
at
level
30
,
right
associativity
)
:
lang_scope
.
...
...
heap_lang/tests.v
View file @
bfbc24d8
...
...
@@ 62,13 +62,12 @@ Module LiftingTests.
λ
:
"x"
,
if
"x"
≤
'0
then

FindPred
(

"x"
+
'
2
)
'0
else
FindPred
"x"
'0
.
Lemma
FindPred_spec
n1
n2
E
Q
:
(
■
(
n1
<
n2
)
∧
Q
(
LitV
(
n2

1
))
)
⊑
wp
E
(
FindPred
'
n2
'
n1
)
%
L
Q
.
(
■
(
n1
<
n2
)
∧
Q
'
(
n2

1
))
⊑
wp
E
(
FindPred
'
n2
'
n1
)
%
L
Q
.
Proof
.
(
*
FIXME
there
are
some
annoying
scopes
shown
here
:
%
Z
,
%
L
.
*
)
revert
n1
;
apply
l
ö
b_all_1
=>
n1
.
rewrite
(
comm
uPred_and
(
■
_
)
%
I
)
assoc
;
apply
const_elim_r
=>?
.
(
*
first
need
to
do
the
rec
to
get
a
later
*
)
rewrite

(
wp_bindi
(
AppLCtx
_
)).
rewrite

(
wp_bindi
(
AppLCtx
_
))
/=
.
rewrite

wp_rec
'
// =>/=; rewrite wp_value' //=.
(
*
FIXME
:
ssr
rewrite
fails
with
"Error: _pattern_value_ is used in conclusion."
*
)
rewrite
>
(
later_intro
(
Q
_
)).
...
...
@@ 106,8 +105,7 @@ Module LiftingTests.
Qed
.
Goal
∀
E
,
True
⊑
wp
(
Σ
:=
Σ
)
E
(
let
:
"x"
:=
Pred
'
42
in
Pred
"x"
)
(
λ
v
,
v
=
(
'
40
)
%
L
).
True
⊑
wp
(
Σ
:=
Σ
)
E
(
let
:
"x"
:=
Pred
'
42
in
Pred
"x"
)
(
λ
v
,
v
=
'
40
).
Proof
.
intros
E
.
rewrite

(
wp_bindi
(
LetCtx
_
_
))

Pred_spec
//= wp_let //=.
...
...
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