Skip to content

Commit

Permalink
Add subset type back
Browse files Browse the repository at this point in the history
  • Loading branch information
fzaiser committed Oct 13, 2023
1 parent 5efab50 commit a7682c9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/ProbabilisticProgramming/Monad.dfy
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ module Monad {

// Equation (2.38)
function Tail(s: Random.Bitstream): (s': Random.Bitstream) {
TailIsBitstream(s);
(n: nat) => s(n+1)
}

Expand Down Expand Up @@ -130,6 +131,9 @@ module Monad {
}
}

lemma {:axiom} TailIsBitstream(s: Random.Bitstream)
ensures Random.IsBitstream((n: nat) => s(n+1))

// Equation (2.68) && (2.77)
lemma {:axiom} CoinHasProbOneHalf(b: bool)
ensures
Expand Down
4 changes: 3 additions & 1 deletion src/ProbabilisticProgramming/RandomSource.dfy
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ module Random {
Definitions
************/

type Bitstream = nat -> bool
type Bitstream = s: nat -> bool | IsBitstream(s) witness *

ghost predicate IsBitstream(stream: nat -> bool)

ghost const sampleSpace: iset<Bitstream> := iset s: Bitstream

Expand Down

0 comments on commit a7682c9

Please sign in to comment.