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
00bc1c70
Commit
00bc1c70
authored
Sep 27, 2012
by
Andrei Paskevich
Browse files
session: extract explanations from match expressions
parent
9d8f4801
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/session/session.ml
View file @
00bc1c70
...
...
@@ -685,6 +685,24 @@ let rec get_expl_fmla f =
let
(
_
,
f
)
=
Term
.
t_open_bound
fb
in
get_expl_fmla
f
|
Term
.
Tcase
(
_
,
[
fb
])
->
let
(
_
,
f
)
=
Term
.
t_open_branch
fb
in
get_expl_fmla
f
|
Term
.
Tcase
(
_
,
bl
)
->
(* we check if the match is post-split, i.e. only one
branch has an explanation label *)
let
rec
rest_expl
s
=
function
|
[]
->
raise
(
Found
s
)
|
fb
::
bl
->
let
(
_
,
f
)
=
Term
.
t_open_branch
fb
in
(
try
get_expl_fmla
f
with
Found
_
->
()
);
rest_expl
s
bl
in
let
rec
find_expl
=
function
|
[]
->
()
|
fb
::
bl
->
let
(
_
,
f
)
=
Term
.
t_open_branch
fb
in
(
try
get_expl_fmla
f
with
Found
s
->
rest_expl
s
bl
);
find_expl
bl
in
find_expl
bl
|
_
->
()
)
type
expl
=
string
option
...
...
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