Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Operational semantics in K #4

Open
19 of 21 tasks
ayberkt opened this issue May 29, 2017 · 2 comments
Open
19 of 21 tasks

Operational semantics in K #4

ayberkt opened this issue May 29, 2017 · 2 comments

Comments

@ayberkt
Copy link
Collaborator

ayberkt commented May 29, 2017

Our primary goal is to implement the operational semantics in K. The following rules from the Eisenberg spec need to be implemented.

  • S_Var
  • S_App
  • S_Beta
  • S_Push
    • Deferred for now.
  • S_TPush
    • Deferred for now.
  • S_CPush
    • Deferred for now.
  • S_Trans
    • Deferred for now.
  • S_Cast
    • Deferred for now.
  • S_Tick
    • Deferred for now.
  • S_Case
    • Consider how this plays with S_LetRecCase.
  • S_MatchData
  • S_MatchLit
  • S_MatchDefault
  • S_CasePush
    • Deferred for now.
  • S_LetNonRec
  • S_LetRec
    • We should decide how to implement the modification of Σ.
  • S_LetRecApp
  • S_LetRecCast
    • Deferred for now.
  • S_LetRecCase
    • We might need to discuss this further.
  • S_LetRecFlat
    • We might need to discuss this further.
  • S_LetRecReturn
@ayberkt
Copy link
Collaborator Author

ayberkt commented May 30, 2017

To implement S_Var, I and @lucaspena considered the following rule:

// S_Var
rule
  <k> tmVar(_, name(R)) => E ... </k>
  <store> ... L |-> thunk(E, _) ... </store>
  <env> ... R |-> val(L) ... </env>

Does this seem correct to you @bmmoore ? Do we need to do something else for data constructors or closures? How would you implement this S_Var rule from the Eisenberg document?

@bmmoore
Copy link
Member

bmmoore commented May 30, 2017

You need to use the saved environment while evaluating the thunk, and include something to update the store with the result. For values that have already been forced, I think just evaluating to val(L) is correct. Indirection in the store may need to be handled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants