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

glinear updates aren't allowed in ghost context #24

Open
tjhance opened this issue Apr 9, 2021 · 0 comments
Open

glinear updates aren't allowed in ghost context #24

tjhance opened this issue Apr 9, 2021 · 0 comments
Labels
glinear related to glinear

Comments

@tjhance
Copy link
Collaborator

tjhance commented Apr 9, 2021

glinear updates need to be allowed within ghost contexts:

glinear datatype F = F

glinear method maybe_swap(glinear x: F, glinear y: F, ghost b: bool)
returns (glinear x': F, glinear y': F)
{
  if b {
    x' := y;
    y' := x;
  } else {
    x' := x;
    y' := y;
  }
}

This should be allowed but currently errors with

GLinearGhost.dfy(10,7): Error: Assignment to non-ghost variable is not allowed in this context (because this is a ghost method or because the statement is guarded by a specification-only expression)
GLinearGhost.dfy(11,7): Error: Assignment to non-ghost variable is not allowed in this context (because this is a ghost method or because the statement is guarded by a specification-only expression)
GLinearGhost.dfy(13,7): Error: Assignment to non-ghost variable is not allowed in this context (because this is a ghost method or because the statement is guarded by a specification-only expression)
GLinearGhost.dfy(14,7): Error: Assignment to non-ghost variable is not allowed in this context (because this is a ghost method or because the statement is guarded by a specification-only expression)
@tjhance tjhance added the glinear related to glinear label Apr 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
glinear related to glinear
Projects
None yet
Development

No branches or pull requests

1 participant