Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Support
    • Submit feedback
    • Contribute to GitLab
  • Sign in
why3
why3
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 81
    • Issues 81
    • List
    • Boards
    • Labels
    • Milestones
  • Merge Requests 8
    • Merge Requests 8
  • Packages
    • Packages
    • Container Registry
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Commits
  • Issue Boards
  • Why3
  • why3why3
  • Issues
  • #254

Closed
Open
Opened Jan 18, 2019 by François Bobot@bobot
  • Report abuse
  • New issue
Report abuse New issue

Clone, writes and resets

The typing of this code raises Invalid_argument("Ity.eff_reset")

theory Effect

  use ref.Ref

   type t = { mutable a: ref int }

  let resize (h: t) : unit
    =
     let r = ! (h.a) in
     h.a <- ref r

  let set (h: t) : unit
    =
      resize h;
      h.a := 0

end

theory Clone

       clone Effect

end

By looking at the code it seems that an invariant is broken (writes and resets are not disjoint?). The cty that fails:

(h:t) : ()
writes { (h.a:ref int @rho).contents, (h:t <ref int @rho> @rho1).a }
covers { h:t <ref int @rho> @rho1 }
resets { h.a:ref int @rho }

@paskevyc @filliatr

Edited Jan 18, 2019 by François Bobot
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
0
Labels
None
Assign labels
  • View project labels
Reference: why3/why3#254