Encodings #
This file contains the definition of a (finite) encoding, a map from a type to strings in an alphabet, used in defining computability by Turing machines. It also contains several examples:
Examples #
finEncodingNatBool: a binary encoding ofℕin a simple alphabet.finEncodingNatΓ': a binary encoding ofℕin the alphabet used for TM's.unaryFinEncodingNat: a unary encoding ofℕfinEncodingBoolBool: an encoding ofBool.finEncodingList: an encoding ofList αin the alphabetα.finEncodingPair: an encoding ofα × βfrom encodings ofαandβ.
An encoding of a type in a certain alphabet, together with a decoding.
- Γ : Type v
The alphabet of the encoding
The encoding function
The decoding function
Decoding and encoding are inverses of each other.
Instances For
An Encoding plus a guarantee of finiteness of the alphabet.
The alphabet of the encoding is finite
Instances For
A binary encoding of ℕ in Bool, as a FinEncoding.
Instances For
A binary FinEncoding of ℕ in Γ'.
Instances For
A unary FinEncoding of ℕ in Bool.
Instances For
A FinEncoding of Bool in Bool.
Instances For
A FinEncoding of a List α in (finite) alphabet α, encoded directly.
Instances For
Given FinEncoding of α and β,
constructs a FinEncoding of α × β by concatenating the encodings,
mapping the symbols from the first encoding with Sum.inl
and those from the second with Sum.inr.