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
fa07e4a8
Commit
fa07e4a8
authored
5 years ago
by
Patrick Baudin
Browse files
Options
Downloads
Patches
Plain Diff
[WP] fixes Cint solver
parent
07049d24
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/plugins/wp/Changelog
+1
-0
1 addition, 0 deletions
src/plugins/wp/Changelog
src/plugins/wp/Cint.ml
+6
-1
6 additions, 1 deletion
src/plugins/wp/Cint.ml
with
7 additions
and
1 deletion
src/plugins/wp/Changelog
+
1
−
0
View file @
fa07e4a8
...
...
@@ -20,6 +20,7 @@
# <Prover>: prover
###############################################################################
- Wp [2019/05/09] Fixes -wp-simplify-is-cint simplifier
- Wp [2019/04/26] Now requires -warn-invalid-bool
- Wp [2019/04/26] Removed option -wp-bool-range
- Wp [2019/04/24] Support for Why3 1.* and Coq 8.{7-9}
...
...
This diff is collapsed.
Click to expand it.
src/plugins/wp/Cint.ml
+
6
−
1
View file @
fa07e4a8
...
...
@@ -815,6 +815,7 @@ let c_int_bounds_ival f =
let
max_reduce_quantifiers
=
1000
(** We know that t is a predicate which is the opened body of a forall *)
let
reduce_bound
v
dom
t
:
term
=
let
module
Exc
=
struct
exception
True
...
...
@@ -831,8 +832,9 @@ let reduce_bound v dom t : term =
Ival
.
fold_int
red
dom
()
;
raise
Exc
.
True
with
Exc
.
Unknown
i
->
i
in
let
max_bound
=
try
Ival
.
fold_int
(*
_decrease
*)
red
dom
()
;
raise
Exc
.
True
Ival
.
fold_int_decrease
red
dom
()
;
raise
Exc
.
True
with
Exc
.
Unknown
i
->
i
in
(** we try to reduce the bounds of the domains, when trivially false *)
let
dom_red
=
Ival
.
inject_range
(
Some
min_bound
)
(
Some
max_bound
)
in
if
not
(
Ival
.
equal
dom_red
dom
)
&&
Ival
.
is_included
dom_red
dom
then
t
...
...
@@ -929,6 +931,8 @@ let is_cint_simplifier = object (self)
domain
<-
Tmap
.
add
tvar
!
var_domain
domain
;
let
t
=
walk
~
is_goal
t
in
domain
<-
Tmap
.
remove
tvar
domain
;
(** Bonus: Add additionnal hypothesis in forall when we could deduce
better constraint on the variable *)
let
t
=
if
quant
=
Forall
&&
is_goal
&&
Ival
.
cardinal_is_less_than
!
var_domain
max_reduce_quantifiers
...
...
@@ -936,6 +940,7 @@ let is_cint_simplifier = object (self)
else
t
in
e_bind
quant
var
t
|
Fun
(
g
,
[
a
])
->
(** Here we simplifies the cints which are redoundant *)
begin
try
let
ubound
=
c_int_bounds_ival
(
is_cint
g
)
in
let
dom
=
(
Tmap
.
find
a
domain
)
in
...
...
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