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
89c3adc3
Commit
89c3adc3
authored
Aug 26, 2016
by
Guillaume Melquiond
Browse files
Merge branch 'bugfix/v0.87'
parents
3dd84985
b388193c
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/whyml/mlw_interp.ml
View file @
89c3adc3
...
...
@@ -45,6 +45,8 @@ type value =
|
Vcase
of
value
*
term_branch
list
let
array_cons_ls
=
ref
ps_equ
let
ls_true
=
ref
ps_equ
let
ls_false
=
ref
ps_equ
let
rec
print_value
fmt
v
=
match
v
with
...
...
@@ -228,6 +230,9 @@ let rec matching env (t:value) p =
else
if
ls2
.
ls_constr
>
0
then
raise
NoMatch
else
raise
Undetermined
|
Vbool
b
->
let
l
=
if
b
then
!
ls_true
else
!
ls_false
in
if
ls_equal
ls1
l
then
env
else
raise
NoMatch
|
_
->
raise
Undetermined
...
...
@@ -407,8 +412,8 @@ let eval_map_set ls_set l =
let
built_in_theories
=
[
[
"bool"
]
,
"Bool"
,
[]
,
[
"True"
,
Non
e
,
eval_true
;
"False"
,
Non
e
,
eval_false
;
[
"True"
,
Some
ls_tru
e
,
eval_true
;
"False"
,
Some
ls_fals
e
,
eval_false
;
]
;
[
"int"
]
,
"Int"
,
[]
,
[
"infix +"
,
None
,
eval_int_op
BigInt
.
add
;
...
...
src/whyml/mlw_ocaml.ml
View file @
89c3adc3
...
...
@@ -798,7 +798,7 @@ module Print = struct
print_lident
info
fmt
ts
|
Tapp
(
ts
,
[
ty
])
->
fprintf
fmt
(
protect_on
paren
"%a@ %a"
)
(
print_ty
info
)
ty
(
print_lident
info
)
ts
(
print_ty
~
paren
:
true
info
)
ty
(
print_lident
info
)
ts
|
Tapp
(
ts
,
tl
)
->
fprintf
fmt
(
protect_on
paren
"(%a)@ %a"
)
(
print_list
comma
(
print_ty
info
))
tl
...
...
@@ -969,7 +969,7 @@ module Print = struct
fprintf
fmt
"%a.%a"
(
print_expr_p
info
)
e
(
print_lident
info
)
f
|
Esetfield
(
e1
,
f
,
e2
)
->
fprintf
fmt
(
protect_on
paren
"%a.%a <- %a"
)
(
print_expr
info
)
e1
(
print_lident
info
)
f
(
print_expr
info
)
e2
(
print_expr
_p
info
)
e1
(
print_lident
info
)
f
(
print_expr
info
)
e2
|
Eblock
[]
->
fprintf
fmt
"()"
|
Eblock
[
e
]
->
...
...
@@ -1005,7 +1005,7 @@ module Print = struct
fprintf
fmt
(
protect_on
paren
"raise %a"
)
(
print_uident
info
)
id
|
Eraise
(
Xident
id
,
Some
e1
)
->
fprintf
fmt
(
protect_on
paren
"raise (%a %a)"
)
(
print_uident
info
)
id
(
print_expr
info
)
e1
(
print_uident
info
)
id
(
print_expr
~
paren
:
true
info
)
e1
|
Etry
(
e1
,
bl
)
->
fprintf
fmt
"@[<v>@[<hv>@[<hov 2>begin@ try@ %a@]@ with@]@
\n
@[<hov>%a@]@
\n
end@]"
...
...
@@ -1069,7 +1069,7 @@ module Print = struct
fprintf
fmt
"exception %a@
\n
@
\n
"
(
print_uident
info
)
xs
|
Dexn
(
xs
,
Some
ty
)
->
fprintf
fmt
"@[<hov 2>exception %a of %a@]@
\n
@
\n
"
(
print_uident
info
)
xs
(
print_ty
info
)
ty
(
print_uident
info
)
xs
(
print_ty
~
paren
:
true
info
)
ty
end
...
...
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