Frama-C-discuss mailing list archives

This page gathers the archives of the old Frama-C-discuss archives, that was hosted by Inria's gforge before its demise at the end of 2020. To search for mails newer than September 2020, please visit the page of the new mailing list on Renater.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Frama-c-discuss] Average Problem


  • Subject: [Frama-c-discuss] Average Problem
  • From: sdavrieux at gmail.com (Sebastian)
  • Date: Mon, 29 Sep 2014 10:00:36 +0200
  • In-reply-to: <54291115.1080500@gmail.com>
  • References: <54291115.1080500@gmail.com>

Good morning,
     I'm trying to do the average without overflow, however I'm not able 
to check an assert that contains \sum annotation.
So I decided to make a simpler function that only uses \sum, but it 
doesn't work. What can I do to solve the problem?

Best regards,
Sebastian
-------------- next part --------------
/*@
	requires length > 2;
  requires \valid(a + (0 .. length - 1)); 
  requires \valid_read(a + (0 .. length - 1));
	requires \sum(0, length - 1, \lambda integer k; a[k]) == 6U;
*/
void foo (unsigned int* a, unsigned int length) {
	/*@
		assert \sum(0, length - 1, \lambda integer k; a[k]) == 6U;
	*/
	return;
}