1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//! Church-encoded boolean [Term]s and operations.
use crateTerm;
/// The Church-encoded boolean `false`.
///
/// This is α-equivalent to `λt f. f`.
/// The Church-encoded boolean value `true`.
///
/// This is α-equivalent to `λt f. t`.
/// The `if-then-else` function.
///
/// This is α-equivalent to `λc t e. c t e`.
/// Since Church booleans encode this functionality in themselves, this is technically redundant.
/// The boolean `not` function.
///
/// This is α-equivalent to `λb. if-then-else b fls tru` (see [fls], [tru], and [if_then_else]).
/// The boolean `and` function.
///
/// This is α-equivalent to `λl r. l r fls`, where `fls` is the Church-encoded boolean value `false` (see [fls]).
/// The boolean `or` function.
///
/// This is α-equivalent to `λl r. l tru r`, where `tru` is the Church-encoded boolean value `true` (see [tru]).