2021-01-27 07:48 CET

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0002501Frama-CPlug-in > wppublic2020-06-12 08:59
Reporterjens 
Assigned ToAllanBlanchard 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSLinux, macOSOS Version
Product VersionFrama-C 20-Calcium 
Target VersionFixed in VersionFrama-C 21-Scandium 
Summary0002501: error in generated proof obligation
DescriptionThe attached file 'issue.c' contains a simplified (but still not very small) example of an issue I have within ACSL by Example.

There is lemma R_2 for the logic function R.
The definition of R uses the logic function F contained in the axiomatic block A.
When trying to verify R_2 with the command line below I obtain the message
                  [Why3 Error] anomaly: Failure("Can't find 'L_F' in why3 namespace")

frama-c -wp -wp-prover alt-ergo -wp-prover native:coq issue.c
[kernel] Parsing issue.c (with preprocessing)
[wp] Warning: native support for coq is deprecated, use tip instead
[wp] 2 goals scheduled
[wp] [Failed] Goal typed_lemma_R_2
  Alt-Ergo 2.3.1: Failed
                  [Why3 Error] anomaly: Failure("Can't find 'L_F' in why3 namespace")
       Coq: Unknown
[wp] [Cache] found:1
[wp] Proved goals: 1 / 2
  Qed: 0
  Coq: 0 (unknown: 1)
  Alt-Ergo 2.3.1: 1 (10ms) (23) (cached: 1) (failed: 1)


When looking at the generated verification condition with Coq I found the following:
The generated hypothesis 'FixL_R' uses of course the function 'L_F'.
However, the necessary import clause 'Require Import A_A.' comes only AFTER the definition of 'FixL_R'.

Additional InformationThere is a work-around by calling the helper function 'Fix' in the definition of R (see the comment in the code).

The problem also "disappears' if lemma 'R_1' is removed (but I don't have this option).

While looking at this problem, I noticed that in general coq definitions and import clauses are interspersed in the verification conditions...
TagsNo tags attached.
Attached Files
  • c file icon issue.c (857 bytes) 2020-03-10 11:44 -
    /*@
      axiomatic A
      {
        logic integer
        F(int* a, integer m, integer n, int v) =
          (n <= m) ? 
           0 : ((0 <= F(a, m, n-1, v) < n-m-1) ?
             F(a, m, n-1, v) : ((a[n-1] != v) ? n-m-1 : n-m));
      }
    
      logic integer
      Fix(int* a, integer x, integer n, int v) = x + F(a, x, n, v);
    
      logic integer
      R(int* a, integer n, int v, integer p) =
        \let c = n;
        \let x = R(a, n, v, p-1) + 1;
          p < 0 ? -1 : // 0 <= p
            (n <= 0 ? 0 : // 0 < n
              p < c ? x + F(a, x, n, v) : n
              //p < c ? Fix(a, x, n, v) : n
            );
    
      lemma R_1:
        \forall int *a, v, integer n, p;
          \let x = R(a, n, v, p-1) + 1;
          0 <= n      ==>
          0 <= p < n  ==> 
          R(a, n, v, p) == x + F(a, x, n, v);
    
      lemma R_2:
        \forall int *a, v, integer i, n, p;
          0 < n       ==>
          0 <= p < n  ==>
          0 <= R(a, n, v, p);
    */
    
    
    
    c file icon issue.c (857 bytes) 2020-03-10 11:44 +

-Relationships
+Relationships

-Notes

~0006971

jens (reporter)

With 20.0+dev (Calcium), installed early May 2020 from https://git.frama-c.com/pub/frama-c, the error is still present.

~0006972

AllanBlanchard (developer)

Last edited: 2020-05-12 17:27

View 2 revisions

The problem has been fixed. The fix will be available in the next release (and in the upcoming bĂȘta) but not immediately in the public development version.

+Notes

-Issue History
Date Modified Username Field Change
2020-03-10 11:44 jens New Issue
2020-03-10 11:44 jens Status new => assigned
2020-03-10 11:44 jens Assigned To => correnson
2020-03-10 11:44 jens File Added: issue.c
2020-03-16 12:32 correnson Assigned To correnson => AllanBlanchard
2020-05-09 16:46 jens Note Added: 0006971
2020-05-12 17:12 AllanBlanchard Note Added: 0006972
2020-05-12 17:12 AllanBlanchard Status assigned => resolved
2020-05-12 17:12 AllanBlanchard Fixed in Version => Frama-C 21-Scandium
2020-05-12 17:12 AllanBlanchard Resolution open => fixed
2020-05-12 17:27 AllanBlanchard Note Edited: 0006972 View Revisions
2020-06-12 08:59 signoles Status resolved => closed
+Issue History