Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • F frama-c
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 171
    • Issues 171
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • pub
  • frama-c
  • Issues
  • #76
Closed
Open
Issue created Aug 23, 2018 by mantis-gitlab-migration@mantis-gitlab-migration

conditional input annotations result in why3 type errors

ID0002394: This issue was created automatically from Mantis Issue 2394. Further discussion may take place here.


Id Project Category View Due Date Updated
ID0002394 Frama-C Plug-in > wp public 2018-08-23 2020-02-17
Reporter timourf Assigned To correnson Resolution fixed
Priority normal Severity major Reproducibility always
Platform x86_64 OS GNU/Linux OS Version Debian 9
Product Version Frama-C 17-Chlorine Target Version - Fixed in Version Frama-C 20-Calcium

Description :

I am trying to put conditions on my function specification that specify return values conditioned on special input values. A minimal example is as follows:

/*@ requires 0 <= t <= 1; @ ensures t == 1.f ==> \result == b; @ assigns \nothing */ float interpolate(float a, float b, float t) { ... }

Why3 (stderr) reports:

File "/tmp/wp0a3ed9.dir/typed/interpolate_Why3_ide.why", line 20, characters 11-26: This term has type real -> real, but is expected to have type real

The "problem line" is "ensures t == 1.f ==> \result == b;"

This seems to be a problem between wp and why3. The error persists with every external prover I use with why3. The list of provers I've tried is [Z3,CVC3,CVC4,Alt-Ergo,Gappa], and the only exception is why3:coq (see issue 0002389).

Additional Information :

why3 0.88.3 frama-c chlorine 20180502

Steps To Reproduce :

see attached file "buggy.c" run:

frama-c -wp -wp-prover "why3:XXX" buggy.c where XXX is any prover installed with why3

Attachments

  • buggy.c
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking