Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
why3
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
119
Issues
119
List
Boards
Labels
Service Desk
Milestones
Merge Requests
16
Merge Requests
16
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Why3
why3
Commits
9fedeaf3
Commit
9fedeaf3
authored
Oct 24, 2018
by
Raphael Rieu-Helft
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify t'int (c:t) -> c in VCs
parent
efecb614
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
2 deletions
+15
-2
src/mlw/vc.ml
src/mlw/vc.ml
+15
-2
No files found.
src/mlw/vc.ml
View file @
9fedeaf3
...
...
@@ -1513,15 +1513,28 @@ and wp_expr kn k q = match k with
let
wp
,
_
,
_
=
sp_expr
kn
k
Mint
.
empty
Mpv
.
empty
in
wp
|
Ktag
((
Push
_
|
WP
)
,
_
)
->
assert
false
(* cannot happen *)
let
simp_cast_projections
env
t
=
let
rec
fn
t
=
match
t
.
t_node
with
|
Tapp
(
ls
,
[{
t_node
=
Tconst
(
Number
.
ConstInt
c
);
t_ty
=
Some
{
ty_node
=
Tyapp
(
ts
,
_
)}}])
when
is_range_type_def
ts
.
ts_def
->
(* t'int (c:t) -> c *)
if
ls_equal
ls
(
int_of_range
env
ts
)
then
t_const
(
Number
.
ConstInt
c
)
ty_int
else
t
|
_
->
t_map
fn
t
in
t_map
fn
t
(** VCgen *)
let
vc_kode
{
known_map
=
kn
}
vc_wp
k
=
let
vc_kode
({
known_map
=
kn
}
as
env
)
vc_wp
k
=
if
Debug
.
test_flag
debug_vc
then
Format
.
eprintf
"K @[%a@]@
\n
"
k_print
k
;
let
k
=
reflow
vc_wp
k
in
if
Debug
.
test_flag
debug_reflow
then
Format
.
eprintf
"R @[%a@]@
\n
"
k_print
k
;
wp_expr
kn
k
Mint
.
empty
let
vc
=
wp_expr
kn
k
Mint
.
empty
in
simp_cast_projections
env
vc
let
vc_fun
env
vc_wp
cty
e
=
vc_kode
env
vc_wp
(
k_fun
env
Mls
.
empty
cty
e
)
...
...
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