Questions tagged [acsl]

ACSL (ANSI/ISO C Specification Language) is a specification language for C programs, used by tools such as Frama-C.

40 questions
1
vote
1 answer

How to assert that a point is unreachable?

For Frama-C and the WP plugin, how can a user assert that a point in a program is unreachable? Looking for something like: //@ assert \unreachable;
Costava
  • 175
  • 9
1
vote
1 answer

Frama-C/E-ACSL Error including header files with wrapper script

I am trying to analyze my code using the E-ACSL wrapper script but am facing issues when trying to include header files. For demonstration, I am using the following code and an include directory with one header…
sgjl
  • 27
  • 5
1
vote
1 answer

How to include header files with E-ACSL wrapper script?

I am new to Frama-C and wanted to ask how I could add header files when using the E-ACSL wrapper script. Normally, I've been adding header files the following way with WP and RTE: frama-c -rte main.c -cpp-extra-args="-I src/include -I ..." However,…
sgjl
  • 27
  • 5
1
vote
1 answer

Why is my ACSL contract failing on my copy function?

I'm new to ACSL and I tried to replicate the function contract of this copy function provided by "ACSL by Example" from the Fraunhofer Society. The Code below works perfectly and every goal gets proven. /*@ predicate IsValidRange(uint8_t* a, integer…
Robin
  • 13
  • 2
1
vote
1 answer

Why WP can't deduce "else" close?

I'm trying to write the specification for a function which takes 2 pointers to int and put the smaller value to the first pointer and the other to the second. Here is the code and the specification: /*@ requires \valid(a) && \valid(b); …
Dorian
  • 490
  • 2
  • 10
1
vote
1 answer

Frama-C does not recognize valid memory access from bitwise-ANDed index

I am right-shifting an unsigned integer then &ing it with 0b111, so the resulting value must be in the range [0, 7]. When I use that value as an index into an array of length 8, Frama-C is not able to verify the associated rte: mem_access…
Costava
  • 175
  • 9
1
vote
1 answer

Frama-C with Eva plugin - Unsupported ACSL construct

I am currently trying to evaluate a test suite with Frama-C and it's plugin Eva. To do this I run Frama-C with the following flags: frama-c -eva -cpp-extra-args="-DINCLUDEMAIN -I .../" .c Frama-C (24.0) was installed…
Gerry
  • 13
  • 4
1
vote
1 answer

Why is the guard invalid in this loop invariant

I'm trying to create a loop invariant to check if all the elements of an array with an even index have the number 2on them (program to find prime numbers, in this step it's generating the SPF). However, when I try this: /*@ loop invariant (\forall…
1
vote
0 answers

How can I prove this C is_power_of_2 function using Frama-C?

In a previous question I was asking for help writing a predicate to find if a number is a power of 2. This was a prelude to trying to prove the following C function: static inline bool is_power_of_2 (unsigned long v) { return v && ((v & (v - 1))…
Rich
  • 926
  • 1
  • 9
  • 17
1
vote
1 answer

Can ACSL denote that an assignment should be hidden?

This function mocks a function that returns a continuously rising value until overflow occurs. It is like the millis() function in Arduino. To prove the implementation, I need to increment (thus, assign) static variables to keep state between…
1
vote
1 answer

Specifying Referential transparency in ACSL

I want to find some ACSL annotation that can be applied to a function or function pointer to indicate that it has the property of referential transparency. Some way to say "this function will always return the same value when given the same…
user1243488
  • 145
  • 2
  • 5
1
vote
0 answers

E-ACSL logic function call error - Unbound function

I want to define simple function contracts (defined in ACSL manual, section 2.3.2) from the program insert.c stated below. These contracts will be defined according to the observer functions (e.g: If isempty(s)==true, after inserton…
1
vote
1 answer

Error compiling E-ACSL FRAMA-C

I am new to Frama-C framework and I am trying to do some contract testing with C programs. I intend to use E-ACSL plugin for this, and I tried a test program to see how it works, but I get some compilation errors. Here is my code: #include…
1
vote
1 answer

ACSL specification of a function that appends a string to a dynamic character array

I am working on writing an ACSL specification for a function that appends a given string to the end of a dynamic character array. Here is what I have so far: #include #include #include #include #ifndef…
Daniel Trebbien
  • 38,421
  • 18
  • 121
  • 193
0
votes
0 answers

FRAMA-C/WP Goals not being proved

I am trying to prove a simplified version of an example from the WP manual but I keep getting an error for one of the ensures clauses. Here is my code: /*@ requires \valid(a) && \valid(b); @ ensures A: *a == \old(*b) ; @ ensures B: *b == \old(*a)…
sgjl
  • 27
  • 5