unlab-gpu 0.1.0

Micro scripting language for neural networks that uses unmtx-gpu.
Documentation
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
//
// Copyright (c) 2026 Łukasz Szpakowski
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
//
//! A module of documentation of built-in functions.
use crate::doc::*;
use crate::getopts_doc::*;
use crate::mod_node::*;
#[cfg(feature = "plot")]
use crate::plot_doc::*;

/// Adds the documentation of built-in functions to the root module of signature and the root
/// module of documentation.
pub fn add_std_builtin_fun_doc(sig_root_mod: &mut ModNode<Sig, ()>, doc_root_mod: &mut ModNode<String, Option<String>>)
{
    let doc = r#"
Standard library that is a basic library for the Unlab scripting language.

This library contains basic functions to operate on numbers, matrices, arrays, structures, and
other objects. Also, this library allows access to system operations by providing system
functions. Functions to running scripts, loading libraries, and testing also are provided by this
library.

# Values and objects

Value types are:

- none
- boolean
- integer number
- floating-point number
- reference to immutable object
- strong reference to mutable object
- weak reference to mutable object

Immutable object types are:

- string
- integer range
- floating-point range
- matrix
- function
- matrix array
- matrix row slice
- error
- window identifier

Mutable object types are:

- array
- structure

Indexable object types are:

- string
- matrix array
- matrix row slice
- array
- structure

Iterable object types are:

- string
- integer range
- floating-point range
- matrix array
- matrix row slice
- array

# Mathematical functions

A mathematical function with one argument recursivaly performs an operation on floating-point
number and/or matrices. One element or one field is ignored if it isn't floating-point number,
matrix, or mutable object and one argument is a mutable object.

A mathematical function with two arguments recursively performs an operation on floating-point
number and/or matrices. Two elements or two fields are compares with types if they aren't 
floating-point numbers, matrices, or mutable object and two arguments are mutable objects. If two
elements or two fields aren't equal, an error occurs. One element or one field is ignored if it
isn't a floating-point number, a matrix, or a mutable object; one argument is a mutable object;
and other argument is a number.

# TOML format and JSON format

This library contains the following functions to loading values and saving values for the
[TOML](https://en.wikipedia.org/wiki/TOML) format and the
[JSON](https://en.wikipedia.org/wiki/JSON) format:

- [`loadtoml`](#var.loadtoml)
- [`savetoml`](#var.savetoml)
- [`loadjson`](#var.loadjson)
- [`savejson`](#var.savejson)

These functions load and/or save the following values:

- none
- boolean
- integer number
- floating-point number
- string
- array
- structure
"#;
    match doc_root_mod.value() {
        Some(prev_doc) => doc_root_mod.set_value(Some(prev_doc.clone() + "\n" + &doc[1..])),
        None => doc_root_mod.set_value(Some(String::from(&doc[1..]))),
    }
    
    let doc = r#"
A $\pi$ number.
"#;
    sig_root_mod.add_var(String::from("pi"), Sig::Var);
    doc_root_mod.add_var(String::from("pi"), String::from(&doc[1..]));

    let doc = r#"
An $e$ number.
"#;
    sig_root_mod.add_var(String::from("e"), Sig::Var);
    doc_root_mod.add_var(String::from("e"), String::from(&doc[1..]));

    let doc = r#"
A machine epsilon number.
"#;
    sig_root_mod.add_var(String::from("eps"), Sig::Var);
    doc_root_mod.add_var(String::from("eps"), String::from(&doc[1..]));

    let doc = r#"
A path separator that can be `"/"` for Unix or `"\\"` for Windows.
"#;
    sig_root_mod.add_var(String::from("pathsep"), Sig::Var);
    doc_root_mod.add_var(String::from("pathsep"), String::from(&doc[1..]));
    
    let doc = r#"
Returns a string corresponding to the type of the `X` value.

The stings corresponding to the value types and the object types are:

- `"none"` - none value
- `"bool"` - boolean value
- `"int"` - integer number
- `"float"` - floating-point number
- `"string"` - string
- `"intrange"` - integer range
- `"floatrange"` - floating-point range
- `"matrix"` - matrix
- `"function"` - function
- `"matrixarray"` matrix array
- `"matrixrowslice"` - matrix row slice
- `"error"` - error
- `"windowid"` - window identifier
- `"array"` - array
- `"struct"` - structure
- `"weak"` - weak reference
"#;
    sig_root_mod.add_var(String::from("type"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("X"))
    ]));
    doc_root_mod.add_var(String::from("type"), String::from(&doc[1..]));

    let doc = r#"
Returns a copy of the `X` object.

If the `X` object isn't a mutable object, this function returns the `X` object.
"#;
    sig_root_mod.add_var(String::from("bool"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("X"))
    ]));
    doc_root_mod.add_var(String::from("bool"), String::from(&doc[1..]));
    
    
    let doc = r#"
Converts the `X` value to a boolean value.

This function returns `true` if the `X` value isn't `none`, `false`, zero, or an error; otherwise
`false`.
"#;
    sig_root_mod.add_var(String::from("bool"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("X"))
    ]));
    doc_root_mod.add_var(String::from("bool"), String::from(&doc[1..]));
    
    let doc = r#"
Converts the `X` value to an integer number.

The `X` number is converted to an integer number by this function. This function returns `1` for a
non-numeric value if the `X` value isn't `none`, `false`, or an error; otherwise `0`.
"#;
    sig_root_mod.add_var(String::from("int"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("X"))
    ]));
    doc_root_mod.add_var(String::from("int"), String::from(&doc[1..]));
    
    let doc = r#"
Converts the `X` value to a float-point number.

The `X` number is converted to a float-point number by this function. This function returns `1.0`
for a non-numeric value if the `X` value isn't `none`, `false`, or an error; otherwise `0.0`.
"#;
    sig_root_mod.add_var(String::from("float"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("X"))
    ]));
    doc_root_mod.add_var(String::from("float"), String::from(&doc[1..]));
    
    let doc = r#"
Converts the `X` value to a string.
"#;
    sig_root_mod.add_var(String::from("string"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("X"))
    ]));
    doc_root_mod.add_var(String::from("string"), String::from(&doc[1..]));
    let doc = r#"
Returns a matrix with zeros that has the `N` number of rows and the `M` number of columns.

The returned matrix is:

$$ \begin{bmatrix} 0 & 0 & \ldots & 0 \\ 0 & 0 & \ldots & 0 \\ \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & \ldots & 0 \end{bmatrix} $$
"#;
    sig_root_mod.add_var(String::from("zeros"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("N")),
        BuiltinFunArg::Arg(String::from("M"))
    ]));
    doc_root_mod.add_var(String::from("zeros"), String::from(&doc[1..]));
    
    let doc = r#"
Returns a matrix with ones that has the `N` number of rows and the `M` number of columns.

The returned matrix is:

$$ \begin{bmatrix} 1 & 1 & \ldots & 1 \\ 1 & 1 & \ldots & 1 \\ \vdots & \vdots & \ddots & \vdots \\ 1 & 1 & \ldots & 1 \end{bmatrix} $$
"#;
    sig_root_mod.add_var(String::from("ones"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("N")),
        BuiltinFunArg::Arg(String::from("M"))
    ]));
    doc_root_mod.add_var(String::from("ones"), String::from(&doc[1..]));
    
    let doc = r#"
Returns an identity matrix that has the `N` number of rows and columns.

The identity matrix is:

$$ \begin{bmatrix} 1 & 0 & \ldots & 0 \\ 0 & 1 & \ldots & 0 \\ \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & \ldots & 1 \end{bmatrix} $$
"#;
    sig_root_mod.add_var(String::from("eye"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("N"))
    ]));
    doc_root_mod.add_var(String::from("eye"), String::from(&doc[1..]));
    let doc = r#"
Returns an initialized matrix that has the `N` number of rows and the `M` number of columns.

This function applies the `f` function to the `D` value and the element indices
($f(\mathbf{D}, i, j)$) for each element of initialized matrix. The initialized matrix is:

$$ \begin{bmatrix} f(\mathbf{D}, 1, 1) & f(\mathbf{D}, 1, 2) & \ldots & f(\mathbf{D}, 1, M) \\ f(\mathbf{D}, 2, 1) & f(\mathbf{D}, 2, 2) & \ldots & f(\mathbf{D}, 2, M) \\ \vdots & \vdots & \ddots & \vdots \\ f(\mathbf{D}, N, 1) & f(\mathbf{D}, N, 2) & \ldots & f(\mathbf{D}, N, M) \end{bmatrix} $$
"#;
    sig_root_mod.add_var(String::from("init"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("N")),
        BuiltinFunArg::Arg(String::from("M")),
        BuiltinFunArg::Arg(String::from("D")),
        BuiltinFunArg::Arg(String::from("f"))
    ]));
    doc_root_mod.add_var(String::from("init"), String::from(&doc[1..]));
    
    let doc = r#"
Returns an initialized diagonal matrix that has the `N` number of rows and columns.

This function applies the `f` function to the `D` value and the element index
($f(\mathbf{D}, i)$) for each element of main diagonal of initialized diagonal matrix. The
initialized diagonal matrix is:

$$ \begin{bmatrix} f(\mathbf{D}, 1) & 0 & \ldots & 0 \\ 0  & f(\mathbf{D}, 2) & \ldots & 0 \\ \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & \ldots & f(\mathbf{D}, N) \end{bmatrix} $$
"#;
    sig_root_mod.add_var(String::from("initdiag"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("N")),
        BuiltinFunArg::Arg(String::from("D")),
        BuiltinFunArg::Arg(String::from("f"))
    ]));
    doc_root_mod.add_var(String::from("initdiag"), String::from(&doc[1..]));
    
    let doc = r#"
Creates a matrix from the `X` iterable object that contains the iterable objects which contains
the numbers.

If the `X` object is a matrix, this function returns the `X` object. The created matrix is:

$$ \begin{bmatrix} x_{1 1} & x_{1 2} & \ldots & x_{1M} \\ x_{2 1} & x_{2 2} & \ldots & x_{2M} \\ \vdots & \vdots & \ddots & \vdots \\ x_{N1} & x_{N2} & \ldots & x_{NM} \end{bmatrix} $$

"#;
    sig_root_mod.add_var(String::from("matrix"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("X"))
    ]));
    doc_root_mod.add_var(String::from("matrix"), String::from(&doc[1..]));
    
    let doc = r#"
Creates a matrix with one row from the `x` iterable object that contains the numbers.

If the `x` object is a matrix with one row, this function returns the `x` object. The created matrix
with one row is:

$$ \begin{bmatrix} x_1 & x_2 & \ldots & x_N \end{bmatrix} $$
"#;
    sig_root_mod.add_var(String::from("rowvector"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("x"))
    ]));
    doc_root_mod.add_var(String::from("rowvector"), String::from(&doc[1..]));
    
    let doc = r#"
Creates a matrix with one column vector from the `x` iterable object that contains the numbers.

If the `x` object is a matrix with one column, this function returns the `x` object. The created
matrix with one column is:

$$ \begin{bmatrix} x_1 \\ x_2 \\ \vdots \\ x_N \end{bmatrix} $$
"#;
    sig_root_mod.add_var(String::from("colvector"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("x"))
    ]));
    doc_root_mod.add_var(String::from("colvector"), String::from(&doc[1..]));
    
    let doc = r#"
Converts the `X` matrix to a matrix array.

If the `X` object is a matrix array, this function returns the `X` object.
"#;
    sig_root_mod.add_var(String::from("matrixarray"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("X"))
    ]));
    doc_root_mod.add_var(String::from("matrixarray"), String::from(&doc[1..]));
    
    let doc = r#"
Creates an error with the `kind` error kind and the `msg` message which are strings.
"#;
    sig_root_mod.add_var(String::from("error"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("kind")),
        BuiltinFunArg::Arg(String::from("msg"))
    ]));
    doc_root_mod.add_var(String::from("error"), String::from(&doc[1..]));

    let doc = r#"
Creates an array from the `X` iterable object.

If the `X` value is an array, this function returns the `X` value.
"#;
    sig_root_mod.add_var(String::from("array"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("X"))
    ]));
    doc_root_mod.add_var(String::from("array"), String::from(&doc[1..]));

    let doc = r#"
Converts the `R` reference to the strong reference.

If the `R` reference is strong, this function returns the `R` reference. 
"#;
    sig_root_mod.add_var(String::from("strong"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("R"))
    ]));
    doc_root_mod.add_var(String::from("strong"), String::from(&doc[1..]));
    
    let doc = r#"
Converts the `R` reference to the weak reference.

If the `R` reference is weak, this function returns the `R` reference. 
"#;
    sig_root_mod.add_var(String::from("weak"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("R"))
    ]));
    doc_root_mod.add_var(String::from("weak"), String::from(&doc[1..]));

    let doc = r#"
Returns `true` if the `X` object is empty, otherwise `false`.

The `X` object can be a string, a matrix array, a matrix row slice, or an array. 
"#;
    sig_root_mod.add_var(String::from("isempty"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("X"))
    ]));
    doc_root_mod.add_var(String::from("isempty"), String::from(&doc[1..]));

    let doc = r#"
Returns the number of elements in the`X` object.

The `X` object can be a string, a matrix array, a matrix row slice, or an array. This function
returns the number of UTF-8 characters for a string, the number of rows for a matrix array, or the
number of columns for a matrix row slice. 
"#;
    sig_root_mod.add_var(String::from("length"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("X"))
    ]));
    doc_root_mod.add_var(String::from("length"), String::from(&doc[1..]));

    let doc = r#"
Returns the number of rows in the `X` object.

The `X` object can be a matrix or a matrix array.
"#;
    sig_root_mod.add_var(String::from("rows"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("X"))
    ]));
    doc_root_mod.add_var(String::from("rows"), String::from(&doc[1..]));

    let doc = r#"
Returns the number of columns in the `X` object.

The `X` object can be a matrix or a matrix array.
"#;
    sig_root_mod.add_var(String::from("columns"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("X"))
    ]));
    doc_root_mod.add_var(String::from("columns"), String::from(&doc[1..]));

    let doc = r#"
Returns the element with one index or two indices in the `X` indexable object if the `X`
indexable object contains the element, otherwise `none`.

If the `j` index is passed and the `X` value is a matrix array, this function returns the element
with the `i` row index and the `j`  column index in the `X` matrix array. This function returns
the string with one UTF-8 character for a string, the matrix row slice for a matrix array, or the
element of matrix for a matrix row slice if the `j` index isn't passed. The field with the `i` 
identifier in the `X` structure is returned if the `j` index isn't passed and the `X` object is
structure.
"#;
    sig_root_mod.add_var(String::from("get"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("X")),
        BuiltinFunArg::Arg(String::from("i")),
        BuiltinFunArg::OptArg(String::from("j"))
    ]));
    doc_root_mod.add_var(String::from("get"), String::from(&doc[1..]));

    let doc = r#"
Returns the element with the `i` index in the diagonal of the `X` matrix array if the diagonal of
`X` matrix array contains the element, otherwise `none`.
"#;
    sig_root_mod.add_var(String::from("getdiag"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("X")),
        BuiltinFunArg::Arg(String::from("i"))
    ]));
    doc_root_mod.add_var(String::from("getdiag"), String::from(&doc[1..]));

    let doc = r#"
Returns the substrings of the `s` string which are separated by the `t` string.

If the `t` string isn't passed, this function uses whitespaces as a separator.
"#;
    sig_root_mod.add_var(String::from("split"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("s")),
        BuiltinFunArg::OptArg(String::from("t"))
    ]));
    doc_root_mod.add_var(String::from("split"), String::from(&doc[1..]));

    let doc = r#"
Returns the `s` string without the start whitespaces and the end whitespaces.
"#;
    sig_root_mod.add_var(String::from("trim"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("s"))
    ]));
    doc_root_mod.add_var(String::from("trim"), String::from(&doc[1..]));

    let doc = r#"
Returns the `s` string without the start whitespaces and the end whitespaces.
"#;
    sig_root_mod.add_var(String::from("trim"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("s"))
    ]));
    doc_root_mod.add_var(String::from("trim"), String::from(&doc[1..]));

    let doc = r#"
Returns the `true` if the `s` string contains the `t`, otherwise `false`.
"#;
    sig_root_mod.add_var(String::from("contains"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("s")),
        BuiltinFunArg::Arg(String::from("t"))
    ]));
    doc_root_mod.add_var(String::from("contains"), String::from(&doc[1..]));

    let doc = r#"
Returns the `true` if the `t` is the prefix of the `s` string, otherwise `false`.
"#;
    sig_root_mod.add_var(String::from("startswith"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("s")),
        BuiltinFunArg::Arg(String::from("t"))
    ]));
    doc_root_mod.add_var(String::from("startswith"), String::from(&doc[1..]));

    let doc = r#"
Returns the `true` if the `t` is the suffix of the `s` string, otherwise `false`.
"#;
    sig_root_mod.add_var(String::from("endswith"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("s")),
        BuiltinFunArg::Arg(String::from("t"))
    ]));
    doc_root_mod.add_var(String::from("endswith"), String::from(&doc[1..]));

    let doc = r#"
Replaces all occurrences of the `t` string in the `s` string with the `u` string.

This function returns a new string with replaced occurrences of the `t` string to the `u` string.
"#;
    sig_root_mod.add_var(String::from("replace"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("s")),
        BuiltinFunArg::Arg(String::from("t")),
        BuiltinFunArg::Arg(String::from("u"))
    ]));
    doc_root_mod.add_var(String::from("replace"), String::from(&doc[1..]));

    let doc = r#"
Returns an uppercase string corresponding the `s` string.
"#;
    sig_root_mod.add_var(String::from("upper"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("s"))
    ]));
    doc_root_mod.add_var(String::from("upper"), String::from(&doc[1..]));

    let doc = r#"
Returns a lowercase string corresponding the `s` string.
"#;
    sig_root_mod.add_var(String::from("lower"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("s"))
    ]));
    doc_root_mod.add_var(String::from("lower"), String::from(&doc[1..]));

    let doc = r#"
Sorts boolean values, numbers, or strings in the `x` array.

This function uses ascending sort order to sorting. Each element in the `x` array must have same
sorting value type that can be the boolean type, the number type, or the string type. If two or
more elements in the `x` array have the different sorting value types, an error occurs. The
integer numbers and the the floating-point numbers have same sorting value type. An error occurs
if any element in the `x` array is `nan`.
"#;
    sig_root_mod.add_var(String::from("sort"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("x"))
    ]));
    doc_root_mod.add_var(String::from("sort"), String::from(&doc[1..]));

    let doc = r#"
Reverses the order of elements in the `x` array.
"#;
    sig_root_mod.add_var(String::from("reverse"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("x"))
    ]));
    doc_root_mod.add_var(String::from("reverse"), String::from(&doc[1..]));

    let doc = r#"
Returns `true` if the `f` function with the passed `D` value returns a convertible value to `true`
for any element in the `X` iterable object ($f(\mathbf{D}, {\mathbf{x}}_i)$), otherwise `false`.
"#;
    sig_root_mod.add_var(String::from("any"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("X")),
        BuiltinFunArg::Arg(String::from("D")),
        BuiltinFunArg::Arg(String::from("f"))
    ]));
    doc_root_mod.add_var(String::from("any"), String::from(&doc[1..]));

    let doc = r#"
Returns `true` if the `f` function with the passed `D` value returns a convertible value to `true`
for all elements in the `X` iterable object ($f(\mathbf{D}, {\mathbf{x}}_i)$), otherwise
`false`.
"#;
    sig_root_mod.add_var(String::from("all"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("X")),
        BuiltinFunArg::Arg(String::from("D")),
        BuiltinFunArg::Arg(String::from("f"))
    ]));
    doc_root_mod.add_var(String::from("all"), String::from(&doc[1..]));

    let doc = r#"
Finds the element in the `X` iterable object.

This function applies the `f` function to the `D` value and each element in the `X` iterable
object ($f(\mathbf{D}, {\mathbf{x}}_i)$) until the `f` function returns a convertible value to 
`true` and then returns the index of this element. If the `f` function doesn't return the 
convertible value to `true` for any element, this function returns `none`.
"#;
    sig_root_mod.add_var(String::from("find"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("X")),
        BuiltinFunArg::Arg(String::from("D")),
        BuiltinFunArg::Arg(String::from("f"))
    ]));
    doc_root_mod.add_var(String::from("find"), String::from(&doc[1..]));

    let doc = r#"
Filters the elements in the `X` iterable object.

This function applies the `f` function to the `D` value and each element in the `X` iterable
object ($f(\mathbf{D}, {\mathbf{x}}_i)$) and then returns the indices of elements for which the
`f` function returns a convertible value to `true`.
"#;
    sig_root_mod.add_var(String::from("filter"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("X")),
        BuiltinFunArg::Arg(String::from("D")),
        BuiltinFunArg::Arg(String::from("f"))
    ]));
    doc_root_mod.add_var(String::from("filter"), String::from(&doc[1..]));

    let doc = r#"
Finds maximum element in the `X` iterable object or maximum value between the `X` value and the
`Y` value ($\max(x, y)$, $\max(x_{ij}, y)$, $\max(x, y_{ij})$, or $\max(x_{ij}, y_{ij})$).

This function with two arguments is a mathematical function that takes two arguments. This
argument can be a number, a matrix, or a mutable object. These arguments can't be a matrix and a
mutable object. If the `X` value and the `Y` value are integer numbers, this function also
returns an integer number. This function returns `none` if the `X` iterable object is empty and
the `Y` value isn't passed.
"#;
    sig_root_mod.add_var(String::from("max"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("X")),
        BuiltinFunArg::OptArg(String::from("Y"))
    ]));
    doc_root_mod.add_var(String::from("max"), String::from(&doc[1..]));

    let doc = r#"
Finds minimum element in the `X` iterable object or minimum value between the `X` value and the
`Y` value ($\min(x, y)$, $\min(x_{ij}, y)$, $\min(x, y_{ij})$, or $\min(x_{ij}, y_{ij})$).

This function with two arguments is a mathematical function that takes two arguments. This
argument can be a number, a matrix, or a mutable object. These arguments can't be a matrix and a
mutable object. If the `X` value and the `Y` value are integer numbers, this function also
returns an integer number. This function returns `none` if the `X` iterable object is empty and
the `Y` value isn't passed.
"#;
    sig_root_mod.add_var(String::from("min"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("X")),
        BuiltinFunArg::OptArg(String::from("Y"))
    ]));
    doc_root_mod.add_var(String::from("min"), String::from(&doc[1..]));

    let doc = r#"
Finds maximum element in the `X` iterable object and returns its index.

This function returns `none` if the `X` iterable object is empty.
"#;
    sig_root_mod.add_var(String::from("imax"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("X"))
    ]));
    doc_root_mod.add_var(String::from("imax"), String::from(&doc[1..]));

    let doc = r#"
Finds minumum element in the `X` iterable object and returns its index.

This function returns `none` if the `X` iterable object is empty.
"#;
    sig_root_mod.add_var(String::from("imin"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("X"))
    ]));
    doc_root_mod.add_var(String::from("imin"), String::from(&doc[1..]));

    let doc = r#"
Pushes the `y` value to the back of the`X` array.
"#;
    sig_root_mod.add_var(String::from("push"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("X")),
        BuiltinFunArg::Arg(String::from("y"))
    ]));
    doc_root_mod.add_var(String::from("push"), String::from(&doc[1..]));

    let doc = r#"
Removes the last element from the `X` array and returns the last element.

If the `X` array is empty, this function returns `none`.
"#;
    sig_root_mod.add_var(String::from("pop"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("X"))
    ]));
    doc_root_mod.add_var(String::from("pop"), String::from(&doc[1..]));

    let doc = r#"
Appends the `Y` mutable object to the `X` mutable object.

The `X` mutable object and the `Y` mutable object must be arrays or structures. If two fields in
two structures have same field identifier, the field in the first structure is overwritten by a
value from the field in the second structure.
"#;
    sig_root_mod.add_var(String::from("append"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("X")),
        BuiltinFunArg::Arg(String::from("Y"))
    ]));
    doc_root_mod.add_var(String::from("append"), String::from(&doc[1..]));

    let doc = r#"
Inserts the `y` value to the `X` mutable object.

If the `X` mutable object is an array, this function inserts the `y` value as an element with the
`i` index to the `X` array, moves all elements after the inserted element to right, and returns
`none`.  If the `X` mutable object is a structure, this function inserts the `X` value as a field
with the `i` identifier to the `X` structure and then returns the replaced field. This function
returns `none` if the `X` structure doesn't contain the field with the `i` identifier. 
"#;
    sig_root_mod.add_var(String::from("insert"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("X")),
        BuiltinFunArg::Arg(String::from("i")),
        BuiltinFunArg::Arg(String::from("y"))
    ]));
    doc_root_mod.add_var(String::from("insert"), String::from(&doc[1..]));

    let doc = r#"
Removes the element from the `X` mutable object.

If the `X` mutable object is an array, this function removes an element with the `i` index from
the `X` array and moves all elements after the removed element to left. If the `X` mutable object
is a structure, this function removes a field with the `i` identifier from the `X` structure.
This finction returns the removed element or the removed field if the `X` mutable object contains
the element with the `i` index or the field with the `i` identifier, otherwise `none`.
"#;
    sig_root_mod.add_var(String::from("remove"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("X")),
        BuiltinFunArg::Arg(String::from("i"))
    ]));
    doc_root_mod.add_var(String::from("remove"), String::from(&doc[1..]));

    let doc = r#"
Returns the error kind for the `e` error.
"#;
    sig_root_mod.add_var(String::from("errorkind"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("e"))
    ]));
    doc_root_mod.add_var(String::from("errorkind"), String::from(&doc[1..]));

    let doc = r#"
Returns the error message for the `e` error.
"#;
    sig_root_mod.add_var(String::from("errormsg"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("e"))
    ]));
    doc_root_mod.add_var(String::from("errormsg"), String::from(&doc[1..]));
    
    let doc = r#"
Returns `true` if the `X` value is equal to the `Y` value, otherwise `false`.

This function doesn't compare matrices. The result of this function is `false` if two values are
matrices. This function doesn't compare value types for integer numbers and floating-point
numbers.
"#;
    sig_root_mod.add_var(String::from("isequal"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("X")),
        BuiltinFunArg::Arg(String::from("Y"))
    ]));
    doc_root_mod.add_var(String::from("isequal"), String::from(&doc[1..]));

    let doc = r#"
Returns `true` if the `X` value isn't equal to the `Y` value, otherwise `false`.

This function doesn't compare matrices. The result of this function is `true` if two values are
matrices. This function doesn't compare value types for integer numbers and floating-point
numbers.
"#;
    sig_root_mod.add_var(String::from("isnotequal"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("X")),
        BuiltinFunArg::Arg(String::from("Y"))
    ]));
    doc_root_mod.add_var(String::from("isnotequal"), String::from(&doc[1..]));

    let doc = r#"
Returns `true` if the `X` value is less than the `Y` value, otherwise `false`.

This function compares two boolean values, two numbers, or two strings. The result of this
function is `false` for two other values.
"#;
    sig_root_mod.add_var(String::from("isless"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("X")),
        BuiltinFunArg::Arg(String::from("Y"))
    ]));
    doc_root_mod.add_var(String::from("isless"), String::from(&doc[1..]));

    let doc = r#"
Returns `true` if the `X` value is greater than or equal to the `Y` value, otherwise `false`.

This function compares two boolean values, two numbers, or two strings. The result of this
function is `false` for two other values.
"#;
    sig_root_mod.add_var(String::from("isgreaterequal"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("X")),
        BuiltinFunArg::Arg(String::from("Y"))
    ]));
    doc_root_mod.add_var(String::from("isgreaterequal"), String::from(&doc[1..]));

    let doc = r#"
Returns `true` if the `X` value is greater than the `Y` value, otherwise `false`.

This function compares two boolean values, two numbers, or two strings. The result of this
function is `false` for two other values.
"#;
    sig_root_mod.add_var(String::from("isgreater"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("X")),
        BuiltinFunArg::Arg(String::from("Y"))
    ]));
    doc_root_mod.add_var(String::from("isgreater"), String::from(&doc[1..]));

    let doc = r#"
Returns `true` if the `X` value is less than or equal to the `Y` value, otherwise `false`.

This function compares two boolean values, two numbers, or two strings. The result of this
function is `false` for two other values.
"#;
    sig_root_mod.add_var(String::from("islessequal"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("X")),
        BuiltinFunArg::Arg(String::from("Y"))
    ]));
    doc_root_mod.add_var(String::from("islessequal"), String::from(&doc[1..]));

    let doc = r#"
Calculates sigmoid function for the `X` value ($\operatorname{sigmoid}(\mathbf{X})$).

This function is a mathematical function that takes a number, a matrix, or a mutable object.
"#;
    sig_root_mod.add_var(String::from("sigmoid"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("X"))
    ]));
    doc_root_mod.add_var(String::from("sigmoid"), String::from(&doc[1..]));

    let doc = r#"
Calculates hyperbolic tangent for the `X` value ($\tanh(\mathbf{X})$).

This function is a mathematical function that takes a number, a matrix, or a mutable object.
"#;
    sig_root_mod.add_var(String::from("tanh"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("X"))
    ]));
    doc_root_mod.add_var(String::from("tanh"), String::from(&doc[1..]));

    let doc = r#"
Calculates swish function for the `X` value ($\operatorname{swish}(\mathbf{X})$).

This function is a mathematical function that takes a number, a matrix, or a mutable object.
"#;
    sig_root_mod.add_var(String::from("swish"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("X"))
    ]));
    doc_root_mod.add_var(String::from("swish"), String::from(&doc[1..]));

    let doc = r#"
Calculates softmax function for the `X` value ($\operatorname{softmax}(\mathbf{X})$).

This function is a mathematical function that takes a number, a matrix, or a mutable object.
"#;
    sig_root_mod.add_var(String::from("softmax"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("X"))
    ]));
    doc_root_mod.add_var(String::from("softmax"), String::from(&doc[1..]));

    let doc = r#"
Calculates square root of the `X` value ($\sqrt{x}$ or $\sqrt{x_{ij}}$).

This function is a mathematical function that takes a number, a matrix, or a mutable object.
"#;
    sig_root_mod.add_var(String::from("sqrt"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("X"))
    ]));
    doc_root_mod.add_var(String::from("sqrt"), String::from(&doc[1..]));

    let doc = r#"
Indeed transposes the `X` matrix (${\mathbf{X}}^\top$).
"#;
    sig_root_mod.add_var(String::from("reallytranspose"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("X"))
    ]));
    doc_root_mod.add_var(String::from("reallytranspose"), String::from(&doc[1..]));

    let doc = r#"
This function is alias to the [`reallytranspose`](#var.reallytranspose) function.
"#;
    sig_root_mod.add_var(String::from("rt"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("X"))
    ]));
    doc_root_mod.add_var(String::from("rt"), String::from(&doc[1..]));

    let doc = r#"
Repeats the `x` vector as column or row.
"#;
    sig_root_mod.add_var(String::from("repeat"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("x"))
    ]));
    doc_root_mod.add_var(String::from("repeat"), String::from(&doc[1..]));

    let doc = r#"
Calculates remainder of division the `x` value by the `y` value ($\operatorname{mod}(x, y)$).

If the `x` value and the `y` value are integer numbers, this function also returns an integer
number.
"#;
    sig_root_mod.add_var(String::from("mod"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("x")),
        BuiltinFunArg::Arg(String::from("y"))
    ]));
    doc_root_mod.add_var(String::from("mod"), String::from(&doc[1..]));
    
    let doc = r#"
Calculates absolute value of the `X` value ($|x|$ or $|x_{ij}|$).

This function is a mathematical function that takes a number, a matrix, or a mutable object. If
the `X` value is an integer number, this function also returns an integer value.
"#;
    sig_root_mod.add_var(String::from("abs"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("X"))
    ]));
    doc_root_mod.add_var(String::from("abs"), String::from(&doc[1..]));

    let doc = r#"
Raises the `X` value to the power of the `Y` value ($x^y$, ${x_{ij}}^y$, $x^{y_{ij}}$, or
${x_{ij}}^{y_{ij}}$).

This function is a mathematical function that takes two arguments. This argument can be a number,
a matrix, or a mutable object. These arguments can't be a matrix and a mutable object.
"#;
    sig_root_mod.add_var(String::from("pow"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("X")),
        BuiltinFunArg::Arg(String::from("Y"))
    ]));
    doc_root_mod.add_var(String::from("pow"), String::from(&doc[1..]));

    let doc = r#"
Calculates exponentional function of the `X` value ($e^x$ or $e^{x_{ij}}$).

This function is a mathematical function that takes a number, a matrix, or a mutable object.
"#;
    sig_root_mod.add_var(String::from("exp"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("X"))
    ]));
    doc_root_mod.add_var(String::from("exp"), String::from(&doc[1..]));

    let doc = r#"
Calculates natural logarithm of the `X` value ($\ln{x}$ or $\ln{x_{ij}}$).

This function is a mathematical function that takes a number, a matrix, or a mutable object.
"#;
    sig_root_mod.add_var(String::from("log"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("X"))
    ]));
    doc_root_mod.add_var(String::from("log"), String::from(&doc[1..]));

    let doc = r#"
Calculates base 2 logarithm of the `X` value ($\log_2{x}$ or $\log_2{x_{ij}}$).

This function is a mathematical function that takes a number, a matrix, or a mutable object.
"#;
    sig_root_mod.add_var(String::from("log2"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("X"))
    ]));
    doc_root_mod.add_var(String::from("log2"), String::from(&doc[1..]));

    let doc = r#"
Calculates base 10 logarithm of the `X` value ($\log_10{x}$ or $\log_10{x_{ij}}$).

This function is a mathematical function that takes a number, a matrix, or a mutable object.
"#;
    sig_root_mod.add_var(String::from("log10"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("X"))
    ]));
    doc_root_mod.add_var(String::from("log10"), String::from(&doc[1..]));

    let doc = r#"
Calculates sine function for the `X` value ($\sin(\mathbf{X})$).

This function is a mathematical function that takes a number, a matrix, or a mutable object.
"#;
    sig_root_mod.add_var(String::from("sin"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("X"))
    ]));
    doc_root_mod.add_var(String::from("sin"), String::from(&doc[1..]));

    let doc = r#"
Calculates cosine function for the `X` value ($\cos(\mathbf{X})$).

This function is a mathematical function that takes a number, a matrix, or a mutable object.
"#;
    sig_root_mod.add_var(String::from("cos"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("X"))
    ]));
    doc_root_mod.add_var(String::from("cos"), String::from(&doc[1..]));

    let doc = r#"
Calculates tangent function for the `X` value ($\tan(\mathbf{X})$).

This function is a mathematical function that takes a number, a matrix, or a mutable object.
"#;
    sig_root_mod.add_var(String::from("tan"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("X"))
    ]));
    doc_root_mod.add_var(String::from("tan"), String::from(&doc[1..]));

    let doc = r#"
Calculates arcsine function for the `X` value ($\arcsin(\mathbf{X})$).

This function is a mathematical function that takes a number, a matrix, or a mutable object.
"#;
    sig_root_mod.add_var(String::from("asin"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("X"))
    ]));
    doc_root_mod.add_var(String::from("asin"), String::from(&doc[1..]));

    let doc = r#"
Calculates arccosine function for the `X` value ($\arccos(\mathbf{X})$).

This function is a mathematical function that takes a number, a matrix, or a mutable object.
"#;
    sig_root_mod.add_var(String::from("acos"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("X"))
    ]));
    doc_root_mod.add_var(String::from("acos"), String::from(&doc[1..]));

    let doc = r#"
Calculates arctangent function for the `X` value ($\arctan(\mathbf{X})$).

This function is a mathematical function that takes a number, a matrix, or a mutable object.
"#;
    sig_root_mod.add_var(String::from("atan"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("X"))
    ]));
    doc_root_mod.add_var(String::from("atan"), String::from(&doc[1..]));

    let doc = r#"
Calculates arctangent function for the `X` value and the `Y` value ($\arctan(\frac{x}{y})$,
$\arctan(\frac{x_{ij}}{y})$, $\arctan(\frac{x}{y_{ij}})$, or $\arctan(\frac{x_{ij}}{y_{ij}})$).

This function is a mathematical function that takes two arguments. This argument can be a number,
a matrix, or a mutable object. These arguments can't be a matrix and a mutable object.
"#;
    sig_root_mod.add_var(String::from("atan2"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("X"))
    ]));
    doc_root_mod.add_var(String::from("atan2"), String::from(&doc[1..]));

    let doc = r#"
Calculates hyperbolic sine function for the `X` value ($\sinh(\mathbf{X})$).

This function is a mathematical function that takes a number, a matrix, or a mutable object.
"#;
    sig_root_mod.add_var(String::from("sinh"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("X"))
    ]));
    doc_root_mod.add_var(String::from("sinh"), String::from(&doc[1..]));

    let doc = r#"
Calculates hyperbolic cosine function for the `X` value ($\cosh(\mathbf{X})$).

This function is a mathematical function that takes a number, a matrix, or a mutable object.
"#;
    sig_root_mod.add_var(String::from("cosh"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("X"))
    ]));
    doc_root_mod.add_var(String::from("cosh"), String::from(&doc[1..]));

    let doc = r#"
Calculates inverse hyperbolic sine function for the `X` value
($\operatorname{arsinh}(\mathbf{X})$).

This function is a mathematical function that takes a number, a matrix, or a mutable object.
"#;
    sig_root_mod.add_var(String::from("asinh"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("X"))
    ]));
    doc_root_mod.add_var(String::from("asinh"), String::from(&doc[1..]));

    let doc = r#"
Calculates inverse hyperbolic cosine function for the `X` value
($\operatorname{arcosh}(\mathbf{X})$).

This function is a mathematical function that takes a number, a matrix, or a mutable object.
"#;
    sig_root_mod.add_var(String::from("acosh"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("X"))
    ]));
    doc_root_mod.add_var(String::from("acosh"), String::from(&doc[1..]));

    let doc = r#"
Calculates inverse hyperbolic tangent function for the `X` value
($\operatorname{artanh}(\mathbf{X})$).

This function is a mathematical function that takes a number, a matrix, or a mutable object.
"#;
    sig_root_mod.add_var(String::from("atanh"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("X"))
    ]));
    doc_root_mod.add_var(String::from("atanh"), String::from(&doc[1..]));

    let doc = r#"
Calculates signum function for the `X` value ($\operatorname{sgn}(\mathbf{X})$).

This function is a mathematical function that takes a number, a matrix, or a mutable object.
"#;
    sig_root_mod.add_var(String::from("sign"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("X"))
    ]));
    doc_root_mod.add_var(String::from("sign"), String::from(&doc[1..]));

    let doc = r#"
Calculates ceil function for the `X` value ($\operatorname{ceil}(\mathbf{X})$).

This function is a mathematical function that takes a number, a matrix, or a mutable object.
"#;
    sig_root_mod.add_var(String::from("ceil"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("X"))
    ]));
    doc_root_mod.add_var(String::from("ceil"), String::from(&doc[1..]));

    let doc = r#"
Calculates floor function for the `X` value ($\operatorname{floor}(\mathbf{X})$).

This function is a mathematical function that takes a number, a matrix, or a mutable object.
"#;
    sig_root_mod.add_var(String::from("floor"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("X"))
    ]));
    doc_root_mod.add_var(String::from("floor"), String::from(&doc[1..]));

    let doc = r#"
Calculates round function for the `X` value ($\operatorname{round}(\mathbf{X})$).

This function is a mathematical function that takes a number, a matrix, or a mutable object.
"#;
    sig_root_mod.add_var(String::from("round"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("X"))
    ]));
    doc_root_mod.add_var(String::from("round"), String::from(&doc[1..]));

    let doc = r#"
Calculates trunc function for the `X` value ($\operatorname{trunc}(\mathbf{X})$).

This function is a mathematical function that takes a number, a matrix, or a mutable object.
"#;
    sig_root_mod.add_var(String::from("trunc"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("X"))
    ]));
    doc_root_mod.add_var(String::from("trunc"), String::from(&doc[1..]));

    let doc = r#"
Generates a random floating-point number in range $[0, 1)$.
"#;
    sig_root_mod.add_var(String::from("rand"), Sig::BuiltinFun(vec![]));
    doc_root_mod.add_var(String::from("rand"), String::from(&doc[1..]));

    let doc = r#"
Generates a random integer number in range $[1, N]$ or range $[N, M]$.
"#;
    sig_root_mod.add_var(String::from("randi"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("N")),
        BuiltinFunArg::OptArg(String::from("M"))
    ]));
    doc_root_mod.add_var(String::from("randi"), String::from(&doc[1..]));

    let doc = r#"
Converts the `s` string to an integer number.

If the `s` string can be converted to the integer number, this function returns an error with the
`"parseint"` error kind.
"#;
    sig_root_mod.add_var(String::from("str2int"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("s"))
    ]));
    doc_root_mod.add_var(String::from("str2int"), String::from(&doc[1..]));

    let doc = r#"
Converts the `s` string to a floating-point number.

If the `s` string can be converted to the floating-point number, this function returns an error
with the `"parsefloat"` error kind.
"#;
    sig_root_mod.add_var(String::from("str2int"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("s"))
    ]));
    doc_root_mod.add_var(String::from("str2int"), String::from(&doc[1..]));    
    
    let doc = r#"
Converts the hexadecimal number as the `s` string to a decimal integer number.

If the `s` string can be converted to the decimal integer number, this function returns an error 
with the error kind `"parseint"`.
"#;
    sig_root_mod.add_var(String::from("hex2dec"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("s"))
    ]));
    doc_root_mod.add_var(String::from("hex2dec"), String::from(&doc[1..]));

    let doc = r#"
Converts the first character of the `s` string to a character code as an integer number.

If the `s` string is empty, this function returns `none`.
"#;
    sig_root_mod.add_var(String::from("char2code"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("s"))
    ]));
    doc_root_mod.add_var(String::from("char2code"), String::from(&doc[1..]));

    let doc = r#"
Converts the character code as the `x` integer number to the string with the character.

If the `x` character code is invalid, this function returns `none`.
"#;
    sig_root_mod.add_var(String::from("code2char"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("x"))
    ]));
    doc_root_mod.add_var(String::from("code2char"), String::from(&doc[1..]));

    let doc = r#"
Formats the `millis` number of milliseconds according to the `fmt` format.

The formats with examples are:

- `"s"` - seconds for exmaple `"1234.567s"`
- `"ms"` - minutes and seconds for example `"12m34.567s"`
- `"hms"` - hours, minutes, and seconds for example `"12h34m56.789s"`

If the `fmt` format is invalid, this function returns an error with the `"format"` error kind.
"#;
    sig_root_mod.add_var(String::from("formatmillis"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("fmt")),
        BuiltinFunArg::Arg(String::from("millis"))
    ]));
    doc_root_mod.add_var(String::from("formatmillis"), String::from(&doc[1..]));

    let doc = r#"
Formats the `X` value according to the `width` width and the `align` alignment.

If the string of the `X` value has a number of characters less than the `width` width, the string
of `X` value is padded with spaces according to the `align` alignment. The alignments are:

- `"left"` - left alignment
- `"center"` - center alignment
- `"right"` - right alignment

If the `align` alignment isn't passed, this function uses the left alignment for the string of
the `X` value by default. If the `width` width and/or the `align` alignment are/is invalid, this 
function returns an error with the `"format"` error kind.
"#;
    sig_root_mod.add_var(String::from("withwidth"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("X")),
        BuiltinFunArg::Arg(String::from("width")),
        BuiltinFunArg::OptArg(String::from("align"))
    ]));
    doc_root_mod.add_var(String::from("withwidth"), String::from(&doc[1..]));

    let doc = r#"
Formats the `X` value with the zero padding according to the `width` width.

If the string of the `X` value has a number of characters less than the `width` width, the string
of `X` value is padded with zeros according to the right alignment. If the `width` width is 
invalid, this function returns an error with the `"format"` error kind.
"#;
    sig_root_mod.add_var(String::from("withzeros"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("X")),
        BuiltinFunArg::Arg(String::from("width"))
    ]));
    doc_root_mod.add_var(String::from("withzeros"), String::from(&doc[1..]));

    let doc = r#"
Reads a line from the standard input.

If an I/O error occurs while this operation, this function returns an error with the `"io"` error 
kind.
"#;
    sig_root_mod.add_var(String::from("readline"), Sig::BuiltinFun(vec![]));
    doc_root_mod.add_var(String::from("readline"), String::from(&doc[1..]));

    let doc = r#"
Formats the values and then returns the formatted values as a string.
"#;
    sig_root_mod.add_var(String::from("format"), Sig::BuiltinFun(vec![
        BuiltinFunArg::OptArg(String::from("X")),
        BuiltinFunArg::DotDotDot
    ]));
    doc_root_mod.add_var(String::from("format"), String::from(&doc[1..]));

    let doc = r#"
Prints the values to the standard output.
"#;
    sig_root_mod.add_var(String::from("print"), Sig::BuiltinFun(vec![
        BuiltinFunArg::OptArg(String::from("X")),
        BuiltinFunArg::DotDotDot
    ]));
    doc_root_mod.add_var(String::from("print"), String::from(&doc[1..]));

    let doc = r#"
Prints the values with the newline character to the standard output.
"#;
    sig_root_mod.add_var(String::from("println"), Sig::BuiltinFun(vec![
        BuiltinFunArg::OptArg(String::from("X")),
        BuiltinFunArg::DotDotDot
    ]));
    doc_root_mod.add_var(String::from("println"), String::from(&doc[1..]));

    let doc = r#"
Prints the values to the standard error.
"#;
    sig_root_mod.add_var(String::from("eprint"), Sig::BuiltinFun(vec![
        BuiltinFunArg::OptArg(String::from("X")),
        BuiltinFunArg::DotDotDot
    ]));
    doc_root_mod.add_var(String::from("eprint"), String::from(&doc[1..]));

    let doc = r#"
Prints the values with the newline character to the standard error.
"#;
    sig_root_mod.add_var(String::from("eprintln"), Sig::BuiltinFun(vec![
        BuiltinFunArg::OptArg(String::from("X")),
        BuiltinFunArg::DotDotDot
    ]));
    doc_root_mod.add_var(String::from("eprintln"), String::from(&doc[1..]));

    let doc = r#"
Flushes the stream of standard output.

This function writes all unwritten buffered data in the stream of standard output to the standard 
output. Also, this function returns `true` if an I/O error doesn't occur while this operation,
otherwise an error with the `"io"` error kind.
"#;
    sig_root_mod.add_var(String::from("flush"), Sig::BuiltinFun(vec![]));
    doc_root_mod.add_var(String::from("flush"), String::from(&doc[1..]));

    let doc = r#"
Flushes the stream of standard error.

This function writes all unwritten buffered data in the stream of standard error to the standard
error. Also, this function returns `true` if an I/O error doesn't occur while this operation,
otherwise an error with the `"io"` error kind.
"#;
    sig_root_mod.add_var(String::from("eflush"), Sig::BuiltinFun(vec![]));
    doc_root_mod.add_var(String::from("eflush"), String::from(&doc[1..]));

    let doc = r#"
Changes the current working directory to the `path` directory.

This function returns `true` if an I/O error doesn't occur while this operation, otherwise an
error with the `"io"` error kind.
"#;
    sig_root_mod.add_var(String::from("cd"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("path"))
    ]));
    doc_root_mod.add_var(String::from("cd"), String::from(&doc[1..]));

    let doc = r#"
Returns the path of current working directory.

If an I/O error occur while this operation, this function returns an error with the `"io"` error
kind.
"#;
    sig_root_mod.add_var(String::from("pwd"), Sig::BuiltinFun(vec![]));
    doc_root_mod.add_var(String::from("pwd"), String::from(&doc[1..]));

    let doc = r#"
Returns `true` if the `path` file exists, otherwise `false`.

If an I/O error occur while this operation, this function returns an error with the `"io"` error
kind.
"#;
    sig_root_mod.add_var(String::from("exist"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("path"))
    ]));
    doc_root_mod.add_var(String::from("exist"), String::from(&doc[1..]));

    let doc = r#"
Returns a file type as a string for the `path` file.

The file types are:

- `"dir"` - directory
- `"file"` - any file except directory

If an I/O error occur while this operation, this function returns an error with the `"io"` error
kind.
"#;
    sig_root_mod.add_var(String::from("filetype"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("path"))
    ]));
    doc_root_mod.add_var(String::from("filetype"), String::from(&doc[1..]));

    let doc = r#"
Returns file names in the `path` directory.

If an I/O error occur while this operation, this function returns an error with the `"io"` error
kind.
"#;
    sig_root_mod.add_var(String::from("dir"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("path"))
    ]));
    doc_root_mod.add_var(String::from("dir"), String::from(&doc[1..]));
    
    let doc = r#"
This function is alias to the [`dir`](#var.dir) function.
"#;
    sig_root_mod.add_var(String::from("ls"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("path"))
    ]));
    doc_root_mod.add_var(String::from("ls"), String::from(&doc[1..]));

    let doc = r#"
Creates a `path` directory.

This function returns `true` if an I/O error doesn't occur while this operation, otherwise an
error with the `"io"` error kind.
"#;
    sig_root_mod.add_var(String::from("mkdir"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("path"))
    ]));
    doc_root_mod.add_var(String::from("mkdir"), String::from(&doc[1..]));

    let doc = r#"
Removes the `path` directory.

This function returns `true` if an I/O error doesn't occur while this operation, otherwise an
error with the `"io"` error kind.
"#;
    sig_root_mod.add_var(String::from("rmdir"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("path"))
    ]));
    doc_root_mod.add_var(String::from("rmdir"), String::from(&doc[1..]));

    let doc = r#"
Removes the `path` file.

This function returns `true` if an I/O error doesn't occur while this operation, otherwise an
error with the `"io"` error kind.
"#;
    sig_root_mod.add_var(String::from("rmfile"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("path"))
    ]));
    doc_root_mod.add_var(String::from("rmfile"), String::from(&doc[1..]));

    let doc = r#"
Copies the content of the `srcpath` file with the permissions to the `dstpath` file.

This function overwrites the content of the `dstpath` file if the `dstpath` file already exists.
Also, this function returns `true` if an I/O error doesn't occur while this operation, otherwise
an error with the `"io"` error kind.
"#;
    sig_root_mod.add_var(String::from("copy"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("srcpath")),
        BuiltinFunArg::Arg(String::from("dstpath"))
    ]));
    doc_root_mod.add_var(String::from("copy"), String::from(&doc[1..]));

    let doc = r#"
Renames the `oldpath` file to the `newpath` name.

This function replaces the `newpath` file if the `newpath` file already exists. Also, this
function returns `true` if an I/O error doesn't occur while this operation, otherwise an error
with the `"io"` error kind.
"#;
    sig_root_mod.add_var(String::from("rename"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("oldpath")),
        BuiltinFunArg::Arg(String::from("newpath"))
    ]));
    doc_root_mod.add_var(String::from("rename"), String::from(&doc[1..]));

    let doc = r#"
Executes the command with the `cmdname` command name and the arguments as a child process.

This function returns the exit code if an I/O error doesn't occur while this operation, otherwise
an error with the `"io"` error kind. Also, this function returns an error with the `"exitstatus"`
error kind if child process terminated by signal.
"#;
    sig_root_mod.add_var(String::from("spawn"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("cmdname")),
        BuiltinFunArg::OptArg(String::from("arg")),
        BuiltinFunArg::DotDotDot
    ]));
    doc_root_mod.add_var(String::from("spawn"), String::from(&doc[1..]));

    let doc = r#"
Terminates the current process with the `exitcode` exit code.
"#;
    sig_root_mod.add_var(String::from("exit"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("exitcode"))
    ]));
    doc_root_mod.add_var(String::from("exit"), String::from(&doc[1..]));

    let doc = r#"
Loads values from the `path` file in the binary format.

This function returns the loaded values if an I/O error doesn't occur while this operation, 
otherwise an error with the `"io"` error kind.
"#;
    sig_root_mod.add_var(String::from("load"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("path"))
    ]));
    doc_root_mod.add_var(String::from("load"), String::from(&doc[1..]));

    let doc = r#"
Saves the values to the `path` file in the binary format.

This function returns `true` if an I/O error doesn't occur while this operation, otherwise an
error with the `"io"` error kind.
"#;
    sig_root_mod.add_var(String::from("save"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("path")),
        BuiltinFunArg::OptArg(String::from("X")),
        BuiltinFunArg::DotDotDot
    ]));
    doc_root_mod.add_var(String::from("save"), String::from(&doc[1..]));

    let doc = r#"
Loads a string from the `path` text file.

This function returns the loaded string if an I/O error doesn't occur while this operation,
otherwise an error with the `"io"` error kind.
"#;
    sig_root_mod.add_var(String::from("loadstr"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("path"))
    ]));
    doc_root_mod.add_var(String::from("loadstr"), String::from(&doc[1..]));

    let doc = r#"
Saves the `s` string to the `path` text file.

This function returns `true` if an I/O error doesn't occur while this operation, otherwise an
error with the `"io"` error kind.
"#;
    sig_root_mod.add_var(String::from("savestr"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("path")),
        BuiltinFunArg::Arg(String::from("s"))
    ]));
    doc_root_mod.add_var(String::from("savestr"), String::from(&doc[1..]));

    let doc = r#"
Loads a value from the `path` file in the [TOML](https://en.wikipedia.org/wiki/TOML) format.

This function returns the loaded value if an error doesn't occur while this operation, otherwise
an error with the `"io"` error kind or the `"toml"` kind error.
"#;
    sig_root_mod.add_var(String::from("loadtoml"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("path"))
    ]));
    doc_root_mod.add_var(String::from("loadtoml"), String::from(&doc[1..]));

    let doc = r#"
Saves the `X` value to the `path` file in the [TOML](https://en.wikipedia.org/wiki/TOML) format.

This function returns `true` if an error doesn't occur while this operation, otherwise an error
with the `"io"` error kind or the `"toml"` error kind.
"#;
    sig_root_mod.add_var(String::from("savetoml"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("path")),
        BuiltinFunArg::Arg(String::from("X"))
    ]));
    doc_root_mod.add_var(String::from("savetoml"), String::from(&doc[1..]));

    let doc = r#"
Loads a value from the `path` file in the [JSON](https://en.wikipedia.org/wiki/JSON) format.

This function returns the loaded value if an error doesn't occur while this operation, otherwise
an error with the `"io"` error kind or the `"json"` kind error.
"#;
    sig_root_mod.add_var(String::from("loadjson"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("path"))
    ]));
    doc_root_mod.add_var(String::from("loadjson"), String::from(&doc[1..]));

    let doc = r#"
Saves the `X` value to the `path` file in the [JSON](https://en.wikipedia.org/wiki/JSON) format.

This function returns `true` if an error doesn't occur while this operation, otherwise an error
with the `"io"` error kind or the `"json"` error kind.
"#;
    sig_root_mod.add_var(String::from("savejson"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("path")),
        BuiltinFunArg::Arg(String::from("X"))
    ]));
    doc_root_mod.add_var(String::from("savejson"), String::from(&doc[1..]));

    let doc = r#"
Returns the arguments which are passed for this script.
"#;
    sig_root_mod.add_var(String::from("args"), Sig::BuiltinFun(vec![]));
    doc_root_mod.add_var(String::from("args"), String::from(&doc[1..]));

    let doc = r#"
Returns the environment variables of current process as strings.
"#;
    sig_root_mod.add_var(String::from("env"), Sig::BuiltinFun(vec![]));
    doc_root_mod.add_var(String::from("env"), String::from(&doc[1..]));

    let doc = r#"
Returns the path to the script directory.
"#;
    sig_root_mod.add_var(String::from("scriptdir"), Sig::BuiltinFun(vec![]));
    doc_root_mod.add_var(String::from("scriptdir"), String::from(&doc[1..]));

    let doc = r#"
Returns the library paths as the string.
"#;
    sig_root_mod.add_var(String::from("libpath"), Sig::BuiltinFun(vec![]));
    doc_root_mod.add_var(String::from("libpath"), String::from(&doc[1..]));

    let doc = r#"
Returns the domain of current library if interpreter is in the libary, otherwise `None`.
"#;
    sig_root_mod.add_var(String::from("domain"), Sig::BuiltinFun(vec![]));
    doc_root_mod.add_var(String::from("domain"), String::from(&doc[1..]));

    let doc = r#"
Loads the library with the `libname` library name if the library isn't already loaded, otherwise
this function doesn't load the library.

The library with the `libname` library name is loaded in the root module. The `libname` library
name should contain the domain and the name which are separeted by the `/` character. If the
`libname` library name hasn't the domain and the interpreter is in the library, this function
loads the library with the domain of current library.
"#;
    sig_root_mod.add_var(String::from("uselib"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("libname"))
    ]));
    doc_root_mod.add_var(String::from("uselib"), String::from(&doc[1..]));

    let doc = r#"
Loads the library with the `libname` library name even if the library is already loaded.

The library with the `libname` library name is loaded in the root module. The `libname` library
name should contain the domain and the name which are separeted by the `/` character. If the
`libname` library name hasn't the domain and the interpreter is in the library, this function
loads the library with the domain of current library.
"#;
    sig_root_mod.add_var(String::from("reuselib"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("libname"))
    ]));
    doc_root_mod.add_var(String::from("reuselib"), String::from(&doc[1..]));

    let doc = r#"
Runs the script that is refers by the `path` path.

If the `path` path is relative, the script is runned from the script directory. The script is
runned in the current module. The `/` path separators can be used in the `path` path regardless
of the operating system because  the `/` path separators are replaced to the system path
separators.
"#;
    sig_root_mod.add_var(String::from("run"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("path"))
    ]));
    doc_root_mod.add_var(String::from("run"), String::from(&doc[1..]));

    let doc = r#"
This function is alias to the [`run`](#var.run) function.

This alias adds the documetation comments from the `path` file while documentation generation. 
The `path` path should be a string literal so that documentation comment are added.
"#;
    sig_root_mod.add_var(String::from("runwithdoc"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("path"))
    ]));
    doc_root_mod.add_var(String::from("runwithdoc"), String::from(&doc[1..]));

    let doc = r#"
Returns the elapsed time in milliseconds since an interpreter start.
"#;
    sig_root_mod.add_var(String::from("clock"), Sig::BuiltinFun(vec![]));
    doc_root_mod.add_var(String::from("clock"), String::from(&doc[1..]));

    let doc = r#"
Imports the module with the `modname` name in the current module.

If the `newident` identifier is passed, the module is imported as module with the `newident`
identifier. The `modname` name should contain the module identifiers which are separated by the
`::` character sequence. The first module identifier in the `modname` name can be the `root`
keyword that refers to the root module. The `modname` name can have the `::` prefix.
"#;
    sig_root_mod.add_var(String::from("usemod"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("modname")),
        BuiltinFunArg::OptArg(String::from("newident"))
    ]));
    doc_root_mod.add_var(String::from("usemod"), String::from(&doc[1..]));

    let doc = r#"
Imports all modules from the module with the `modname` name in the current module.

The `modname` name should contain the module identifiers which are separated by the `::` 
character sequence.  The first module identifier in the `modname` name can be the `root` keyword
that refers to the root module. The `modname` name can have the `::` prefix.
"#;
    sig_root_mod.add_var(String::from("usemods"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("modname"))
    ]));
    doc_root_mod.add_var(String::from("usemods"), String::from(&doc[1..]));

    let doc = r#"
Imports the module with the `varname` name in the current module.

If the `newident` identifier is passed, the variable is imported as module with the `newident`
identifier. The `varname` name should contain the module identifiers and/or the variable 
identifier which are separated by the `::` character sequence. The first module identifier in the
`varname` name can be the `root` keyword that refers to the root module. The `varname` name can
have the `::` prefix.
"#;
    sig_root_mod.add_var(String::from("usevar"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("varname")),
        BuiltinFunArg::OptArg(String::from("newident"))
    ]));
    doc_root_mod.add_var(String::from("usevar"), String::from(&doc[1..]));

    let doc = r#"
Imports all variables from the module with the `modname` name in the current module.

The `modname` name should contain the module identifiers which are separated by the `::` 
character sequence.  The first module identifier in the `modname` name can be the `root`
keyword that refers to the root module. The `modname` name can have the `::` prefix.
"#;
    sig_root_mod.add_var(String::from("usevars"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("modname"))
    ]));
    doc_root_mod.add_var(String::from("usevars"), String::from(&doc[1..]));

    let doc = r#"
Removes the module import with the `ident` identifier from the current module.
"#;
    sig_root_mod.add_var(String::from("removeusemod"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("ident"))
    ]));
    doc_root_mod.add_var(String::from("removeusemod"), String::from(&doc[1..]));

    let doc = r#"
Removes the variable import with the `ident` identifier from the current module.
"#;
    sig_root_mod.add_var(String::from("removeusevar"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("ident"))
    ]));
    doc_root_mod.add_var(String::from("removeusevar"), String::from(&doc[1..]));

    let doc = r#"
Removes the module with the `ident` identifier from the current module.
"#;
    sig_root_mod.add_var(String::from("removemod"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("ident"))
    ]));
    doc_root_mod.add_var(String::from("removemod"), String::from(&doc[1..]));

    let doc = r#"
Removes the variable with the `ident` identifier from the current module.
"#;
    sig_root_mod.add_var(String::from("removevar"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("ident"))
    ]));
    doc_root_mod.add_var(String::from("removevar"), String::from(&doc[1..]));

    let doc = r#"
Removes the local variable with the `ident` identifier.
"#;
    sig_root_mod.add_var(String::from("removelocalvar"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("ident"))
    ]));
    doc_root_mod.add_var(String::from("removelocalvar"), String::from(&doc[1..]));

    let doc = r#"
An interruption error occurs if an interruption is occurred.
"#;
    sig_root_mod.add_var(String::from("checkintr"), Sig::BuiltinFun(vec![]));
    doc_root_mod.add_var(String::from("checkintr"), String::from(&doc[1..]));

    let doc = r#"
Returns the backend name as a string.
"#;
    sig_root_mod.add_var(String::from("backend"), Sig::BuiltinFun(vec![]));
    doc_root_mod.add_var(String::from("backend"), String::from(&doc[1..]));

    let doc = r#"
Returns the Unlab-gpu version.
"#;
    sig_root_mod.add_var(String::from("version"), Sig::BuiltinFun(vec![]));
    doc_root_mod.add_var(String::from("version"), String::from(&doc[1..]));

    let doc = r#"
An version error if the Unlab-gpu version isn't matched to the `s` version requirement.
"#;
    sig_root_mod.add_var(String::from("reqver"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("s"))
    ]));
    doc_root_mod.add_var(String::from("reqver"), String::from(&doc[1..]));

    let doc = r#"
Returns the documentation paths as the string.
"#;
    sig_root_mod.add_var(String::from("docpath"), Sig::BuiltinFun(vec![]));
    doc_root_mod.add_var(String::from("docpath"), String::from(&doc[1..]));

    let doc = r#"
Opens the documentation.

If the `libname` library name isn't passed, this function opens this documentation. The `libname`
library name should contain the domain and the name which are separeted by the `/` character. 
"#;
    sig_root_mod.add_var(String::from("doc"), Sig::BuiltinFun(vec![
        BuiltinFunArg::OptArg(String::from("libname"))
    ]));
    doc_root_mod.add_var(String::from("doc"), String::from(&doc[1..]));

    let doc = r#"
This function is alias to the [`doc`](#var.doc) function.
"#;
    sig_root_mod.add_var(String::from("help"), Sig::BuiltinFun(vec![
        BuiltinFunArg::OptArg(String::from("libname"))
    ]));
    doc_root_mod.add_var(String::from("help"), String::from(&doc[1..]));

    let doc = r#"
Asserts that the `V` value is `true`.

An assertion error occurs if the `V` value isn't `true`. If next arguments are passed, an
assertion error has the message that is the formatted next arguments.
"#;
    sig_root_mod.add_var(String::from("assert"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("V")),
        BuiltinFunArg::OptArg(String::from("X")),
        BuiltinFunArg::DotDotDot
    ]));
    doc_root_mod.add_var(String::from("assert"), String::from(&doc[1..]));

    let doc = r#"
Asserts that the `L` value is equal to the `R` value.

An assertion error occurs if the `L` value isn't equal to the `R` value. If next arguments are
passed, an assertion error has the message that is the formatted next arguments.
"#;
    sig_root_mod.add_var(String::from("asserteq"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("L")),
        BuiltinFunArg::Arg(String::from("R")),
        BuiltinFunArg::OptArg(String::from("X")),
        BuiltinFunArg::DotDotDot
    ]));
    doc_root_mod.add_var(String::from("asserteq"), String::from(&doc[1..]));

    let doc = r#"
Asserts that the `L` value isn't equal to the `R` value.

An assertion error occurs if the `L` value is equal to the `R` value. If next arguments are
passed, an assertion error has the message that is the formatted next arguments.
"#;
    sig_root_mod.add_var(String::from("assertne"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("L")),
        BuiltinFunArg::Arg(String::from("R")),
        BuiltinFunArg::OptArg(String::from("X")),
        BuiltinFunArg::DotDotDot
    ]));
    doc_root_mod.add_var(String::from("assertne"), String::from(&doc[1..]));

    let doc = r#"
Asserts that the difference between the `L` value and the `R` value is greater than the `eps`
value.

An assertion error occurs if the difference between the `L` value and the `R` value isn't greater
than the `eps` value. If next arguments are passed, an assertion error has the message that is
the formatted next arguments. The differences are recursively checked like comparison without
types for matrix arrays, matrix row slices, arrays, or structures. The difference between two
elements or two fields are checked if two elements or two fields are numbers, otherwise this
function compares two element or two fields.
"#;
    sig_root_mod.add_var(String::from("assertnearlyeq"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("L")),
        BuiltinFunArg::Arg(String::from("R")),
        BuiltinFunArg::Arg(String::from("eps")),
        BuiltinFunArg::OptArg(String::from("X")),
        BuiltinFunArg::DotDotDot
    ]));
    doc_root_mod.add_var(String::from("assertnearlyeq"), String::from(&doc[1..]));

    let doc = r#"
Asserts that the difference between the `L` value and the `R` value isn't greater than the `eps`
value.

An assertion error occurs if the difference between the `L` value and the `R` value is greater
than the `eps` value. If next arguments are passed, an assertion error has the message that is
the formatted next arguments. The differences are recursively checked like comparison without
types for matrix arrays, matrix row slices, arrays, or structures. The difference between two
elements or two fields are checked if two elements or two fields are numbers, otherwise this
function compares two element or two fields.
"#;
    sig_root_mod.add_var(String::from("assertnearlyne"), Sig::BuiltinFun(vec![
        BuiltinFunArg::Arg(String::from("L")),
        BuiltinFunArg::Arg(String::from("R")),
        BuiltinFunArg::Arg(String::from("eps")),
        BuiltinFunArg::OptArg(String::from("X")),
        BuiltinFunArg::DotDotDot
    ]));
    doc_root_mod.add_var(String::from("assertnearlyne"), String::from(&doc[1..]));

    let doc = r#"
Adds the current module to the test suites.
"#;
    sig_root_mod.add_var(String::from("tests"), Sig::BuiltinFun(vec![]));
    doc_root_mod.add_var(String::from("tests"), String::from(&doc[1..]));

    add_getopts_doc(sig_root_mod, doc_root_mod);
    #[cfg(feature = "plot")]
    add_plot_doc(sig_root_mod, doc_root_mod);
}