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

Name confusion between datatypes and structs #7

Closed
yav opened this issue Oct 23, 2024 · 1 comment
Closed

Name confusion between datatypes and structs #7

yav opened this issue Oct 23, 2024 · 1 comment

Comments

@yav
Copy link

yav commented Oct 23, 2024

CN supports using the same name for both structs and datatypes, but in testing mode we get confused between the two.
Here's an example:

struct List
{
  int value;
  struct List* next;
};

/*@
datatype List {
  Nil {},
  Cons { i32 head, List tail }
}

predicate List ListSegment(pointer from, pointer to) {
  if (is_null(from)) {
    assert(is_null(to));
    return Nil {};
  } else {
    take head = Owned<struct List>(from);
    take tail = ListSegment(head.next, to);
    return Cons { head: head.value, tail: tail };
  }
}
@*/
@yav
Copy link
Author

yav commented Nov 7, 2024

Moved to main repo as rems-project#706

@yav yav closed this as completed Nov 7, 2024
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

1 participant