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
47737c99
Commit
47737c99
authored
1 year ago
by
Kilyan Le Gallic
Browse files
Options
Downloads
Patches
Plain Diff
[wp] Location outputting of Why3 symbols
parent
81bfb398
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
+29
-14
29 additions, 14 deletions
src/plugins/wp/Why3Import.ml
with
29 additions
and
14 deletions
src/plugins/wp/Why3Import.ml
+
29
−
14
View file @
47737c99
...
...
@@ -42,14 +42,22 @@ let extract_path thname =
let
pp_id
fmt
(
id
:
W
.
Ident
.
ident
)
=
Format
.
pp_print_string
fmt
id
.
id_string
(* For debug only*)
let
pp_id_loc
fmt
(
id
:
W
.
Ident
.
ident
)
=
match
id
.
id_loc
with
|
Some
loc
->
W
.
Loc
.
pp_position
fmt
loc
|
None
->
L
.
debug
~
level
:
0
"No location found"
(* logic_type =
| Ctype of typ (** a C type *)
| Ltype of logic_type_info * logic_type list
(** an user-defined logic type with its parameters *)
| Lvar of string (** a type variable. *)
| Linteger (** mathematical integers, {i i.e.} Z *)
| Lreal (** mathematical reals, {i i.e.} R *)
| Larrow of logic_type list * logic_type (** (n-ary) function type *)*)
| Ctype of typ (** a C type *)
| Ltype of logic_type_info * logic_type list
(** an user-defined logic type with its parameters *)
| Lvar of string (** a type variable. *)
| Linteger (** mathematical integers, {i i.e.} Z *)
| Lreal (** mathematical reals, {i i.e.} R *)
| Larrow of logic_type list * logic_type (** (n-ary) function type *)*)
(*logic_type_info = {
mutable lt_name: string;
...
...
@@ -59,18 +67,21 @@ let pp_id fmt (id: W.Ident.ident) =
mutable lt_attr: attributes;
(** attributes associated to the logic type.
@since Phosphorus-20170501-beta1 *)
}*)
}*)
let
rec
lt_of_ts
(
ty
:
W
.
Ty
.
ty
)
=
let
rec
_
lt_of_ts
(
ty
:
W
.
Ty
.
ty
)
=
match
ty
.
ty_node
with
|
W
.
Ty
.
Tyvar
tvs
->
(* Tvs *)
L
.
debug
~
level
:
0
"Tvsymbol %a.@"
pp_id
tvs
.
tv_name
;
L
.
debug
~
level
:
0
"Tvsymbol location %a.@"
pp_id_loc
tvs
.
tv_name
;
(* Cil_types.Linteger *)
|
W
.
Ty
.
Tyapp
(
tys
,
tyl
)
->
L
.
debug
~
level
:
0
"Tysymbol %a.@"
pp_id
tys
.
ts_name
;
List
.
iter
(
fun
ty
->
lt_of_ts
ty
)
tyl
;
L
.
debug
~
level
:
0
"Tysymbol location %a.@"
pp_id_loc
tys
.
ts_name
;
List
.
iter
(
fun
ty
->
_lt_of_ts
ty
)
tyl
;
(* Cil_types.Lreal *)
and
lti_of_ls
(
tys
:
W
.
Ty
.
tysymbol
)
:
Cil_types
.
logic_type_info
=
and
_
lti_of_ls
(
tys
:
W
.
Ty
.
tysymbol
)
:
Cil_types
.
logic_type_info
=
{
lt_name
=
tys
.
ts_name
.
id_string
;
lt_params
=
[
""
];
...
...
@@ -88,18 +99,22 @@ let import_theory env thname =
begin
match
decl
.
d_node
with
|
Dtype
ts
->
L
.
debug
~
level
:
0
"Decl and type %a.@"
pp_id
ts
.
ts_name
L
.
debug
~
level
:
0
"Decl and type %a.@"
pp_id
ts
.
ts_name
;
L
.
debug
~
level
:
0
"Location %a.@"
pp_id_loc
ts
.
ts_name
|
Ddata
ddatas
->
List
.
iter
(
fun
((
ts
,
_
)
:
W
.
Decl
.
data_decl
)
->
L
.
debug
~
level
:
0
"Decl and data %a.@"
pp_id
ts
.
ts_name
;
L
.
debug
~
level
:
0
"Location %a.@"
pp_id_loc
ts
.
ts_name
)
ddatas
|
Dparam
ls
->
L
.
debug
~
level
:
0
"Decl and dparam %a.@"
pp_id
ls
.
ls_name
L
.
debug
~
level
:
0
"Decl and dparam %a.@"
pp_id
ls
.
ls_name
;
L
.
debug
~
level
:
0
"Location %a.@"
pp_id_loc
ls
.
ls_name
|
Dlogic
dlogics
->
List
.
iter
(
fun
((
ls
,_
)
:
W
.
Decl
.
logic_decl
)
->
L
.
debug
~
level
:
0
"Decl and dlogic %a.@"
pp_id
ls
.
ls_name
L
.
debug
~
level
:
0
"Decl and dlogic %a.@"
pp_id
ls
.
ls_name
;
L
.
debug
~
level
:
0
"Location %a.@"
pp_id_loc
ls
.
ls_name
)
dlogics
|
_
->
L
.
debug
~
level
:
0
"Decl but whatever"
end
...
...
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