Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frama-c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
frama-c
Commits
c99f4348
Commit
c99f4348
authored
1 year ago
by
Kilyan Le Gallic
Browse files
Options
Downloads
Patches
Plain Diff
[wp] Verbose iteration of opened theories as a PoC of theory crawling
parent
e771d7ec
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/plugins/wp/Why3Import.ml
+19
-3
19 additions, 3 deletions
src/plugins/wp/Why3Import.ml
with
19 additions
and
3 deletions
src/plugins/wp/Why3Import.ml
+
19
−
3
View file @
c99f4348
...
@@ -21,7 +21,6 @@
...
@@ -21,7 +21,6 @@
(**************************************************************************)
(**************************************************************************)
module
L
=
Wp_parameters
module
L
=
Wp_parameters
module
P
=
Why3
.
Pmodule
module
T
=
Why3
.
Theory
module
T
=
Why3
.
Theory
module
F
=
Filepath
.
Normalized
module
F
=
Filepath
.
Normalized
module
W
=
Why3
module
W
=
Why3
...
@@ -44,15 +43,32 @@ let extract_last_segments (str_list : string list) =
...
@@ -44,15 +43,32 @@ let extract_last_segments (str_list : string list) =
|
[]
->
(
""
,
[]
)
|
[]
->
(
""
,
[]
)
)
str_list
)
str_list
let
get_name_from_ident
(
ident
)
=
let
ident_printer
=
W
.
Ident
.
create_ident_printer
[]
in
W
.
Ident
.
id_unique
(
ident_printer
)
ident
let
open_theory
(
env
)
(
theories
)
=
let
open_theory
(
env
)
(
theories
)
=
List
.
iter
List
.
iter
(
fun
(
thy_n
,
thy_p
)
->
(
fun
(
thy_n
,
thy_p
)
->
try
try
let
theory
=
(
W
.
Env
.
read_theory
env
(
thy_p
)
(
thy_n
))
in
let
theory
=
(
W
.
Env
.
read_theory
env
(
thy_p
)
(
thy_n
))
in
W
.
Pretty
.
print_theory
Format
.
std_formatter
theory
;
List
.
iter
(
fun
(
tdecl
:
T
.
tdecl
)
->
match
tdecl
.
td_node
with
|
Decl
d
->
(
match
(
d
.
d_node
:
W
.
Decl
.
decl_node
)
with
|
Dtype
dtype
->
L
.
debug
~
level
:
0
"Decl and type, named : %s.@"
(
get_name_from_ident
dtype
.
ts_name
);
|
Ddata
_
->
L
.
debug
~
level
:
0
"Decl and ddata"
|
Dparam
_
->
L
.
debug
~
level
:
0
"Decl and dparam"
|
Dlogic
_
->
L
.
debug
~
level
:
0
"Decl and dlogic"
|
_
->
L
.
debug
~
level
:
0
"Decl but whatever"
)
|
Use
_
->
L
.
debug
~
level
:
0
"Use"
|
Clone
_
->
L
.
debug
~
level
:
0
"Clone"
|
Meta
_
->
L
.
debug
~
level
:
0
"Meta"
)
theory
.
th_decls
;
with
W
.
Env
.
LibraryNotFound
paths
->
with
W
.
Env
.
LibraryNotFound
paths
->
L
.
debug
~
level
:
0
"Library %s not found at %s "
thy_n
(
String
.
concat
"."
paths
);
L
.
debug
~
level
:
0
"Library %s not found at %s "
thy_n
(
String
.
concat
"."
paths
);
)
(
extract_last_segments
theories
)
)
(
extract_last_segments
theories
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment