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

opaque leaked through consequence axiom #20

Closed
Chris-Hawblitzel opened this issue Aug 14, 2016 · 0 comments
Closed

opaque leaked through consequence axiom #20

Chris-Hawblitzel opened this issue Aug 14, 2016 · 0 comments
Assignees

Comments

@Chris-Hawblitzel
Copy link
Collaborator

The following code defines an opaque predicate p and never reveals p, but it still manages to prove something that should only be provable if p is revealed:

predicate {:opaque} p(i:int)
{
  i == 3
}

predicate {:opaque} q(x:int)
  requires p(x)
  ensures  p(x)
{
  true
}

lemma L(x:int)
  requires p(x)
{
  reveal_q();
  assert q(x);
  assert x == 3; // succeeds; should fail
}

I think the consequence axiom for q unintentionally reveals p by using q's fuel ($ly) instead of the start fuel for p:

// consequence axiom for _module.__default.q
axiom 0 < $ModuleContextHeight
     || (0 == $ModuleContextHeight && 1 <= $FunctionContextHeight)
   ==> (forall $ly: LayerType, $Heap: Heap, x#0: int :: 
    { _module.__default.q($ly, $Heap, x#0) } 
    _module.__default.q#canCall($Heap, x#0)
         || ((0 != $ModuleContextHeight || 1 != $FunctionContextHeight)
           && $IsGoodHeap($Heap)
           && _module.__default.p($ly, $Heap, x#0))
       ==> _module.__default.p($ly, $Heap, x#0));
@parno parno closed this as completed in e6fd241 Sep 2, 2016
@parno parno self-assigned this Nov 18, 2016
camrein added a commit that referenced this issue Apr 8, 2021
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