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
5
votes
2 answers

Proofs for code that relies on unsigned integer overflow?

How should I approach proving the correctness of code like the following, which, to avoid some inefficiency, relies on modular arithmetic? #include uint32_t my_add(uint32_t a, uint32_t b) { uint32_t r = a + b; if (r < a) …
5
votes
2 answers

Understanding Frama-C slicer results

I'd like to know if it's possible to do some kind of forward conditioned slicing with Frama-C and I'm playing with some examples to understand how one could achieve this. I've got this simple example which seems to result in an imprecise slice and I…
roo
  • 149
  • 9
4
votes
1 answer

Meaning of \old in ACSL post-conditions

I am a newbie user of Frama-C and have a few questions regarding assertions over pointers. Consider the C fragment below involving: two related data structures Data and Handle, s.t. Handle has a pointer to Data; a 'state' field in Data…
edrdo
  • 133
  • 5
4
votes
1 answer

How to increase Frama-C's GUI font/text size?

When running frama-c-gui, I'd like to increase its font size (for a tutorial, class, demo, video, etc), to ensure the text is visible in a large room. How can I do it?
anol
  • 8,264
  • 3
  • 34
  • 78
4
votes
1 answer

Frama-C - Get function input value through command line

Analysing the code below on GUI, it is possible check the input values of the function div0. int div0(int x, int y) …
4
votes
1 answer

Problem of Non-Terminating Function (no dependencies)

Using Frama-C, I am trying to slice just one source code as follows: #include #include #include typedef struct { int event; int status; int* msg; }pbBLEEvt_t; int msgq_receive(pbBLEEvt_t *buff); void…
backpacker
  • 43
  • 3
4
votes
1 answer

How to use Frama-Clang to parse C++ programs

I have installed the plugin Frama-Clang of Frama-c to parse C++ programs. However, I don't know how to correctly use it. I tried it with a very simple c++ program but failed. Here is the code of test.cpp: #include using namespace…
M.J
  • 41
  • 2
4
votes
1 answer

ocamlfind: Package `lablgtk2.gnomecanvas' not found on ubuntu 17.04

I am trying to install Frama-C gui Phosphorus from repository (6aa64) on Ubuntu 17.04 (Zesty). Frama-C opam works fine but it lacks the GUI as far as I can tell + I might want to patch frama-C later on so I would like to be able to compile it…
mattator
  • 319
  • 3
  • 12
4
votes
1 answer

How customize machine dependency in Frama-C?

I have got a 16-bit MPU which is different from x86_16 in size of size_t, ptrdiff_t etc. Can anybody give me details and clear instructions about how to customize machine dependency in Frama-C for my MPU?
Max P.
  • 55
  • 6
4
votes
0 answers

tutorial example fails: mismatch with alt-ergo?

I have installed frama-c using opam and homebrew, following the instructions from the frama-c site. I'm on Mac OS X (El Capitan), and the versions are: frama-c: Magnesium-20151002 alt-ergo: 1.01 ocaml: 4.02.3 When I attempt to run with the…
Mike Hicks
  • 41
  • 1
4
votes
1 answer

Prevent Frama-C's slicing plugin from changing input code

Given a C file, I want to compute the backward slice for some criteria and compare the slice to the original code. Because I don't want to implement a slicing program from cratch, I've already tried to get used to Frama-C which seems to help with…
Paddre
  • 798
  • 1
  • 9
  • 19
4
votes
1 answer

Verification of a linear search with Frama-C

I'm yet again perplexed by a simple verification exercise, this time in Frama-C (Sodium) using the WP plugin, since I couldn't get Jessie to work on the uni workstations (in process of being installed by admin staff/team.) I have been reading 'ACSL…
vivichrist
  • 309
  • 2
  • 9
4
votes
1 answer

Frama-C slice: parallelizable loop

I am trying to perform a backward slicing of an array element at specific position. I tried two different source codes. The first one is (first.c): const int in_array[5][5]={ 1,2,3,4,5, …
Jymas
  • 43
  • 4
4
votes
1 answer

Frama-C behaviors and value analysis

I want to use Frama-C to analyze a program containing a read-like function: given a buffer buf and its length len, the function writes exactly len bytes in buf (unless there is an error). I used ACSL to specify it, but the value analysis is…
anol
  • 8,264
  • 3
  • 34
  • 78
4
votes
1 answer

Introduce maths-functions specifications with ACSL/Frama-C

Is it possible to implement specifications in ACSL for functions usually called at compiling with -lm, as sqrt ? I am using it for Frama-C's plug-in WP. Here is a small example to illustrate what I would want to do. /*@ requires sqrt_spec: \forall…
Nilexys
  • 633
  • 1
  • 5
  • 10
1
2
3
29 30