Encodings #
This file contains the definition of an encoding, a map from a type to strings in an alphabet, used in defining computability by Turing machines. It also contains several examples:
Examples #
encodingNatBool: a binary encoding ofℕin a simple alphabet.encodingNatΓ': a binary encoding ofℕin the alphabet used for TM's.unaryEncodingNat: a unary encoding ofℕencodingBoolBool: an encoding ofBool.encodingList: an encoding ofList αin the alphabetα.encodingProd: an encoding ofα × βfrom encodings ofαandβ.
An encoding of a type in a certain alphabet, together with a decoding.
- encode : α → List Γ
The encoding function
The decoding function
Decoding and encoding are inverses of each other.
Instances For
Given an Encoding of α and β,
constructs an Encoding of α × β by concatenating the encodings,
mapping the symbols from the first encoding with Sum.inl
and those from the second with Sum.inr.
Instances For
Deprecated aliases for FinEncoding and unbundled Γ #
Deprecated: Use inferInstanceAs (Fintype Γ) instead.
Instances For
Deprecated alias for encodingNatBool.
Instances For
Deprecated alias for encodingNatΓ'.
Instances For
Deprecated alias for unaryEncodingNat.
Instances For
Deprecated alias for encodingBoolBool.
Instances For
Deprecated alias for encodingList.
Instances For
Deprecated alias for encodingProd.
Instances For
Deprecated alias for Encoding.card_le_aleph0.