Skip to content
Snippets Groups Projects
Commit d1ebfb73 authored by Loïc Correnson's avatar Loïc Correnson
Browse files

[WP] added tests with incomplete consolidation

parent 0425dfd2
No related branches found
No related tags found
No related merge requests found
...@@ -6,10 +6,10 @@ ...@@ -6,10 +6,10 @@
OPT: -wp-dynamic -wp OPT: -wp-dynamic -wp
*/ */
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
/*@ /*@
requires -10<=x<=10; requires -10<=x<=10;
ensures \result == x+1; ensures \result == x+1;
assigns \nothing; assigns \nothing;
*/ */
int f1(int x); int f1(int x);
...@@ -22,7 +22,7 @@ typedef struct S { ...@@ -22,7 +22,7 @@ typedef struct S {
} ; } ;
/*@ /*@
requires (closure->f == &f1 && \abs(closure->param)<=5) || closure->f == &f2 ; requires (closure->f == &f1 && \abs(closure->param)<=5) || closure->f == &f2 ;
ensures \abs(\result - closure->param) <= 1 ; ensures \abs(\result - closure->param) <= 1 ;
*/ */
int call(struct S * closure) { int call(struct S * closure) {
...@@ -78,6 +78,15 @@ int some_behaviors (int (*p)(void)) { ...@@ -78,6 +78,15 @@ int some_behaviors (int (*p)(void)) {
return (*p)(); return (*p)();
} }
/*@
ensures X1==1;
assigns X1 ;
*/
int missing_context (int (*p)(void)) {
//@ calls h1 ;
return (*p)();
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
//@ requires \false; ensures \false; exits \false; assigns \nothing; //@ requires \false; ensures \false; exits \false; assigns \nothing;
int unreachable_g(int x); int unreachable_g(int x);
......
{ "wp:global": { "alt-ergo": { "total": 3, "valid": 3, "rank": 16 }, { "wp:global": { "alt-ergo": { "total": 4, "valid": 3, "unknown": 1,
"qed": { "total": 43, "valid": 43 }, "rank": 16 },
"wp:main": { "total": 46, "valid": 46, "rank": 16 } }, "qed": { "total": 47, "valid": 47 },
"wp:main": { "total": 51, "valid": 50, "unknown": 1,
"rank": 16 } },
"wp:functions": { "call": { "specialization_f1_pre_at_call_stmt_3": "wp:functions": { "call": { "specialization_f1_pre_at_call_stmt_3":
{ "alt-ergo": { "total": 1, "valid": 1, { "alt-ergo": { "total": 1, "valid": 1,
"rank": 16 }, "rank": 16 },
...@@ -104,7 +106,32 @@ ...@@ -104,7 +106,32 @@
"valid": 24 }, "valid": 24 },
"wp:main": { "total": 24, "wp:main": { "total": 24,
"valid": 24 } } }, "valid": 24 } } },
"no_call": { "specialization_unreachable_g_pre_at_no_call_stmt_27": "missing_context": { "missing_context_stmt_calls_h1":
{ "alt-ergo": { "total": 1,
"unknown": 1 },
"wp:main": { "total": 1,
"unknown": 1 } },
"missing_context_assign": { "qed":
{ "total": 3,
"valid": 3 },
"wp:main":
{ "total": 3,
"valid": 3 } },
"missing_context_post": { "qed":
{ "total": 1,
"valid": 1 },
"wp:main":
{ "total": 1,
"valid": 1 } },
"wp:section": { "alt-ergo":
{ "total": 1,
"unknown": 1 },
"qed": { "total": 4,
"valid": 4 },
"wp:main": { "total": 5,
"valid": 4,
"unknown": 1 } } },
"no_call": { "specialization_unreachable_g_pre_at_no_call_stmt_32":
{ "qed": { "total": 1, "valid": 1 }, { "qed": { "total": 1, "valid": 1 },
"wp:main": { "total": 1, "valid": 1 } }, "wp:main": { "total": 1, "valid": 1 } },
"no_call_stmt_calls_unreachable_g": "no_call_stmt_calls_unreachable_g":
......
...@@ -7,8 +7,9 @@ ...@@ -7,8 +7,9 @@
[wp] tests/wp_plugin/dynamic.i:65: Calls h1 h2 [wp] tests/wp_plugin/dynamic.i:65: Calls h1 h2
[wp] tests/wp_plugin/dynamic.i:78: Calls (for bhv1) h1 h2 h0 [wp] tests/wp_plugin/dynamic.i:78: Calls (for bhv1) h1 h2 h0
[wp] tests/wp_plugin/dynamic.i:78: Calls (for bhv0) h1 h2 h0 [wp] tests/wp_plugin/dynamic.i:78: Calls (for bhv0) h1 h2 h0
[wp] tests/wp_plugin/dynamic.i:91: Calls unreachable_g [wp] tests/wp_plugin/dynamic.i:87: Calls h1
[wp:calls] Dynamic call(s): 5. [wp] tests/wp_plugin/dynamic.i:100: Calls unreachable_g
[wp:calls] Dynamic call(s): 6.
[wp] Loading driver 'share/wp.driver' [wp] Loading driver 'share/wp.driver'
[wp] tests/wp_plugin/dynamic.i:78: Warning: [wp] tests/wp_plugin/dynamic.i:78: Warning:
Missigns 'calls' clause dedicated to dynamic calls (see WP manual) Missigns 'calls' clause dedicated to dynamic calls (see WP manual)
...@@ -158,28 +159,60 @@ Goal Post-condition (file tests/wp_plugin/dynamic.i, line 39) in 'guarded_call' ...@@ -158,28 +159,60 @@ Goal Post-condition (file tests/wp_plugin/dynamic.i, line 39) in 'guarded_call'
Tags: Call g. Tags: Call g.
Prove: true. Prove: true.
------------------------------------------------------------
------------------------------------------------------------
Function missing_context
------------------------------------------------------------
Goal Calls h1 in 'missing_context' at instruction (file tests/wp_plugin/dynamic.i, line 87):
Assume { (* Heap *) Have: region(p.base) <= 0. }
Prove: global(G_h1_57) = p.
------------------------------------------------------------
Goal Post-condition (file tests/wp_plugin/dynamic.i, line 82) in 'missing_context':
Tags: Call h1.
Prove: true.
------------------------------------------------------------
Goal Assigns (file tests/wp_plugin/dynamic.i, line 83) in 'missing_context':
Prove: true.
------------------------------------------------------------
Goal Assigns (file tests/wp_plugin/dynamic.i, line 83) in 'missing_context' (1/2):
Prove: true.
------------------------------------------------------------
Goal Assigns (file tests/wp_plugin/dynamic.i, line 83) in 'missing_context' (2/2):
Call Result at line 87
Tags: Call h1.
Prove: true.
------------------------------------------------------------ ------------------------------------------------------------
------------------------------------------------------------ ------------------------------------------------------------
Function no_call Function no_call
------------------------------------------------------------ ------------------------------------------------------------
Goal Calls unreachable_g in 'no_call' at instruction (file tests/wp_plugin/dynamic.i, line 91): Goal Calls unreachable_g in 'no_call' at instruction (file tests/wp_plugin/dynamic.i, line 100):
Prove: true. Prove: true.
------------------------------------------------------------ ------------------------------------------------------------
Goal Post-condition (file tests/wp_plugin/dynamic.i, line 85) in 'no_call' (1/2): Goal Post-condition (file tests/wp_plugin/dynamic.i, line 94) in 'no_call' (1/2):
Prove: true. Prove: true.
------------------------------------------------------------ ------------------------------------------------------------
Goal Post-condition (file tests/wp_plugin/dynamic.i, line 85) in 'no_call' (2/2): Goal Post-condition (file tests/wp_plugin/dynamic.i, line 94) in 'no_call' (2/2):
Tags: Call unreachable_g. Tags: Call unreachable_g.
Prove: true. Prove: true.
------------------------------------------------------------ ------------------------------------------------------------
Goal Instance of 'Pre-condition (file tests/wp_plugin/dynamic.i, line 82) in 'unreachable_g'' in 'no_call' at instruction (file tests/wp_plugin/dynamic.i, line 91) Goal Instance of 'Pre-condition (file tests/wp_plugin/dynamic.i, line 91) in 'unreachable_g'' in 'no_call' at instruction (file tests/wp_plugin/dynamic.i, line 100)
: :
Tags: Call unreachable_g. Tags: Call unreachable_g.
Prove: true. Prove: true.
...@@ -350,3 +383,6 @@ Prove: true. ...@@ -350,3 +383,6 @@ Prove: true.
[wp] Warning: Memory model hypotheses for function 'some_behaviors': [wp] Warning: Memory model hypotheses for function 'some_behaviors':
/*@ behavior typed: requires \separated(&X1,p); */ /*@ behavior typed: requires \separated(&X1,p); */
int some_behaviors(int (*p)(void)); int some_behaviors(int (*p)(void));
[wp] Warning: Memory model hypotheses for function 'missing_context':
/*@ behavior typed: requires \separated(&X1,p); */
int missing_context(int (*p)(void));
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
[wp] tests/wp_plugin/dynamic.i:78: Warning: [wp] tests/wp_plugin/dynamic.i:78: Warning:
Missigns 'calls' clause dedicated to dynamic calls (see WP manual) Missigns 'calls' clause dedicated to dynamic calls (see WP manual)
[wp] Warning: Missing RTE guards [wp] Warning: Missing RTE guards
[wp] 46 goals scheduled [wp] 51 goals scheduled
[wp] [Qed] Goal typed_behavior_stmt_calls_h1_h2_for_bhv1 : Valid [wp] [Qed] Goal typed_behavior_stmt_calls_h1_h2_for_bhv1 : Valid
[wp] [Qed] Goal typed_behavior_bhv1_post_part1 : Valid [wp] [Qed] Goal typed_behavior_bhv1_post_part1 : Valid
[wp] [Qed] Goal typed_behavior_bhv1_post_part2 : Valid [wp] [Qed] Goal typed_behavior_bhv1_post_part2 : Valid
...@@ -24,6 +24,11 @@ ...@@ -24,6 +24,11 @@
[wp] [Qed] Goal typed_guarded_call_post_part2 : Valid [wp] [Qed] Goal typed_guarded_call_post_part2 : Valid
[wp] [Qed] Goal typed_guarded_call_post_2_part1 : Valid [wp] [Qed] Goal typed_guarded_call_post_2_part1 : Valid
[wp] [Qed] Goal typed_guarded_call_post_2_part2 : Valid [wp] [Qed] Goal typed_guarded_call_post_2_part2 : Valid
[wp] [Alt-Ergo] Goal typed_missing_context_stmt_calls_h1 : Unknown
[wp] [Qed] Goal typed_missing_context_post : Valid
[wp] [Qed] Goal typed_missing_context_assign_exit : Valid
[wp] [Qed] Goal typed_missing_context_assign_normal_part1 : Valid
[wp] [Qed] Goal typed_missing_context_assign_normal_part2 : Valid
[wp] [Qed] Goal typed_no_call_stmt_calls_unreachable_g : Valid [wp] [Qed] Goal typed_no_call_stmt_calls_unreachable_g : Valid
[wp] [Qed] Goal typed_no_call_post_part1 : Valid [wp] [Qed] Goal typed_no_call_post_part1 : Valid
[wp] [Qed] Goal typed_no_call_post_part2 : Valid [wp] [Qed] Goal typed_no_call_post_part2 : Valid
...@@ -52,9 +57,9 @@ ...@@ -52,9 +57,9 @@
[wp] [Qed] Goal typed_some_behaviors_bhv1_assign_normal_part3 : Valid [wp] [Qed] Goal typed_some_behaviors_bhv1_assign_normal_part3 : Valid
[wp] [Qed] Goal typed_some_behaviors_bhv1_assign_normal_part4 : Valid [wp] [Qed] Goal typed_some_behaviors_bhv1_assign_normal_part4 : Valid
[wp] [Qed] Goal typed_some_behaviors_bhv1_assign_normal_part5 : Valid [wp] [Qed] Goal typed_some_behaviors_bhv1_assign_normal_part5 : Valid
[wp] Proved goals: 46 / 46 [wp] Proved goals: 50 / 51
Qed: 43 Qed: 47
Alt-Ergo: 3 Alt-Ergo: 3 (unknown: 1)
[wp] Report 'tests/wp_plugin/dynamic.i.0.report.json' [wp] Report 'tests/wp_plugin/dynamic.i.0.report.json'
------------------------------------------------------------- -------------------------------------------------------------
Functions WP Alt-Ergo Total Success Functions WP Alt-Ergo Total Success
...@@ -62,6 +67,7 @@ call 2 2 (56..80) 4 100% ...@@ -62,6 +67,7 @@ call 2 2 (56..80) 4 100%
guarded_call 4 1 (16..28) 5 100% guarded_call 4 1 (16..28) 5 100%
behavior 9 - 9 100% behavior 9 - 9 100%
some_behaviors 24 - 24 100% some_behaviors 24 - 24 100%
missing_context 4 - 5 80.0%
no_call 4 - 4 100% no_call 4 - 4 100%
------------------------------------------------------------- -------------------------------------------------------------
[wp] Warning: Memory model hypotheses for function 'guarded_call': [wp] Warning: Memory model hypotheses for function 'guarded_call':
...@@ -73,3 +79,6 @@ no_call 4 - 4 100% ...@@ -73,3 +79,6 @@ no_call 4 - 4 100%
[wp] Warning: Memory model hypotheses for function 'some_behaviors': [wp] Warning: Memory model hypotheses for function 'some_behaviors':
/*@ behavior typed: requires \separated(&X1,p); */ /*@ behavior typed: requires \separated(&X1,p); */
int some_behaviors(int (*p)(void)); int some_behaviors(int (*p)(void));
[wp] Warning: Memory model hypotheses for function 'missing_context':
/*@ behavior typed: requires \separated(&X1,p); */
int missing_context(int (*p)(void));
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment