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
375899b4
Commit
375899b4
authored
3 years ago
by
Patrick Baudin
Committed by
Virgile Prevosto
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[Test] accepts integer/real as C field
parent
5334a89c
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
tests/spec/logic_type.c
+13
-0
13 additions, 0 deletions
tests/spec/logic_type.c
tests/spec/oracle/logic_type.res.oracle
+24
-0
24 additions, 0 deletions
tests/spec/oracle/logic_type.res.oracle
with
37 additions
and
0 deletions
tests/spec/logic_type.c
+
13
−
0
View file @
375899b4
...
@@ -34,3 +34,16 @@ void h(void) {
...
@@ -34,3 +34,16 @@ void h(void) {
//@ logic boolean boolean_from_integer(integer b) = (boolean) b;
//@ logic boolean boolean_from_integer(integer b) = (boolean) b;
//@ logic boolean boolean_from_int(int b) = (boolean) b;
//@ logic boolean boolean_from_int(int b) = (boolean) b;
//@ logic boolean boolean_from_Bool(_Bool b) = (boolean) b;
//@ logic boolean boolean_from_Bool(_Bool b) = (boolean) b;
typedef
struct
INTEGER
{
int
integer
;
}
Integer
;
/*@ axiomatic B {
logic integer value{L}(Integer *p) = p->integer;
} */
typedef
struct
COMPLEX
{
double
real
,
img
;
}
Complex
;
/*@ axiomatic CPX {
type complex = Complex;
logic double re{L}(complex *p) = p->real;
logic complex with_re(complex c, double re) = { c \with .real = re };
} */
This diff is collapsed.
Click to expand it.
tests/spec/oracle/logic_type.res.oracle
+
24
−
0
View file @
375899b4
...
@@ -21,6 +21,15 @@ struct __anonstruct_Point_1 {
...
@@ -21,6 +21,15 @@ struct __anonstruct_Point_1 {
int y ;
int y ;
};
};
typedef struct __anonstruct_Point_1 Point;
typedef struct __anonstruct_Point_1 Point;
struct INTEGER {
int integer ;
};
typedef struct INTEGER Integer;
struct COMPLEX {
double real ;
double img ;
};
typedef struct COMPLEX Complex;
/*@ type t;
/*@ type t;
*/
*/
/*@ logic t create(int x) ;
/*@ logic t create(int x) ;
...
@@ -60,6 +69,21 @@ void h(void)
...
@@ -60,6 +69,21 @@ void h(void)
/*@ logic 𝔹 boolean_from_int(int b) = b ≢ 0;
/*@ logic 𝔹 boolean_from_int(int b) = b ≢ 0;
*/
*/
/*@ logic 𝔹 boolean_from_Bool(_Bool b) = b ≢ 0;
/*@ logic 𝔹 boolean_from_Bool(_Bool b) = b ≢ 0;
*/
/*@ axiomatic B {
logic ℤ value{L}(Integer *p) = p->integer;
}
*/
/*@
axiomatic CPX {
type complex = Complex;
logic double re{L}(Complex *p) = p->real;
logic complex with_re(complex c, double re) = {c \with .real = re};
}
*/
*/
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