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
b1c9dbc6
Commit
b1c9dbc6
authored
5 years ago
by
Allan Blanchard
Browse files
Options
Downloads
Patches
Plain Diff
[WP] Test for sum types constraints
parent
e3967587
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/tests/wp_acsl/oracle/sum_types.res.oracle
+235
-0
235 additions, 0 deletions
src/plugins/wp/tests/wp_acsl/oracle/sum_types.res.oracle
src/plugins/wp/tests/wp_acsl/sum_types.i
+35
-0
35 additions, 0 deletions
src/plugins/wp/tests/wp_acsl/sum_types.i
with
270 additions
and
0 deletions
src/plugins/wp/tests/wp_acsl/oracle/sum_types.res.oracle
0 → 100644
+
235
−
0
View file @
b1c9dbc6
# frama-c -wp [...]
[kernel] Parsing tests/wp_acsl/sum_types.i (no preprocessing)
[wp] Running WP plugin...
[wp] Loading driver 'share/wp.driver'
[wp] 3 goals scheduled
---------------------------------------------
--- Context 'typed' Cluster 'A_A'
---------------------------------------------
theory A_A
(* use why3.BuiltIn.BuiltIn *)
(* use bool.Bool *)
(* use int.Int *)
(* use int.ComputerDivision *)
(* use real.RealInfix *)
(* use frama_c_wp.qed.Qed *)
(* use map.Map *)
type A_InAxiomatic =
| C_IAu int
| C_IAc int
| C_IAi int
(* use frama_c_wp.cint.Cint *)
inductive is_InAxiomatic A_InAxiomatic =
| Q_IAu : forall p:int. is_uint32 p -> is_InAxiomatic (C_IAu p)
| Q_IAc : forall p:int. is_sint8 p -> is_InAxiomatic (C_IAc p)
| Q_IAi : forall p:int. is_InAxiomatic (C_IAi p)
predicate P_P A_InAxiomatic
end
---------------------------------------------
--- Context 'typed' Cluster 'Axiomatic1'
---------------------------------------------
theory Axiomatic1
(* use why3.BuiltIn.BuiltIn *)
(* use bool.Bool *)
(* use int.Int *)
(* use int.ComputerDivision *)
(* use real.RealInfix *)
(* use frama_c_wp.qed.Qed *)
(* use map.Map *)
type A_AtTopLevel =
| C_TLu int
| C_TLc int
| C_TLi int
(* use frama_c_wp.cint.Cint *)
inductive is_AtTopLevel A_AtTopLevel =
| Q_TLu : forall p:int. is_uint32 p -> is_AtTopLevel (C_TLu p)
| Q_TLc : forall p:int. is_sint8 p -> is_AtTopLevel (C_TLc p)
| Q_TLi : forall p:int. is_AtTopLevel (C_TLi p)
(* use A_A *)
lemma Q_LA : forall a:A_InAxiomatic. is_InAxiomatic a -> P_P a
end
---------------------------------------------
--- Context 'typed' Cluster 'A_X'
---------------------------------------------
theory A_X
(* use why3.BuiltIn.BuiltIn *)
(* use bool.Bool *)
(* use int.Int *)
(* use int.ComputerDivision *)
(* use real.RealInfix *)
(* use frama_c_wp.qed.Qed *)
(* use map.Map *)
(* use Axiomatic1 *)
predicate P_Q A_AtTopLevel
end
---------------------------------------------
--- Context 'typed' Cluster 'Axiomatic2'
---------------------------------------------
theory Axiomatic2
(* use why3.BuiltIn.BuiltIn *)
(* use bool.Bool *)
(* use int.Int *)
(* use int.ComputerDivision *)
(* use real.RealInfix *)
(* use frama_c_wp.qed.Qed *)
(* use map.Map *)
type A_Rec =
| C_Nil
| C_C int A_Rec
(* use frama_c_wp.cint.Cint *)
inductive is_Rec A_Rec =
| Q_Nil : is_Rec C_Nil
| Q_C :
forall p:int, p1:A_Rec. is_Rec p1 -> is_sint32 p -> is_Rec (C_C p p1)
(* use Axiomatic1 *)
(* use A_X *)
lemma Q_LB : forall a:A_AtTopLevel. is_AtTopLevel a -> P_Q a
end
---------------------------------------------
--- Context 'typed' Cluster 'A_Y'
---------------------------------------------
theory A_Y
(* use why3.BuiltIn.BuiltIn *)
(* use bool.Bool *)
(* use int.Int *)
(* use int.ComputerDivision *)
(* use real.RealInfix *)
(* use frama_c_wp.qed.Qed *)
(* use map.Map *)
(* use Axiomatic2 *)
predicate P_R A_Rec
end
[wp:print-generated]
theory WP
(* use why3.BuiltIn.BuiltIn *)
(* use bool.Bool *)
(* use int.Int *)
(* use int.ComputerDivision *)
(* use real.RealInfix *)
(* use frama_c_wp.qed.Qed *)
(* use map.Map *)
(* use Axiomatic2 *)
(* use A_Y *)
goal wp_goal : forall r:A_Rec. is_Rec r -> P_R r
end
[wp:print-generated]
theory WP1
(* use why3.BuiltIn.BuiltIn *)
(* use bool.Bool *)
(* use int.Int *)
(* use int.ComputerDivision *)
(* use real.RealInfix *)
(* use frama_c_wp.qed.Qed *)
(* use map.Map *)
(* use Axiomatic1 *)
(* use A_X *)
goal wp_goal : forall a:A_AtTopLevel. is_AtTopLevel a -> P_Q a
end
[wp:print-generated]
theory WP2
(* use why3.BuiltIn.BuiltIn *)
(* use bool.Bool *)
(* use int.Int *)
(* use int.ComputerDivision *)
(* use real.RealInfix *)
(* use frama_c_wp.qed.Qed *)
(* use map.Map *)
(* use A_A *)
goal wp_goal : forall i:A_InAxiomatic. is_InAxiomatic i -> P_P i
end
[wp] 3 goals generated
------------------------------------------------------------
Global
------------------------------------------------------------
Lemma LA:
Prove: (is_InAxiomatic a_0) -> (P_P a_0)
------------------------------------------------------------
Lemma LB:
Assume: 'LA'
Prove: (is_AtTopLevel a_0) -> (P_Q a_0)
------------------------------------------------------------
Lemma LC:
Assume: 'LB' 'LA'
Prove: (is_Rec a_0) -> (P_R a_0)
------------------------------------------------------------
This diff is collapsed.
Click to expand it.
src/plugins/wp/tests/wp_acsl/sum_types.i
0 → 100644
+
35
−
0
View file @
b1c9dbc6
/* run.config
OPT:-wp-prover=why3 -wp-gen -wp-msg-key print-generated
*/
/* run.config_qualif
DONTRUN:
*/
/*@
axiomatic A {
type InAxiomatic = IAu(unsigned)
| IAc(char)
| IAi(integer) ;
predicate P(InAxiomatic a) reads \nothing ;
}
lemma LA: \forall InAxiomatic a ; P(a) ;
*/
/*@
type AtTopLevel = TLu(unsigned)
| TLc(char)
| TLi(integer) ;
axiomatic X {
predicate Q(AtTopLevel a) reads \nothing ;
}
lemma LB: \forall AtTopLevel a ; Q(a) ;
*/
/*@
type Rec = Nil | C(int, Rec) ;
axiomatic Y {
predicate R(Rec a) reads \nothing ;
}
lemma LC: \forall Rec a ; R(a) ;
*/
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