OSDN Git Service

Name Boolean ops.
[joypy/Thun.git] / implementations / check_against_defs.txt
1
2 ██╗     ██╗██████╗ ██████╗  █████╗ ██████╗ ██╗   ██╗
3 ██║     ██║██╔══██╗██╔══██╗██╔══██╗██╔══██╗╚██╗ ██╔╝
4 ██║     ██║██████╔╝██████╔╝███████║██████╔╝ ╚████╔╝
5 ██║     ██║██╔══██╗██╔══██╗██╔══██║██╔══██╗  ╚██╔╝
6 ███████╗██║██████╔╝██║  ██║██║  ██║██║  ██║   ██║
7 ╚══════╝╚═╝╚═════╝ ╚═╝  ╚═╝╚═╝  ╚═╝╚═╝  ╚═╝   ╚═╝
8
9
10 Start with increment and decrement:
11
12     -- ≡ 1 -
13     ++ ≡ 1 +
14
15 Common symbols for operations:
16
17     = ≡ eq
18     + ≡ add
19     > ≡ gt
20     < ≡ lt
21     >= ≡ ge
22     <= ≡ le
23     != ≡ ne
24     <> ≡ ne
25
26     % ≡ mod
27     + ≡ add
28     - ≡ sub
29     * ≡ mul
30     / ≡ floordiv
31     div ≡ floordiv
32
33     & ≡ and
34     | ≡ or
35     ! ≡ not
36
37     << ≡ lshift
38     >> ≡ rshift
39
40
41 • ≡
42
43
44 ? ≡ dup bool
45
46
47 && ≡ nulco [nullary [false]] dip branch
48 || ≡ nulco [nullary] dip [true] branch
49
50
51 !- ≡ 0 >=
52
53 <{} ≡ [] swap
54 <<{} ≡ [] rollup
55
56 abs ≡ dup 0 < [] [neg] branch
57
58 anamorphism ≡ [pop []] swap [dip swons] genrec
59
60 app1 ≡ grba infrst
61 app2 ≡ [grba swap grba swap] dip [infrst] cons ii
62 app3 ≡ 3 appN
63 appN ≡ [grabN] codi map reverse disenstacken
64
65 at ≡ drop first
66
67 b ≡ [i] dip i
68 dipd ≡ [dip] codi
69 genrec ≡ [[genrec] ccccons] nullary swons concat ifte
70 tailrec ≡ [i] genrec
71 ifte ≡ [nullary] dipd swap branch
72 ii ≡ [dip] dupdip i
73 infra ≡ swons swaack [i] dip swaack
74 x ≡ dup i
75 pam ≡ [i] map
76
77
78     nullary ≡ [stack] dip infra first
79     unary ≡ nullary popd
80     binary ≡ unary popd
81     ternary ≡ binary popd
82
83 ccccons ≡ ccons ccons
84 ccons ≡ cons cons
85
86 clear ≡ [] swaack pop
87
88 cleave ≡ fork popdd
89 clop ≡ cleave popdd
90 fork ≡ [i] app2
91
92 cmp ≡ [[>] swap] dipd [ifte] ccons [=] swons ifte
93
94 codi ≡ cons dip
95 codireco ≡ codi reco
96
97 dinfrirst ≡ dip infrst
98
99
100 disenstacken ≡ ? [uncons ?] loop pop
101 enstacken ≡ stack [clear] dip
102
103 down_to_zero ≡ [0 >] [dup --] while
104
105 drop ≡ [rest] times
106
107 dupd ≡ [dup] dip
108 dupdd ≡ [dup] dipd
109 dupdip ≡ dupd dip
110 dupdipd ≡ dup dipd
111
112
113       rest ≡ uncons popd
114      first ≡ uncons pop
115     second ≡ rest first
116      third ≡ rest second
117     fourth ≡ rest third
118
119
120 flatten ≡ <{} [concat] step
121
122 gcd ≡ true [tuck mod dup 0 >] loop pop
123
124
125 grabN ≡ <{} [cons] times
126 grba ≡ [stack popd] dip
127
128 hypot [sqr] ii + sqrt
129
130 infrst ≡ infra first
131
132 make_generator ≡ [codireco] ccons
133
134 manual ≡ [] words [help] step pop
135
136 neg ≡ 0 swap -
137 not ≡ [true] [false] branch
138
139 nulco ≡ [nullary] cons
140 of ≡ swap at
141
142 over ≡ [dup] dip swap
143
144 pm ≡ [+] [-] clop
145
146 popd ≡ [pop] dip
147 popdd ≡ [pop] dipd
148 popop ≡ pop pop
149 popopop ≡ pop popop
150 popopd ≡ [popop] dip
151 popopdd ≡ [popop] dipd
152
153 product ≡ 1 swap [*] step
154
155 quoted ≡ [unit] dip
156
157 range ≡ [0 <=] [1 - dup] anamorphism
158 range_to_zero ≡ unit [down_to_zero] infra
159
160 reco ≡ rest cons
161
162
163 reverse ≡ <{} shunt
164
165 roll> ≡ swap swapd
166 roll< ≡ swapd swap
167 rollup ≡ roll>
168 rolldown roll<
169
170 rrest ≡ rest rest
171
172 run ≡ <{} infra
173 shift ≡ uncons [swons] dip
174 shunt ≡ [swons] step
175 size ≡ [pop ++] step_zero
176 spiral_next ≡ [[[abs] ii <=] [[<>] [pop !-] ||] &&] [[!-] [[++]] [[--]] ifte dip] [[pop !-] [--] [++] ifte] ifte
177 split_at ≡ [drop] [take] clop
178 split_list ≡ [take reverse] [drop] clop
179 sqr ≡ dup *
180 stackd ≡ [stack] dip
181 step_zero ≡ 0 roll> step
182 stuncons ≡ stack uncons
183 sum ≡ [+] step_zero
184 swapd ≡ [swap] dip
185 swons ≡ swap cons
186 swoncat ≡ swap concat
187 sqr ≡ dup mul
188 take ≡ <<{} [shift] times pop
189 tuck ≡ dup swapd
190 uncons ≡ [first] [rest] cleave
191 unit ≡ [] cons
192 unquoted ≡ [i] dip
193 unswons ≡ uncons swap
194 while ≡ swap nulco dupdipd concat loop
195
196 step ≡ [_step0] x
197 _step0 ≡ _step1 [popopop] [_stept] branch
198 _step1 ≡ [?] dipd roll<
199 _stept ≡ [uncons] dipd [dupdipd] dip x
200
201 times ≡ [_times0] x
202 _times0 ≡ _times1 [popopop] [_timest] branch
203 _times1 ≡ [dup 0 >] dipd roll<
204 _timest ≡ [[--] dip dupdipd] dip x
205
206 map ≡ [_map0] cons [[] [_map?] [_mape]] dip tailrec
207 _map? ≡ pop bool not
208 _mape ≡ popd reverse
209 _map0 ≡ [_map1] dipd _map2
210 _map1 ≡ stackd shift
211 _map2 ≡ [infrst] cons dipd roll< swons
212
213