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
f5bb71ef
Commit
f5bb71ef
authored
8 months ago
by
Kilyan Le Gallic
Committed by
Allan Blanchard
5 months ago
Browse files
Options
Downloads
Patches
Plain Diff
[wp] Added caching pattern to import_theory
parent
9aa687fe
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
+45
-42
45 additions, 42 deletions
src/plugins/wp/Why3Import.ml
with
45 additions
and
42 deletions
src/plugins/wp/Why3Import.ml
+
45
−
42
View file @
f5bb71ef
...
@@ -267,48 +267,48 @@ let li_of_ls (env:env) (menv : menv) (ls : W.Term.lsymbol) : C.logic_info =
...
@@ -267,48 +267,48 @@ let li_of_ls (env:env) (menv : menv) (ls : W.Term.lsymbol) : C.logic_info =
let
import_theory
(
env
:
env
)
thname
=
let
import_theory
(
env
:
env
)
thname
=
let
theory_name
,
theory_path
=
extract_path
thname
in
let
theory_name
,
theory_path
=
extract_path
thname
in
try
try
if
not
(
Datatype
.
String
.
Hashtbl
.
mem
env
.
menv
thname
)
then
try
ignore
(
Datatype
.
String
.
Hashtbl
.
find
env
.
menv
thname
)
with
Not_found
->
beg
in
let
menv
:
menv
=
{
li
=
[]
;
lti
=
[]
}
in
let
menv
:
menv
=
{
li
=
[]
;
lti
=
[]
}
in
let
theory
=
W
.
Env
.
read_theory
env
.
wenv
theory_path
theory_name
in
let
theory
=
W
.
Env
.
read_theory
env
.
wenv
theory_path
theory_name
in
List
.
iter
(
fun
(
tdecl
:
T
.
tdecl
)
->
List
.
iter
(
fun
(
tdecl
:
T
.
tdecl
)
->
match
tdecl
.
td_node
with
match
tdecl
.
td_node
with
|
Decl
decl
->
|
Decl
decl
->
begin
begin
match
decl
.
d_node
with
match
decl
.
d_node
with
|
Dtype
ts
->
|
Dtype
ts
->
L
.
debug
~
dkey
"Decl and type %a"
pp_id
ts
.
ts_name
;
L
.
debug
~
dkey
"
Decl and type
%a"
pp_id
ts
.
ts_name
;
L
.
debug
~
dkey
"
Location
%a"
pp_id
_loc
ts
.
ts_name
;
L
.
debug
~
dkey
"Location %a"
pp_id_loc
ts
.
ts_name
;
let
lti
=
lti_of_ts
env
menv
ts
in
let
lti
=
lti_of_ts
env
menv
ts
in
L
.
debug
~
dkey
"Correspondign LTI %a"
pp_lti
lti
;
L
.
debug
~
dkey
"Correspondign LTI %a"
pp_lti
lti
;
|
Ddata
ddatas
->
|
Ddata
ddatas
->
List
.
iter
List
.
iter
(
fun
((
ts
,
_
)
:
W
.
Decl
.
data_decl
)
->
(
fun
((
ts
,
_
)
:
W
.
Decl
.
data_decl
)
->
L
.
debug
~
dkey
"Decl and data %a"
pp_id
ts
.
ts_name
;
L
.
debug
~
dkey
"
Decl and data
%a"
pp_id
ts
.
ts_name
;
L
.
debug
~
dkey
"
Location
%a"
pp_id
_loc
ts
.
ts_name
;
L
.
debug
~
dkey
"Location %a"
pp_id_loc
ts
.
ts_name
;
let
lti
=
lti_of_ts
env
menv
ts
in
let
lti
=
lti_of_ts
env
menv
ts
in
L
.
debug
~
dkey
"Correspondign data LTI %a"
pp_lti
lti
;
L
.
debug
~
dkey
"Correspondign data LTI %a"
pp_lti
lti
;
)
ddatas
)
ddatas
|
Dparam
ls
->
|
Dparam
ls
->
L
.
debug
~
dkey
"Decl and dparam %a"
pp_id
ls
.
ls_name
;
L
.
debug
~
dkey
"
Decl and dparam
%a"
pp_id
ls
.
ls_name
;
L
.
debug
~
dkey
"
Location
%a"
pp_id
_loc
ls
.
ls_name
L
.
debug
~
dkey
"Location %a"
pp_id_loc
ls
.
ls_name
|
Dlogic
dlogics
->
|
Dlogic
dlogics
->
List
.
iter
List
.
iter
(
fun
((
ls
,_
)
:
W
.
Decl
.
logic_decl
)
->
(
fun
((
ls
,_
)
:
W
.
Decl
.
logic_decl
)
->
L
.
debug
~
dkey
"Decl and dlogic %a"
pp_id
ls
.
ls_name
;
L
.
debug
~
dkey
"
Decl and dlogic
%a"
pp_id
ls
.
ls_name
;
L
.
debug
~
dkey
"
Location
%a"
pp_id
_loc
ls
.
ls_name
;
L
.
debug
~
dkey
"Location %a"
pp_id_loc
ls
.
ls_name
;
let
li
=
li_of_ls
env
menv
ls
in
let
li
=
li_of_ls
env
menv
ls
in
L
.
debug
~
dkey
"Corresponding dlogic LTI %a"
pp_li
li
;
L
.
debug
~
dkey
"Corresponding dlogic LTI %a"
pp_li
li
;
)
dlogics
)
dlogics
|
_
->
L
.
debug
~
dkey
"Other type of Decl"
|
_
->
L
.
debug
~
dkey
"Other type of Decl"
end
end
|
Use
_
|
Clone
_
|
Meta
_
->
L
.
debug
~
dkey
""
|
Use
_
|
Clone
_
|
Meta
_
->
L
.
debug
~
dkey
""
)
theory
.
th_decls
;
)
theory
.
th_decls
;
Datatype
.
String
.
Hashtbl
.
add
env
.
menv
thname
Datatype
.
String
.
Hashtbl
.
add
env
.
menv
thname
{
logics
=
List
.
rev
menv
.
li
;
{
logic
s
=
List
.
rev
menv
.
li
;
type
s
=
List
.
rev
menv
.
l
t
i
;
types
=
List
.
rev
menv
.
lti
;
paths
=
theory_path
}
;
paths
=
theory_path
};
end
with
W
.
Env
.
LibraryNotFound
_
->
with
W
.
Env
.
LibraryNotFound
_
->
L
.
error
"Library %s not found"
thname
L
.
error
"Library %s not found"
thname
...
@@ -349,6 +349,9 @@ let loader (ctxt: Logic_typing.module_builder) (_: C.location) (m: string list)
...
@@ -349,6 +349,9 @@ let loader (ctxt: Logic_typing.module_builder) (_: C.location) (m: string list)
L
.
result
"Successfully imported theory at %s"
L
.
result
"Successfully imported theory at %s"
@@
String
.
concat
"::"
current_module
.
paths
;
@@
String
.
concat
"::"
current_module
.
paths
;
(*LB.add_builtin*)
end
end
let
()
=
let
()
=
...
...
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