Skip to content

Handle conseq when the combined statement has a non-empty ambient logic context.  #847

@fdupress

Description

@fdupress

I was trying out this PR and I still get some issues with combining lossless with hoare to get phoare.
I don't know why, but this is the pattern that fails with invalid goal:

require import AllCore FMap.


module Foo = {
   proc foo(i :int, a : (int,int) fmap) = {
           a.[i] <- oget a.[i] + 1;
           return a;
   }
}.

lemma foo_ll : islossless Foo.foo by islossless.

lemma foo_h _i _a :
   hoare [ Foo.foo : i = _i /\ a = _a ==>
     forall j, j<>_i =>  _a.[j] = res.[j]] by proc;auto;smt(FMap.get_setE).

lemma foo_p _i _a : phoare [ Foo.foo : i = _i /\ a = _a ==>
     forall j, j<>_i =>  _a.[j] = res.[j]] = 1%r
   by conseq foo_ll (foo_h _i _a).

_Originally posted by @mbbarbosa in https://github.com/EasyCrypt/easycrypt/pull/837#issuecomment-3619981606_

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions