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

Confusion between C and CN names when testing #706

Open
yav opened this issue Nov 7, 2024 · 0 comments
Open

Confusion between C and CN names when testing #706

yav opened this issue Nov 7, 2024 · 0 comments

Comments

@yav
Copy link
Collaborator

yav commented Nov 7, 2024

In CN the names used in specs and the names in C live in different namespaces, but this is not reflected during testing.
Here are some examples:

/*@                                                                              
function (boolean) f() { true }                                                     
@*/                                                                                 
                                                                                 
void f() {}   

This leads to "conflicting types for f"

The same sort of thing happens with type declarations, for 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 };
  }
}
@*/

This leads to "redefinition of struct List"

cn --version
git-e4de4e424 [2024-11-07 16:37:28 +0000]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant