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

Panic: Failure("Not of correct form (unlikely case - i's not matching)") #4

Closed
yav opened this issue Oct 23, 2024 · 2 comments
Closed

Comments

@yav
Copy link

yav commented Oct 23, 2024

The following program causes a crash:

void even_odd(unsigned long size, int *p)
/*@
requires
  take a1 = each(u64 i; i < size) { Owned<int>(array_shift<int>(p,i)) };
ensures
  take a2 = each(u64 i; i < size) { Owned<int>(array_shift<int>(p,i)) };
@*/
{
}

The error is

cn: internal error, uncaught exception:
    Failure("Not of correct form (unlikely case - i's not matching)")

Commit: 53c1e48

@ZippeyKeys12
Copy link
Owner

Both this and #6 are from the executable spec requiring the permission for an each to be <term> <op> <index> && ..., where index is the variable the each is quantified over and op is either < or <=. This inequality must also be the leftmost operand of &&s.

This error is because size is a variable, so it mostly matches the pattern, except size is not i.

The error in #6 is because you used a cast, so it doesn't match the pattern.

The test generation itself also has a similar restriction, that there is an upper bound, but it is not syntactic and so more general. It isn't reachable though, since the executable spec will always fail first.

@yav
Copy link
Author

yav commented Nov 7, 2024

Moved to rems-project#689 in main repo

@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

2 participants