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

Is simplifyCallTree is wrong on Choice Nop t ? #16

Open
lambdageek opened this issue Jul 12, 2017 · 2 comments
Open

Is simplifyCallTree is wrong on Choice Nop t ? #16

lambdageek opened this issue Jul 12, 2017 · 2 comments
Labels
Milestone

Comments

@lambdageek
Copy link
Collaborator

simplifyCallTree (Choice a b) = case (simplifyCallTree a, simplifyCallTree b) of
  (a', Nop) -> a'
  (Nop, b') -> b'
  (a', b') -> Choice a' b'

This seems wrong to me. That's saying that fnA and fnB below are equivalent. Is that really what we want?

void f1 (void);
void f2 (void);

void fnA (int i) {
  if (i)
    f1 ();
  f2 ();
}

void fnB (int i) {
  f1 ();
  f2 ();
}

conditionally granting or revoking or needing or using a permissions shouldn't be the same as always having it, should it?

@evincarofautumn
Copy link
Owner

I think it should be the same? grant(a) | 0 checks both branches and unifies them, resulting in lacks(a)has(a), the same as just grant(a). We don’t know which branch will be taken until runtime, so we assume both effects happen.

@lambdageek
Copy link
Collaborator Author

So never taking a lock and possibly-always taking a lock are the same? What class of bugs will this detect?

I think the join point at the end of the if should have a conflict: not every path results in a has(a) (ie: if f1 is mutex_lock() then at the end of the if we have a conflict: one branch has(locked) and the other one doesn't.) So we shouldn't even begin to consider f2

@evincarofautumn evincarofautumn added this to the 1.0 milestone Oct 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants