Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Why3
why3
Commits
f3bcd139
Commit
f3bcd139
authored
Jul 25, 2016
by
MARCHE Claude
Committed by
Guillaume Melquiond
Jan 03, 2017
Browse files
fix ambiguous or patterns (warning 57)
parent
26f3c01c
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/transform/eliminate_epsilon.ml
View file @
f3bcd139
...
...
@@ -113,10 +113,8 @@ let to_elim el t = match el with
let
vl
,_,
t
=
t_open_lambda
t
in
vl
=
[]
||
t
.
t_ty
=
None
let
rec
lift_f
el
acc
t0
=
match
t0
.
t_node
with
|
(
Tapp
(
ps
,
[
t1
;
{
t_node
=
Teps
fb
}
as
t2
])
|
Tapp
(
ps
,
[{
t_node
=
Teps
fb
}
as
t2
;
t1
]))
when
ls_equal
ps
ps_equ
&&
to_elim
el
t2
->
let
rec
lift_f
el
acc
t0
=
let
elim_eps_eq
t1
fb
t2
=
let
vs
,
f
=
t_open_bound
fb
in
if
canonicalize
vs
f
<>
Nothing
then
match
t1
.
t_node
with
...
...
@@ -132,6 +130,15 @@ let rec lift_f el acc t0 = match t0.t_node with
else
let
f
=
t_let_close_simp
vs
t1
f
in
lift_f
el
acc
(
t_label_copy
t0
f
)
in
match
t0
.
t_node
with
(* cannot merge the 2 patterns because of warning 57 *)
|
Tapp
(
ps
,
[
t1
;
{
t_node
=
Teps
fb
}
as
t2
])
when
ls_equal
ps
ps_equ
&&
to_elim
el
t2
->
elim_eps_eq
t1
fb
t2
|
Tapp
(
ps
,
[{
t_node
=
Teps
fb
}
as
t2
;
t1
])
when
ls_equal
ps
ps_equ
&&
to_elim
el
t2
->
elim_eps_eq
t1
fb
t2
|
Teps
fb
when
to_elim
el
t0
->
let
vl
=
Mvs
.
keys
(
t_vars
t0
)
in
let
vs
,
f
=
t_open_bound
fb
in
...
...
src/transform/eval_match.ml
View file @
f3bcd139
...
...
@@ -115,12 +115,18 @@ let dive_to_constructor kn fn env t =
let
rec
cs_equ
kn
env
t1
t2
=
if
t_equal
t1
t2
then
t_true
else
match
t1
,
t2
with
else
let
aux
cs
tl
t
=
let
fn
=
apply_cs_equ
kn
cs
tl
in
try
dive_to_constructor
kn
fn
env
t
with
Exit
->
t_equ
t1
t2
in
match
t1
,
t2
with
(* cannot merge the 2 patterns because of warning 57 *)
|
{
t_node
=
Tapp
(
cs
,
tl
)
}
,
t
|
t
,
{
t_node
=
Tapp
(
cs
,
tl
)
}
when
is_constructor
kn
cs
->
let
fn
=
apply_cs_equ
kn
cs
tl
in
begin
try
dive_to_constructor
kn
fn
env
t
with
Exit
->
t_equ
t1
t2
end
when
is_constructor
kn
cs
->
aux
cs
tl
t
|
t
,
{
t_node
=
Tapp
(
cs
,
tl
)
}
when
is_constructor
kn
cs
->
aux
cs
tl
t
|
_
->
t_equ
t1
t2
and
apply_cs_equ
kn
cs1
tl1
env
t
=
match
t
.
t_node
with
...
...
src/whyml/mlw_ocaml.ml
View file @
f3bcd139
...
...
@@ -782,14 +782,14 @@ module Print = struct
fprintf
fmt
"%s"
s
else
let
fname
=
if
lp
=
[]
then
info
.
fname
else
None
in
let
m
=
String
.
capitalize
(
modulename
?
fname
lp
t
)
in
let
m
=
String
s
.
capitalize
(
modulename
?
fname
lp
t
)
in
fprintf
fmt
"%s.%s"
m
s
with
Not_found
->
let
s
=
id_unique
~
sanitizer
iprinter
id
in
fprintf
fmt
"%s"
s
let
print_lident
=
print_qident
~
sanitizer
:
String
.
uncapitalize
let
print_uident
=
print_qident
~
sanitizer
:
String
.
capitalize
let
print_lident
=
print_qident
~
sanitizer
:
String
s
.
uncapitalize
let
print_uident
=
print_qident
~
sanitizer
:
String
s
.
capitalize
let
print_path_id
fmt
=
function
|
[]
,
id
->
print_ident
fmt
id
...
...
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