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
a46444ce
Commit
a46444ce
authored
9 months ago
by
Kilyan Le Gallic
Committed by
Loïc Correnson
8 months ago
Browse files
Options
Downloads
Patches
Plain Diff
[wp] Creation of empty environment
parent
24c9bdf3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/plugins/wp/Why3Import.ml
+11
-11
11 additions, 11 deletions
src/plugins/wp/Why3Import.ml
with
11 additions
and
11 deletions
src/plugins/wp/Why3Import.ml
+
11
−
11
View file @
a46444ce
...
...
@@ -40,6 +40,8 @@ let create_why3_env loadpath =
let
main
=
WConf
.
get_main
@@
WConf
.
read_config
None
in
W
.
Env
.
create_env
@@
WConf
.
loadpath
main
@
F
.
to_string_list
loadpath
let
extract_path
thname
=
let
segments
=
String
.
split_on_char
'.'
thname
in
match
List
.
rev
segments
with
...
...
@@ -123,7 +125,13 @@ type env = {
menv
:
why3module
Datatype
.
String
.
Hashtbl
.
t
}
let
create_empty_env
wenv
=
let
tenv
=
W
.
Ty
.
Hts
.
create
0
in
let
lenv
=
W
.
Term
.
Hls
.
create
0
in
let
lils
=
Logic_info
.
Hashtbl
.
create
0
in
let
ltits
=
Logic_type_info
.
Hashtbl
.
create
0
in
let
menv
=
Datatype
.
String
.
Hashtbl
.
create
0
in
{
wenv
;
tenv
;
lenv
;
lils
;
ltits
;
menv
}
(* -------------------------------------------------------------------------- *)
(* --- Built-in --- *)
(* -------------------------------------------------------------------------- *)
...
...
@@ -186,9 +194,6 @@ and lti_of_ts (env : env) (ts : W.Ty.tysymbol) : C.logic_type_info =
}
in
W
.
Ty
.
Hts
.
add
env
.
tenv
ts
lti
;
let
cwmod
=
Datatype
.
String
.
Hashtbl
.
find
env
.
menv
@@
recover_module
ts
.
ts_name
in
Datatype
.
String
.
Hashtbl
.
replace
env
.
menv
(
recover_module
ts
.
ts_name
)
{
cwmod
with
types
=
cwmod
.
types
@
[
lti
]};
...
...
@@ -278,7 +283,7 @@ let import_theory (env : env) thname =
let
li
=
li_of_ls
env
ls
in
L
.
debug
~
dkey
"Corresponding dlogic LTI %a"
pp_li
li
;
)
dlogics
|
_
->
L
.
debug
~
dkey
"
Decl and whatever
"
|
_
->
L
.
debug
~
dkey
"
Other type of Decl
"
end
|
Use
_
|
Clone
_
|
Meta
_
->
L
.
debug
~
dkey
""
)
theory
.
th_decls
...
...
@@ -298,12 +303,7 @@ let () =
if
libs
<>
[]
||
imports
<>
[]
then
begin
let
wenv
=
create_why3_env
@@
libs
in
let
tenv
=
W
.
Ty
.
Hts
.
create
0
in
let
lenv
=
W
.
Term
.
Hls
.
create
0
in
let
lils
=
Logic_info
.
Hashtbl
.
create
0
in
let
ltits
=
Logic_type_info
.
Hashtbl
.
create
0
in
let
menv
=
Datatype
.
String
.
Hashtbl
.
create
0
in
let
env
:
env
=
{
wenv
;
tenv
;
lenv
;
lils
;
ltits
;
menv
}
in
let
env
:
env
=
create_empty_env
wenv
in
add_builtins
env
;
List
.
iter
(
import_theory
env
)
@@
imports
;
W
.
Ty
.
Hts
.
iter
(
fun
(
tys
)
(
lti
)
->
...
...
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