Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Why3
why3
Commits
80c69550
Commit
80c69550
authored
Jul 13, 2012
by
Asma Tafat-Bouzid
Browse files
blocking semantic
parent
ad56b76e
Changes
1
Hide whitespace changes
Inline
Side-by-side
examples/hoare_logic/blocking_semantics2/blocking_semantics2_WP_bool_value_1.v
View file @
80c69550
...
...
@@ -696,13 +696,13 @@ Fixpoint wp(e:expr) (q:fmla) {struct e}: fmla :=
end
.
Unset
Implicit
Arguments
.
Axiom
wp_implies
:
forall
(
p
:
fmla
)
(
q
:
fmla
),
(
forall
(
sigma
:
(
map
mident
Axiom
monotonicite
:
forall
(
p
:
fmla
)
(
q
:
fmla
),
(
forall
(
sigma
:
(
map
mident
value
))
(
pi
:
(
list
(
ident
*
value
)
%
type
)),
(
eval_fmla
sigma
pi
p
)
->
(
eval_fmla
sigma
pi
q
))
->
forall
(
sigma
:
(
map
mident
value
))
(
pi
:
(
list
(
ident
*
value
)
%
type
))
(
e
:
expr
),
(
eval_fmla
sigma
pi
(
wp
e
p
))
->
(
eval_fmla
sigma
pi
(
wp
e
q
)).
Axiom
wp
_conj
:
forall
(
sigma
:
(
map
mident
value
))
(
pi
:
(
list
(
ident
*
Axiom
distib
_conj
:
forall
(
sigma
:
(
map
mident
value
))
(
pi
:
(
list
(
ident
*
value
)
%
type
))
(
e
:
expr
)
(
p
:
fmla
)
(
q
:
fmla
),
(
eval_fmla
sigma
pi
(
wp
e
(
Fand
p
q
)))
<->
((
eval_fmla
sigma
pi
(
wp
e
p
))
/
\
(
eval_fmla
sigma
pi
(
wp
e
q
))).
...
...
@@ -718,33 +718,22 @@ Definition is_value(e:expr): Prop :=
|
_
=>
False
end
.
Axiom
unique_type_expr
:
forall
(
e
:
expr
)
(
sigmat
:
(
map
mident
datatype
))
(
pit
:
(
list
(
ident
*
datatype
)
%
type
))
(
ty1
:
datatype
)
(
ty2
:
datatype
),
(
type_expr
sigmat
pit
e
ty1
)
->
((
type_expr
sigmat
pit
e
ty2
)
->
(
ty1
=
ty2
)).
Axiom
decide_value
:
forall
(
e
:
expr
),
(
~
(
is_value
e
))
\
/
exists
v
:
value
,
(
e
=
(
Evalue
v
)).
(
*
Why3
goal
*
)
Theorem
bool_value
:
forall
(
e
:
expr
)
(
sigmat
:
(
map
mident
datatype
))
(
pit
:
(
list
(
ident
*
datatype
)
%
type
)),
(
type_expr
sigmat
pit
e
TYbool
)
->
((
is_value
e
)
->
((
e
=
(
Evalue
(
Vbool
false
)))
\
/
(
e
=
(
Evalue
(
Vbool
true
))))).
intros
e
sigmat
pit
h1
h2
.
destruct
(
decide_value
e
).
(
*
e
is
not
a
value
*
)
tauto
.
(
*
e
is
not
a
value
*
)
elim
H
;
clear
H
h2
;
intros
v
H
.
subst
e
.
assert
(
h
:
type_expr
sigmat
pit
(
Evalue
v
)
(
type_value
v
)).
apply
Type_evalue
.
assert
(
TYbool
=
(
type_value
v
)).
apply
unique_type_expr
with
(
Evalue
v
)
sigmat
pit
;
auto
.
assert
(
h3
:
v
=
(
Vbool
false
)
\
/
v
=
(
Vbool
true
)).
admit
.
Theorem
bool_value
:
forall
(
v
:
value
)
(
sigmat
:
(
map
mident
datatype
))
(
pit
:
(
list
(
ident
*
datatype
)
%
type
)),
(
type_expr
sigmat
pit
(
Evalue
v
)
TYbool
)
->
((
v
=
(
Vbool
false
))
\
/
(
v
=
(
Vbool
true
))).
intros
e
sigmat
pit
h1
.
case_eq
e
;
intros
v
value_e
h
;
try
contradiction
.
clear
h
.
subst
.
inversion
h1
;
subst
.
generalize
H3
.
clear
H3
.
case_eq
v
;
simpl
;
intros
;
try
congruence
.
case
b
;
auto
.
Qed
.
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