Questions tagged [frama-c]

Frama-C is an Open Source suite of tools dedicated to the analysis of C source code.

Frama-C offers ready-to-use analyses for C programs: call graph, value analysis, functional dependencies, Program Dependence Graph, runtime monitoring, etc. It also allows the verification of functional properties, temporal logic, and much more. Results can be expressed in plain text, in SARIF, or in Frama-C's graphical interface.

Each analysis is implemented as a plug-in, and plug-ins inside the platform can use the results of one another. Frama-C is Open Source and extensible: new analyses can be implemented in OCaml as additional plug-ins that take advantage of existing ones. They communicate using the ACSL specification language, which also enables describing what the program is supposed to do.

Most provided analyses in Frama-C are sound: used within a delimited perimeter, all the behaviors that can happen at run-time are included in the behaviors statically predicted by Frama-C. Notwithstanding the possibility of bugs, plug-ins must be used as documented for the property to hold. This makes it possible to use Frama-C for the formal verification of C programs.

447 questions
0
votes
1 answer

Timeout while proving the WP using Alt-ergo on Frama C

I was trying to verify the correctness of the below program using Frama-c.I am new user to frama-C. PROBLEM: Input basic salary of an employee and calculate its Gross salary according to following: Basic Salary <= 10000 : HRA = 20%, DA = 80% Basic…
Niresh
  • 67
  • 7
0
votes
0 answers

Verifying validity of pointer in frama-c

This is a really early frama-c question so sorry about that but I've been at it for a few hours and I can't get a really simple function to verify. I know it's complaining about the function process and it was written purposefully poorly but I had…
foreverska
  • 585
  • 3
  • 20
0
votes
1 answer

Frama-C reports "invalid ghost in extern linkage specification" while loading .C files

I am very new to Frama-C so perhaps I'm missing something obvious. As I try to load my project files (with some .C files among them) Frama-C reports the following error in the Console window and stops processing [kernel]…
Daniel Genin
  • 463
  • 5
  • 10
0
votes
2 answers

Frama-C acsl max example from manual not working

I believe I am missing something obvious, but I have tried a lot and I haven't managed to find the source of the problem. I am following the acsl guide from Frama-C. There is this introductory example of how to verify the correctness of finding the…
gdaras
  • 9,401
  • 2
  • 23
  • 39
0
votes
0 answers

Proving Correctness of Matrix Transpose in Frama-C

I'm trying to prove a simple matrix transpose in Frama-C. I currently have: #define N 3 void transpose_matrix(int [N][N], int, int, int[N][N]); int main() { int r=N; int c=N; /* Storing element of matrix entered by user in array…
0
votes
1 answer

How can I map frama-c CLI code to the original c statement? And how can I find the documentation of the api of the frama-c?

I'm trying to get the program dependence graph (PDG) using frama-c at the original code's statement level. However, 'pdg' plug-in in frama-c prints the PDG at the parsed code's node level. Since frama-c-gui can highlight the original statement…
0
votes
1 answer

How to install Frama-C on Manjaro 18.1.5?

I'm trying to install frama-c on my distro of manjaro 18.1.5, but no matter what I try, I always have an error. First I tried to install via the AUR, and it seems to work, but when i try to open a file from the gui, it fails and says something like…
Benoît
  • 13
  • 2
0
votes
1 answer

Frama-c: How to justify variadic argument with va_list and va_arg?

Currently, I am using Frama-C version 19, and struggling with variadic arguments. For example) #include #include void vars2(int n, va_list args) { for (size_t i = 0; i < n; ++i) { int tmp = va_arg(args,…
0
votes
1 answer

Verification of Shell Sorting algorithm loop invariants?

Good day to all! I wrote the Shell sort verification code, but I can’t build the correct loop invariants.It is not possible to correctly compose invariants and prove the correctness of the program... Please help me! /*@ predicate Sorted{L}(int* a,…
Gersa
  • 39
  • 6
0
votes
0 answers

How verification of Shell sorting in ACSL Frama-C?

There is a software implementation of Shell sorting in C, and I also annotated it for verification in Frama-C. It is not possible to correctly compose invariants and prove the correctness of the program. Please help if you can ... /*@ predicate…
Gersa
  • 39
  • 6
0
votes
1 answer

Why can Eva plugin calculate "(a >> 15) & 1" but cannot calculate "(a >> 0) & 1"?

I am trying to analyze a C source code using Eva plugin of Frama-C. In the following example, I found that Eva can calculate the value of a shift expression in which the right-hand-side value is big, but cannot calculate when the right-hand-side…
Thuy Nguyen
  • 353
  • 2
  • 10
0
votes
1 answer

Can I skip eva's assertion on signed overflow?

Sample code: void main(){ unsigned int x; x = 1U << 31; // OK x = 1 << 31; // Sign overflowed return; } frama-c-gui -eva main.c: void main(void) { unsigned int x; x = 1U << 31; /*@ assert Eva: signed_overflow: 1 << 31 ≤…
ratt
  • 115
  • 5
0
votes
1 answer

EVA plugin: How to check the add value in " temp = (volatile unsigned short*) add " through the temp variable

I am trying to check the add value in " temp = (volatile unsigned short*) add " through the temp variable in the following example: main() { unsigned short add = 0x01; unsigned short val = 0x00; unsigned short *temp; temp = (volatile…
Thuy Nguyen
  • 353
  • 2
  • 10
0
votes
1 answer

Frama-c kernel user error: invalid global initializer tmp?

During frama-c kernel parsing, got "User Eror: invalid global intializer tmp". The source compile fine with gcc. It has something to do with frama-c using 'tmp' variable for conditional operator with memory location. Any idea on how to get around…
ratt
  • 115
  • 5
0
votes
0 answers

frama-c wp plugin syntax error when using CVC4 prover

With a sample find.c file, I can prove it with no problem using default alt-ergo. But when change to cvc4 then getting warning messages and syntax error. Here the code: /*@ requires 0 <= n && \valid(a+(0..n-1)); assigns \nothing; ensures …
ratt
  • 115
  • 5