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] adjacent_find problem
- Subject: [Frama-c-discuss] adjacent_find problem
- From: Pascal.CUOQ at cea.fr (CUOQ Pascal)
- Date: Sat, 16 Jan 2010 14:47:11 +0100
- References: <D6E8ED48-D985-47F0-B5A4-FE23BC9A7027@first.fraunhofer.de><4B519F63.5010805@inria.fr><1C3E80B4-C87C-4369-AAB1-16953A0107B9@first.fraunhofer.de> <5EFD4D7AC6265F4D9D3A849CEA9219191AB27F@LAXA.intra.cea.fr>
> By typing your predicate as accepting an int, you forced a > cast to be applied to its argument each time the argument is > of type integer. To clarify, "i+1" is of type "integer" because "+" takes two integers and returns an integer. The int "i" it silently promoted to "integer" in order to apply "+" to it, but the type-checker refuses to convert the result to the int expected by have_equal_neighbours because this could lose information. /*@ predicate have_equal_neighbours{Label}(int* a, int n) = ... */ ... loop invariant !have_equal_neighbours(a, i+1); ... Pascal
- References:
- [Frama-c-discuss] adjacent_find problem
- From: jens.gerlach at first.fraunhofer.de (Jens Gerlach)
- [Frama-c-discuss] adjacent_find problem
- From: guillaume.melquiond at inria.fr (Guillaume Melquiond)
- [Frama-c-discuss] adjacent_find problem
- From: jens.gerlach at first.fraunhofer.de (Jens Gerlach)
- [Frama-c-discuss] adjacent_find problem
- From: Pascal.CUOQ at cea.fr (CUOQ Pascal)
- [Frama-c-discuss] adjacent_find problem
- Prev by Date: [Frama-c-discuss] adjacent_find problem
- Next by Date: [Frama-c-discuss] adjacent_find problem
- Previous by thread: [Frama-c-discuss] adjacent_find problem
- Next by thread: [Frama-c-discuss] adjacent_find problem
- Index(es):