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
1539529a
Commit
1539529a
authored
10 months ago
by
Kilyan Le Gallic
Browse files
Options
Downloads
Patches
Plain Diff
[wp] Added support for real in tvars, fixed typo on lt_of_ty_opt function name
parent
875b043e
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
+6
-3
6 additions, 3 deletions
src/plugins/wp/Why3Import.ml
with
6 additions
and
3 deletions
src/plugins/wp/Why3Import.ml
+
6
−
3
View file @
1539529a
...
...
@@ -106,7 +106,9 @@ type tenv = C.logic_type_info W.Ty.Hts.t
type
lenv
=
C
.
logic_info
W
.
Term
.
Hls
.
t
type
tvars
=
C
.
logic_type
W
.
Ty
.
Mtv
.
t
(* -------------------------------------------------------------------------- *)
(* --- Built-in --- *)
(* -------------------------------------------------------------------------- *)
let
_populate_tenv_builtin
(
tenv
:
tenv
)
=
let
_integer
=
C
.
Linteger
in
let
_real
=
C
.
Lreal
in
...
...
@@ -128,6 +130,7 @@ let tvars_of_txs (txs: W.Ty.tvsymbol list) : string list * tvars =
let
x
=
tv
.
tv_name
.
id_string
in
match
x
with
|
"int"
->
x
::
txs
,
W
.
Ty
.
Mtv
.
add
tv
(
C
.
Linteger
)
tvs
|
"real"
->
x
::
txs
,
W
.
Ty
.
Mtv
.
add
tv
(
C
.
Lreal
)
tvs
|
_
->
x
::
txs
,
W
.
Ty
.
Mtv
.
add
tv
(
C
.
Lvar
x
)
tvs
)
txs
([]
,
W
.
Ty
.
Mtv
.
empty
)
...
...
@@ -164,7 +167,7 @@ let lv_of_ty (tenv:tenv) (tvars:tvars) (index) (ty:W.Ty.ty) : C.logic_var =
Cil_const
.
make_logic_var_formal
(
Printf
.
sprintf
"x%d"
index
)
@@
(
lt_of_ty
tenv
tvars
ty
)
let
l
r
_of_ty_opt
(
lt_opt
)
=
let
l
t
_of_ty_opt
(
lt_opt
)
=
match
lt_opt
with
|
None
->
C
.
Ctype
(
C
.
TVoid
[]
)
(* Same as logic_typing *)
|
Some
tr
->
tr
...
...
@@ -175,7 +178,7 @@ let li_of_ls (tenv:tenv) (ls : W.Term.lsymbol) (lenv:lenv) : C.logic_info =
let
l_type
=
Option
.
map
(
lt_of_ty
tenv
tvars
)
ls
.
ls_value
in
let
l_profile
=
List
.
mapi
(
lv_of_ty
tenv
tvars
)
ls
.
ls_args
in
let
l_args
=
List
.
map
(
fun
(
lv
:
C
.
logic_var
)
->
lv
.
lv_type
)
l_profile
in
let
signature
=
C
.
Larrow
(
l_args
,
l
r
_of_ty_opt
l_type
)
in
let
signature
=
C
.
Larrow
(
l_args
,
l
t
_of_ty_opt
l_type
)
in
let
li
=
C
.{
l_var_info
=
Cil_const
.
make_logic_var_global
...
...
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