Skip to content

Commit

Permalink
Reduce resource usage
Browse files Browse the repository at this point in the history
  • Loading branch information
fzaiser committed Nov 3, 2023
1 parent 671d977 commit 44f2af5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Distributions/BernoulliExpNeg/Implementation.dfy
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,11 @@ module BernoulliExpNeg.Implementation {
invariant gamma'.numer >= 0
invariant Model.GammaReductionLoop((true, gamma))(old(s)) == Model.GammaReductionLoop((b, gamma'))(s)
{
var prevGamma := gamma';
var prevS := s;
b := BernoulliExpNegSampleCaseLe1(Rationals.Int(1));
gamma' := Rationals.Rational(gamma'.numer - gamma'.denom, gamma'.denom);
assert Model.GammaReductionLoop((true, prevGamma))(prevS) == Model.GammaReductionLoop((b, gamma'))(s);
}
if b {
c:= BernoulliExpNegSampleCaseLe1(gamma');
Expand Down

0 comments on commit 44f2af5

Please sign in to comment.