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
25da1cd5
Commit
25da1cd5
authored
Dec 14, 2016
by
Stefan Berghofer
Committed by
MARCHE Claude
Jan 03, 2017
Browse files
Added support for "or" patterns to Isabelle printer
parent
57ca6f0e
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/printer/isabelle.ml
View file @
25da1cd5
...
...
@@ -158,6 +158,18 @@ let print_abs info pr fmt (v, t) =
let
p_type
p
=
p
.
pat_ty
let
rec
split_por
p
=
match
p
.
pat_node
with
|
Pwild
->
[
pat_wild
p
.
pat_ty
]
|
Pvar
v
->
[
pat_var
v
]
|
Pas
_
->
assert
false
|
Por
(
p1
,
p2
)
->
split_por
p1
@
split_por
p2
|
Papp
(
cs
,
pl
)
->
List
.
map
(
fun
zs
->
pat_app
cs
zs
p
.
pat_ty
)
(
List
.
fold_right
(
fun
xs
xss
->
List
.
concat
(
List
.
map
(
fun
x
->
List
.
map
(
fun
ys
->
x
::
ys
)
xss
)
xs
))
(
List
.
map
split_por
pl
)
[[]])
let
rec
print_pat
info
fmt
p
=
match
p
.
pat_node
with
|
Pwild
->
print_const
fmt
"Pure.dummy_pattern"
|
Pvar
v
->
print_var
info
fmt
v
...
...
@@ -258,8 +270,9 @@ and print_quant info defs s fmt (vl, f) = match vl with
(
print_abs
info
(
print_quant
info
defs
s
)))
fmt
(
s
,
(
v
,
(
vl'
,
f
)))
and
print_branch
info
defs
fmt
br
=
let
p
,
_
as
q
=
t_open_branch
br
in
elem'
"pat"
(
pair
(
print_pat
info
)
(
print_term
info
defs
))
fmt
q
;
let
p
,
t
=
t_open_branch
br
in
print_list
nothing
(
elem'
"pat"
(
pair
(
print_pat
info
)
(
print_term
info
defs
)))
fmt
(
List
.
map
(
fun
q
->
(
q
,
t
))
(
split_por
p
));
Svs
.
iter
forget_var
p
.
pat_vars
let
rec
dest_conj
t
=
match
t
.
t_node
with
...
...
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