2020-12-05 00:46 CET

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0001484Frama-CPlug-in > wppublic2020-02-17 18:08
Reportervirgile 
Assigned Tocorrenson 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
Product VersionFrama-C GIT, precise the release id 
Target VersionFixed in VersionFrama-C 20-Calcium 
Summary0001484: ill-typed alt-ergo proof obligation
DescriptionUsing WP with RTE enabled on the attached file results in proof obligations rejected as ill-typed by Alt-Ergo.
Steps To Reproduceframa-c -wp -wp-rte t.c
Additional InformationWithout rte, everything is fine. With RTE, the resulting proof obligation is the following:

  forall x_0 : int.
  let x_1 = to_sint32(neqb(0, x_0)) : int in
  let x_2 = to_uint8(x_0 - (ite((eqb(0, x_0)), 0, 1))) : int in
  is_uint8(x_0) ->
  (x_1 <= (2147483648 + x_0)) ->
  (x_0 <= (2147483647 + x_1)) ->
  is_uint8(x_2) ->
  (x_2 <= x_0)

the definition of x_1 is lacking an ite(_,0,1) conversion, as shown in the definition of x_2. x_1 does not appear in the PO without RTE, as it is only used in the (x<=2147483648 + x_0) and x_0 <= (2147483647 + x_1) hypotheses reflecting the RTE-generated hypotheses.
Note that writing the RTE-generated hypotheses in the code (and launching WP without -wp-rte) results in warning cast from (boolean) not yet implemented, and degenerated goals.
TagsNo tags attached.
Attached Files
  • c file icon t.c (165 bytes) 2013-09-25 15:30 -
    //@ ensures \result <= x;
    unsigned char f(unsigned char x) { 
      /*@ assert rte: signed_overflow: (int)x-(int)((int)x≢0) ≤ 2147483647;
      */
      return x-(x!=0); 
    }
    
    c file icon t.c (165 bytes) 2013-09-25 15:30 +

-Relationships
related to 0002355assignedvirgile Alt-Ergo reports about " bool and int cannot be unified" 
+Relationships

-Notes

~0004090

virgile (developer)

Actually, thinking about it, I guess that the difference between RTE-generated and user-written assertions lies in the fact that RTE might not insert a coercion from boolean to integer in the corresponding AST node.

~0006948

signoles (manager)

Fixed in Frama-C 20.0 (Calcium).
+Notes

-Issue History
Date Modified Username Field Change
2013-09-25 15:30 virgile New Issue
2013-09-25 15:30 virgile Status new => assigned
2013-09-25 15:30 virgile Assigned To => correnson
2013-09-25 15:30 virgile File Added: t.c
2013-09-25 16:03 virgile Additional Information Updated
2013-09-25 16:11 virgile Note Added: 0004090
2018-02-05 17:27 virgile Relationship added related to 0002355
2019-10-17 17:11 correnson Status assigned => resolved
2019-10-17 17:11 correnson Fixed in Version => Frama-C 20-Calcium
2019-10-17 17:11 correnson Resolution open => fixed
2020-02-17 18:08 signoles Status resolved => closed
2020-02-17 18:08 signoles Note Added: 0006948
+Issue History