Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
GHC
GHC
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,253
    • Issues 4,253
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 397
    • Merge Requests 397
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Security & Compliance
    • Security & Compliance
    • Dependency List
    • License Compliance
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #10121

Closed
Open
Opened Feb 27, 2015 by Javran Cheng@JavranReporter

operational semantics is incomplete?

I was trying to read docs/core-spec/core-spec.pdf to understand the operational semantics for core language. So I started off by playing with operational semantics rules manually.

But I found the following expression gets stuck:

v1 = let fix = \f -> let x = f x in x
         pf = \f x -> if x == 0
                          then x
                          else f (pred x)
     in (fix pf) 2
-- S_LETNONREC
v2 = ((\f -> let x = f x in x)
      (\f x -> if x == 0
                   then x
                   else f (pred x)))
     2
-- S_APP
v3 = (let x = (\f x -> if x == 0
                           then x
                           else f (pred x)) x
      in x) 2
-- S_APP; S_LETREC
v4 = (let x = (\f x -> if x == 0
                           then x
                           else f (pred x)) x
      in (\f x -> if x == 0
                      then x
                      else f (pred x)) x) 2
-- S_APP
v5 = (let x = (\f x -> if x == 0
                           then x
                           else f (pred x)) x
      in (\x1 -> if x1 == 0
                     then x1
                     else x (pred x1))) 2

at this point x is not a free variable so S_LETRECRETURN cannot be applied.

Did I make it wrong or some rules are missing for the operational semantics?

Trac metadata
Trac field Value
Version 7.8.4
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Documentation
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
Assignee
Assign to
8.0.1
Milestone
8.0.1 (Past due)
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#10121