Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
why3
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Monitor
Service Desk
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Why3
why3
Commits
28f8abb4
Commit
28f8abb4
authored
12 years ago
by
MARCHE Claude
Browse files
Options
Downloads
Patches
Plain Diff
Jessie3: isqrt.c proved, yahoo !
parent
203733cd
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/jessie/ACSLtoWhy3.ml
+13
-4
13 additions, 4 deletions
src/jessie/ACSLtoWhy3.ml
src/jessie/tests/basic/oracle/isqrt.res.oracle
+54
-3
54 additions, 3 deletions
src/jessie/tests/basic/oracle/isqrt.res.oracle
with
67 additions
and
7 deletions
src/jessie/ACSLtoWhy3.ml
+
13
−
4
View file @
28f8abb4
...
@@ -419,6 +419,9 @@ let rel (ty1,t1) op (ty2,t2) =
...
@@ -419,6 +419,9 @@ let rel (ty1,t1) op (ty2,t2) =
|
Req
,_,_
->
Term
.
t_equ
t1
t2
|
Req
,_,_
->
Term
.
t_equ
t1
t2
|
Rneq
,_,_
->
Term
.
t_neq
t1
t2
|
Rneq
,_,_
->
Term
.
t_neq
t1
t2
|
Rge
,
Linteger
,
Linteger
->
t_app
ge_int
[
t1
;
t2
]
|
Rge
,
Linteger
,
Linteger
->
t_app
ge_int
[
t1
;
t2
]
|
Rle
,
Linteger
,
Linteger
->
t_app
le_int
[
t1
;
t2
]
|
Rgt
,
Linteger
,
Linteger
->
t_app
gt_int
[
t1
;
t2
]
|
Rlt
,
Linteger
,
Linteger
->
t_app
lt_int
[
t1
;
t2
]
|
Rge
,
Lreal
,
Lreal
->
t_app
ge_real
[
t1
;
t2
]
|
Rge
,
Lreal
,
Lreal
->
t_app
ge_real
[
t1
;
t2
]
|
Rge
,_,_
->
|
Rge
,_,_
->
Self
.
not_yet_implemented
"rel Rge"
Self
.
not_yet_implemented
"rel Rge"
...
@@ -633,18 +636,22 @@ let annot a e =
...
@@ -633,18 +636,22 @@ let annot a e =
Self
.
not_yet_implemented
"annot APragma"
Self
.
not_yet_implemented
"annot APragma"
let
loop_annot
a
=
let
loop_annot
a
=
List
.
fold_left
(
fun
(
_
inv
,
_
var
)
a
->
List
.
fold_left
(
fun
(
inv
,
var
)
a
->
match
a
.
annot_content
with
match
(
Annotations
.
code_annotation_of_rooted
a
)
.
annot_content
with
|
AAssert
([]
,_
pred
)
->
|
AAssert
([]
,_
pred
)
->
Self
.
not_yet_implemented
"loop_annot AAssert"
Self
.
not_yet_implemented
"loop_annot AAssert"
|
AAssert
(
_labels
,_
pred
)
->
|
AAssert
(
_labels
,_
pred
)
->
Self
.
not_yet_implemented
"loop_annot AAssert"
Self
.
not_yet_implemented
"loop_annot AAssert"
|
AStmtSpec
_
->
|
AStmtSpec
_
->
Self
.
not_yet_implemented
"loop_annot AStmtSpec"
Self
.
not_yet_implemented
"loop_annot AStmtSpec"
|
AInvariant
([]
,
true
,
p
)
->
(
Term
.
t_and
inv
(
predicate_named
~
label
:
Here
p
)
,
var
)
|
AInvariant
_
->
|
AInvariant
_
->
Self
.
not_yet_implemented
"loop_annot AInvariant"
Self
.
not_yet_implemented
"loop_annot AInvariant"
|
AVariant
_
->
|
AVariant
(
t
,
None
)
->
Self
.
not_yet_implemented
"loop_annot AVariant"
(
inv
,
(
snd
(
term
~
label
:
Here
t
)
,
None
)
::
var
)
|
AVariant
(
_var
,
Some
_
)
->
Self
.
not_yet_implemented
"loop_annot AVariant/Some"
|
AAssigns
_
->
|
AAssigns
_
->
Self
.
not_yet_implemented
"loop_annot AAssigns"
Self
.
not_yet_implemented
"loop_annot AAssigns"
|
AAllocation
_
->
|
AAllocation
_
->
...
@@ -767,6 +774,8 @@ let rec stmt s =
...
@@ -767,6 +774,8 @@ let rec stmt s =
with Continue -> ()
with Continue -> ()
with Break -> ()
with Break -> ()
*)
*)
assert
(
annots
=
[]
);
let
annots
=
Annotations
.
code_annot
s
in
let
inv
,
var
=
loop_annot
annots
in
let
inv
,
var
=
loop_annot
annots
in
let
v
=
let
v
=
Mlw_ty
.
create_pvsymbol
(
Ident
.
id_fresh
"_dummy"
)
Mlw_ty
.
create_pvsymbol
(
Ident
.
id_fresh
"_dummy"
)
...
...
This diff is collapsed.
Click to expand it.
src/jessie/tests/basic/oracle/isqrt.res.oracle
+
54
−
3
View file @
28f8abb4
...
@@ -3,6 +3,57 @@
...
@@ -3,6 +3,57 @@
[jessie3] user error: WARNING: Variable Frama_C_copy_block not translated
[jessie3] user error: WARNING: Variable Frama_C_copy_block not translated
[jessie3] creating logic symbol 739 (sqr)
[jessie3] creating logic symbol 739 (sqr)
[jessie3] processing function isqrt
[jessie3] processing function isqrt
[kernel] Plug-in jessie3 aborted: unimplemented feature.
[jessie3] found 1 logic decl(s)
You may send a feature request at http://bts.frama-c.com with:
[jessie3] made 1 theory(ies)
'[Plug-in jessie3] rel'.
[jessie3] made 1 function(s)
[jessie3] running theory 1:
[jessie3] theory Global_logic_declarations
(* use why3.BuiltIn *)
(* use int.Int *)
(* use real.Real *)
function sqr (x:int) : int = x * x
end
[jessie3] Alt-Ergo 0.94, Alt-Ergo 0.95, CVC3 2.2, CVC3 2.4.1, Z3 3.2, Z3 4.2
[jessie3] running theory 1:
[jessie3] theory C_Functions
(* use why3.BuiltIn *)
(* use why3.Bool *)
(* use why3.Unit *)
(* use why3.Prelude *)
(* use int.Int *)
(* use real.Real *)
(* use Global_logic_declarations *)
(* use ref.Ref *)
goal WP_parameter_isqrt :
forall x:int.
x >= 0 ->
(forall count:int.
count = 0 ->
(forall sum:int.
sum = 1 ->
((count >= 0 /\ x >= sqr count) /\ sum = sqr (count + 1)) /\
(forall sum1:int, count1:int.
(count1 >= 0 /\ x >= sqr count1) /\ sum1 = sqr (count1 + 1) ->
(if sum1 <= x then forall count2:int.
count2 = (count1 + 1) ->
(forall sum2:int.
sum2 = (sum1 + ((2 * count2) + 1)) ->
((count2 >= 0 /\ x >= sqr count2) /\
sum2 = sqr (count2 + 1)) /\
0 <= (x - count1) /\
(x - count2) < (x - count1))
else (count1 >= 0 /\ sqr count1 <= x) /\ x < sqr (count1 + 1)))))
end
[jessie3] Alt-Ergo 0.94, Alt-Ergo 0.95, CVC3 2.2, CVC3 2.4.1, Z3 3.2, Z3 4.2
[jessie3] Task 1: Valid, Valid, Valid, Valid, Valid, Valid
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