Documentation
Projects
.
IO
.
Basic
Search
return to top
source
Imports
Init
Projects.IO.Defs
Imported by
VerifiedIO
.
ProgM
.
wf_pure
VerifiedIO
.
ProgM
.
wf_bind
VerifiedIO
.
ProgM
.
monadCnd_wf
VerifiedIO
.
ProgM
.
wf_map
VerifiedIO
.
ProgM
.
wf_ioBit
VerifiedIO
.
Prog
.
wf_toProgM
VerifiedIO
.
toProg_toProgM
VerifiedIO
.
toProgM_toProg
VerifiedIO
.
run_ioBit_nil
VerifiedIO
.
run_ioBit_cons
VerifiedIO
.
run_readBit_nil
VerifiedIO
.
run_readBit_cons
VerifiedIO
.
run_writeBit_nil
VerifiedIO
.
run_writeBit_cons
VerifiedIO
.
ProgM
.
wf_readBit
VerifiedIO
.
ProgM
.
wf_writeBit
VerifiedIO
.
ProgM
.
wf_readBitsUntil
VerifiedIO
.
ProgM
.
wf_readNat
VerifiedIO
.
ProgM
.
wf_writeNat
source
@[simp]
instance
VerifiedIO
.
ProgM
.
wf_pure
{
α
:
Type
}
{
x
:
α
}
:
(
pure
x
)
.
WF
source
instance
VerifiedIO
.
ProgM
.
wf_bind
{
α
β
:
Type
}
{
m
:
ProgM
α
}
{
f
:
α
→
ProgM
β
}
[
H₁
:
m
.
WF
]
[
H₂
:
∀ (
x
:
α
),
(
f
x
)
.
WF
]
:
(
m
>>=
f
).
WF
source
instance
VerifiedIO
.
ProgM
.
monadCnd_wf
:
MonadCnd
fun {
α
:
Type
} =>
WF
source
instance
VerifiedIO
.
ProgM
.
wf_map
{
α
β
:
Type
}
{
m
:
ProgM
α
}
{
f
:
α
→
β
}
[
H₁
:
m
.
WF
]
:
(
f
<$>
m
).
WF
source
@[simp]
instance
VerifiedIO
.
ProgM
.
wf_ioBit
{
b
:
Bit
}
:
(
ioBit
b
)
.
WF
source
@[simp]
instance
VerifiedIO
.
Prog
.
wf_toProgM
{
p
:
Prog
}
:
p
.
toProgM
.
WF
source
@[simp]
theorem
VerifiedIO
.
toProg_toProgM
{
p
:
Prog
}
:
p
.
toProgM
.
toProg
=
p
source
theorem
VerifiedIO
.
toProgM_toProg
{
m
:
ProgM
Unit
}
(
h
:
∀ (
bs
:
List
Bit
),
∃ (
b
:
Bit
),
StateT.run
m
bs
=
Sum.inl
b
)
:
m
.
toProg
.
toProgM
=
m
source
@[simp]
theorem
VerifiedIO
.
run_ioBit_nil
{
b
:
Bit
}
:
StateT.run
(
ioBit
b
)
[
]
=
Sum.inl
b
source
@[simp]
theorem
VerifiedIO
.
run_ioBit_cons
{
b
b₁
:
Bit
}
{
bs
:
List
Bit
}
:
StateT.run
(
ioBit
b
)
(
b₁
::
bs
)
=
Sum.inr
(
b₁
,
bs
)
source
@[simp]
theorem
VerifiedIO
.
run_readBit_nil
:
StateT.run
readBit
[
]
=
Sum.inl
0
source
@[simp]
theorem
VerifiedIO
.
run_readBit_cons
{
b
:
Bit
}
{
bs
:
List
Bit
}
:
StateT.run
readBit
(
b
::
bs
)
=
Sum.inr
(
b
,
bs
)
source
@[simp]
theorem
VerifiedIO
.
run_writeBit_nil
{
b
:
Bit
}
:
StateT.run
(
writeBit
b
)
[
]
=
Sum.inl
b
source
@[simp]
theorem
VerifiedIO
.
run_writeBit_cons
{
b
b₁
:
Bit
}
{
bs
:
List
Bit
}
:
StateT.run
(
writeBit
b
)
(
b₁
::
bs
)
=
Sum.inr
(
(
)
,
bs
)
source
@[simp]
instance
VerifiedIO
.
ProgM
.
wf_readBit
:
readBit
.
WF
source
@[simp]
instance
VerifiedIO
.
ProgM
.
wf_writeBit
{
b
:
Bit
}
:
(
writeBit
b
)
.
WF
source
@[simp]
instance
VerifiedIO
.
ProgM
.
wf_readBitsUntil
{
p
:
List
Bit
→
Bool
}
:
(
readBitsUntil
p
)
.
WF
source
@[simp]
instance
VerifiedIO
.
ProgM
.
wf_readNat
:
readNat
.
WF
source
@[simp]
instance
VerifiedIO
.
ProgM
.
wf_writeNat
{
n
:
ℕ
}
:
(
writeNat
n
)
.
WF