Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
  • This project
    • Loading...
  • Sign in / Register
why3
why3
  • Overview
    • Overview
    • Details
    • Activity
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Registry
  • Issues 31
    • Issues 31
    • List
    • Board
    • Labels
    • Milestones
  • Merge Requests 2
    • Merge Requests 2
  • CI / CD
    • CI / CD
    • Pipelines
    • Schedules
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Commits
  • Issue Boards
  • Why3
  • why3why3
  • Issues
  • #87

Closed
Open
Opened Feb 09, 2018 by MARCHE Claude@marche 
  • Report abuse
  • New issue
Report abuse New issue

Cannot use a type variable absent from the function arguments

The following is an excerpt of a code that was working in the 'old' system. It is not well-typed anymore: Unbound type variable: 'c

  function compose (g:'b -> 'c) (f:'a -> 'b) : 'a -> 'c
  axiom compose_def : forall g:'b -> 'c,f:'a -> 'b,x:'a.
    compose g f x = g (f x)

  function const (x: 'b) : 'a -> 'b
  axiom const_def : forall x:'b,z:'a. const x z = x

  predicate extensionalEqual (f g:'a -> 'b) =
    forall x:'a. f x = g x

  let lemma const_compose_right (f:'a -> 'b) (x:'a) : unit
    ensures { compose f (const x) = (const (f x): 'c -> 'b) }
  =
    assert { extensionalEqual (const (f x) : 'c -> 'b) (compose f (const x)) }
Edited Feb 09, 2018 by MARCHE Claude
Assignee
Assign to
New system
Milestone
New system
Assign milestone
Time tracking
None
Due date
No due date
1
Labels
component: core
Assign labels
  • View labels
Reference: why3/why3#87